diff -Nru rsyslog-7.6.0/aclocal.m4 rsyslog-5.10.1/aclocal.m4 --- rsyslog-7.6.0/aclocal.m4 2014-02-12 12:06:28.000000000 +0000 +++ rsyslog-5.10.1/aclocal.m4 2012-10-17 14:42:31.000000000 +0000 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. +# 2005, 2006, 2007, 2008, 2009 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. @@ -14,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. 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'.])]) @@ -48,8 +47,7 @@ # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) @@ -95,8 +93,7 @@ pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried @@ -144,9 +141,9 @@ AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD @@ -180,15 +177,12 @@ fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -198,7 +192,7 @@ [am__api_version='1.11' 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.11.3], [], +m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -214,21 +208,19 @@ # 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.11.3])dnl +[AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005 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. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -310,14 +302,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# 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. -# serial 12 +# serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -357,7 +349,6 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. - rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -422,7 +413,7 @@ break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) + msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -487,13 +478,10 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' - am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -715,15 +703,12 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001, 2003, 2005, 2008 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. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -890,15 +875,12 @@ fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2003, 2004, 2005, 2006 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. -# serial 1 - # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -921,14 +903,13 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 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. -# serial 5 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -936,13 +917,13 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# -------------------- +# ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ------------------------ +# ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -1018,13 +999,13 @@ fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2009, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009 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. -# serial 2 +# serial 1 # AM_SILENT_RULES([DEFAULT]) # -------------------------- @@ -1039,50 +1020,18 @@ no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac -dnl -dnl A few `make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using `$V' instead of `$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005 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. -# serial 1 - # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -1105,13 +1054,13 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008 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. -# serial 3 +# serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -1120,13 +1069,13 @@ AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- +# --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1148,11 +1097,10 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff -Nru rsyslog-7.6.0/action.c rsyslog-5.10.1/action.c --- rsyslog-7.6.0/action.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/action.c 2012-10-17 14:41:20.000000000 +0000 @@ -8,15 +8,15 @@ * the right code in question): For performance reasons, this module * uses different methods of message submission based on the user-selected * configuration. This code is similar, but can not be abstracted because - * of the performance-affecting differences in it. As such, it is often + * of the performanse-affecting differences in it. As such, it is often * necessary to triple-check that everything works well in *all* modes. * The different modes (and calling sequence) are: * - * if set iExecEveryNthOccur > 1 || iSecsExecOnceInterval + * if set iExecEveryNthOccur > 1 || f_ReduceRepeated || iSecsExecOnceInterval * - doSubmitToActionQComplexBatch * - helperSubmitToActionQComplexBatch * - doActionCallAction - * handles mark message reduction, but in essence calls + * handles duplicate message processing, but in essence calls * - actionWriteToAction * - qqueueEnqObj * (now queue engine processing) @@ -69,7 +69,7 @@ * beast. * rgerhards, 2011-06-15 * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -98,23 +98,20 @@ #include #include #include -#include #include "dirty.h" #include "template.h" #include "action.h" #include "modules.h" +#include "sync.h" #include "cfsysline.h" #include "srUtils.h" #include "errmsg.h" #include "batch.h" #include "wti.h" -#include "rsconf.h" #include "datetime.h" #include "unicode-helper.h" #include "atomic.h" -#include "ruleset.h" -#include "parserif.h" #include "statsobj.h" #define NO_TIME_PROVIDED 0 /* indicate we do not provide any cached time */ @@ -132,46 +129,40 @@ DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(statsobj) -DEFobjCurrIf(ruleset) - -typedef struct configSettings_s { - int bActExecWhenPrevSusp; /* execute action only when previous one was suspended? */ - int bActionWriteAllMarkMsgs; /* should all mark messages be unconditionally written? */ - int iActExecOnceInterval; /* execute action once every nn seconds */ - int iActExecEveryNthOccur; /* execute action every n-th occurence (0,1=always) */ - time_t iActExecEveryNthOccurTO; /* timeout for n-occurence setting (in seconds, 0=never) */ - int glbliActionResumeInterval; - int glbliActionResumeRetryCount; /* how often should suspended actions be retried? */ - int bActionRepMsgHasMsg; /* last messsage repeated... has msg fragment in it */ - uchar *pszActionName; /* short name for the action */ - /* action queue and its configuration parameters */ - queueType_t ActionQueType; /* type of the main message queue above */ - int iActionQueueSize; /* size of the main message queue above */ - int iActionQueueDeqBatchSize; /* batch size for action queues */ - int iActionQHighWtrMark; /* high water mark for disk-assisted queues */ - int iActionQLowWtrMark; /* low water mark for disk-assisted queues */ - int iActionQDiscardMark; /* begin to discard messages */ - int iActionQDiscardSeverity; /* by default, discard nothing to prevent unintentional loss */ - int iActionQueueNumWorkers; /* number of worker threads for the mm queue above */ - uchar *pszActionQFName; /* prefix for the main message queue file */ - int64 iActionQueMaxFileSize; - int iActionQPersistUpdCnt; /* persist queue info every n updates */ - int bActionQSyncQeueFiles; /* sync queue files */ - int iActionQtoQShutdown; /* queue shutdown */ - int iActionQtoActShutdown; /* action shutdown (in phase 2) */ - int iActionQtoEnq; /* timeout for queue enque */ - int iActionQtoWrkShutdown; /* timeout for worker thread shutdown */ - int iActionQWrkMinMsgs; /* minimum messages per worker needed to start a new one */ - int bActionQSaveOnShutdown; /* save queue on shutdown (when DA enabled)? */ - int64 iActionQueMaxDiskSpace; /* max disk space allocated 0 ==> unlimited */ - int iActionQueueDeqSlowdown; /* dequeue slowdown (simple rate limiting) */ - int iActionQueueDeqtWinFromHr; /* hour begin of time frame when queue is to be dequeued */ - int iActionQueueDeqtWinToHr; /* hour begin of time frame when queue is to be dequeued */ -} configSettings_t; - -configSettings_t cs; /* our current config settings */ -configSettings_t cs_save; /* our saved (scope!) config settings */ +static int iActExecOnceInterval = 0; /* execute action once every nn seconds */ +static int iActExecEveryNthOccur = 0; /* execute action every n-th occurence (0,1=always) */ +static time_t iActExecEveryNthOccurTO = 0; /* timeout for n-occurence setting (in seconds, 0=never) */ +static int glbliActionResumeInterval = 30; +int glbliActionResumeRetryCount = 0; /* how often should suspended actions be retried? */ +static int bActionRepMsgHasMsg = 0; /* last messsage repeated... has msg fragment in it */ + +static int bActionWriteAllMarkMsgs = RSFALSE; /* should all mark messages be unconditionally written? */ +static uchar *pszActionName; /* short name for the action */ +/* action queue and its configuration parameters */ +static queueType_t ActionQueType = QUEUETYPE_DIRECT; /* type of the main message queue above */ +static int iActionQueueSize = 1000; /* size of the main message queue above */ +static int iActionQueueDeqBatchSize = 16; /* batch size for action queues */ +static int iActionQHighWtrMark = 800; /* high water mark for disk-assisted queues */ +static int iActionQLightDlyMrk = -1; /* light delay mark for disk-assisted queues */ +static int iActionQLowWtrMark = 200; /* low water mark for disk-assisted queues */ +static int iActionQDiscardMark = 9800; /* begin to discard messages */ +static int iActionQDiscardSeverity = 8; /* by default, discard nothing to prevent unintentional loss */ +static int iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ +static uchar *pszActionQFName = NULL; /* prefix for the main message queue file */ +static int64 iActionQueMaxFileSize = 1024*1024; +static int iActionQPersistUpdCnt = 0; /* persist queue info every n updates */ +static int bActionQSyncQeueFiles = 0; /* sync queue files */ +static int iActionQtoQShutdown = 0; /* queue shutdown */ +static int iActionQtoActShutdown = 1000; /* action shutdown (in phase 2) */ +static int iActionQtoEnq = 2000; /* timeout for queue enque */ +static int iActionQtoWrkShutdown = 60000; /* timeout for worker thread shutdown */ +static int iActionQWrkMinMsgs = 100; /* minimum messages per worker needed to start a new one */ +static int bActionQSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */ +static int64 iActionQueMaxDiskSpace = 0; /* max disk space allocated 0 ==> unlimited */ +static int iActionQueueDeqSlowdown = 0; /* dequeue slowdown (simple rate limiting) */ +static int iActionQueueDeqtWinFromHr = 0; /* hour begin of time frame when queue is to be dequeued */ +static int iActionQueueDeqtWinToHr = 25; /* hour begin of time frame when queue is to be dequeued */ /* the counter below counts actions created. It is used to obtain unique IDs for the action. They * should not be relied on for any long-term activity (e.g. disk queue names!), but they are nice @@ -180,26 +171,6 @@ * counting. -- rgerhards, 2008-01-29 */ static int iActionNbr = 0; -int bActionReportSuspension = 1; - -/* tables for interfacing with the v6 config system */ -static struct cnfparamdescr cnfparamdescr[] = { - { "name", eCmdHdlrGetWord, 0 }, /* legacy: actionname */ - { "type", eCmdHdlrString, CNFPARAM_REQUIRED }, /* legacy: actionname */ - { "action.writeallmarkmessages", eCmdHdlrBinary, 0 }, /* legacy: actionwriteallmarkmessages */ - { "action.execonlyeverynthtime", eCmdHdlrInt, 0 }, /* legacy: actionexeconlyeverynthtime */ - { "action.execonlyeverynthtimetimeout", eCmdHdlrInt, 0 }, /* legacy: actionexeconlyeverynthtimetimeout */ - { "action.execonlyonceeveryinterval", eCmdHdlrInt, 0 }, /* legacy: actionexeconlyonceeveryinterval */ - { "action.execonlywhenpreviousissuspended", eCmdHdlrBinary, 0 }, /* legacy: actionexeconlywhenpreviousissuspended */ - { "action.repeatedmsgcontainsoriginalmsg", eCmdHdlrBinary, 0 }, /* legacy: repeatedmsgcontainsoriginalmsg */ - { "action.resumeretrycount", eCmdHdlrInt, 0 }, /* legacy: actionresumeretrycount */ - { "action.resumeinterval", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk pblk = - { CNFPARAMBLK_VERSION, - sizeof(cnfparamdescr)/sizeof(struct cnfparamdescr), - cnfparamdescr - }; /* ------------------------------ methods ------------------------------ */ @@ -252,32 +223,33 @@ { DEFiRet; - cs.ActionQueType = QUEUETYPE_DIRECT; /* type of the main message queue above */ - cs.iActionQueueSize = 1000; /* size of the main message queue above */ - cs.iActionQueueDeqBatchSize = 16; /* default batch size */ - cs.iActionQHighWtrMark = -1; /* high water mark for disk-assisted queues */ - cs.iActionQLowWtrMark = -1; /* low water mark for disk-assisted queues */ - cs.iActionQDiscardMark = 980; /* begin to discard messages */ - cs.iActionQDiscardSeverity = 8; /* discard warning and above */ - cs.iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ - cs.iActionQueMaxFileSize = 1024*1024; - cs.iActionQPersistUpdCnt = 0; /* persist queue info every n updates */ - cs.bActionQSyncQeueFiles = 0; - cs.iActionQtoQShutdown = 0; /* queue shutdown */ - cs.iActionQtoActShutdown = 1000; /* action shutdown (in phase 2) */ - cs.iActionQtoEnq = 50; /* timeout for queue enque */ - cs.iActionQtoWrkShutdown = 60000; /* timeout for worker thread shutdown */ - cs.iActionQWrkMinMsgs = -1; /* minimum messages per worker needed to start a new one */ - cs.bActionQSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */ - cs.iActionQueMaxDiskSpace = 0; - cs.iActionQueueDeqSlowdown = 0; - cs.iActionQueueDeqtWinFromHr = 0; - cs.iActionQueueDeqtWinToHr = 25; /* 25 disables time windowed dequeuing */ + ActionQueType = QUEUETYPE_DIRECT; /* type of the main message queue above */ + iActionQueueSize = 1000; /* size of the main message queue above */ + iActionQueueDeqBatchSize = 16; /* default batch size */ + iActionQHighWtrMark = 800; /* high water mark for disk-assisted queues */ + iActionQLightDlyMrk = -1; + iActionQLowWtrMark = 200; /* low water mark for disk-assisted queues */ + iActionQDiscardMark = 9800; /* begin to discard messages */ + iActionQDiscardSeverity = 8; /* discard warning and above */ + iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ + iActionQueMaxFileSize = 1024*1024; + iActionQPersistUpdCnt = 0; /* persist queue info every n updates */ + bActionQSyncQeueFiles = 0; + iActionQtoQShutdown = 0; /* queue shutdown */ + iActionQtoActShutdown = 1000; /* action shutdown (in phase 2) */ + iActionQtoEnq = 2000; /* timeout for queue enque */ + iActionQtoWrkShutdown = 60000; /* timeout for worker thread shutdown */ + iActionQWrkMinMsgs = 100; /* minimum messages per worker needed to start a new one */ + bActionQSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */ + iActionQueMaxDiskSpace = 0; + iActionQueueDeqSlowdown = 0; + iActionQueueDeqtWinFromHr = 0; + iActionQueueDeqtWinToHr = 25; /* 25 disables time windowed dequeuing */ - cs.glbliActionResumeRetryCount = 0; /* I guess it is smart to reset this one, too */ + glbliActionResumeRetryCount = 0; /* I guess it is smart to reset this one, too */ - d_free(cs.pszActionQFName); - cs.pszActionQFName = NULL; /* prefix for the main message queue file */ + d_free(pszActionQFName); + pszActionQFName = NULL; /* prefix for the main message queue file */ RETiRet; } @@ -291,11 +263,6 @@ DEFiRet; ASSERT(pThis != NULL); - if(!strcmp((char*)modGetName(pThis->pMod), "builtin:omdiscard")) { - /* discard actions will be optimized out */ - FINALIZE; - } - if(pThis->pQueue != NULL) { qqueueDestruct(&pThis->pQueue); } @@ -309,21 +276,22 @@ if(pThis->pMod != NULL) pThis->pMod->freeInstance(pThis->pModData); - pthread_mutex_destroy(&pThis->mutAction); + if(pThis->f_pMsg != NULL) + msgDestruct(&pThis->f_pMsg); + + SYNC_OBJ_TOOL_EXIT(pThis); pthread_mutex_destroy(&pThis->mutActExec); d_free(pThis->pszName); d_free(pThis->ppTpl); -finalize_it: d_free(pThis); + RETiRet; } /* create a new action descriptor object * rgerhards, 2007-08-01 - * Note that it is vital to set proper initial values as the v6 config - * system depends on these! */ rsRetVal actionConstruct(action_t **ppThis) { @@ -333,19 +301,12 @@ ASSERT(ppThis != NULL); CHKmalloc(pThis = (action_t*) calloc(1, sizeof(action_t))); - pThis->iResumeInterval = 30; - pThis->iResumeRetryCount = 0; - pThis->pszName = NULL; - pThis->bWriteAllMarkMsgs = RSFALSE; - pThis->iExecEveryNthOccur = 0; - pThis->iExecEveryNthOccurTO = 0; - pThis->iSecsExecOnceInterval = 0; - pThis->bExecWhenPrevSusp = 0; - pThis->bRepMsgHasMsg = 0; + pThis->iResumeInterval = glbliActionResumeInterval; + pThis->iResumeRetryCount = glbliActionResumeRetryCount; pThis->tLastOccur = datetime.GetTime(NULL); /* done once per action on startup only */ pthread_mutex_init(&pThis->mutActExec, NULL); - pthread_mutex_init(&pThis->mutAction, NULL); INIT_ATOMIC_HELPER_MUT(pThis->mutCAS); + SYNC_OBJ_TOOL_INIT(pThis); /* indicate we have a new action */ ++iActionNbr; @@ -359,23 +320,19 @@ /* action construction finalizer */ rsRetVal -actionConstructFinalize(action_t *pThis, struct nvlst *lst) +actionConstructFinalize(action_t *pThis) { DEFiRet; uchar pszAName[64]; /* friendly name of our action */ ASSERT(pThis != NULL); - if(!strcmp((char*)modGetName(pThis->pMod), "builtin:omdiscard")) { - /* discard actions will be optimized out */ - FINALIZE; - } /* generate a friendly name for us action stats */ if(pThis->pszName == NULL) { snprintf((char*) pszAName, sizeof(pszAName)/sizeof(uchar), "action %d", iActionNbr); } else { ustrncpy(pszAName, pThis->pszName, sizeof(pszAName)); - pszAName[sizeof(pszAName)-1] = '\0'; /* to be on the save side */ + pszAName[63] = '\0'; /* to be on the save side */ } /* support statistics gathering */ @@ -384,22 +341,11 @@ STATSCOUNTER_INIT(pThis->ctrProcessed, pThis->mutCtrProcessed); CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("processed"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrProcessed)); + ctrType_IntCtr, &pThis->ctrProcessed)); STATSCOUNTER_INIT(pThis->ctrFail, pThis->mutCtrFail); CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("failed"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrFail)); - - STATSCOUNTER_INIT(pThis->ctrSuspend, pThis->mutCtrSuspend); - CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("suspended"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrSuspend)); - STATSCOUNTER_INIT(pThis->ctrSuspendDuration, pThis->mutCtrSuspendDuration); - CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("suspended.duration"), - ctrType_IntCtr, 0, &pThis->ctrSuspendDuration)); - - STATSCOUNTER_INIT(pThis->ctrResume, pThis->mutCtrResume); - CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("resumed"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrResume)); + ctrType_IntCtr, &pThis->ctrFail)); CHKiRet(statsobj.ConstructFinalize(pThis->statsobj)); @@ -420,11 +366,16 @@ * mode is much faster processing (and simpler code) -- rgerhards, 2010-06-08 */ if( pThis->iExecEveryNthOccur > 1 + || pThis->f_ReduceRepeated || pThis->iSecsExecOnceInterval ) { DBGPRINTF("info: firehose mode disabled for action because " - "iExecEveryNthOccur=%d, iSecsExecOnceInterval=%d\n", - pThis->iExecEveryNthOccur, pThis->iSecsExecOnceInterval); + "iExecEveryNthOccur=%d, " + "ReduceRepeated=%d, " + "iSecsExecOnceInterval=%d\n", + pThis->iExecEveryNthOccur, pThis->f_ReduceRepeated, + pThis->iSecsExecOnceInterval + ); pThis->submitToActQ = doSubmitToActionQComplexBatch; } else if(pThis->bWriteAllMarkMsgs == RSFALSE) { /* nearly full-speed submission mode, default case */ @@ -434,67 +385,67 @@ pThis->submitToActQ = doSubmitToActionQBatch; } + /* we need to make a safety check: if the queue is NOT in direct mode, a single + * message object may be accessed by multiple threads. As such, we need to enable + * msg object thread safety in this case (this costs a bit performance and thus + * is not enabled by default. -- rgerhards, 2008-02-20 + */ + if(ActionQueType != QUEUETYPE_DIRECT) + MsgEnableThreadSafety(); + /* create queue */ /* action queues always (for now) have just one worker. This may change when * we begin to implement an interface the enable output modules to request * to be run on multiple threads. So far, this is forbidden by the interface * spec. -- rgerhards, 2008-01-30 */ - CHKiRet(qqueueConstruct(&pThis->pQueue, cs.ActionQueType, 1, cs.iActionQueueSize, + CHKiRet(qqueueConstruct(&pThis->pQueue, ActionQueType, 1, iActionQueueSize, (rsRetVal (*)(void*, batch_t*, int*))processBatchMain)); obj.SetName((obj_t*) pThis->pQueue, pszAName); - qqueueSetpAction(pThis->pQueue, pThis); - if(lst == NULL) { /* use legacy params? */ - /* ... set some properties ... */ -# define setQPROP(func, directive, data) \ - CHKiRet_Hdlr(func(pThis->pQueue, data)) { \ - errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", \ - error %d. Ignored, running with default setting", iRet); \ - } -# define setQPROPstr(func, directive, data) \ - CHKiRet_Hdlr(func(pThis->pQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \ - errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", \ - error %d. Ignored, running with default setting", iRet); \ - } - setQPROP(qqueueSetsizeOnDiskMax, "$ActionQueueMaxDiskSpace", cs.iActionQueMaxDiskSpace); - setQPROP(qqueueSetiDeqBatchSize, "$ActionQueueDequeueBatchSize", cs.iActionQueueDeqBatchSize); - setQPROP(qqueueSetMaxFileSize, "$ActionQueueFileSize", cs.iActionQueMaxFileSize); - setQPROPstr(qqueueSetFilePrefix, "$ActionQueueFileName", cs.pszActionQFName); - setQPROP(qqueueSetiPersistUpdCnt, "$ActionQueueCheckpointInterval", cs.iActionQPersistUpdCnt); - setQPROP(qqueueSetbSyncQueueFiles, "$ActionQueueSyncQueueFiles", cs.bActionQSyncQeueFiles); - setQPROP(qqueueSettoQShutdown, "$ActionQueueTimeoutShutdown", cs.iActionQtoQShutdown ); - setQPROP(qqueueSettoActShutdown, "$ActionQueueTimeoutActionCompletion", cs.iActionQtoActShutdown); - setQPROP(qqueueSettoWrkShutdown, "$ActionQueueWorkerTimeoutThreadShutdown", cs.iActionQtoWrkShutdown); - setQPROP(qqueueSettoEnq, "$ActionQueueTimeoutEnqueue", cs.iActionQtoEnq); - setQPROP(qqueueSetiHighWtrMrk, "$ActionQueueHighWaterMark", cs.iActionQHighWtrMark); - setQPROP(qqueueSetiLowWtrMrk, "$ActionQueueLowWaterMark", cs.iActionQLowWtrMark); - setQPROP(qqueueSetiDiscardMrk, "$ActionQueueDiscardMark", cs.iActionQDiscardMark); - setQPROP(qqueueSetiDiscardSeverity, "$ActionQueueDiscardSeverity", cs.iActionQDiscardSeverity); - setQPROP(qqueueSetiMinMsgsPerWrkr, "$ActionQueueWorkerThreadMinimumMessages", cs.iActionQWrkMinMsgs); - setQPROP(qqueueSetiNumWorkerThreads, "$ActionQueueWorkerThreads", cs.iActionQueueNumWorkers); - setQPROP(qqueueSetbSaveOnShutdown, "$ActionQueueSaveOnShutdown", cs.bActionQSaveOnShutdown); - setQPROP(qqueueSetiDeqSlowdown, "$ActionQueueDequeueSlowdown", cs.iActionQueueDeqSlowdown); - setQPROP(qqueueSetiDeqtWinFromHr, "$ActionQueueDequeueTimeBegin", cs.iActionQueueDeqtWinFromHr); - setQPROP(qqueueSetiDeqtWinToHr, "$ActionQueueDequeueTimeEnd", cs.iActionQueueDeqtWinToHr); - } else { - /* we have v6-style config params */ - qqueueSetDefaultsActionQueue(pThis->pQueue); - qqueueApplyCnfParam(pThis->pQueue, lst); - } + /* ... set some properties ... */ +# define setQPROP(func, directive, data) \ + CHKiRet_Hdlr(func(pThis->pQueue, data)) { \ + errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \ + } +# define setQPROPstr(func, directive, data) \ + CHKiRet_Hdlr(func(pThis->pQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \ + errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \ + } + + qqueueSetpUsr(pThis->pQueue, pThis); + setQPROP(qqueueSetsizeOnDiskMax, "$ActionQueueMaxDiskSpace", iActionQueMaxDiskSpace); + setQPROP(qqueueSetiDeqBatchSize, "$ActionQueueDequeueBatchSize", iActionQueueDeqBatchSize); + setQPROP(qqueueSetMaxFileSize, "$ActionQueueFileSize", iActionQueMaxFileSize); + setQPROPstr(qqueueSetFilePrefix, "$ActionQueueFileName", pszActionQFName); + setQPROP(qqueueSetiPersistUpdCnt, "$ActionQueueCheckpointInterval", iActionQPersistUpdCnt); + setQPROP(qqueueSetbSyncQueueFiles, "$ActionQueueSyncQueueFiles", bActionQSyncQeueFiles); + setQPROP(qqueueSettoQShutdown, "$ActionQueueTimeoutShutdown", iActionQtoQShutdown ); + setQPROP(qqueueSettoActShutdown, "$ActionQueueTimeoutActionCompletion", iActionQtoActShutdown); + setQPROP(qqueueSettoWrkShutdown, "$ActionQueueWorkerTimeoutThreadShutdown", iActionQtoWrkShutdown); + setQPROP(qqueueSettoEnq, "$ActionQueueTimeoutEnqueue", iActionQtoEnq); + setQPROP(qqueueSetiHighWtrMrk, "$ActionQueueHighWaterMark", iActionQHighWtrMark); + if(iActionQLightDlyMrk > 0) { + setQPROP(qqueueSetiLightDlyMrk, "$ActionQueueLightDelayMark", iActionQLightDlyMrk); + } + setQPROP(qqueueSetiLowWtrMrk, "$ActionQueueLowWaterMark", iActionQLowWtrMark); + setQPROP(qqueueSetiDiscardMrk, "$ActionQueueDiscardMark", iActionQDiscardMark); + setQPROP(qqueueSetiDiscardSeverity, "$ActionQueueDiscardSeverity", iActionQDiscardSeverity); + setQPROP(qqueueSetiMinMsgsPerWrkr, "$ActionQueueWorkerThreadMinimumMessages", iActionQWrkMinMsgs); + setQPROP(qqueueSetbSaveOnShutdown, "$ActionQueueSaveOnShutdown", bActionQSaveOnShutdown); + setQPROP(qqueueSetiDeqSlowdown, "$ActionQueueDequeueSlowdown", iActionQueueDeqSlowdown); + setQPROP(qqueueSetiDeqtWinFromHr, "$ActionQueueDequeueTimeBegin", iActionQueueDeqtWinFromHr); + setQPROP(qqueueSetiDeqtWinToHr, "$ActionQueueDequeueTimeEnd", iActionQueueDeqtWinToHr); # undef setQPROP # undef setQPROPstr - qqueueDbgPrint(pThis->pQueue); + dbgoprint((obj_t*) pThis->pQueue, "save on shutdown %d, max disk space allowed %lld\n", + bActionQSaveOnShutdown, iActionQueMaxDiskSpace); + + CHKiRet(qqueueStart(pThis->pQueue)); DBGPRINTF("Action %p: queue %p created\n", pThis, pThis->pQueue); - - if(pThis->eParamPassing == ACT_MSG_PASSING && pThis->pQueue->qType != QUEUETYPE_DIRECT) { - parser_warnmsg("module %s with message passing mode uses " - "non-direct queue. This most probably leads to undesired " - "results", (char*)modGetName(pThis->pMod)); - } /* and now reset the queue params (see comment in its function header!) */ actionResetQueueParams(); @@ -509,7 +460,7 @@ */ rsRetVal actionSetGlobalResumeInterval(int iNewVal) { - cs.glbliActionResumeInterval = iNewVal; + glbliActionResumeInterval = iNewVal; return RS_RET_OK; } @@ -617,7 +568,7 @@ } -/* Suspend action, this involves changing the action state as well +/* Suspend action, this involves changing the acton state as well * as setting the next retry time. * if we have more than 10 retries, we prolong the * retry interval. If something is really stalled, it will @@ -625,34 +576,13 @@ * CPU time. TODO: maybe a config option for that? * rgerhards, 2007-08-02 */ -static inline void -actionSuspend(action_t * const pThis) +static inline void actionSuspend(action_t *pThis, time_t ttNow) { - time_t ttNow; - int suspendDuration; - char timebuf[32]; - - /* note: we can NOT use a cached timestamp, as time may have evolved - * since caching, and this would break logic (and it actually did so!) - */ - datetime.GetTime(&ttNow); - suspendDuration = pThis->iResumeInterval * (pThis->iNbrResRtry / 10 + 1); - pThis->ttResumeRtry = ttNow + suspendDuration; + if(ttNow == NO_TIME_PROVIDED) + datetime.GetTime(&ttNow); + pThis->ttResumeRtry = ttNow + pThis->iResumeInterval * (pThis->iNbrResRtry / 10 + 1); actionSetState(pThis, ACT_STATE_SUSP); - pThis->ctrSuspendDuration += suspendDuration; - if(pThis->iNbrResRtry == 0) { - STATSCOUNTER_INC(pThis->ctrSuspend, pThis->mutCtrSuspend); - } - DBGPRINTF("action '%s' suspended, earliest retry=%lld (now %lld), iNbrResRtry %d\n", - pThis->pszName, (long long) pThis->ttResumeRtry, (long long) ttNow, - pThis->iNbrResRtry); - if(bActionReportSuspension) { - ctime_r(&pThis->ttResumeRtry, timebuf); - timebuf[strlen(timebuf)-1] = '\0'; /* strip LF */ - errmsg.LogMsg(0, RS_RET_NOT_FOUND, LOG_WARNING, - "action '%s' suspended, next retry is %s", - pThis->pszName, timebuf); - } + DBGPRINTF("earliest retry=%d\n", (int) pThis->ttResumeRtry); } @@ -672,7 +602,7 @@ * of its inability to recover. -- rgerhards, 2010-04-26. */ static inline rsRetVal -actionDoRetry(action_t *pThis, int *pbShutdownImmediate) +actionDoRetry(action_t *pThis, time_t ttNow, int *pbShutdownImmediate) { int iRetries; int iSleepPeriod; @@ -683,35 +613,24 @@ iRetries = 0; while((*pbShutdownImmediate == 0) && pThis->eState == ACT_STATE_RTRY) { - DBGPRINTF("actionDoRetry: %s enter loop, iRetries=%d\n", pThis->pszName, iRetries); iRet = pThis->pMod->tryResume(pThis->pModData); - DBGPRINTF("actionDoRetry: %s action->tryResume returned %d\n", pThis->pszName, iRet); - if((pThis->iResumeOKinRow > 9) && (pThis->iResumeOKinRow % 10 == 0)) { + if((pThis->iResumeOKinRow > 999) && (pThis->iResumeOKinRow % 1000 == 0)) { bTreatOKasSusp = 1; pThis->iResumeOKinRow = 0; } else { bTreatOKasSusp = 0; } if((iRet == RS_RET_OK) && (!bTreatOKasSusp)) { - DBGPRINTF("actionDoRetry: %s had success RDY again (iRet=%d)\n", - pThis->pszName, iRet); - if(bActionReportSuspension) { - errmsg.LogMsg(0, RS_RET_OK, LOG_INFO, "action '%s' resumed", - pThis->pszName); - } actionSetState(pThis, ACT_STATE_RDY); } else if(iRet == RS_RET_SUSPENDED || bTreatOKasSusp) { /* max retries reached? */ - DBGPRINTF("actionDoRetry: %s check for max retries, iResumeRetryCount " - "%d, iRetries %d\n", - pThis->pszName, pThis->iResumeRetryCount, iRetries); if((pThis->iResumeRetryCount != -1 && iRetries >= pThis->iResumeRetryCount)) { - actionSuspend(pThis); - if(pThis->iNbrResRtry < 20) - ++pThis->iNbrResRtry; + actionSuspend(pThis, ttNow); } else { + ++pThis->iNbrResRtry; ++iRetries; iSleepPeriod = pThis->iResumeInterval; + ttNow += iSleepPeriod; /* not truly exact, but sufficiently... */ srSleep(iSleepPeriod, 0); if(*pbShutdownImmediate) { ABORT_FINALIZE(RS_RET_FORCE_TERM); @@ -758,7 +677,7 @@ if(pThis->eState == ACT_STATE_RTRY) { if(ttNow == NO_TIME_PROVIDED) /* use cached result if we have it */ datetime.GetTime(&ttNow); - CHKiRet(actionDoRetry(pThis, pbShutdownImmediate)); + CHKiRet(actionDoRetry(pThis, ttNow, pbShutdownImmediate)); } if(Debug && (pThis->eState == ACT_STATE_RTRY ||pThis->eState == ACT_STATE_SUSP)) { @@ -816,8 +735,8 @@ dbgprintf("%s: ", module.GetStateName(pThis->pMod)); pThis->pMod->dbgPrintInstInfo(pThis->pModData); - dbgprintf("\n"); - dbgprintf("\tInstance data: 0x%lx\n", (unsigned long) pThis->pModData); + dbgprintf("\n\tInstance data: 0x%lx\n", (unsigned long) pThis->pModData); + dbgprintf("\tRepeatedMsgReduction: %d\n", pThis->f_ReduceRepeated); dbgprintf("\tResume Interval: %d\n", pThis->iResumeInterval); if(pThis->eState == ACT_STATE_SUSP) { dbgprintf("\tresume next retry: %u, number retries: %d", @@ -844,36 +763,30 @@ /* prepare the calling parameters for doAction() * rgerhards, 2009-05-07 */ -static rsRetVal -prepareDoActionParams(action_t *pAction, batch_obj_t *pElem, struct syslogTime *ttNow) +static rsRetVal prepareDoActionParams(action_t *pAction, batch_obj_t *pElem) { int i; msg_t *pMsg; - struct json_object *json; DEFiRet; ASSERT(pAction != NULL); ASSERT(pElem != NULL); - pMsg = pElem->pMsg; + pMsg = (msg_t*) pElem->pUsrp; /* here we must loop to process all requested strings */ for(i = 0 ; i < pAction->iNumTpls ; ++i) { switch(pAction->eParamPassing) { case ACT_STRING_PASSING: CHKiRet(tplToString(pAction->ppTpl[i], pMsg, &(pElem->staticActStrings[i]), - &pElem->staticLenStrings[i], ttNow)); + &pElem->staticLenStrings[i])); pElem->staticActParams[i] = pElem->staticActStrings[i]; break; case ACT_ARRAY_PASSING: - CHKiRet(tplToArray(pAction->ppTpl[i], pMsg, (uchar***) &(pElem->staticActParams[i]), ttNow)); + CHKiRet(tplToArray(pAction->ppTpl[i], pMsg, (uchar***) &(pElem->staticActParams[i]))); break; case ACT_MSG_PASSING: pElem->staticActParams[i] = (void*) pMsg; break; - case ACT_JSON_PASSING: - CHKiRet(tplToJSON(pAction->ppTpl[i], pMsg, &json, ttNow)); - pElem->staticActParams[i] = (void*) json; - break; default:dbgprintf("software bug/error: unknown pAction->eParamPassing %d in prepareDoActionParams\n", (int) pAction->eParamPassing); assert(0); /* software bug if this happens! */ @@ -904,12 +817,9 @@ ASSERT(pAction != NULL); - if(pAction->eParamPassing == ACT_STRING_PASSING || pAction->eParamPassing == ACT_MSG_PASSING) - goto done; /* we need to do nothing with these types! */ - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { pElem = &(pBatch->pElem[i]); - if(batchIsValidElem(pBatch, i)) { + if(pElem->bFilterOK && pElem->state != BATCH_STATE_DISC) { switch(pAction->eParamPassing) { case ACT_ARRAY_PASSING: ppMsgs = (uchar***) pElem->staticActParams; @@ -926,22 +836,24 @@ } } break; - case ACT_JSON_PASSING: - for(j = 0 ; j < pAction->iNumTpls ; ++j) { - json_object_put((struct json_object*) - pElem->staticActParams[j]); - pElem->staticActParams[j] = NULL; - } - break; case ACT_STRING_PASSING: case ACT_MSG_PASSING: - /* can never happen, just to keep compiler happy! */ + /* nothing to do in that case */ + /* TODO ... and yet we do something ;) This is considered not + * really needed, but I was not bold enough to remove that while + * fixing the stable. It should be removed in a devel version + * soon (I really don't see a reason why we would need it). + * rgerhards, 2010-12-16 + */ + for(j = 0 ; j < pAction->iNumTpls ; ++j) { + ((uchar**)pElem->staticActParams)[j] = NULL; + } break; } } } -done: RETiRet; + RETiRet; } @@ -1005,8 +917,6 @@ ISOBJ_TYPE_assert(pMsg, msg); CHKiRet(actionPrepare(pThis, pbShutdownImmediate)); - if(pThis->pMod->mod.om.SetShutdownImmdtPtr != NULL) - pThis->pMod->mod.om.SetShutdownImmdtPtr(pThis->pModData, pbShutdownImmediate); if(pThis->eState == ACT_STATE_ITX) CHKiRet(actionCallDoAction(pThis, pMsg, actParams)); @@ -1100,8 +1010,9 @@ /* NOTE: do NOT extend the filter below! Anything else must be done on the * enq side of the queue (see file header comment)! -- rgerhards, 2011-06-15 */ - if(batchIsValidElem(pBatch, i)) { - pMsg = pBatch->pElem[i].pMsg; + if( pBatch->pElem[i].bFilterOK + && pBatch->pElem[i].state != BATCH_STATE_DISC) { + pMsg = (msg_t*) pBatch->pElem[i].pUsrp; localRet = actionProcessMessage(pAction, pMsg, pBatch->pElem[i].staticActParams, pBatch->pbShutdownImmediate); DBGPRINTF("action %p call returned %d\n", pAction, localRet); @@ -1124,11 +1035,11 @@ ++iCommittedUpTo; //pBatch->pElem[iCommittedUpTo++].state = BATCH_STATE_COMM; } - pBatch->eltState[i] = BATCH_STATE_SUB; + pBatch->pElem[i].state = BATCH_STATE_SUB; } else if(localRet == RS_RET_DEFER_COMMIT) { - pBatch->eltState[i] = BATCH_STATE_SUB; + pBatch->pElem[i].state = BATCH_STATE_SUB; } else if(localRet == RS_RET_DISCARDMSG) { - pBatch->eltState[i] = BATCH_STATE_DISC; + pBatch->pElem[i].state = BATCH_STATE_DISC; } else { dbgprintf("tryDoAction: unexpected error code %d[nElem %d, Commited UpTo %d], finalizing\n", localRet, *pnElem, iCommittedUpTo); @@ -1147,6 +1058,16 @@ RETiRet; } +/* debug aid */ +static void displayBatchState(batch_t *pBatch) +{ + int i; + for(i = 0 ; i < pBatch->nElem ; ++i) { + dbgprintf("XXXXX: displayBatchState2 %p[%d]: %d\n", pBatch, i, pBatch->pElem[i].state); + } +} + + /* submit a batch for actual action processing. * The first nElem elements are processed. This function calls itself * recursively if it needs to handle errors. @@ -1165,7 +1086,6 @@ assert(pBatch != NULL); - DBGPRINTF("submitBatch: enter, nElem %d\n", nElem); wasDoneTo = pBatch->iDoneUpTo; bDone = 0; do { @@ -1187,14 +1107,13 @@ || localRet == RS_RET_DEFER_COMMIT) { bDone = 1; } else if(localRet == RS_RET_SUSPENDED) { - DBGPRINTF("action ret RS_RET_SUSPENDED - retry full batch\n"); - /* do nothing, this will retry the full batch */ + ; /* do nothing, this will retry the full batch */ } else if(localRet == RS_RET_ACTION_FAILED) { /* in this case, everything not yet committed is BAD */ for(i = pBatch->iDoneUpTo ; i < wasDoneTo + nElem ; ++i) { - if( pBatch->eltState[i] != BATCH_STATE_DISC - && pBatch->eltState[i] != BATCH_STATE_COMM ) { - pBatch->eltState[i] = BATCH_STATE_BAD; + if( pBatch->pElem[i].state != BATCH_STATE_DISC + && pBatch->pElem[i].state != BATCH_STATE_COMM ) { + pBatch->pElem[i].state = BATCH_STATE_BAD; pBatch->pElem[i].bPrevWasSuspended = 1; STATSCOUNTER_INC(pAction->ctrFail, pAction->mutCtrFail); } @@ -1223,29 +1142,6 @@ } -/* copy "active" array of batch, as we need to modify it. The caller - * must make sure the new array is freed and the orginal batch - * pointer is restored (thus the caller must save it). If active - * is currently NULL, this is properly handled. - * Note: the batches active pointer is modified, so it must be - * saved BEFORE calling this function! - * rgerhards, 2012-09-12 - */ -static rsRetVal -copyActive(batch_t *pBatch) -{ - sbool *active; - DEFiRet; - - CHKmalloc(active = malloc(batchNumMsgs(pBatch) * sizeof(sbool))); - if(pBatch->active == NULL) - memset(active, 1, batchNumMsgs(pBatch)); - else - memcpy(active, pBatch->active, batchNumMsgs(pBatch)); - pBatch->active = active; -finalize_it: - RETiRet; -} /* The following function prepares a batch for processing, that it is * reinitializes batch states, generates strings and does everything else @@ -1256,29 +1152,19 @@ * rgerhards, 2010-06-14 */ static inline rsRetVal -prepareBatch(action_t *pAction, batch_t *pBatch, sbool **activeSave, int *bMustRestoreActivePtr) +prepareBatch(action_t *pAction, batch_t *pBatch) { int i; batch_obj_t *pElem; - struct syslogTime ttNow; DEFiRet; - /* indicate we have not yet read the date */ - ttNow.year = 0; - pBatch->iDoneUpTo = 0; for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { pElem = &(pBatch->pElem[i]); - if(batchIsValidElem(pBatch, i)) { - pBatch->eltState[i] = BATCH_STATE_RDY; - if(prepareDoActionParams(pAction, pElem, &ttNow) != RS_RET_OK) { - /* make sure we have our copy of "active" array */ - if(!*bMustRestoreActivePtr) { - *activeSave = pBatch->active; - copyActive(pBatch); - } - pBatch->active[i] = RSFALSE; - } + if(pElem->bFilterOK && pElem->state != BATCH_STATE_DISC) { + pElem->state = BATCH_STATE_RDY; + if(prepareDoActionParams(pAction, pElem) != RS_RET_OK) + pElem->bFilterOK = RSFALSE; } } RETiRet; @@ -1311,18 +1197,14 @@ processBatchMain(action_t *pAction, batch_t *pBatch, int *pbShutdownImmediate) { int *pbShutdownImmdtSave; - sbool *activeSave; - int bMustRestoreActivePtr = 0; rsRetVal localRet; DEFiRet; assert(pBatch != NULL); - if(pbShutdownImmediate != NULL) { - pbShutdownImmdtSave = pBatch->pbShutdownImmediate; - pBatch->pbShutdownImmediate = pbShutdownImmediate; - } - CHKiRet(prepareBatch(pAction, pBatch, &activeSave, &bMustRestoreActivePtr)); + pbShutdownImmdtSave = pBatch->pbShutdownImmediate; + pBatch->pbShutdownImmediate = pbShutdownImmediate; + CHKiRet(prepareBatch(pAction, pBatch)); /* We now must guard the output module against execution by multiple threads. The * plugin interface specifies that output modules must not be thread-safe (except @@ -1345,15 +1227,9 @@ if(iRet == RS_RET_OK) iRet = localRet; - - if(bMustRestoreActivePtr) { - free(pBatch->active); - pBatch->active = activeSave; - } finalize_it: - if(pbShutdownImmediate != NULL) - pBatch->pbShutdownImmediate = pbShutdownImmdtSave; + pBatch->pbShutdownImmediate = pbShutdownImmdtSave; RETiRet; } #pragma GCC diagnostic warning "-Wempty-body" @@ -1397,16 +1273,16 @@ DEFiRet; if (!strcasecmp((char *) pszType, "fixedarray")) { - cs.ActionQueType = QUEUETYPE_FIXED_ARRAY; + ActionQueType = QUEUETYPE_FIXED_ARRAY; DBGPRINTF("action queue type set to FIXED_ARRAY\n"); } else if (!strcasecmp((char *) pszType, "linkedlist")) { - cs.ActionQueType = QUEUETYPE_LINKEDLIST; + ActionQueType = QUEUETYPE_LINKEDLIST; DBGPRINTF("action queue type set to LINKEDLIST\n"); } else if (!strcasecmp((char *) pszType, "disk")) { - cs.ActionQueType = QUEUETYPE_DISK; + ActionQueType = QUEUETYPE_DISK; DBGPRINTF("action queue type set to DISK\n"); } else if (!strcasecmp((char *) pszType, "direct")) { - cs.ActionQueType = QUEUETYPE_DIRECT; + ActionQueType = QUEUETYPE_DIRECT; DBGPRINTF("action queue type set to DIRECT (no queueing at all)\n"); } else { errmsg.LogError(0, RS_RET_INVALID_PARAMS, "unknown actionqueue parameter: %s", (char *) pszType); @@ -1429,18 +1305,12 @@ { DEFiRet; - if(pAction->eState == ACT_STATE_DIED) { - DBGPRINTF("action %p died, do NOT execute\n", pAction); - FINALIZE; - } - STATSCOUNTER_INC(pAction->ctrProcessed, pAction->mutCtrProcessed); if(pAction->pQueue->qType == QUEUETYPE_DIRECT) - iRet = qqueueEnqMsgDirect(pAction->pQueue, MsgAddRef(pMsg)); + iRet = qqueueEnqObjDirect(pAction->pQueue, (void*) MsgAddRef(pMsg)); else - iRet = qqueueEnqMsg(pAction->pQueue, eFLOWCTL_NO_DELAY, MsgAddRef(pMsg)); + iRet = qqueueEnqObj(pAction->pQueue, eFLOWCTL_NO_DELAY, (void*) MsgAddRef(pMsg)); -finalize_it: RETiRet; } @@ -1453,10 +1323,14 @@ * be filtered out before calling us (what is done currently!). */ rsRetVal -actionWriteToAction(action_t *pAction, msg_t *pMsg) +actionWriteToAction(action_t *pAction) { + msg_t *pMsgSave; /* to save current message pointer, necessary to restore + it in case it needs to be updated (e.g. repeated msgs) */ DEFiRet; + pMsgSave = NULL; /* indicate message poiner not saved */ + /* first, we check if the action should actually be called. The action-specific * $ActionExecOnlyEveryNthTime permits us to execute an action only every Nth * time. So we need to check if we need to drop the (otherwise perfectly executable) @@ -1483,6 +1357,43 @@ } } + /* then check if this is a regular message or the repeation of + * a previous message. If so, we need to change the message text + * to "last message repeated n times" and then go ahead and write + * it. Please note that we can not modify the message object, because + * that would update it in other selectors as well. As such, we first + * need to create a local copy of the message, which we than can update. + * rgerhards, 2007-07-10 + */ + if(pAction->f_prevcount > 1) { + msg_t *pMsg; + size_t lenRepMsg; + uchar szRepMsg[1024]; + + if((pMsg = MsgDup(pAction->f_pMsg)) == NULL) { + /* it failed - nothing we can do against it... */ + DBGPRINTF("Message duplication failed, dropping repeat message.\n"); + ABORT_FINALIZE(RS_RET_ERR); + } + + if(pAction->bRepMsgHasMsg == 0) { /* old format repeat message? */ + lenRepMsg = snprintf((char*)szRepMsg, sizeof(szRepMsg), " last message repeated %d times", + pAction->f_prevcount); + } else { + lenRepMsg = snprintf((char*)szRepMsg, sizeof(szRepMsg), " message repeated %d times: [%.800s]", + pAction->f_prevcount, getMSG(pAction->f_pMsg)); + } + + /* We now need to update the other message properties. Please note that digital + * signatures inside the message are also invalidated. + */ + datetime.getCurrTime(&(pMsg->tRcvdAt), &(pMsg->ttGenTime)); + memcpy(&pMsg->tTIMESTAMP, &pMsg->tRcvdAt, sizeof(struct syslogTime)); + MsgReplaceMSG(pMsg, szRepMsg, lenRepMsg); + pMsgSave = pAction->f_pMsg; /* save message pointer for later restoration */ + pAction->f_pMsg = pMsg; /* use the new msg (pointer will be restored below) */ + } + DBGPRINTF("Called action(complex case), logging to %s\n", module.GetStateName(pAction->pMod)); /* now check if we need to drop the message because otherwise the action would be too @@ -1503,14 +1414,31 @@ /* we use reception time, not dequeue time - this is considered more appropriate and also faster ;) * rgerhards, 2008-09-17 */ pAction->tLastExec = getActNow(pAction); /* re-init time flags */ - pAction->f_time = pMsg->ttGenTime; + pAction->f_time = pAction->f_pMsg->ttGenTime; /* When we reach this point, we have a valid, non-disabled action. * So let's enqueue our message for execution. -- rgerhards, 2007-07-24 */ - iRet = doSubmitToActionQ(pAction, pMsg); + iRet = doSubmitToActionQ(pAction, pAction->f_pMsg); + + if(iRet == RS_RET_OK) + pAction->f_prevcount = 0; /* message processed, so we start a new cycle */ finalize_it: + if(pMsgSave != NULL) { + /* we had saved the original message pointer. That was + * done because we needed to create a temporary one + * (most often for "message repeated n time" handling). If so, + * we need to restore the original one now, so that procesing + * can continue as normal. We also need to discard the temporary + * one, as we do not like memory leaks ;) Please note that the original + * message object will be discarded by our callers, so this is nothing + * of our business. rgerhards, 2007-07-10 + */ + msgDestruct(&pAction->f_pMsg); + pAction->f_pMsg = pMsgSave; /* restore it */ + } + RETiRet; } @@ -1524,7 +1452,7 @@ msg_t *pMsg; DEFiRet; - pMsg = pBatch->pElem[idxBtch].pMsg; + pMsg = (msg_t*)(pBatch->pElem[idxBtch].pUsrp); pAction->tActNow = -1; /* we do not yet know our current time (clear prev. value) */ /* don't output marks to recently written outputs */ @@ -1533,8 +1461,43 @@ ABORT_FINALIZE(RS_RET_OK); } - /* call the output driver */ - iRet = actionWriteToAction(pAction, pMsg); + /* suppress duplicate messages */ + if ((pAction->f_ReduceRepeated == 1) && pAction->f_pMsg != NULL && + (pMsg->msgFlags & MARK) == 0 && getMSGLen(pMsg) == getMSGLen(pAction->f_pMsg) && + !ustrcmp(getMSG(pMsg), getMSG(pAction->f_pMsg)) && + !strcmp(getHOSTNAME(pMsg), getHOSTNAME(pAction->f_pMsg)) && + !strcmp(getPROCID(pMsg, LOCK_MUTEX), getPROCID(pAction->f_pMsg, LOCK_MUTEX)) && + !strcmp(getAPPNAME(pMsg, LOCK_MUTEX), getAPPNAME(pAction->f_pMsg, LOCK_MUTEX))) { + pAction->f_prevcount++; + DBGPRINTF("msg repeated %d times, %ld sec of %d.\n", + pAction->f_prevcount, (long) getActNow(pAction) - pAction->f_time, + repeatinterval[pAction->f_repeatcount]); + /* use current message, so we have the new timestamp (means we need to discard previous one) */ + msgDestruct(&pAction->f_pMsg); + pAction->f_pMsg = MsgAddRef(pMsg); + /* If domark would have logged this by now, flush it now (so we don't hold + * isolated messages), but back off so we'll flush less often in the future. + */ + if(getActNow(pAction) > REPEATTIME(pAction)) { + iRet = actionWriteToAction(pAction); + BACKOFF(pAction); + } + } else {/* new message, save it */ + /* first check if we have a previous message stored + * if so, emit and then discard it first + */ + if(pAction->f_pMsg != NULL) { + if(pAction->f_prevcount > 0) + actionWriteToAction(pAction); + /* we do not care about iRet above - I think it's right but if we have + * some troubles, you know where to look at ;) -- rgerhards, 2007-08-01 + */ + msgDestruct(&pAction->f_pMsg); + } + pAction->f_pMsg = MsgAddRef(pMsg); + /* call the output driver */ + iRet = actionWriteToAction(pAction); + } finalize_it: /* we need to update the batch to handle failover processing correctly */ @@ -1548,43 +1511,6 @@ } -/* helper to activateActions, it activates a specific action. - */ -DEFFUNC_llExecFunc(doActivateActions) -{ - rsRetVal localRet; - action_t *pThis = (action_t*) pData; - BEGINfunc - localRet = qqueueStart(pThis->pQueue); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, "error starting up action queue"); - if(localRet == RS_RET_FILE_PREFIX_MISSING) { - errmsg.LogError(0, localRet, "file prefix (work directory?) " - "is missing"); - } - actionDisable(pThis); - } - DBGPRINTF("Action %s[%p]: queue %p started\n", modGetName(pThis->pMod), - pThis, pThis->pQueue); - ENDfunc - return RS_RET_OK; /* we ignore errors, we can not do anything either way */ -} - - -/* This function "activates" the action after privileges have been dropped. Currently, - * this means that the queues are started. - * rgerhards, 2011-05-02 - */ -rsRetVal -activateActions(void) -{ - DEFiRet; - iRet = ruleset.IterateAllActions(ourConf, doActivateActions, NULL); - RETiRet; -} - - - /* This submits the message to the action queue in case where we need to handle * bWriteAllMarkMessage == RSFALSE only. Note that we use a non-blocking CAS loop * for the synchronization. Here, we just modify the filter condition to be false when @@ -1599,15 +1525,22 @@ time_t now = 0; time_t lastAct; int i; - sbool *activeSave; + int bModifiedFilter; + sbool FilterSave[1024]; + sbool *pFilterSave; DEFiRet; - activeSave = pBatch->active; - copyActive(pBatch); + if(batchNumMsgs(pBatch) <= (int) (sizeof(FilterSave)/sizeof(sbool))) { + pFilterSave = FilterSave; + } else { + CHKmalloc(pFilterSave = malloc(batchNumMsgs(pBatch) * sizeof(sbool))); + } + bModifiedFilter = 0; for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - if((pBatch->eltState[i] == BATCH_STATE_DISC) || !pBatch->active[i]) + if(!pBatch->pElem[i].bFilterOK) continue; + pFilterSave[i] = pBatch->pElem[i].bFilterOK; if(now == 0) { now = datetime.GetTime(NULL); /* good time call - the only one done */ } @@ -1616,17 +1549,17 @@ * also faster ;) -- rgerhards, 2008-09-17 */ do { lastAct = pAction->f_time; - if(pBatch->pElem[i].pMsg->msgFlags & MARK) { + if(((msg_t*)(pBatch->pElem[i].pUsrp))->msgFlags & MARK) { if((now - lastAct) < MarkInterval / 2) { - pBatch->active[i] = 0; - DBGPRINTF("batch item %d: action was recently called, ignoring " - "mark message\n", i); + pBatch->pElem[i].bFilterOK = 0; + bModifiedFilter = 1; + DBGPRINTF("action was recently called, ignoring mark message\n"); break; /* do not update timestamp for non-written mark messages */ } } } while(ATOMIC_CAS_time_t(&pAction->f_time, lastAct, - pBatch->pElem[i].pMsg->ttGenTime, &pAction->mutCAS) == 0); - if(pBatch->active[i]) { + ((msg_t*)(pBatch->pElem[i].pUsrp))->ttGenTime, &pAction->mutCAS) == 0); + if(pBatch->pElem[i].bFilterOK) { DBGPRINTF("Called action(NotAllMark), processing batch[%d] via '%s'\n", i, module.GetStateName(pAction->pMod)); } @@ -1634,8 +1567,17 @@ iRet = doSubmitToActionQBatch(pAction, pBatch); - free(pBatch->active); - pBatch->active = activeSave; + if(bModifiedFilter) { + /* in this case, we need to restore previous state */ + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + /* note: clang static code analyzer reports a false positive below */ + pBatch->pElem[i].bFilterOK = pFilterSave[i]; + } + } + +finalize_it: + if(pFilterSave != FilterSave) + free(pFilterSave); RETiRet; } @@ -1645,7 +1587,8 @@ { int i; for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { - if( batchIsValidElem(pBatch, i)) { + if( pBatch->pElem[i].bFilterOK + && pBatch->pElem[i].state != BATCH_STATE_DISC) { STATSCOUNTER_INC(pAction->ctrProcessed, pAction->mutCtrProcessed); } } @@ -1659,13 +1602,18 @@ static inline rsRetVal doQueueEnqObjDirectBatch(action_t *pAction, batch_t *pBatch) { + sbool FilterSave[1024]; + sbool *pFilterSave; sbool bNeedSubmit; - sbool *activeSave; + sbool bModifiedFilter; int i; DEFiRet; - activeSave = pBatch->active; - copyActive(pBatch); + if(batchNumMsgs(pBatch) <= (int) (sizeof(FilterSave)/sizeof(sbool))) { + pFilterSave = FilterSave; + } else { + CHKmalloc(pFilterSave = malloc(batchNumMsgs(pBatch) * sizeof(sbool))); + } /* note: for direct mode, we need to adjust the filter property. For non-direct * this is not necessary, because in that case we enqueue only what actually needs @@ -1673,25 +1621,37 @@ */ if(pAction->bExecWhenPrevSusp) { bNeedSubmit = 0; + bModifiedFilter = 0; for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + pFilterSave[i] = pBatch->pElem[i].bFilterOK; if(!pBatch->pElem[i].bPrevWasSuspended) { - DBGPRINTF("action enq stage: change active to 0 due to " + DBGPRINTF("action enq stage: change bFilterOK to 0 due to " "failover case in elem %d\n", i); - pBatch->active[i] = 0; + pBatch->pElem[i].bFilterOK = 0; + bModifiedFilter = 1; } - if(batchIsValidElem(pBatch, i)) { + if(pBatch->pElem[i].bFilterOK && pBatch->pElem[i].state != BATCH_STATE_DISC) { STATSCOUNTER_INC(pAction->ctrProcessed, pAction->mutCtrProcessed); bNeedSubmit = 1; } - DBGPRINTF("action %p[%d]: valid:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", - pAction, i, batchIsValidElem(pBatch, i), pBatch->eltState[i], + DBGPRINTF("action %p[%d]: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, i, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); } if(bNeedSubmit) { /* note: stats were already computed above */ iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch); } else { - DBGPRINTF("no need to submit batch, all invalid\n"); + DBGPRINTF("no need to submit batch, all bFilterOK==0 or discarded\n"); + } + if(bModifiedFilter) { + for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { + DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, + pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); + /* note: clang static code analyzer reports a false positive below */ + pBatch->pElem[i].bFilterOK = pFilterSave[i]; + } } } else { if(GatherStats) @@ -1699,8 +1659,7 @@ iRet = qqueueEnqObjDirectBatch(pAction->pQueue, pBatch); } - free(pBatch->active); - pBatch->active = activeSave; +finalize_it: RETiRet; } @@ -1723,12 +1682,13 @@ * TODO: optimize this, we may do at least a multi-submit! */ for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { - DBGPRINTF("action %p: valid:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", - pAction, batchIsValidElem(pBatch, i), pBatch->eltState[i], + DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); - if( batchIsValidElem(pBatch, i) + if( pBatch->pElem[i].bFilterOK + && pBatch->pElem[i].state != BATCH_STATE_DISC && (pAction->bExecWhenPrevSusp == 0 || pBatch->pElem[i].bPrevWasSuspended == 1)) { - doSubmitToActionQ(pAction, pBatch->pElem[i].pMsg); + doSubmitToActionQ(pAction, (msg_t*)(pBatch->pElem[i].pUsrp)); } } } @@ -1751,10 +1711,11 @@ DBGPRINTF("Called action %p (complex case), logging to %s\n", pAction, module.GetStateName(pAction->pMod)); for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { - DBGPRINTF("action %p: valid:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", - pAction, batchIsValidElem(pBatch, i), pBatch->eltState[i], + DBGPRINTF("action %p: filterOK:%d state:%d execWhenPrev:%d prevWasSusp:%d\n", + pAction, pBatch->pElem[i].bFilterOK, pBatch->pElem[i].state, pAction->bExecWhenPrevSusp, pBatch->pElem[i].bPrevWasSuspended); - if( batchIsValidElem(pBatch, i) + if( pBatch->pElem[i].bFilterOK + && pBatch->pElem[i].state != BATCH_STATE_DISC && ((pAction->bExecWhenPrevSusp == 0) || pBatch->pElem[i].bPrevWasSuspended) ) { doActionCallAction(pAction, pBatch, i); } @@ -1772,67 +1733,23 @@ { DEFiRet; - d_pthread_mutex_lock(&pAction->mutAction); - pthread_cleanup_push(mutexCancelCleanup, &pAction->mutAction); + LockObj(pAction); + pthread_cleanup_push(mutexCancelCleanup, pAction->Sync_mut); iRet = helperSubmitToActionQComplexBatch(pAction, pBatch); - d_pthread_mutex_unlock(&pAction->mutAction); + UnlockObj(pAction); pthread_cleanup_pop(0); /* remove mutex cleanup handler */ RETiRet; } #pragma GCC diagnostic warning "-Wempty-body" - -/* apply all params from param block to action. This supports the v6 config system. - * Defaults must have been set appropriately during action construct! - * rgerhards, 2011-08-01 - */ -static rsRetVal -actionApplyCnfParam(action_t *pAction, struct cnfparamvals *pvals) -{ - int i; - - for(i = 0 ; i < pblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblk.descr[i].name, "name")) { - pAction->pszName = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblk.descr[i].name, "type")) { - continue; /* this is handled seperately during module select! */ - } else if(!strcmp(pblk.descr[i].name, "action.writeallmarkmessages")) { - pAction->bWriteAllMarkMsgs = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.execonlyeverynthtime")) { - pAction->iExecEveryNthOccur = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.execonlyeverynthtimetimeout")) { - pAction->iExecEveryNthOccurTO = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.execonlyonceeveryinterval")) { - pAction->iSecsExecOnceInterval = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.execonlywhenpreviousissuspended")) { - pAction->bExecWhenPrevSusp = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.repeatedmsgcontainsoriginalmsg")) { - pAction->bRepMsgHasMsg = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.resumeretrycount")) { - pAction->iResumeRetryCount = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "action.resumeinterval")) { - pAction->iResumeInterval = pvals[i].val.d.n; - } else { - dbgprintf("action: program error, non-handled " - "param '%s'\n", pblk.descr[i].name); - } - } - return RS_RET_OK; -} - - /* add an Action to the current selector * The pOMSR is freed, as it is not needed after this function. * Note: this function pulls global data that specifies action config state. * rgerhards, 2007-07-27 */ rsRetVal -addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, - omodStringRequest_t *pOMSR, struct cnfparamvals *actParams, - struct nvlst *lst, int bSuspended) +addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, int bSuspended) { DEFiRet; int i; @@ -1844,28 +1761,22 @@ assert(ppAction != NULL); assert(pMod != NULL); assert(pOMSR != NULL); - DBGPRINTF("Module %s processes this action.\n", module.GetName(pMod)); + DBGPRINTF("Module %s processed this config line.\n", module.GetName(pMod)); CHKiRet(actionConstruct(&pAction)); /* create action object first */ pAction->pMod = pMod; pAction->pModData = pModData; - if(actParams == NULL) { /* use legacy systemn */ - pAction->pszName = cs.pszActionName; - pAction->iResumeInterval = cs.glbliActionResumeInterval; - pAction->iResumeRetryCount = cs.glbliActionResumeRetryCount; - pAction->bWriteAllMarkMsgs = cs.bActionWriteAllMarkMsgs; - pAction->bExecWhenPrevSusp = cs.bActExecWhenPrevSusp; - pAction->iSecsExecOnceInterval = cs.iActExecOnceInterval; - pAction->iExecEveryNthOccur = cs.iActExecEveryNthOccur; - pAction->iExecEveryNthOccurTO = cs.iActExecEveryNthOccurTO; - pAction->bRepMsgHasMsg = cs.bActionRepMsgHasMsg; - cs.iActExecEveryNthOccur = 0; /* auto-reset */ - cs.iActExecEveryNthOccurTO = 0; /* auto-reset */ - cs.bActionWriteAllMarkMsgs = RSFALSE; /* auto-reset */ - cs.pszActionName = NULL; /* free again! */ - } else { - actionApplyCnfParam(pAction, actParams); - } + pAction->pszName = pszActionName; + pszActionName = NULL; /* free again! */ + pAction->bWriteAllMarkMsgs = bActionWriteAllMarkMsgs; + bActionWriteAllMarkMsgs = RSFALSE; /* reset */ + pAction->bExecWhenPrevSusp = bActExecWhenPrevSusp; + pAction->iSecsExecOnceInterval = iActExecOnceInterval; + pAction->iExecEveryNthOccur = iActExecEveryNthOccur; + pAction->iExecEveryNthOccurTO = iActExecEveryNthOccurTO; + pAction->bRepMsgHasMsg = bActionRepMsgHasMsg; + iActExecEveryNthOccur = 0; /* auto-reset */ + iActExecEveryNthOccurTO = 0; /* auto-reset */ /* check if we can obtain the template pointers - TODO: move to separate function? */ pAction->iNumTpls = OMSRgetEntryCount(pOMSR); @@ -1884,11 +1795,9 @@ /* Ok, we got everything, so it now is time to look up the template * (Hint: templates MUST be defined before they are used!) */ - if( !(iTplOpts & OMSR_TPL_AS_MSG) - && (pAction->ppTpl[i] = - tplFind(ourConf, (char*)pTplName, strlen((char*)pTplName))) == NULL) { + if((pAction->ppTpl[i] = tplFind((char*)pTplName, strlen((char*)pTplName))) == NULL) { snprintf(errMsg, sizeof(errMsg) / sizeof(char), - " Could not find template '%s' - action disabled", + " Could not find template '%s' - action disabled\n", pTplName); errno = 0; errmsg.LogError(0, RS_RET_NOT_FOUND, "%s", errMsg); @@ -1908,8 +1817,6 @@ pAction->eParamPassing = ACT_ARRAY_PASSING; } else if(iTplOpts & OMSR_TPL_AS_MSG) { pAction->eParamPassing = ACT_MSG_PASSING; - } else if(iTplOpts & OMSR_TPL_AS_JSON) { - pAction->eParamPassing = ACT_JSON_PASSING; } else { pAction->eParamPassing = ACT_STRING_PASSING; } @@ -1919,13 +1826,19 @@ pAction->pMod = pMod; pAction->pModData = pModData; - /* check if the module is compatible with select features (currently no such features exist) */ + /* now check if the module is compatible with select features */ + if(pMod->isCompatibleWithFeature(sFEATURERepeatedMsgReduction) == RS_RET_OK) + pAction->f_ReduceRepeated = bReduceRepeatMsgs; + else { + DBGPRINTF("module is incompatible with RepeatedMsgReduction - turned off\n"); + pAction->f_ReduceRepeated = 0; + } pAction->eState = ACT_STATE_RDY; /* action is enabled */ if(bSuspended) - actionSuspend(pAction); + actionSuspend(pAction, datetime.GetTime(NULL)); /* "good" time call, only during init and unavoidable */ - CHKiRet(actionConstructFinalize(pAction, lst)); + CHKiRet(actionConstructFinalize(pAction)); /* TODO: if we exit here, we have a memory leak... */ @@ -1951,78 +1864,11 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - cs.iActExecOnceInterval = 0; - cs.bActExecWhenPrevSusp = 0; + iActExecOnceInterval = 0; return RS_RET_OK; } -/* initialize (current) config variables. - * Used at program start and when a new scope is created. - */ -static inline void -initConfigVariables(void) -{ - cs.bActionWriteAllMarkMsgs = RSFALSE; - cs.glbliActionResumeRetryCount = 0; - cs.bActExecWhenPrevSusp = 0; - cs.iActExecOnceInterval = 0; - cs.iActExecEveryNthOccur = 0; - cs.iActExecEveryNthOccurTO = 0; - cs.glbliActionResumeInterval = 30; - cs.glbliActionResumeRetryCount = 0; - cs.bActionRepMsgHasMsg = 0; - if(cs.pszActionName != NULL) { - free(cs.pszActionName); - cs.pszActionName = NULL; - } - actionResetQueueParams(); -} - - -rsRetVal -actionNewInst(struct nvlst *lst, action_t **ppAction) -{ - struct cnfparamvals *paramvals; - modInfo_t *pMod; - uchar *cnfModName = NULL; - omodStringRequest_t *pOMSR; - void *pModData; - action_t *pAction; - DEFiRet; - - paramvals = nvlstGetParams(lst, &pblk, NULL); - if(paramvals == NULL) { - ABORT_FINALIZE(RS_RET_PARAM_ERROR); - } - dbgprintf("action param blk after actionNewInst:\n"); - cnfparamsPrint(&pblk, paramvals); - cnfModName = (uchar*)es_str2cstr(paramvals[cnfparamGetIdx(&pblk, ("type"))].val.d.estr, NULL); - if((pMod = module.FindWithCnfName(loadConf, cnfModName, eMOD_OUT)) == NULL) { - errmsg.LogError(0, RS_RET_MOD_UNKNOWN, "module name '%s' is unknown", cnfModName); - ABORT_FINALIZE(RS_RET_MOD_UNKNOWN); - } - iRet = pMod->mod.om.newActInst(cnfModName, lst, &pModData, &pOMSR); - // TODO: check if RS_RET_SUSPENDED is still valid in v6! - if(iRet != RS_RET_OK && iRet != RS_RET_SUSPENDED) { - FINALIZE; /* iRet is already set to error state */ - } - - if((iRet = addAction(&pAction, pMod, pModData, pOMSR, paramvals, lst, - (iRet == RS_RET_SUSPENDED)? 1 : 0)) == RS_RET_OK) { - /* check if the module is compatible with select features - * (currently no such features exist) */ - pAction->eState = ACT_STATE_RDY; /* action is enabled */ - loadConf->actions.nbrActions++; /* one more active action! */ - } - *ppAction = pAction; - -finalize_it: - free(cnfModName); - cnfparamvalsDestruct(paramvals, &pblk); - RETiRet; -} - /* TODO: we are not yet a real object, the ClassInit here just looks like it is.. */ rsRetVal actionClassInit(void) @@ -2034,42 +1880,38 @@ CHKiRet(objUse(module, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(statsobj, CORE_COMPONENT)); - CHKiRet(objUse(ruleset, CORE_COMPONENT)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionname", 0, eCmdHdlrGetWord, NULL, &cs.pszActionName, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuefilename", 0, eCmdHdlrGetWord, NULL, &cs.pszActionQFName, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesize", 0, eCmdHdlrInt, NULL, &cs.iActionQueueSize, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionwriteallmarkmessages", 0, eCmdHdlrBinary, NULL, &cs.bActionWriteAllMarkMsgs, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuebatchsize", 0, eCmdHdlrInt, NULL, &cs.iActionQueueDeqBatchSize, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuemaxdiskspace", 0, eCmdHdlrSize, NULL, &cs.iActionQueMaxDiskSpace, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuehighwatermark", 0, eCmdHdlrInt, NULL, &cs.iActionQHighWtrMark, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuelowwatermark", 0, eCmdHdlrInt, NULL, &cs.iActionQLowWtrMark, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuediscardmark", 0, eCmdHdlrInt, NULL, &cs.iActionQDiscardMark, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuediscardseverity", 0, eCmdHdlrInt, NULL, &cs.iActionQDiscardSeverity, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuecheckpointinterval", 0, eCmdHdlrInt, NULL, &cs.iActionQPersistUpdCnt, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesyncqueuefiles", 0, eCmdHdlrBinary, NULL, &cs.bActionQSyncQeueFiles, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionname", 0, eCmdHdlrGetWord, NULL, &pszActionName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuefilename", 0, eCmdHdlrGetWord, NULL, &pszActionQFName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesize", 0, eCmdHdlrInt, NULL, &iActionQueueSize, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionwriteallmarkmessages", 0, eCmdHdlrBinary, NULL, &bActionWriteAllMarkMsgs, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuebatchsize", 0, eCmdHdlrInt, NULL, &iActionQueueDeqBatchSize, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuemaxdiskspace", 0, eCmdHdlrSize, NULL, &iActionQueMaxDiskSpace, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuehighwatermark", 0, eCmdHdlrInt, NULL, &iActionQHighWtrMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuelowwatermark", 0, eCmdHdlrInt, NULL, &iActionQLowWtrMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuediscardmark", 0, eCmdHdlrInt, NULL, &iActionQDiscardMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuelightdelaymark", 0, eCmdHdlrInt, NULL, &iActionQLightDlyMrk, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuediscardseverity", 0, eCmdHdlrInt, NULL, &iActionQDiscardSeverity, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuecheckpointinterval", 0, eCmdHdlrInt, NULL, &iActionQPersistUpdCnt, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesyncqueuefiles", 0, eCmdHdlrBinary, NULL, &bActionQSyncQeueFiles, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetype", 0, eCmdHdlrGetWord, setActionQueType, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueueworkerthreads", 0, eCmdHdlrInt, NULL, &cs.iActionQueueNumWorkers, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetimeoutshutdown", 0, eCmdHdlrInt, NULL, &cs.iActionQtoQShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetimeoutactioncompletion", 0, eCmdHdlrInt, NULL, &cs.iActionQtoActShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetimeoutenqueue", 0, eCmdHdlrInt, NULL, &cs.iActionQtoEnq, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueueworkertimeoutthreadshutdown", 0, eCmdHdlrInt, NULL, &cs.iActionQtoWrkShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueueworkerthreadminimummessages", 0, eCmdHdlrInt, NULL, &cs.iActionQWrkMinMsgs, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuemaxfilesize", 0, eCmdHdlrSize, NULL, &cs.iActionQueMaxFileSize, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesaveonshutdown", 0, eCmdHdlrBinary, NULL, &cs.bActionQSaveOnShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeueslowdown", 0, eCmdHdlrInt, NULL, &cs.iActionQueueDeqSlowdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuetimebegin", 0, eCmdHdlrInt, NULL, &cs.iActionQueueDeqtWinFromHr, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuetimeend", 0, eCmdHdlrInt, NULL, &cs.iActionQueueDeqtWinToHr, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlyeverynthtime", 0, eCmdHdlrInt, NULL, &cs.iActExecEveryNthOccur, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlyeverynthtimetimeout", 0, eCmdHdlrInt, NULL, &cs.iActExecEveryNthOccurTO, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlyonceeveryinterval", 0, eCmdHdlrInt, NULL, &cs.iActExecOnceInterval, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"repeatedmsgcontainsoriginalmsg", 0, eCmdHdlrBinary, NULL, &cs.bActionRepMsgHasMsg, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlywhenpreviousissuspended", 0, eCmdHdlrBinary, NULL, &cs.bActExecWhenPrevSusp, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionresumeretrycount", 0, eCmdHdlrInt, NULL, &cs.glbliActionResumeRetryCount, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueueworkerthreads", 0, eCmdHdlrInt, NULL, &iActionQueueNumWorkers, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetimeoutshutdown", 0, eCmdHdlrInt, NULL, &iActionQtoQShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetimeoutactioncompletion", 0, eCmdHdlrInt, NULL, &iActionQtoActShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuetimeoutenqueue", 0, eCmdHdlrInt, NULL, &iActionQtoEnq, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueueworkertimeoutthreadshutdown", 0, eCmdHdlrInt, NULL, &iActionQtoWrkShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueueworkerthreadminimummessages", 0, eCmdHdlrInt, NULL, &iActionQWrkMinMsgs, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuemaxfilesize", 0, eCmdHdlrSize, NULL, &iActionQueMaxFileSize, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuesaveonshutdown", 0, eCmdHdlrBinary, NULL, &bActionQSaveOnShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeueslowdown", 0, eCmdHdlrInt, NULL, &iActionQueueDeqSlowdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuetimebegin", 0, eCmdHdlrInt, NULL, &iActionQueueDeqtWinFromHr, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionqueuedequeuetimeend", 0, eCmdHdlrInt, NULL, &iActionQueueDeqtWinToHr, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlyeverynthtime", 0, eCmdHdlrInt, NULL, &iActExecEveryNthOccur, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlyeverynthtimetimeout", 0, eCmdHdlrInt, NULL, &iActExecEveryNthOccurTO, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlyonceeveryinterval", 0, eCmdHdlrInt, NULL, &iActExecOnceInterval, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"repeatedmsgcontainsoriginalmsg", 0, eCmdHdlrBinary, NULL, &bActionRepMsgHasMsg, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL)); - initConfigVariables(); /* first-time init of config setings */ - finalize_it: RETiRet; } diff -Nru rsyslog-7.6.0/action.h rsyslog-5.10.1/action.h --- rsyslog-7.6.0/action.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/action.h 2012-10-17 14:41:20.000000000 +0000 @@ -26,15 +26,18 @@ #define ACTION_H_INCLUDED 1 #include "syslogd-types.h" +#include "sync.h" #include "queue.h" -/* external data */ +/* external data - this is to be removed when we change the action + * object interface (will happen some time..., at latest when the + * config file format is changed). -- rgerhards, 2008-01-28 + */ extern int glbliActionResumeRetryCount; -extern int bActionReportSuspension; typedef enum { - ACT_STATE_DIED = 0, /* action permanently failed and now disabled - MUST BE ZERO! */ + ACT_STATE_DIED = 0, /* action permanently failed and now disabled - MUST BE ZEO! */ ACT_STATE_RDY = 1, /* action ready, waiting for new transaction */ ACT_STATE_ITX = 2, /* transaction active, waiting for new data or commit */ ACT_STATE_COMM = 3, /* transaction finished (a transient state) */ @@ -44,8 +47,9 @@ /* the following struct defines the action object data structure */ +typedef struct action_s action_t; struct action_s { - time_t f_time; /* used for "max. n messages in m seconds" processing */ + time_t f_time; /* used for "message repeated n times" - be careful, old, old code */ time_t tActNow; /* the current time for an action execution. Initially set to -1 and populated on an as-needed basis. This is a performance optimization. */ time_t tLastExec; /* time this action was last executed */ @@ -66,16 +70,22 @@ struct modInfo_s *pMod;/* pointer to output module handling this selector */ void *pModData; /* pointer to module data - content is module-specific */ sbool bRepMsgHasMsg; /* "message repeated..." has msg fragment in it (0-no, 1-yes) */ + short f_ReduceRepeated;/* reduce repeated lines 0 - no, 1 - yes */ + int f_prevcount; /* repetition cnt of prevline */ + int f_repeatcount; /* number of "repeated" msgs */ rsRetVal (*submitToActQ)(action_t *, batch_t *);/* function submit message to action queue */ rsRetVal (*qConstruct)(struct queue_s *pThis); - enum { ACT_STRING_PASSING = 0, ACT_ARRAY_PASSING = 1, ACT_MSG_PASSING = 2, - ACT_JSON_PASSING = 3} + enum { ACT_STRING_PASSING = 0, ACT_ARRAY_PASSING = 1, ACT_MSG_PASSING } eParamPassing; /* mode of parameter passing to action */ int iNumTpls; /* number of array entries for template element below */ struct template **ppTpl;/* array of template to use - strings must be passed to doAction * in this order. */ + msg_t *f_pMsg; /* pointer to the message (this will replace the other vars with msg + * content later). This is preserved after the message has been + * processed - it is also used to detect duplicates. + */ qqueue_t *pQueue; /* action queue */ - pthread_mutex_t mutAction; /* primary action mutex */ + SYNC_OBJ_TOOL; /* required for mutex support */ pthread_mutex_t mutActExec; /* mutex to guard actual execution of doAction for single-threaded modules */ uchar *pszName; /* action name (for documentation) */ DEF_ATOMIC_HELPER_MUT(mutCAS); @@ -83,26 +93,20 @@ statsobj_t *statsobj; STATSCOUNTER_DEF(ctrProcessed, mutCtrProcessed); STATSCOUNTER_DEF(ctrFail, mutCtrFail); - STATSCOUNTER_DEF(ctrSuspend, mutCtrSuspend); - STATSCOUNTER_DEF(ctrSuspendDuration, mutCtrSuspendDuration); - STATSCOUNTER_DEF(ctrResume, mutCtrResume); }; /* function prototypes */ rsRetVal actionConstruct(action_t **ppThis); -rsRetVal actionConstructFinalize(action_t *pThis, struct nvlst *lst); +rsRetVal actionConstructFinalize(action_t *pThis); rsRetVal actionDestruct(action_t *pThis); rsRetVal actionDbgPrint(action_t *pThis); rsRetVal actionSetGlobalResumeInterval(int iNewVal); rsRetVal actionDoAction(action_t *pAction); -rsRetVal actionWriteToAction(action_t *pAction, msg_t *pMsg); +rsRetVal actionWriteToAction(action_t *pAction); rsRetVal actionCallHUPHdlr(action_t *pAction); rsRetVal actionClassInit(void); -rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, struct cnfparamvals *actParams, struct nvlst *lst, int bSuspended); -rsRetVal activateActions(void); -rsRetVal actionNewInst(struct nvlst *lst, action_t **ppAction); -rsRetVal actionProcessCnf(struct cnfobj *o); +rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, int bSuspended); #endif /* #ifndef ACTION_H_INCLUDED */ diff -Nru rsyslog-7.6.0/ChangeLog rsyslog-5.10.1/ChangeLog --- rsyslog-7.6.0/ChangeLog 2014-02-12 12:06:16.000000000 +0000 +++ rsyslog-5.10.1/ChangeLog 2012-10-17 14:41:54.000000000 +0000 @@ -1,1995 +1,8 @@ --------------------------------------------------------------------------- -Version 7.6.0 [v7.6-stable] 2014-01-?? -This starts a new stable branch based on 7.5.8 plus the following changes: -- bugfix: imuxsock input parameters were not accepted - due to copy&paste error. Thanks to Andy Goldstein for the fix. -- added ProcessInternalMessages global system parameter - This permits to inject rsyslog status messages into *another* main - syslogd or the journal. -- new dependency: liblogging-stdlog (for submitting to external logger) -- bugfix: json templates are improperly created - Strings miss the terminating NUL character, which obviously can lead - to all sorts of problems. - See also: https://github.com/rsyslog/rsyslog/issues/27 - Thanks to Alain for the analysis and the patch. -- ompgsql bugfix: improper handling of auto-backgrounding mode - If rsyslog was set to auto-background itself (default code behaviour, but - many distros now turn it off for good reason), ompgsql could not - properly connect. This could even lead to a segfault. The core reason - was that a PG session handle was kept open over a fork, something that - is explicitely forbidden in the PG API. - Thanks to Alain for the analysis and the patch. ---------------------------------------------------------------------------- -Version 7.5.8 [v7-release candidate] 2014-01-09 -- add exec_template() RainerScript function -- add debug.onShutdown and debug.logFile global paramters - These enebale the new "debug on shutdown" mode, which can be used to - track hard to find problems that occur during system shutdown. -- Add directives for numerically specifying GIDs/UIDs - The already present directives (FileOwner, FileGroup, DirOwner, - DirGroup) translate names to numerical IDs, which depends on the user - information being available during rsyslog's startup. This can fail if - the information is obtained over a network or from a service such as - SSSD. The new directives provide a way to specify the numerical IDs - directly and bypass the lookup. - Thanks to Tomas Heinrich for the patch. -- actions now report if they suspend and resume themselves - this is by default on and controllable by the action.reportSuspension - global parameter -- bugfix: omelasticsearch fail.es stats counter was improperly maintained -- bugfix: mmrfc5424addhmac: "key" parameter was not properly processed -- add new impstats action counters: - * suspended - * suspended.duration - * resumed ---------------------------------------------------------------------------- -Version 7.5.7 [v7-devel] 2013-11-25 -- queue defaults have changed - * high water mark is now dynamically 90% of queue size - * low water makr is now dynamically 70% of queue size - * queue.discardMark is now dynamically 98% of queue size - * queue.workerThreadMinimumMessage set to queue.size / num workers - For queues with very low queue.maxSize (< 100), "emergency" defaults - will be used. -- worker thread pool handling has been improved - Among others, permits pool to actually shrink (was quite hard with - previous implementation. This will also improve performance and/or - lower system overhead on busy systems. - Thanks to Pavel Levshin for the enhancement. -- bugfix: mmpstrucdata generated inaccessible properties -- bugfix: RainerScript optimizer did not optimize PRI filters - things like "if $syslogfacility-text == "local3"" were not converted - to PRIFILT. This was a regression introduced in 7.5.6. -- bugfix: legacy directive $ActionQueueWorkerThreads was not honored -- bugfix: segfault on startup when certain script constructs are used - e.g. "if not $msg ..." -- bugfix: ommysql lost configfile/section parameters after first close - This means that when a connection was broken, it was probably - re-instantiated with different parameters than configured. -- bugfix: regression in template processing with subtrees in templates - Thanks to Pavel Levshin for the fix -- bugfix: regular worker threads are not properly (re)started if DA - mode is active. - This occurs only under rare conditions, but definitely is a bug that - needed to be addressed. It probably is present since version 4. - Note that this patch has not been applied to v7.4-stable, as it - is very unlikely to happen and the fix itself has some regression - potential (the fix looks very solid, but it addresses a core component). - Thanks to Pavel Levshin for the fix -- now emit warning message if om with msg passing mode uses action queue - These can modify the message, and this causes races. -- bugfix: $SystemLogUseSysTimeStamp/$SystemLogUsePIDFromSystem did not work - Thanks to Tomas Heinrich for the patch. ---------------------------------------------------------------------------- -Version 7.5.6 [devel] 2013-10-29 -- impstats: add capability to bind to a ruleset -- improved performance of RainerScript variable access - by refactoring the whole body of variable handling code. This also - solves some of the anomalies experienced in some versions of rsyslog. - All variable types are now handled in unified code, including - access via templates. -- RainerScript: make use of 64 bit for numbers where available - Thanks to Pavel Levshin for enhancement. -- slight performance optimization if GCC is used - We give branch prediction hints for the frequent RETiRet macro which is - used for error handling. Some slight performance gain is to be expected - from that. -- removed global variable support - The original idea was not well thought out and global variables, as - implemented, worked far different from what anybody would expect. As - such, we consider the current approach as an experiment that did not - work out and opt to removing it, clearing the way for a better future - solution. Note: global vars were introduced in 7.5.3 on Sept, 11th 2013. -- new module mmsequence, primarily used for action load balancing - Thanks to Pavel Levshin for contributing this module. -- bugfix: unset statement always worked on message var, even if local - var was given -- imudp: support for binding to ruleset added -- bugfix: segfault if variable was assigned to non-container subtree - Thanks to Pavel Levshin for the fix -- bugfix: imuxsock did not suport addtl sockets if syssock was disabled - Thanks to Pavel Levshin for the fix -- bugfix: running imupd on multiple threads lead to segfault if recvmmsg - is available -- bugfix: imudp when using recvmmsg could report wrong sender IP -- bugfix: segfault if re_extract() function was used and no match found -- bugfix: omelasticsearch did not compile on platforms without atomic - instructions -- bugfix: potential misadressing on startup if property-filter was used - This could happen if the property name was longer than 127 chars, a case - that would not happen in practice. -- bugfix: invalid property filter was not properly disabled in ruleset - Note: the cosmetic memory leak introduced with that patch in 7.4.5 is - now also fixed. -- imported bugfixes from 7.4.6 stable release ---------------------------------------------------------------------------- -Version 7.5.5 [devel] 2013-10-16 -- imfile: permit to monitor an unlimited number of files -- imptcp: add "defaultTZ" input parameter -- imudp: support for multiple receiver threads added -- imudp: add "dfltTZ" input config parameter -- bugfix: memory leak in mmnormalize -- bugfix: mmutf8fix did not properly handle invalid UTF-8 at END of message - if the very last character sequence was too long, this was not detected - Thanks to Risto Vaarandi for reporting this problem. -- mmanon: removed the check for specific "terminator characters" after - last octet. As it turned out, this didn't work in practice as there - was an enormous set of potential terminator chars -- so removing - them was the best thing to do. Note that this may change behaviour of - existing installations. Yet, we still consider this an important - bugfix, that should be applied to the stable branch. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=477 - Thanks to Muri Cicanor for initiating the discussion -- now requires libestr 0.1.7 as early versions had a nasty bug in - string comparisons -- bugfix: mmanon did not detect all IP addresses in rewrite mode - The problem occured if two IPs were close to each other and the first one - was shrunk. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=485 - Thanks to micah-at-riseup.net for reporting this bug -- bugfix: mmanon sometimes used invalid replacement char in simple mode - depending on configuration sequence, the replacement character was set - to 's' instead of the correct value. Most importantly, it was set to - 's' if simple mode was selected and no replacement char set. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=484 - Thanks to micah-at-riseup.net for reporting this bug -- bugfix: memory leak in mmnormalize -- bugfix: array-based ==/!= comparisions lead to invalid results - This was a regression introduced in 7.3.5 bei the PRI optimizer ---------------------------------------------------------------------------- -Version 7.5.4 [devel] 2013-10-07 -- mmpstrucdata: new module to parse RFC5424 structured data into json - message properties -- change main/ruleset queue defaults to be more enterprise-like - new defaults are queue.size 100,000 max workers 2, worker - activation after 40,000 msgs are queued, batch size 256. These settings - are much more useful for enterprises and will not hurt low-end systems - that much. This is part of our re-focus on enterprise needs. -- omfwd: new action parameter "maxErrorMessages" added -- omfile: new module parameters to set action defaults added - * dirCreateMode - * fileCreateMode -- mmutf8fix: new module to fix invalid UTF-8 sequences -- imuxsock: handle unlimited number of additional listen sockets -- doc: improve usability by linking to relevant web ressources - The idea is to enable users to quickly find additional information, - samples, HOWTOs and the like on the main site. - At the same time, (very) slightly remove memory footprint when - few listeners are monitored. -- bugfix: omfwd parameter streamdrivermmode was not properly handled - it was always overwritten by whatever value was set via the - legacy directive $ActionSendStreamDriverMode -- imtcp: add streamdriver.name module parameter - permits overriding the system default stream driver (gtls, ptcp) -- bugfix: build system: libgcrypt.h needed even if libgrcypt was disabled - Thanks to Jonny Törnbom for reporting this problem -- imported bugfixes from 7.4.4 ---------------------------------------------------------------------------- -Version 7.5.3 [devel] 2013-09-11 -- imfile: support for escaping LF characters added - embedded LF in syslog messages cause a lot of trouble. imfile now has - the capability to escape them to "#012" (just like the regular control - character escape option). This requires new-style input statements to be - used. If legacy configuration statements are used, LF escaping is always - turned off to preserve compatibility. - NOTE: if input() statements were already used, there is a CHANGE OF - BEHAVIOUR: starting with this version, escaping is enabled by - default. So if you do not want it, you need to add - escapeLF="off" - to the input statement. Given the trouble LFs cause and the fact - that the majority of installations still use legacy config, we - considered this behaviour change acceptable and useful. - see also: http://blog.gerhards.net/2013/09/imfile-multi-line-messages.html -- add support for global and local variables -- bugfix: queue file size was not correctly processed - this could lead to using one queue file per message for sizes >2GiB - Thanks to Tomas Heinrich for the patch. -- add main_queue() configuration object to configure main message queue -- bugfix: stream compression in imptcp caused timestamp to be corrupted -- imudp: add ability to specify SO_RCVBUF size (rcvbufSize parameter) -- imudp: use inputname for statistics, if configured -- impstats: add process resource usage counters [via getrusage()] -- impstats: add paramter "resetCounters" to report delta values - possible for most, but not all, counters. See doc for details. -- librelp 1.2.0 is now required -- make use of new librelp generic error reporting facility - This leads to more error messages being passed to the user and - thus simplified troubleshooting. -- bugfix: very small memory leak in imrelp - more or less cosmetic, a single memory block was not freed, but this - only happens immediately before termination (when the OS automatically - frees all memory). Still an annoyance e.g. in valgrind. -- fix compile problem in debug build -- imported fixes from 7.4.4 ---------------------------------------------------------------------------- -Version 7.5.2 [devel] 2013-07-04 -- librelp 1.1.4 is now required - We use API extensions for better error reporting and higher performance. -- omrelp: use transactional mode to make imrelp emit bulk sends -- omrelp: add "windowSize" parameter to set custom RELP window size -- bugfix: double-free in omelasticsearch - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=461 - a security advisory for this bug is available at: - http://www.lsexperts.de/advisories/lse-2013-07-03.txt - CVE: CVE-2013-4758 - PLEASE NOTE: This issue only existed if omelasticsearch was used - in a non-default configuration, where the "errorfile" parameter - was specified. Without that parameter set, the bug could not - be triggered. - Thanks to Markus Vervier and Marius Ionescu for providing a detailled - bug report. Special thanks to Markus for coordinating his security - advisory with us. -- doc: fixed various typos - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=391 - Thanks to Georgi Georgiev for the patch. ---------------------------------------------------------------------------- -Version 7.5.1 [devel] 2013-06-26 -- librelp 1.1.3 is required - older versions can lead to a segfault -- add mmfields, which among others supports easy parsing of CEF messages -- omrelp: - * new parameter "compression.prioritystring" to control encryption - parameters used by GnuTLS -- imrelp: - * new parameter "compression.dhbits" to control the number of - bits being used for Diffie-Hellman key generation - * new parameter "compression.prioritystring" to control encryption - parameters used by GnuTLS - * support for impstats added - * support for setting permitted peers (client authentication) added - * bugfix: potential segfault at startup on invalid config parameters -- imjournal: imported patches from 7.4.1 -- omprog: add support for command line parameters -- added experimental TCP stream compression (imptcp only, currently) -- added BSD-specific syslog facilities - * "console" - * "bsd_security" - this is called "security" under BSD, but that name - was unfortunately already taken by some standard facility. So I - did the (hopefully) second-best thing and renamed it a little. -- imported fixes from 7.4.2 (especially build problems on FreeBSD) -- bugfix: imptcp did not properly initialize compression status variable - could lead to segfault if stream:always compression mode was selected ---------------------------------------------------------------------------- -Version 7.5.0 [devel] 2013-06-11 -- imrelp: implement "ruleset" module parameter -- imrelp/omrelp: add TLS & compression (zip) support -- omrelp: add "rebindInterval" parameter -- add -S command line option to specify IP address to use for RELP client - connections - Thanks to Axel Rau for the patch. ---------------------------------------------------------------------------- -Version 7.4.10 [v7.4-stable] 2014-02-12 -- bugfix: json templates are improperly created - Strings miss the terminating NUL character, which obviously can lead - to all sorts of problems. - See also: https://github.com/rsyslog/rsyslog/issues/27 - Thanks to Alain for the analysis and the patch. -- ompgsql bugfix: improper handling of auto-backgrounding mode - If rsyslog was set to auto-background itself (default code behaviour, but - many distros now turn it off for good reason), ompgsql could not - properly connect. This could even lead to a segfault. The core reason - was that a PG session handle was kept open over a fork, something that - is explicitely forbidden in the PG API. - Thanks to Alain for the analysis and the patch. ---------------------------------------------------------------------------- -Version 7.4.9 [v7.4-stable] 2014-01-22 -- added ProcessInternalMessages global system parameter - This permits to inject rsyslog status messages into *another* main - syslogd or the journal. -- new dependency: liblogging-stdlog (for submitting to external logger) -- bugfix: imuxsock input parameters were not accepted - due to copy&paste error. Thanks to Andy Goldstein for the fix. -- bugfix: potential double-free in RainerScript equal comparison - happens if the left-hand operand is JSON object and the right-hand - operand is a non-string that does not convert to a number (for - example, it can be another JSON object, probably the only case that - could happen in practice). This is very unlikely to be triggered. -- bugfix: some RainerScript Json(Variable)/string comparisons were wrong ---------------------------------------------------------------------------- -Version 7.4.8 [v7.4-stable] 2014-01-08 -- rsgtutil provides better error messages on unfinished signature blocks -- bugfix: guard against control characters in internal (error) messages - Thanks to Ahto Truu for alerting us. -- bugfix: immark did emit messages under kern.=info instead of syslog.=info - Note that his can potentially break exisiting configurations that - rely on immark sending as kern.=info. Unfortunately, we cannot leave - this unfixed as we never should emit messages under the kern facility. ---------------------------------------------------------------------------- -Version 7.4.7 [v7.4-stable] 2013-12-10 -- bugfix: limiting queue disk space did not work properly - * queue.maxdiskspace actually initializes queue.maxfilesize - * total size of queue files was not checked against - queue.maxdiskspace for disk assisted queues. - Thanks to Karol Jurak for the patch. -- bugfix: linux kernel-like ratelimiter did not work properly with all - inputs (for example, it did not work with imdup). The reason was that - the PRI value was used, but that needed parsing of the message, which - was done too late. -- bugfix: disk queues created files in wrong working directory - if the $WorkDirectory was changed multiple times, all queues only - used the last value set. -- bugfix: legacy directive $ActionQueueWorkerThreads was not honored -- bugfix: segfault on startup when certain script constructs are used - e.g. "if not $msg ..." -- bugfix: imuxsock: UseSysTimeStamp config parameter did not work correctly - Thanks to Tomas Heinrich for alerting us and provinding a solution - suggestion. -- bugfix: $SystemLogUseSysTimeStamp/$SystemLogUsePIDFromSystem did not work - Thanks to Tomas Heinrich for the patch. -- improved checking of queue config parameters on startup -- bugfix: call to ruleset with async queue did not use the queue - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=443 -- bugfix: if imtcp is loaded and no listeners are configured (which is - uncommon), rsyslog crashes during shutdown. ---------------------------------------------------------------------------- -Version 7.4.6 [v7.4-stable] 2013-10-31 -- bugfix: potential abort during HUP - This could happen when one of imklog, imzmq3, imkmsg, impstats, - imjournal, or imuxsock were under heavy load during a HUP. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=489 - Thanks to Guy Rozendorn for reporting the problem and Peval Levhshin for - his analysis. -- bugfix: imtcp flowControl parameter incorrectly defaulted to "off" - This could cause message loss on systems under heavy load and was - a change-of-behaviour to previous version. This is a regression - most probably introduced in 5.9.0 (but did not try hard to find the - exact point of its introduction). -- now requires libestr 0.1.9 as earlier versions lead to problems with - number handling in RainerScript -- bugfix: memory leak in strlen() RainerScript function - Thanks to Gregoire Seux for reportig this bug. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=486 -- bugfix: buffer overrun if re_extract function was called for submatch 50 - Thanks to Pavel Levshin for reporting the problem and its location. -- bugfix: memleak in re_extract() function - Thanks to Pavel Levshin for reporting this problem. -- bugfix: potential abort in RainerScript optimizer - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=488 - Thanks to Thomas Doll for reporting the problem and Pavel Levshin for - fixing it. -- bugfix: memory leak in omhiredis - Thanks to Pavel Levshin for the fix -- bugfix: segfault if variable was assigned to non-container subtree - Thanks to Pavel Levshin for the fix ---------------------------------------------------------------------------- -Version 7.4.5 [v7.4-stable] 2013-10-22 -- mmanon: removed the check for specific "terminator characters" after - last octet. As it turned out, this didn't work in practice as there - was an enormous set of potential terminator chars -- so removing - them was the best thing to do. Note that this may change behaviour of - existing installations. Yet, we still consider this an important - bugfix, that should be applied to the stable branch. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=477 - Thanks to Muri Cicanor for initiating the discussion -- now requires libestr 0.1.8 as early versions had a nasty bug in - string comparisons -- omelasticsearch: add failed.httprequests stats counter -- bugfix: invalid property filter was not properly disabled in ruleset - Note that this bugfix introduces a very slight memory leak, which is - cosmetic, as it just holds data until termination that is no longer - needed. It is just the part of the config that was invalid. We will - "fix" this "issue" in the devel version first, as the fix is a bit - too intrusive to do without hard need in the stable version. -- bugfix: segfault if re_extract() function was used and no match found -- bugfix: potential misadressing on startup if property-filter was used - This could happen if the property name was longer than 127 chars, a case - that would not happen in practice. -- bugfix: omelasticsearch: correct failed.http stats counter -- bugfix: omelasticsearch: did not correctly initialize stats counters -- bugfix: omelasticsearch: failed.es counter was only maintained in bulk mode - This usually did not lead to any problems, because they are in static - memory, which is initialized to zero by the OS when the plugin is - loaded. But it may cause problems especially on systems that do not - support atomic instructions - in this case the associated mutexes also - did not get properly initialized. -- bugfix: mmanon did not detect all IP addresses in rewrite mode - The problem occured if two IPs were close to each other and the first one - was shrunk. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=485 - Thanks to micah-at-riseup.net for reporting this bug -- bugfix: mmanon sometimes used invalid replacement char in simple mode - depending on configuration sequence, the replacement character was set - to 's' instead of the correct value. Most importantly, it was set to - 's' if simple mode was selected and no replacement char set. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=484 - Thanks to micah-at-riseup.net for reporting this bug -- bugfix: memory leak in mmnormalize -- bugfix: array-based ==/!= comparisions lead to invalid results - This was a regression introduced in 7.3.5 bei the PRI optimizer -- bugfix: omprog blocked signals to executed programs - The made it impossible to send signals to programs executed via - omprog. - Thanks to Risto Vaarandi for the analysis and a patch. -- bugfix: doc: imuxsock legacy param $SystemLogSocketParseTrusted was - misspelled - Thanks to David Lang for alerting us -- bugfix: imfile "facility" input parameter improperly handled - caused facility not to be set, and severity to be overwritten with - the facility value. - Thanks to forum user dmunny for reporting this bug. -- bugfix: small memory leak in imfile when $ResetConfigVariables was used - Thanks to Grégory Nuyttens for reporting this bug and providig a fix -- bugfix: segfault on startup if TLS was used but no CA cert set -- bugfix: segfault on startup if TCP TLS was used but no cert or key set -- bugfix: some more build problems with newer json-c versions - Thanks to Michael Biebl for mentioning the problem. -- bugfix: build system: libgcrypt.h needed even if libgrcypt was disabled - Thanks to Jonny Törnbom for reporting this problem ---------------------------------------------------------------------------- -Version 7.4.4 [v7.4-stable] 2013-09-03 -- better error messages in GuardTime signature provider - Thanks to Ahto Truu for providing the patch. -- make rsyslog use the new json-c pkgconfig file if available - Thanks to the Gentoo team for the patches. -- bugfix: imfile parameter "persistStateInterval" was unusable - due to a case typo in imfile; work-around was to use legacy config - Thanks to Brandon Murphy for reporting this bug. -- bugfix: TLV16 flag encoding error in signature files from GT provider - This fixes a problem where the TLV16 flag was improperly encoded. - Unfortunately, existing files already have the bug and may not properly - be processed. The fix uses constants from the GuardTime API lib to - prevent such problems in the future. - Thanks to Ahto Truu for providing the patch. -- bugfix: slightly malformed SMTP handling in ommail -- bugfix: segfault in omprog if no template was provided (now dflt is used) -- bugfix: segfault in ompipe if no template was provided (now dflt is used) -- bugfix: segfault in omsnmp if no template was provided (now dflt is used) -- bugfix: some omsnmp optional config params were flagged as mandatory -- bugfix: segfault in omelasticsearch when resuming queued messages - after restarting Elasticsearch - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=464 -- bugfix: imtcp addtlframedelimiter could not be set to zero - Thanks to Chris Norton for alerting us. -- doc bugfix: remove no-longer existing omtemplate from developer doc - was specifically mentioned as a sample for creating new plugins - Thanks to Yannick Brosseau for alerting us of this problem. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=473 ---------------------------------------------------------------------------- -Version 7.4.3 [v7.4-stable] 2013-07-18 -- bugfix: queue file size was not correctly processed - this could lead to using one queue file per message for sizes >2GiB - Thanks to Tomas Heinrich for the patch. -- bugfix: $QHOUR/$HHOUR were always "00" or "01" - regression some time between v5 and here - Thanks to forum user rjmcinty for reporting this bug -- bugfix: testbench tool chkseq did improperly report invalid file - This happened when permitted duplicate values existed in the very - last lines, right before end-of-file. - Thanks to Radu Gheorghe for reporting this bug. ---------------------------------------------------------------------------- -Version 7.4.3 [v7.4-stable] 2013-07-18 -- bugfix: memory leak if disk queues were used and json data present -- bugfix: CEE/json data was lost during disk queue operation -- bugfix: potential segfault during startup on invalid config - could happen if invalid actions were present, which could lead - to improper handling in optimizer. -- bugfix: 100% CPU utilization when DA queue became full -- bugfix: omlibdbi did not properly close connection on some errors - This happened to errors occuring in Begin/End Transaction entry - points. -- cosmetic bugfix: file name buffer was not freed on disk queue destruction - This was an extremely small one-time per run memleak, so nothing of - concern. However, it bugs under valgrind and similar memory debuggers. -- fix build on FreeBSD - Thanks to Christiano Rolim for the patch ---------------------------------------------------------------------------- -Version 7.4.2 [v7.4-stable] 2013-07-04 -- bugfix: in RFC5425 TLS, multiple wildcards in auth could cause segfault -- bugfix: RainerScript object required parameters were not properly - checked - this clould result to segfaults on startup if parameters - were missing. -- bugfix: double-free in omelasticsearch - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=461 - a security advisory for this bug is available at: - http://www.lsexperts.de/advisories/lse-2013-07-03.txt - CVE: CVE-2013-4758 - PLEASE NOTE: This issue only existed if omelasticsearch was used - in a non-default configuration, where the "errorfile" parameter - was specified. Without that parameter set, the bug could not - be triggered. - Thanks to Markus Vervier and Marius Ionescu for providing a detailled - bug report. Special thanks to Markus for coordinating his security - advisory with us. -- bugfix: omrelp potential segfault at startup on invalid config parameters -- bugfix: small memory leak when $uptime property was used -- bugfix: potential segfault on rsyslog termination in imudp - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=456 -- bugfix: lmsig_gt abort on invalid configuration parameters - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=448 - Thanks to Risto Laanoja for the patch. -- imtcp: fix typo in "listner" parameter, which is "listener" - Currently, both names are accepted. -- solved build problems on FreeBSD - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=457 - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=458 - Thanks to Christiano for reproting and suggesting patches -- solved build problems on CENTOS5 ---------------------------------------------------------------------------- -Version 7.4.1 [v7.4-stable] 2013-06-17 -- imjournal: add ratelimiting capability - The original imjournal code did not support ratelimiting at all. We - now have our own ratelimiter. This can mitigate against journal - database corruption, when the journal re-sends old data. This is a - current bug in systemd journal, but we won't outrule this to happen - in the future again. So it is better to have a safeguard in place. - By default, we permit 20,000 messages witin 10 minutes. This may - be a bit restrictive, but given the risk potential it seems reasonable. - Users requiring larger traffic flows can always adjust the value. -- bugfix: potential loop in rate limiting - if the message that tells about rate-limiting gets rate-limited itself, - it will potentially create and endless loop -- bugfix: potential segfault in imjournal if journal DB is corrupted -- bugfix: prevent a segfault in imjournal if state file is not defined -- bugfix imzmq3: potential segfault on startup - if no problem happend at startup, everything went fine - Thanks to Hongfei Cheng and Brian Knox for the patch ---------------------------------------------------------------------------- -Version 7.4.0 [v7.4-stable] 2013-06-06 -This starts a new stable branch based on 7.3.15 plus the following changes: -- add --enable-cached-man-pages ./configure option - permits to build rsyslog on a system where rst2man is not installed. In - that case, cached versions of the man pages are used (they were built - during "make dist", so they should be current for the version in - question. -- doc bugfix: ReadMode wrong in imfile doc, two values were swapped - Thanks to jokajak@gmail.com for mentioning this - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=450 -- imjournal: no longer do periodic wakeup -- bugfix: potential hang *in debug mode* on rsyslogd termination - This ONLY affected rsyslogd if it were running with debug output - enabled. -- bugfix: $template statement with multiple spaces lead to invalid tpl name - If multiple spaces were used in front of the template name, all but one - of them became actually part of the template name. So - $template a,"..." would be name " a", and as such "a" was not - available, e.g. in - *.* /var/log/file;a - This is a legacy config problem. As it was unreported for many years, - no backport of the fix to old versions will happen. - This is a long-standing bug that was only recently reported by forum - user mc-sim. - Reference: http://kb.monitorware.com/post23448.html -- 0mq fixes; credits to Hongfei Cheng and Brian Knox ---------------------------------------------------------------------------- -Version 7.3.15 [beta] 2013-05-15 -- bugfix: problem in build system (especially when cross-compiling) - Thanks to Tomas Heinrich and winfried_mb2@xmsnet.nl for the patch. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=445 -- bugfix: imjournal had problem with systemd journal API change -- imjournal: now obtain and include PID -- bugfix: .logsig files had tlv16 indicator bit at wrong offset -- bugfix: omrelp legacy config parameters set a timeout of zero - which lead the legacy config to be unusable. -- bugfix: segfault on startup if a disk queue was configure without file - name - Now this triggers an error message and the queue is changed to - linkedList type. -- bugfix: invalid addressing in string class (recent regression) ---------------------------------------------------------------------------- -Version 7.3.14 [beta] 2013-05-06 -- bugfix: some man pages were not properly installed - either rscryutil or rsgtutil man was installed, but not both - Thanks to Marius Tomaschewski for the patch. -- bugfix: potential segfault on startup when builtin module was specified - in module() statement. - Thanks to Marius Tomaschewski for reporting the bug. -- bugfix: segfault due to invalid dynafile cache handling - Accidently, the old-style cache size parameter was used when the - dynafile cache was created in a RainerScript action. If the old-style - size was lower than the one actually set, this lead to misadressing - when the size was overrun, and that could lead to all kinds of - "interesting things", often in segfaults. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=440 ---------------------------------------------------------------------------- -Version 7.3.13 [beta] 2013-04-29 -- added omrabbitmq module (contributed, untested) - Note: this is unsupported and as such was moved immediately into the - beta version. - Thanks to Vaclav Tomec for providing this module. -- bugfix: build problem when --enable-encryption was not selected - Thanks to Michael Biebl for fixing this. -- doc bugfix: omfile parameter "VeryRobustZip" was documentas as - "VeryReliableZip" - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=437 - Thanks to Thomas Doll for reporting this. ---------------------------------------------------------------------------- -Version 7.3.12 [devel] 2013-04-25 -- added doc for omelasticsearch - Thanks to Radu Gheorghe for the doc contribution. -- omelasticsearch: _id field support for bulk operations - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=392 - Thanks to Jérôme Renard for the idea and patches. -- max number of templates for plugin use has been increased to five -- platform compatibility enhancement: solve compile issue with libgcrypt - do not use GCRY_CIPHER_MODE_AESWRAP where not available -- fix compile on Solaris - Thanks to Martin Carpenter for the patch. -- bugfix: off-by-one error in handling local FQDN name (regression) - A remporary buffer was allocated one byte too small. Did only - affect startup, not actual operations. Came up during routine tests, - and can have no effect once the engine runs. Bug was introduced in - 7.3.11. -- bugfix: build problems on Solaris - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=436 -- bugfix: block size limit was not properly honored -- bugfix: potential segfault in guardtime signature provider - it could segfault if an error was reported by the GuardTime API, because - an invalid free could happen then ---------------------------------------------------------------------------- -Version 7.3.11 [devel] 2013-04-23 -- added support for encrypting log files -- omhiredis: added support for redis pipeline support - Thanks to Brian Knox for the patch. -- bugfix: $PreserveFQDN is not properly working - Thanks to Louis Bouchard for the patch - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=426 -- bugfix: imuxsock aborted due to problem in ratelimiting code - Thanks to Tomas Heinrich for the patch. -- bugfix: imuxsock aborted under some conditions - regression from ratelimiting enhancements - this was a different one - to the one Tomas Heinrich patched. -- bugfix: timestamp problems in imkmsg ---------------------------------------------------------------------------- -Version 7.3.10 [devel] 2013-04-10 -- added RainerScript re_extract() function -- omrelp: added support for RainerScript-based configuration -- omrelp: added ability to specify session timeout -- templates now permit substring extraction relative to end-of-string -- bugfix: failover/action suspend did not work correctly - This was experienced if the retry action took more than one second - to complete. For suspending, a cached timestamp was used, and if the - retry took longer, that timestamp was already in the past. As a - result, the action never was kept in suspended state, and as such - no failover happened. The suspend functionalit now does no longer use - the cached timestamp (should not have any performance implication, as - action suspend occurs very infrequently). -- bugfix: gnutls RFC5425 driver had some undersized buffers - Thanks to Tomas Heinrich for the patch. -- bugfix: nested if/prifilt conditions did not work properly - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=415 -- bugfix: imuxsock aborted under some conditions - regression from ratelimiting enhancements -- bugfix: build problems on Solaris - Thanks to Martin Carpenter for the patches. ---------------------------------------------------------------------------- -Version 7.3.9 [devel] 2013-03-27 -- support for signing logs added -- imudp: now supports user-selectable inputname -- omlibdbi: now supports transaction interface - if recent enough lbdbi is present -- imuxsock: add ability to NOT create/delete sockets during startup and - shutdown - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=259 -- imfile: errors persisting state file are now reported - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=292 -- imfile: now detects file change when rsyslog was inactive - Previosly, this case could not be detected, so if a file was overwritten - or rotated away while rsyslog was stopped, some data was missing. This - is now detected and the new file being forwarded right from the - beginning. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=228 -- updated systemd files to match current systemd source -- bugfix: imudp scheduling parameters did affect main thread, not imudp - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=409 -- bugfix: build problem on platforms without GLOB_NOMAGIC -- bugfix: build problems on non-Linux platforms -- bugfix: stdout/stderr were not closed on forking - but were closed when running in the forground - this was just reversed - of what it should be. This is a regression of a recent change. ---------------------------------------------------------------------------- -Version 7.3.8 [devel] 2013-03-18 -- imrelp: now supports listening to IPv4/v6 only instead of always both - build now requires librelp 1.0.2 - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=378 -- bugfix: mmanon did not build on some platforms (e.g. Ubuntu) -- bugfix: segfault in expression optimizer - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=423 -- bugfix: imuxsock was missing SysSock.ParseTrusted module parameter - To use that functionality, legacy rsyslog.conf syntax had to be used. - Also, the doc was missing information on the "ParseTrusted" set of - config directives. -- bugfix: include files got included in the wrong order - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=411 - This happens if an $IncludeConfig directive was done on multiple - files (e.g. the distro default of $IncludeConfig /etc/rsyslog.d/*.conf). - In that case, the order of include file processing is reversed, which - could lead to all sorts of problems. - Thanks to Nathan Stratton Treadway for his great analysis of the problem, - which made bug fixing really easy. ---------------------------------------------------------------------------- -Version 7.3.7 [devel] 2013-03-12 -- add support for anonymizing IPv4 addresses -- add support for writing to the Linux Journal (omjournal) -- imuxsock: add capability to ignore messages from ourselfes - This helps prevent message routing loops, and is vital to have - if omjournal is used together with traditional syslog. -- field() function now supports a string as field delimiter -- added ability to configure debug system via rsyslog.conf -- bugfix: imuxsock segfault when system log socket was used -- bugfix: mmjsonparse segfault if new-style config was used -- bugfix: script == comparison did not work properly on JSON objects -- bugfix: field() function did never return "***FIELD NOT FOUND***" - instead it returned "***ERROR in field() FUNCTION***" in that case ---------------------------------------------------------------------------- -Version 7.3.6 [devel] 2013-01-28 -- greatly improved speed of large-array [N]EQ RainerScript comparisons - Thanks to David Lang for a related discussion that inspired the idea - to do this with a much simpler (yet sufficient) approach than orignally - planned for. -- greatly improved speed of DNS cache for large cache sizes -- general performance improvements -- omfile: added stats counters for dynafile caches -- omfile: improved async writing, finally enabled full async write - also fixed a couple of smaller issues along that way -- impstats: added ability to write stats records to local file - and avoid going through the syslog log stream. syslog logging can now - also be turned off (see doc for details). -- bugfix: imklog issued wrong facility in error messages - ...what could lead to problems in other parts of the code -- fix compile problem in imklog -- added capability to output thread-id-to-function debug info - This is a useful debug aid, but nothing of concern for regular users. ---------------------------------------------------------------------------- -Version 7.3.5 [devel] 2012-12-19 -- ommysql: addded batching/transaction support -- enhanced script optimizer to optimize common PRI-based comparisons - These constructs are especially used in SUSE default config files, - but also by many users (as they are more readable than the equivalent - PRI-based filter). -- omudpspoof: add support for new config system -- omudpspoof: add support for packets larger than 1472 bytes - On Ethernet, they need to be transmitted in multiple fragments. While - it is known that fragmentation can cause issues, it is the best choice - to be made in that case. Also improved debug output. -- bugfix: omudpspoof failed depending on the execution environment - The v7 engine closes fds, and closed some of libnet's fds as well, what - lead to problems (unfortunately, at least some libnet versions do not - report a proper error state but still "success"...). The order of libnet - calls has been adjusted to by in sync with what the core engine does. -- bugfix: segfault on imuxsock startup if system log socket is used - and no ratelimiting supported. Happens only during initial config - read phase, once this is over, everything works stable. -- bugfix: mmnormalize build problems -- bugfix: mmnormalize could abort rsyslog if config parameter was in error -- bugfix: no error message for invalid string template parameters - rather a malformed template was generated, and error information emitted - at runtime. However, this could be quite confusing. Note that with this - "bugfix" user experience changes: formerly, rsyslog and the affected - actions properly started up, but the actions did not produce proper - data. Now, there are startup error messages and the actions are NOT - executed (due to missing template due to template error). -- bugfix[minor]: invalid error code when mmnormalize could not access - rulebase -- bugfix(kind of): script optimizer did not work for complex boolean - expressions -- doc bugfix: corrections and improvements in mmnormalize html doc page -- bugfix: some message properties could be garbled due to race condition - This happened only on very high volume systems, if the same message was - being processed by two different actions. This was a regression caused - by the new config processor, which did no longer properly enable msg - locking in multithreaded cases. The bugfix is actually a refactoring of - the msg locking code - we no longer do unlocked operations, as the use - case for it has mostly gone away. It is potentially possible only at - very low-end systems, and there the small additional overhead of doing - the locking does not really hurt. Instead, the removal of that - capability can actually slightly improve performance in common cases, - as the code path is smaller and requires slightly less memory writes. - That probably outperforms the extra locking overhead (which in the - low-end case always happens in user space, without need for kernel - support as we can always directly aquire the lock - there is no - contention at all). -- build system cleanup (thanks to Michael Biebl for this!) -- bugfix: omelasticsearch did not properly compile on some platforms - due to missing libmath. Thanks to Michael Biebl for the fix ---------------------------------------------------------------------------- -Version 7.3.4 [devel] 2012-11-23 -- further (and rather drastically) improved disk queue performance - we now save one third of the IO calls -- imklog: added ParseKernelTimestamp parameter (import from 5.10.2) - Thanks to Marius Tomaschewski for the patch. -- imklog: added KeepKernelTimestamp parameter (import from 5.10.2) - Thanks to Marius Tomaschewski for the patch. -- bugfix: improper handling of backslash in string-type template()s -- bugfix: leading quote (") in string-type template() lead to thight loop - on startup -- bugfix: no error msg on invalid field option in legacy/string template -- bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds - ... actually, they are microseconds. So the fractional part of the - timestamp was not properly formatted. (import from 5.10.2) - Thanks to Marius Tomaschewski for the bug report and the patch idea. ---------------------------------------------------------------------------- -Version 7.3.3 [devel] 2012-11-07 -- improved disk queue performance -- bugfix: dynafile zip files could be corrupted - This could happen if a dynafile was destructed before the first write. - In practice, this could happen if few lines were written to a file and - it then became evicted from the dynafile cache. This would probably - look very random, because it depended on the timing in regard to - message volume and dynafile cache size. ---------------------------------------------------------------------------- -Version 7.3.2 [devel] 2012-10-30 -- mmnormalize: support for v6+ config interface added -- mmjsonparse: support for v6+ config interface added ---------------------------------------------------------------------------- -Version 7.3.2 [devel] 2012-10-30 -- totally reworked ratelimiting and "last message repeated n times" - all over rsyslog code. Each of the supported inputs now supports - linux-like ratelimiting (formerly only imuxsock did). Also, the - "last message repeated n times" is now processed at the input side - and no longer at the output side of rsyslog processing. This - provides the basis for new future additions as well as usually more - performance and a much simpler output part (which can be even further - refactored). -- imtcp: support for Linux-Type ratelimiting added -- imptcp: support for Linux-Type ratelimiting added -- imudp enhancements: - * support for input batching added (performance improvement) - * support for Linux-Type ratelimiting added -- permited action-like statements (stop, call, ...) in action lists -- bugfix: segfault on startup when modules using MSG_PASSING mode are used -- omelasticsearch: support for writing data errors to local file added -- omelasticsearch: fix check for bulk processing status response ---------------------------------------------------------------------------- -Version 7.3.1 [devel] 2012-10-19 -- optimized template processing performance, especially for $NOW family - of properties -- change lumberjack cookie to "@cee:" from "@cee: " - CEE originally specified the cookie with SP, whereas other lumberjack - tools used it without space. In order to keep interop with lumberjack, - we now use the cookie without space as well. I hope this can be changed - in CEE as well when it is released at a later time. - Thanks to Miloslav TrmaÄ for pointing this out and a similiar v7 patch. -- bugfix: imuxsock and imklog truncated head of received message - This happened only under some circumstances. Thanks to Marius - Tomaschewski, Florian Piekert and Milan Bartos for their help in - solving this issue. -- bugfix: imuxsock did not properly honor $LocalHostIPIF ---------------------------------------------------------------------------- -Version 7.3.0 [devel] 2012-10-09 -- omlibdbi improvements, added - * support for config load phases & module() parameters - * support for default templates - * driverdirectory is now cleanly a global parameter, but can no longer - be specified as an action paramter. Note that in previous versions - this parameter was ignored in all but the first action definition -- improved omfile zip writer to increase compression - This was achieved by somewhat reducing the robustness of the zip archive. - This is controlled by the new action parameter "VeryReliableZip". ----------------------------------------------------------------------------- -Version 7.2.8 [v7-stable] 2013-0?-?? -- bugfix: potential segfault on startup when builtin module was specified - in module() statement. - Thanks to Marius Tomaschewski for reporting the bug. -- bugfix: segfault due to invalid dynafile cache handling - Accidently, the old-style cache size parameter was used when the - dynafile cache was created in a RainerScript action. If the old-style - size was lower than the one actually set, this lead to misadressing - when the size was overrun, and that could lead to all kinds of - "interesting things", often in segfaults. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=440 ----------------------------------------------------------------------------- -Version 7.2.7 [v7-stable] 2013-04-17 -- rsyslogd startup information is now properly conveyed back to init - when privileges are beging dropped - Actually, we have moved termination of the parent in front of the - priv drop. So it shall work now in all cases. See code comments in - commit for more details. -- If forking, the parent now waits for a maximum of 60 seconds for - termination by the child -- improved debugging support in forked (auto-backgrounding) mode - The rsyslog debug log file is now continued to be written across the - fork. -- updated systemd files to match current systemd source -- bugfix: failover/action suspend did not work correctly - This was experienced if the retry action took more than one second - to complete. For suspending, a cached timestamp was used, and if the - retry took longer, that timestamp was already in the past. As a - result, the action never was kept in suspended state, and as such - no failover happened. The suspend functionalit now does no longer use - the cached timestamp (should not have any performance implication, as - action suspend occurs very infrequently). -- bugfix: nested if/prifilt conditions did not work properly - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=415 -- bugfix: script == comparison did not work properly on JSON objects - [backport from 7.3 branch] -- bugfix: imudp scheduling parameters did affect main thread, not imudp - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=409 -- bugfix: imuxsock rate-limiting could not be configured via legacy conf - Rate-limiting for the system socket could not be configured via legacy - configuration directives. However, the new-style RainerScript config - options worked. - Thanks to Milan Bartos for the patch. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=390 -- bugfix: using group resolution could lead to endless loop - Thanks to Tomas Heinrich for the patch. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310 -- bugfix: $mmnormalizeuseramsg paramter was specified with wrong type - Thank to Renzhong Zhang for alerting us of the problem. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=420 -- bugfix: RainerScript getenv() function caused segfault when var was - not found. - Thanks to Philippe Muller for the patch. -- bugfix: several issues in imkmsg - see bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=421#c8 -- bugfix: imuxsock was missing SysSock.ParseTrusted module parameter - To use that functionality, legacy rsyslog.conf syntax had to be used. - Also, the doc was missing information on the "ParseTrusted" set of - config directives. -- bugfix: parameter action.execOnlyWhenPreviousIsSuspended was accidently - of integer-type. For obvious reasons, it needs to be boolean. Note - that this change can break existing configurations if they circumvented - the problem by using 0/1 values. -- doc bugfix: rsyslog.conf man page had invalid file format info - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=418 ----------------------------------------------------------------------------- -Version 7.2.6 [v7-stable] 2013-03-05 -- slightly improved config parser error messages when invalid escapes happen -- bugfix: include files got included in the wrong order - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=411 - This happens if an $IncludeConfig directive was done on multiple - files (e.g. the distro default of $IncludeConfig /etc/rsyslog.d/*.conf). - In that case, the order of include file processing is reversed, which - could lead to all sorts of problems. - Thanks to Nathan Stratton Treadway for his great analysis of the problem, - which made bug fixing really easy. -- bugfix: omelasticsearch failed when authentication data was provided - ... at least in most cases it emitted an error message: - "snprintf failed when trying to build auth string" - Thanks to Joerg Heinemann for alerting us. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=404 -- bugfix: some property-based filter were incorrectly parsed - This usually lead to a syntax error on startup and rsyslogd not actually - starting up. The problem was the regex, which did not care for double - quote characters to follow in the action part - unfortunately something - that can frequently happen with v6+ format. An example: - :programname, isequal, "as" {action(type="omfile" ...) } - Here, the part - :programname, isequal, "as" {action(type="omfile" - was treated as the property filter, and the rest as action part. - Obviously, this did not work out. Unfortunately, such situations usually - resulted in very hard to understand error messages. ----------------------------------------------------------------------------- -Version 7.2.5 [v7-stable] 2013-01-08 -- build system cleanup (thanks to Michael Biebl for this!) -- bugfix: omelasticsearch did not properly compile on some platforms - due to missing libmath. Thanks to Michael Biebl for the fix -- bugfix: invalid DST handling under Solaris - Thanks to Scott Severtson for the patch. -- bugfix: on termination, actions were incorrectly called - The problem was that incomplete fiter evaluation was done *during the - shutdown phase*. This affected only the LAST batches being processed. No - problem existed during the regular run. Could usually only happen on - very busy systems, which were still busy during shutdown. -- bugfix: very large memory consumption (and probably out of memory) when - FromPos was specified in template, but ToPos not. - Thanks to Radu Gheorghe for alerting us of this bug. -- bugfix: timeval2syslogTime cause problems on some platforms - due to invalid assumption on structure data types. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=394 - Thanks to David Hill for the patch [under ASL2.0 as per email conversation - 2013-01-03]. -- bugfix: compile errors in im3195 - Thanks to Martin Körper for the patch -- bugfix: doGetFileCreateMode() had invalid validity check ;) - Thanks to Chandler Latour for the patch. -- bugfix: mmjsonparse errornously returned action error when no CEE cookie - was present. ----------------------------------------------------------------------------- -Version 7.2.4 [v7-stable] 2012-12-07 -- enhance: permit RFC3339 timestamp in local log socket messages - Thanks to Sebastien Ponce for the patch. -- imklog: added ParseKernelTimestamp parameter (import from 5.10.2) - Thanks to Marius Tomaschewski for the patch. -- fix missing functionality: ruleset(){} could not specify ruleset queue - The "queue.xxx" parameter set was not supported, and legacy ruleset - config statements did not work (by intention). The fix introduces the - "queue.xxx" parameter set. It has some regression potential, but only - for the new functionality. Note that using that interface it is possible - to specify duplicate queue file names, which will cause trouble. This - will be solved in v7.3, because there is a too-large regression - potential for the v7.2 stable branch. -- imklog: added KeepKernelTimestamp parameter (import from 5.10.2) - Thanks to Marius Tomaschewski for the patch. -- bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds - ... actually, they are microseconds. So the fractional part of the - timestamp was not properly formatted. (import from 5.10.2) - Thanks to Marius Tomaschewski for the bug report and the patch idea. -- bugfix: supportoctetcountedframing parameter did not work in imptcp -- bugfix: modules not (yet) supporting new conf format were not properly - registered. This lead to a "module not found" error message instead of - the to-be-expected "module does not support new style" error message. - That invalid error message could be quite misleading and actually stop - people from addressing the real problem (aka "go nuts" ;)) -- bugfix: template "type" parameter is mandatory (but was not) -- bugfix: some message properties could be garbled due to race condition - This happened only on very high volume systems, if the same message was - being processed by two different actions. This was a regression caused - by the new config processor, which did no longer properly enable msg - locking in multithreaded cases. The bugfix is actually a refactoring of - the msg locking code - we no longer do unlocked operations, as the use - case for it has mostly gone away. It is potentially possible only at - very low-end systems, and there the small additional overhead of doing - the locking does not really hurt. Instead, the removal of that - capability can actually slightly improve performance in common cases, - as the code path is smaller and requires slightly less memory writes. - That probably outperforms the extra locking overhead (which in the - low-end case always happens in user space, without need for kernel - support as we can always directly aquire the lock - there is no - contention at all). ----------------------------------------------------------------------------- -Version 7.2.3 [v7-stable] 2012-10-21 -- regression fix: rsyslogd terminated when wild-card $IncludeConfig did not - find actual include files. For example, if this directive is present: - $IncludeConfig /etc/rsyslog.d/*.conf - and there are no *.conf files in /etc/rsyslog.d (but rsyslog.d exists), - rsyslogd will emit an error message and terminate. Previous (and expected) - behaviour is that an empty file set is no problem. HOWEVER, if the - directory itself does not exist, this is flagged as an error and will - load to termination (no startup). - Unfortunately, this is often the case by default in many distros, so this - actually prevents rsyslog startup. ----------------------------------------------------------------------------- -Version 7.2.2 [v7-stable] 2012-10-16 -- doc improvements -- enabled to build without libuuid, at loss of uuid functionality - this enables smoother builds on older systems that do not support - libuuid. Loss of functionality should usually not matter too much as - uuid support has only recently been added and is very seldom used. -- bugfix: omfwd did not properly support "template" parameter -- bugfix: potential segfault when re_match() function was used - Thanks to oxpa for the patch. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=371 -- bugfix: potential abort of imtcp on rsyslogd shutdown -- bugfix: imzmq3 segfault with PULL subscription - Thanks to Martin Nilsson for the patch. -- bugfix: improper handling of backslash in string-type template()s -- bugfix: leading quote (") in string-type template() lead to thight loop - on startup -- bugfix: no error msg on invalid field option in legacy/string template -- bugfix: potential segfault due to invalid param handling in comparisons - This could happen in RainerScript comparisons (like contains); in some - cases an unitialized variable was accessed, which could lead to an - invalid free and in turn to a segfault. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=372 - Thanks to Georgi Georgiev for reporting this bug and his great help - in solving it. -- bugfix: no error msg on unreadable $IncludeConfig path -- bugfix: $IncludeConfig did not correctly process directories - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=376 - The testbench was also enhanced to check for these cases. - Thanks to Georgi Georgiev for the bug report. -- bugfix: make rsyslog compile on kfreebsd again - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=380 - Thanks to Guillem Jover for the patch. -- bugfix: garbled message if field name was used with jsonf property option - The length for the field name was invalidly computed, resulting in either - truncated field names or including extra random data. If the random data - contained NULs, the rest of the message became unreadable. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=374 -- bugfix: potential segfault at startup with property-based filter - If the property name was followed by a space before the comma, rsyslogd - aborted on startup. Note that no segfault could happen if the initial - startup went well (this was a problem with the config parser). - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=381 -- bugfix: imfile discarded some file parts - File lines that were incomplete (LF missing) *at the time imfile polled - the file* were partially discarded. That part of the line that was read - without the LF was discarded, and the rest of the line was submitted in - the next polling cycle. This is now changed so that the partial content - is saved until the complete line is read. Note that the patch affects - only read mode 0. - Thanks to Milan Bartos for providing the base idea for the solution. ----------------------------------------------------------------------------- -Version 7.2.1 [v7-stable] 2012-10-29 -- bugfix: ruleset()-object did only support a single statement -- added -D rsyslogd option to enable config parser debug mode -- improved syntax error messages by outputting the error token -- the rsyslog core now suspeneds actions after 10 failures in a row - This was former the case after 1,000 failures and could cause rsyslog - to be spammed/ressources misused. See the v6 compatibility doc for more - details. -- ommongodb rate-limits error messages to prevent spamming the syslog - closes (for v7.2): http://bugzilla.adiscon.com/show_bug.cgi?id=366 ----------------------------------------------------------------------------- -Version 7.2.0 [v7-stable] 2012-10-22 -This starts a new stable branch based on 7.1.12 plus the following changes: -- bugfix: imuxsock did not properly honor $LocalHostIPIF -- omruleset/omdiscard do no longer issue "deprecated" warings, as 7.1 - grammar does not permit to use the replacements under all circumstances ----------------------------------------------------------------------------- -Version 7.1.12 [beta] 2012-10-18 -- minor updates to better support newer systemd developments - Thanks to Michael Biebl for the patches. -- build system cleanup - Thanks to Michael Biebl for the patch series. -- cleanup: removed remains of -c option (compatibility mode) - both from code & doc and emitted warning message if still used - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=361 - Thanks to Michael Biebl for reporting & suggestions -- bugfix: imklog truncated head of received message - This happened only under some circumstances. Thanks to Marius - Tomaschewski and Florian Piekert for their help in solving this issue. ----------------------------------------------------------------------------- -Version 7.1.11 [beta] 2012-10-16 -- bugfix: imuxsock truncated head of received message - This happened only under some circumstances. Thanks to Marius - Tomaschewski, Florian Piekert and Milan Bartos for their help in - solving this issue. -- bugfix: do not crash if set statement is used with date field - Thanks to Miloslav TrmaÄ for the patch. -- change lumberjack cookie to "@cee:" from "@cee: " - CEE originally specified the cookie with SP, whereas other lumberjack - tools used it without space. In order to keep interop with lumberjack, - we now use the cookie without space as well. I hope this can be changed - in CEE as well when it is released at a later time. - Thanks to Miloslav TrmaÄ for pointing this out and a similiar v7 patch. -- added deprecated note to omruleset (plus clue to use "call") -- added deprecated note to discard action (plus clue to use "stop") ---------------------------------------------------------------------------- -Version 7.1.10 [beta] 2012-10-11 - - bugfix: m4 directory was not present in release tarball - - bugfix: small memory leak with string-type templates - - bugfix: small memory leak when template was specified in omfile - - bugfix: some config processing warning messages were treated as errors - - bugfix: small memory leak when processing action() statements - - bugfix: unknown action() parameters were not reported ---------------------------------------------------------------------------- -Version 7.1.9 [beta] 2012-10-09 -- bugfix: comments inside objects (e.g. action()) were not properly handled -- bugfix: in (non)equal comparisons the position of arrays influenced result - This behaviour is OK for "contains"-type of comparisons (which have quite - different semantics), but not for == and <>, which shall be commutative. - This has been fixed now, so there is no difference any longer if the - constant string array is the left or right hand operand. We solved this - via the optimizer, as it keeps the actual script execution code small. ---------------------------------------------------------------------------- -Version 7.1.8 [beta] 2012-10-02 -- bugfix: ruleset(){} directive errornously changed default ruleset - much like the $ruleset legacy conf statement. This potentially lead - to statements being assigned to the wrong ruleset. -- improved module doc -- added "parser" parameter to ruleset(), so that parser chain can be - configured -- implemented "continue" RainerScript statement ---------------------------------------------------------------------------- -Version 7.1.7 [devel] 2012-10-01 -- implemented RainerScript "call" statement -- implemented RainerScript array-based string comparison operations -- implemented imtcp "permittedPeers" module-global parameter -- imudp: support for specifying multiple ports via array added ---------------------------------------------------------------------------- -Version 7.1.6 [devel] 2012-09-28 -- implemented RainerScript input() statement, including support for it - in major input plugins -- implemented RainerScript ruleset() statement ---------------------------------------------------------------------------- -Version 7.1.5 [devel] 2012-09-25 -- implemented RainerScript prifield() function -- implemented RainerScript field() function -- added new module imkmsg to process structured kernel log - Thanks to Milan Bartos for contributing this module -- implemented basic RainerScript optimizer, which will speed up script - operations -- bugfix: invalid free if function re_match() was incorrectly used - if the config file parser detected that param 2 was not constant, some - data fields were not initialized. The destructor did not care about that. - This bug happened only if rsyslog startup was unclean. ---------------------------------------------------------------------------- -Version 7.1.4 [devel] 2012-09-19 -- implemented ability for CEE-based properties to be stored in disk queues -- implemented string concatenation in expressions via &-operator -- implemented json subtree copy in variable assignment -- implemented full JSON support for variable manipulation -- introduced "subtree"-type templates -- bugfix: omfile action did not respect "template" parameter - ... and used default template in all cases -- bugfix: MsgDup() did not copy CEE structure - This function was called at various places, most importantly during - "last messages repeated n times" processing and omruleset. If CEE(JSON) - data was present, it was lost as part of the copy process. -- bugfix: debug output indicated improper queue type ---------------------------------------------------------------------------- -Version 7.1.3 [devel] 2012-09-17 -- introduced "set" and "unset" config statements -- bugfix: missing support for escape sequences in RainerScript - only \' was supported. Now the usual set is supported. Note that v5 - used \x as escape where x was any character (e.g. "\n" meant "n" and NOT - LF). This also means there is some incompatibility to v5 for well-know - sequences. Better break it now than later. -- bugfix: invalid property name in property-filter could cause abort - if action chaining (& operator) was used - http://bugzilla.adiscon.com/show_bug.cgi?id=355 - Thanks to pilou@gmx.com for the bug report ---------------------------------------------------------------------------- -Version 7.1.2 [devel] 2012-09-12 -- bugfix: messages were duplicated, sometimes massively - regression from new code in 7.1.1 and reason for early release -- bugfix: remove invalid socket option call from imuxsock - Thanks to Cristian Ionescu-Idbohrn and Jonny Törnbom -- bugfix: abort when invalid property name was configured - in property-based filter -- bugfix: multiple rulesets did no longer work correctly (7.1.1 regression) ---------------------------------------------------------------------------- -Version 7.1.1 [devel] 2012-09-11 -- MAJOR NEW FEATURE: rulengine now fully supports nesting - including if ... then ... else ... constructs. This is a big change - and it obviously has a lot of bug potential. -- BSD-style (filter) blocks are no longer supported - see http://www.rsyslog.com/g/BSD for details and solution -- imuxsock now stores trusted properties by default in the CEE root - This was done in order to keep compatible with other implementations of - the lumberjack schema - Thanks to Miloslav TrmaÄ for pointing to this. -- bugfix: string-generating templates caused abort if CEE field could not - be found ---------------------------------------------------------------------------- -Version 7.1.0 [devel] 2012-09-06 -- added support for hierarchical properties (CEE/lumberjack) -- added pure JSON output plugin parameter passing mode -- ommongodb now supports templates -- bugfix: imtcp could abort on exit due to invalid free() -- imported bugfixes from 6.4.1 ---------------------------------------------------------------------------- -Version 6.6.1 [v6-stable] 2012-10-?? -- bugfix: build problems on some platforms -- bugfix: misaddressing of $mmnormalizeuserawmsg parameter - On many platforms, this has no effect at all. At some, it may cause - a segfault. The problem occurs only during config phase, no segfault - happens when rsyslog has fully started. -- fix API "glitch" in some plugins - This did not affect users, but could have caused trouble in the future - for developers. -- bugfix: no error msg on invalid field option in legacy/string template -- bugfix: no error msg on unreadable $IncludeConfig path -- bugfix: $IncludeConfig did not correctly process directories - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=376 - The testbench was also enhanced to check for these cases. - Thanks to Georgi Georgiev for the bug report. -- bugfix: spurios error messages from imuxsock about (non-error) EAGAIN - Thanks to Marius Tomaschewski for the patch. -- imklog: added $klogParseKernelTimestamp option - When enabled, kernel message [timestamp] is converted for message time. - Default is to use receive time as in 5.8.x and before, because the clock - used to create the timestamp is not supposed to be as accurate as the - monotonic clock (depends on hardware and kernel) resulting in differences - between kernel and system messages which occurred at same time. - Thanks to Marius Tomaschewski for the patch. -- imklog: added $klogKeepKernelTimestamp option - When enabled, the kernel [timestamp] remains at begin of - each message, even it is used for the message time too. - Thanks to Marius Tomaschewski for the patch. -- bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds - ... actually, they are microseconds. So the fractional part of the - timestamp was not properly formatted. - Thanks to Marius Tomaschewski for the bug report and the patch idea. -- bugfix: hostname set in rsyslog.conf was not picked up until HUP - which could also mean "never" or "not for a very long time". - Thanks to oxpa for providing analysis and a patch -- bugfix: some message properties could be garbled due to race condition - This happened only on very high volume systems, if the same message was - being processed by two different actions. This was a regression caused - by the new config processor, which did no longer properly enable msg - locking in multithreaded cases. The bugfix is actually a refactoring of - the msg locking code - we no longer do unlocked operations, as the use - case for it has mostly gone away. It is potentially possible only at - very low-end systems, and there the small additional overhead of doing - the locking does not really hurt. Instead, the removal of that - capability can actually slightly improve performance in common cases, - as the code path is smaller and requires slightly less memory writes. - That probably outperforms the extra locking overhead (which in the - low-end case always happens in user space, without need for kernel - support as we can always directly aquire the lock - there is no - contention at all). -- bugfix: invalid DST handling under Solaris - Thanks to Scott Severtson for the patch. ---------------------------------------------------------------------------- -Version 6.6.0 [v6-stable] 2012-10-22 -This starts a new stable branch, based on the 6.5.x series, plus: -- bugfix: imuxsock did not properly honor $LocalHostIPIF ---------------------------------------------------------------------------- -Version 6.5.1 [beta] 2012-10-11 -- added tool "logctl" to handle lumberjack logs in MongoDB -- imfile ported to new v6 config interface -- imfile now supports config parameter for maximum number of submits - which is a fine-tuning parameter in regard to input baching -- added pure JSON output plugin parameter passing mode -- ommongodb now supports templates -- bugfix: imtcp could abort on exit due to invalid free() -- bugfix: remove invalid socket option call from imuxsock - Thanks to Cristian Ionescu-Idbohrn and Jonny Törnbom -- added pure JSON output plugin parameter passing mode -- ommongodb now supports templates -- bugfix: imtcp could abort on exit due to invalid free() -- bugfix: missing support for escape sequences in RainerScript - only \' was supported. Now the usual set is supported. Note that v5 - used \x as escape where x was any character (e.g. "\n" meant "n" and NOT - LF). This also means there is some incompatibility to v5 for well-know - sequences. Better break it now than later. -- bugfix: small memory leaks in template() statements - these were one-time memory leaks during startup, so they did NOT grow - during runtime -- bugfix: config validation run did not always return correct return state -- bugfix: config errors did not always cause statement to fail - This could lead to startup with invalid parameters. ---------------------------------------------------------------------------- -Version 6.5.0 [devel] 2012-08-28 -- imrelp now supports non-cancel thread termination - (but now requires at least librelp 1.0.1) -- implemented freeCnf() module interface - This was actually not present in older versions, even though some modules - already used it. The implementation was now done, and not in 6.3/6.4 - because the resulting memory leak was ultra-slim and the new interface - handling has some potential to seriously break things. Not the kind of - thing you want to add in late beta state, if avoidable. -- added --enable-debugless configure option for very high demanding envs - This actually at compile time disables a lot of debug code, resulting - in some speedup (but serious loss of debugging capabilities) -- added new 0mq plugins (via czmq lib) - Thanks to David Kelly for contributing these modules -- bugfix: omhdfs did no longer compile -- bugfix: SystemLogSocketAnnotate did not work correctly - Thanks to Miloslav TrmaÄ for the patch -- $SystemLogParseTrusted config file option - Thanks to Milan Bartos for the patch -- added template config directive -- added new uuid message property - Thanks to Jérôme Renard for the idea and patches. - Note: patches were released under ASL 2.0, see - http://bugzilla.adiscon.com/show_bug.cgi?id=353 ---------------------------------------------------------------------------- -Version 6.4.3 [V6-STABLE/NEVER RELEASED] 2012-??-?? -This version was never released as 6.6.0 came quickly enough. Note that -all these patches here are present in 6.6.0. -- cleanup: removed remains of -c option (compatibility mode) - both from code & doc and emitted warning message if still used - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=361 - Thanks to Michael Biebl for reporting & suggestions -- bugfix: imuxsock and imklog truncated head of received message - This happened only under some circumstances. Thanks to Marius - Tomaschewski, Florian Piekert and Milan Bartos for their help in - solving this issue. -- change lumberjack cookie to "@cee:" from "@cee: " - CEE originally specified the cookie with SP, whereas other lumberjack - tools used it without space. In order to keep interop with lumberjack, - we now use the cookie without space as well. I hope this can be changed - in CEE as well when it is released at a later time. - Thanks to Miloslav TrmaÄ for pointing this out and a similiar v7 patch. -- bugfix: comments inside objects (e.g. action()) were not properly handled -- bugfix: sysklogd-emulating standard template was no longer present in v6 - This was obviously lost during the transition to the new config format. - Thanks to Milan Bartos for alerting us and a patch! -- bugfix: some valid legacy PRI filters were flagged as errornous - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=358 - This happend to filters of the style "local0,local1.*", where the - multiple facilities were comma-separated. -- bugfix: imuxsock did not properly honor $LocalHostIPIF ---------------------------------------------------------------------------- -Version 6.4.2 [V6-STABLE] 2012-09-20 -- bugfix: potential abort, if action queue could not be properly started - This most importantly could happen due to configuration errors. -- bugfix: remove invalid socket option call from imuxsock - Thanks to Cristian Ionescu-Idbohrn and Jonny Törnbom -- bugfix: missing support for escape sequences in RainerScript - only \' was supported. Now the usual set is supported. Note that v5 - used \x as escape where x was any character (e.g. "\n" meant "n" and NOT - LF). This also means there is some incompatibility to v5 for well-know - sequences. Better break it now than later. -- bugfix: config validation run did not always return correct return state ---------------------------------------------------------------------------- -Version 6.4.1 [V6-STABLE] 2012-09-06 -- bugfix: multiple main queues with same queue file name were not detected - This lead to queue file corruption. While the root cause is a config - error, it is a bug that this important and hard to find config error - was not detected by rsyslog. -- bugfix: "jsonf" property replacer option did generate invalid JSON - in JSON, we have "fieldname":"value", but the option emitted - "fieldname"="value". Interestingly, this was accepted by a couple - of sinks, most importantly elasticsearch. Now the correct format is - emitted, which causes a remote chance that some things that relied on - the wrong format will break. - Thanks to Miloslav TrmaÄ for the patch -- change $!all-json did emit an empty (thus non-JSON) string if no libee - data was present. It now emits {} and thus valid JSON. There is a - small risk that this may break some things that relied on the previous - inconsistency. - Thanks to Miloslav TrmaÄ for the patch -- bugfix: omusrsmsg incorrect return state & config warning handling - During config file processing, Omusrmsg often incorrectly returned a - warning status, even when no warning was present (caused by - uninitialized variable). Also, the core handled warning messages - incorrectly, and treated them as errors. As a result, omusrmsg - (most often) could not properly be loaded. Note that this only - occurs with legacy config action syntax. This was a regression - caused by an incorrect merge in to the 6.3.x codebase. - Thanks to Stefano Mason for alerting us of this bug. -- bugfix: Fixed TCP CheckConnection handling in omfwd.c. Interface needed - to be changed in lower stream classes. Syslog TCP Sending is now resumed - properly. Unfixed, that lead to non-detection of downstate of remote - hosts. ---------------------------------------------------------------------------- -Version 6.4.0 [V6-STABLE] 2012-08-20 -- THIS IS THE FIRST VERSION OF THE 6.4.x STABLE BRANCH - It includes all enhancements made in 6.3.x plus what is written in the - ChangeLog below. -- omelasticsearch: support for parameters parent & dynparent added -- bugfix: imtcp aborted when more than 2 connections were used. - Incremented pthread stack size to 4MB for imtcp, imptcp and imttcp - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=342 -- bugfix: imptcp aborted when $InputPTCPServerBindRuleset was used -- bugfix: problem with cutting first 16 characters from message with - bAnnotate - Thanks to Milan Bartos for the patch. ---------------------------------------------------------------------------- -Version 6.3.12 [BETA] 2012-07-02 -- support for elasticsearch via omelasticsearch added - Note that this module has been tested quite well by a number of folks, - and this is why we merge in new functionality in a late beta stage. - Even if problems would exist, only users of omelasticsearch would - experience them, making it a pretty safe addition. -- bugfix: $ActionName was not properly honored - Thanks to Abby Edwards for alerting us ---------------------------------------------------------------------------- -Version 6.3.11 [BETA] 2012-06-18 -- bugfix: expression-based filters with AND/OR could segfault - due to a problem with boolean shortcut operations. From the user's - perspective, the segfault is almost non-deterministic (it occurs when - a shortcut is used). - Thanks to Lars Peterson for providing the initial bug report and his - support in solving it. -- bugfix: "last message repeated n times" message was missing hostname - Thanks to Zdenek Salvet for finding this bug and to Bodik for reporting ---------------------------------------------------------------------------- -Version 6.3.10 [BETA] 2012-06-04 -- bugfix: delayble source could block action queue, even if there was - a disk queue associated with it. The root cause of this problem was - that it makes no sense to delay messages once they arrive in the - action queue - the "input" that is being held in that case is the main - queue worker, what makes no sense. - Thanks to Marcin for alerting us on this problem and providing - instructions to reproduce it. -- bugfix: invalid free in imptcp could lead to abort during startup -- bugfix: if debug message could end up in log file when forking - if rsyslog was set to auto-background (thus fork, the default) and debug - mode to stdout was enabled, debug messages ended up in the first log file - opened. Currently, stdout logging is completely disabled in forking mode - (but writing to the debug log file is still possible). This is a change - in behaviour, which is under review. If it causes problems to you, - please let us know. - Thanks to Tomas Heinrich for the patch. -- bugfix: --enable-smcustbindcdr configure directive did not work - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=330 - Thanks to Ultrabug for the patch. -- bugfix: made rsyslog compile when libestr ist not installed in /usr - Thanks to Miloslav TrmaÄ for providing patches and suggestions ---------------------------------------------------------------------------- -Version 6.3.9 [BETA] 2012-05-22 -- bugfix: imtcp could cause hang during reception - this also applied to other users of core file tcpsrv.c, but imtcp was - by far the most prominent and widely-used, the rest rather exotic - (like imdiag) -- added capability to specify substrings for field extraction mode -- added the "jsonf" property replacer option (and fieldname) -- bugfix: omudpspoof did not work correctly if no spoof hostname was - configured -- bugfix: property replacer option "json" could lead to content loss - message was truncated if escaping was necessary -- bugfix: assigned ruleset was lost when using disk queues - This looked quite hard to diagnose for disk-assisted queues, as the - pure memory part worked well, but ruleset info was lost for messages - stored inside the disk queue. -- bugfix/imuxsock: solving abort if hostname was not set; configured - hostname was not used (both merge regressions) - -bugfix/omfile: template action parameter was not accepted - (and template name set to "??" if the parameter was used) - Thanks to Brian Knox for alerting us on this bug. -- bugfix: ommysql did not properly init/exit the mysql runtime library - this could lead to segfaults. Triggering condition: multiple action - instances using ommysql. Thanks to Tomas Heinrich for reporting this - problem and providing an initial patch (which my solution is based on, - I need to add more code to clean the mess up). -- bugfix: rsyslog did not terminate when delayable inputs were blocked - due to unvailable sources. Fixes: - http://bugzilla.adiscon.com/show_bug.cgi?id=299 - Thanks to Marcin M for bringing up this problem and Andre Lorbach - for helping to reproduce and fix it. -- added capability to specify substrings for field extraction mode -- bugfix: disk queue was not persisted on shutdown, regression of fix to - http://bugzilla.adiscon.com/show_bug.cgi?id=299 - The new code also handles the case of shutdown of blocking light and - full delayable sources somewhat smarter and permits, assuming sufficient - timouts, to persist message up to the max queue capacity. Also some nits - in debug instrumentation have been fixed. ---------------------------------------------------------------------------- -Version 6.3.8 [DEVEL] 2012-04-16 -- added $PStatJSON directive to permit stats records in JSON format -- added "date-unixtimestamp" property replacer option to format as a - unix timestamp (seconds since epoch) -- added "json" property replacer option to support JSON encoding on a - per-property basis -- added omhiredis (contributed module) -- added mmjsonparse to support recognizing and parsing JSON enhanced syslog - messages -- upgraded more plugins to support the new v6 config format: - - ommysql - - omlibdbi - - omsnmp -- added configuration directives to customize queue light delay marks - $MainMsgQueueLightDelayMark, $ActionQueueLightDelayMark; both - specify number of messages starting at which a delay happens. -- added message property parsesuccess to indicate if the last run - higher-level parser could successfully parse the message or not - (see property replacer html doc for details) -- bugfix: abort during startup when rsyslog.conf v6+ format was used in - a certain way -- bugfix: property $!all-json made rsyslog abort if no normalized data - was available -- bugfix: memory leak in array passing output module mode -- added configuration directives to customize queue light delay marks -- permit size modifiers (k,m,g,...) in integer config parameters - Thanks to Jo Rhett for the suggestion. -- bugfix: hostname was not requeried on HUP - Thanks to Per Jessen for reporting this bug and Marius Tomaschewski for - his help in testing the fix. -- bugfix: imklog invalidly computed facility and severity - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313 -- added configuration directive to disable octet-counted framing - for imtcp, directive is $InputTCPServerSupportOctetCountedFraming - for imptcp, directive is $InputPTCPServerSupportOctetCountedFraming -- added capability to use a local interface IP address as fromhost-ip for - locally originating messages. New directive $LocalHostIPIF ---------------------------------------------------------------------------- -Version 6.3.7 [DEVEL] 2012-02-02 -- imported refactored v5.9.6 imklog linux driver, now combined with BSD - driver -- removed imtemplate/omtemplate template modules, as this was waste of time - The actual input/output modules are better copy templates. Instead, the - now-removed modules cost time for maintenance AND often caused confusion - on what their role was. -- added a couple of new stats objects -- improved support for new v6 config system. The build-in output modules - now all support the new config language -- bugfix: facility local was not correctly interpreted in legacy filters - Was only accepted if it was the first PRI in a multi-filter PRI. - Thanks to forum user Mark for bringing this to our attention. -- bugfix: potential abort after reading invalid X.509 certificate - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=290 - Thanks to Tomas Heinrich for the patch -- bufgix: legacy parsing of some filters did not work correctly -- bugfix: rsyslog aborted during startup if there is an error in loading - an action and legacy configuration mode is used -- bugfix: bsd klog driver did no longer compile -- relicensed larger parts of the code under Apache (ASL) 2.0 ---------------------------------------------------------------------------- -Version 6.3.6 [DEVEL] 2011-09-19 -- added $InputRELPServerBindRuleset directive to specify rulesets for RELP -- bugfix: config parser did not support properties with dashes in them - inside property-based filters. Thanks to Gerrit Seré for reporting this. ---------------------------------------------------------------------------- -Version 6.3.5 [DEVEL] (rgerhards/al), 2011-09-01 -- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200 -- bugfix: mark message processing did not work correctly -- imudp&imtcp now report error if no listener at all was defined - Thanks to Marcin for suggesting this error message. -- bugfix: potential misadressing in property replacer ---------------------------------------------------------------------------- -Version 6.3.4 [DEVEL] (rgerhards), 2011-08-02 -- added support for action() config object - * in rsyslog core engine - * in omfile - * in omusrmsg -- bugfix: omusrmsg format usr1,usr2 was no longer supported -- bugfix: misaddressing in config handler - In theory, can cause segfault, in practice this is extremely unlikely - Thanks to Marcin for alertig me. ---------------------------------------------------------------------------- -Version 6.3.3 [DEVEL] (rgerhards), 2011-07-13 -- rsyslog.conf format: now parsed by RainerScript parser - this provides the necessary base for future enhancements as well as some - minor immediate ones. For details see: - http://blog.gerhards.net/2011/07/rsyslog-633-config-format-improvements.html -- performance of script-based filters notably increased -- removed compatibility mode as we expect people have adjusted their - confs by now -- added support for the ":omfile:" syntax for actions ---------------------------------------------------------------------------- -Version 6.3.2 [DEVEL] (rgerhards), 2011-07-06 -- added support for the ":omusrmsg:" syntax in configuring user messages -- systemd support: set stdout/stderr to null - thx to Lennart for the patch -- added support for obtaining timestamp for kernel message from message - If the kernel time-stamps messages, time is now take from that - timestamp instead of the system time when the message was read. This - provides much better accuracy. Thanks to Lennart Poettering for - suggesting this feature and his help during implementation. -- added support for obtaining timestamp from system for imuxsock - This permits to read the time a message was submitted to the system - log socket. Most importantly, this is provided in microsecond resolution. - So we are able to obtain high precision timestampis even for messages - that were - as is usual - not formatted with them. This also simplifies - things in regard to local time calculation in chroot environments. - Many thanks to Lennart Poettering for suggesting this feature, - providing some guidance on implementing it and coordinating getting the - necessary support into the Linux kernel. -- bugfix: timestamp was incorrectly calculated for timezones with minute - offset - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=271 -- bugfix: memory leak in imtcp & subsystems under some circumstances - This leak is tied to error conditions which lead to incorrect cleanup - of some data structures. ---------------------------------------------------------------------------- -Version 6.3.1 [DEVEL] (rgerhards), 2011-06-07 -- added a first implementation of a DNS name cache - this still has a couple of weaknesses, like no expiration of entries, - suboptimal algorithms -- but it should perform much better than - what we had previously. Implementation will be improved based on - feedback during the next couple of releases ---------------------------------------------------------------------------- -Version 6.3.0 [DEVEL] (rgerhards), 2011-06-01 -- introduced new config system - http://blog.gerhards.net/2011/06/new-rsyslog-config-system-materializes.html ---------------------------------------------------------------------------- -Version 6.2.2 [v6-stable], 2012-06-13 -- build system improvements and spec file templates - Thanks to Abby Edwards for providing these enhancements -- bugfix: disk queue was not persisted on shutdown, regression of fix to - http://bugzilla.adiscon.com/show_bug.cgi?id=299 - The new code also handles the case of shutdown of blocking light and - full delayable sources somewhat smarter and permits, assuming sufficient - timouts, to persist message up to the max queue capacity. Also some nits - in debug instrumentation have been fixed. -- bugfix: --enable-smcustbindcdr configure directive did not work - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=330 - Thanks to Ultrabug for the patch. -- add small delay (50ms) after sending shutdown message - There seem to be cases where the shutdown message is otherwise not - processed, not even on an idle system. Thanks to Marcin for - bringing this problem up. -- support for resolving huge groups - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310 - Thanks to Alec Warner for the patch -- bugfix: potential hang due to mutex deadlock - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=316 - Thanks to Andreas Piesk for reporting&analyzing this bug as well as - providing patches and other help in resolving it. -- bugfix: property PROCID empty instead of proper nilvalue if not present - If it is not present, it must have the nilvalue "-" as of RFC5424 - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=332 - Thanks to John N for reporting this issue. -- bugfix: did not compile under solaris due to $uptime property code - For the time being, $uptime is not supported on Solaris -- bugfix: "last message repeated n times" message was missing hostname - Thanks to Zdenek Salvet for finding this bug and to Bodik for reporting ---------------------------------------------------------------------------- -Version 6.2.1 [v6-stable], 2012-05-10 -- change plugin config interface to be compatible with pre-v6.2 system - The functionality was already removed (because it is superseeded by the - v6.3+ config language), but code was still present. I have now removed - those parts that affect interface. Full removal will happen in v6.3, in - order to limit potential regressions. However, it was considered useful - enough to do the interface change in v6-stable; this also eases merging - branches! -- re-licensed larger parts of the codebase under the Apache license 2.0 -- bugfix: omprog made rsyslog abort on startup if not binary to - execute was configured -- bugfix: imklog invalidly computed facility and severity - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313 -- bugfix: stopped DA queue was never processed after a restart due to a - regression from statistics module -- bugfix: memory leak in array passing output module mode -- bugfix: ommysql did not properly init/exit the mysql runtime library - this could lead to segfaults. Triggering condition: multiple action - instances using ommysql. Thanks to Tomas Heinrich for reporting this - problem and providing an initial patch (which my solution is based on, - I need to add more code to clean the mess up). -- bugfix: rsyslog did not terminate when delayable inputs were blocked - due to unvailable sources. Fixes: - http://bugzilla.adiscon.com/show_bug.cgi?id=299 - Thanks to Marcin M for bringing up this problem and Andre Lorbach - for helping to reproduce and fix it. -- bugfix/tcpflood: sending small test files did not work correctly ---------------------------------------------------------------------------- -Version 6.2.0 [v6-stable], 2012-01-09 -- bugfix (kind of): removed numerical part from pri-text - see v6 compatibility document for reasons -- bugfix: race condition when extracting program name, APPNAME, structured - data and PROCID (RFC5424 fields) could lead to invalid characters e.g. - in dynamic file names or during forwarding (general malfunction of these - fields in templates, mostly under heavy load) -- bugfix: imuxsock did no longer ignore message-provided timestamp, if - so configured (the *default*). Lead to no longer sub-second timestamps. - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=281 -- bugfix: omfile returns fatal error code for things that go really wrong - previously, RS_RET_RESUME was returned, which lead to a loop inside the - rule engine as omfile could not really recover. -- bugfix: rsyslogd -v always said 64 atomics were not present - thanks to mono_matsuko for the patch -- bugfix: potential abort after reading invalid X.509 certificate - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=290 - Thanks to Tomas Heinrich for the patch -- enhanced module loader to not rely on PATH_MAX -- imuxsock: added capability to "annotate" messages with "trusted - information", which contains some properties obtained from the system - and as such sure to not be faked. This is inspired by the similiar idea - introduced in systemd. ---------------------------------------------------------------------------- -Version 6.1.12 [BETA], 2011-09-01 -- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200 -- bugfix: mark message processing did not work correctly -- bugfix: potential misadressing in property replacer -- bugfix: memcpy overflow can occur in allowed sender checkig - if a name is resolved to IPv4-mapped-on-IPv6 address - Found by Ismail Dönmez at suse -- bugfix: The NUL-Byte for the syslogtag was not copied in MsgDup (msg.c) -- bugfix: fixed incorrect state handling for Discard Action (transactions) - Note: This caused all messages in a batch to be set to COMMITTED, - even if they were discarded. ---------------------------------------------------------------------------- -Version 6.1.11 [BETA] (rgerhards), 2011-07-11 -- systemd support: set stdout/stderr to null - thx to Lennart for the patch -- added support for the ":omusrmsg:" syntax in configuring user messages -- added support for the ":omfile:" syntax in configuring user messages ---------------------------------------------------------------------------- -Version 6.1.10 [BETA] (rgerhards), 2011-06-22 -- bugfix: problems in failover action handling - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=270 - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=254 -- bugfix: mutex was invalidly left unlocked during action processing - At least one case where this can occur is during thread shutdown, which - may be initiated by lower activity. In most cases, this is quite - unlikely to happen. However, if it does, data structures may be - corrupted which could lead to fatal failure and segfault. I detected - this via a testbench test, not a user report. But I assume that some - users may have had unreproducable aborts that were cause by this bug. ---------------------------------------------------------------------------- -Version 6.1.9 [BETA] (rgerhards), 2011-06-14 -- bugfix: problems in failover action handling - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=270 - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=254 -- bugfix: mutex was invalidly left unlocked during action processing - At least one case where this can occur is during thread shutdown, which - may be initiated by lower activity. In most cases, this is quite - unlikely to happen. However, if it does, data structures may be - corrupted which could lead to fatal failure and segfault. I detected - this via a testbench test, not a user report. But I assume that some - users may have had unreproducable aborts that were cause by this bug. -- bugfix/improvement:$WorkDirectory now gracefully handles trailing slashes -- bugfix: memory leak in imtcp & subsystems under some circumstances - This leak is tied to error conditions which lead to incorrect cleanup - of some data structures. [backport from v6.3] -- bugfix: $ActionFileDefaultTemplate did not work - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=262 ---------------------------------------------------------------------------- -Version 6.1.8 [BETA] (rgerhards), 2011-05-20 -- official new beta version (note that in a sense 6.1.7 was already beta, - so we may release the first stable v6 earlier than usual) -- new module mmsnmptrapd, a sample message modification module -- import of minor bug fixes from v4 & v5 ---------------------------------------------------------------------------- -Version 6.1.7 [DEVEL] (rgerhards), 2011-04-15 -- added log classification capabilities (via mmnormalize & tags) -- speeded up tcp forwarding by reducing number of API calls - this especially speeds up TLS processing -- somewhat improved documentation index -- bugfix: enhanced imudp config processing code disabled due to wrong - merge (affected UDP realtime capabilities) -- bugfix (kind of): memory leak with tcp reception epoll handler - This was an extremely unlikely leak and, if it happend, quite small. - Still it is better to handle this border case. -- bugfix: IPv6-address could not be specified in omrelp - this was due to improper parsing of ":" - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250 -- bugfix: do not open files with full privileges, if privs will be dropped - This make the privilege drop code more bulletproof, but breaks Ubuntu's - work-around for log files created by external programs with the wrong - user and/or group. Note that it was long said that this "functionality" - would break once we go for serious privilege drop code, so hopefully - nobody still depends on it (and, if so, they lost...). -- bugfix: pipes not opened in full priv mode when privs are to be dropped ---------------------------------------------------------------------------- -Version 6.1.6 [DEVEL] (rgerhards), 2011-03-14 -- enhanced omhdfs to support batching mode. This permits to increase - performance, as we now call the HDFS API with much larger message - sizes and far more infrequently -- improved testbench - among others, life tests for ommysql (against a test database) have - been added, valgrind-based testing enhanced, ... -- bugfix: minor memory leak in omlibdbi (< 1k per instance and run) -- bugfix: (regression) omhdfs did no longer compile -- bugfix: omlibdbi did not use password from rsyslog.con - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=203 -- systemd support somewhat improved (can now take over existing log sockt) -- bugfix: discard action did not work under some circumstances - fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=217 -- bugfix: file descriptor leak in gnutls netstream driver - fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=222 -- fixed compile problem in imtemplate - fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=235 ---------------------------------------------------------------------------- -Version 6.1.5 [DEVEL] (rgerhards), 2011-03-04 -- improved testbench -- enhanced imtcp to use a pool of worker threads to process incoming - messages. This enables higher processing rates, especially in the TLS - case (where more CPU is needed for the crypto functions) -- added support for TLS (in anon mode) to tcpflood -- improved TLS error reporting -- improved TLS startup (Diffie-Hellman bits do not need to be generated, - as we do not support full anon key exchange -- we always need certs) -- bugfix: fixed a memory leak and potential abort condition - this could happen if multiple rulesets were used and some output batches - contained messages belonging to more than one ruleset. - fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 - fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218 -- bugfix: memory leak when $RepeatedMsgReduction on was used - bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=225 -- bugfix: potential abort condition when $RepeatedMsgReduction set to on - as well as potentially in a number of other places where MsgDup() was - used. This only happened when the imudp input module was used and it - depended on name resolution not yet had taken place. In other words, - this was a strange problem that could lead to hard to diagnose - instability. So if you experience instability, chances are good that - this fix will help. ---------------------------------------------------------------------------- -Version 6.1.4 [DEVEL] (rgerhards), 2011-02-18 -- bugfix/omhdfs: directive $OMHDFSFileName rendered unusable - due to a search and replace-induced bug ;) -- bugfix: minor race condition in action.c - considered cosmetic - This is considered cosmetic as multiple threads tried to write exactly - the same value into the same memory location without sync. The method - has been changed so this can no longer happen. -- added pmsnare parser module (written by David Lang) -- enhanced imfile to support non-cancel input termination -- improved systemd socket activation thanks to Marius Tomaschewski -- improved error reporting for $WorkDirectory - non-existance and other detectable problems are now reported, - and the work directory is NOT set in this case -- bugfix: pmsnare causded abort under some conditions -- bugfix: abort if imfile reads file line of more than 64KiB - Thanks to Peter Eisentraut for reporting and analysing this problem. - bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221 -- bugfix: queue engine did not properly slow down inputs in FULL_DELAY mode - when in disk-assisted mode. This especially affected imfile, which - created unnecessarily queue files if a large set of input file data was - to process. -- bugfix: very long running actions could prevent shutdown under some - circumstances. This has now been solved, at least for common - situations. -- bugfix: fixed compile problem due to empty structs - this occured only on some platforms/compilers. thanks to Dražen KaÄar - for the fix ---------------------------------------------------------------------------- -Version 6.1.3 [DEVEL] (rgerhards), 2011-02-01 -- experimental support for monogodb added -- added $IMUDPSchedulingPolicy and $IMUDPSchedulingPriority config settings -- added $LocalHostName config directive -- improved tcpsrv performance by enabling multiple-entry epoll - so far, we always pulled a single event from the epoll interface. - Now 128, what should result in performance improvement (less API - calls) on busy systems. Most importantly affects imtcp. -- imptcp now supports non-cancel termination mode, a plus in stability -- imptcp speedup: multiple worker threads can now be used to read data -- new directive $InputIMPTcpHelperThreads added -- bugfix: fixed build problems on some platforms - namely those that have 32bit atomic operations but not 64 bit ones -- bugfix: local hostname was pulled too-early, so that some config - directives (namely FQDN settings) did not have any effect -- enhanced tcpflood to support multiple sender threads - this is required for some high-throughput scenarios (and necessary to - run some performance tests, because otherwise the sender is too slow). -- added some new custom parsers (snare, aix, some Cisco "specialities") - thanks to David Lang ---------------------------------------------------------------------------- -Version 6.1.2 [DEVEL] (rgerhards), 2010-12-16 -- added experimental support for log normalizaton (via liblognorm) - support for normalizing log messages has been added in the form of - mmnormalize. The core engine (property replacer, filter engine) has - been enhanced to support properties from normalized events. - Note: this is EXPERIMENTAL code. It is currently know that - there are issues if the functionality is used with - - disk-based queues - - asynchronous action queues - You can not use the new functionality together with these features. - This limitation will be removed in later releases. However, we - preferred to release early, so that one can experiment with the new - feature set and accepted the price that this means the full set of - functionality is not yet available. If not used together with - these features, log normalizing should be pretty stable. -- enhanced testing tool tcpflood - now supports sending via UDP and the capability to run multiple - iterations and generate statistics data records -- bugfix: potential abort when output modules with different parameter - passing modes were used in configured output modules ---------------------------------------------------------------------------- -Version 6.1.1 [DEVEL] (rgerhards), 2010-11-30 -- bugfix(important): problem in TLS handling could cause rsyslog to loop - in a tight loop, effectively disabling functionality and bearing the - risk of unresponsiveness of the whole system. - Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=194 -- support for omhdfs officially added (import from 5.7.1) -- merged imuxsock improvements from 5.7.1 (see there) -- support for systemd officially added (import from 5.7.0) -- bugfix: a couple of problems that imfile had on some platforms, namely - Ubuntu (not their fault, but occured there) -- bugfix: imfile utilizes 32 bit to track offset. Most importantly, - this problem can not experienced on Fedora 64 bit OS (which has - 64 bit long's!) -- a number of other bugfixes from older versions imported ---------------------------------------------------------------------------- -Version 6.1.0 [DEVEL] (rgerhards), 2010-08-12 - -*********************************** NOTE ********************************** -The v6 versions of rsyslog feature a greatly redesigned config system -which, among others, supports scoping. However, the initial version does -not contain the whole new system. Rather it will evolve. So it is -expected that interfaces, even new ones, break during the initial -6.x.y releases. -*********************************** NOTE ********************************** - -- added $Begin, $End and $ScriptScoping config scope statments - (at this time for actions only). -- added imptcp, a simplified, Linux-specific and potentielly fast - syslog plain tcp input plugin (NOT supporting TLS!) - [ported from v4] ---------------------------------------------------------------------------- -Version 5.10.2 [V5-STABLE], 201?-??-?? -- bugfix: queue file size was not correctly processed - this could lead to using one queue file per message for sizes >2GiB - Thanks to Tomas Heinrich for the patch. -- updated systemd files to match current systemd source -- bugfix: spurios error messages from imuxsock about (non-error) EAGAIN - Thanks to Marius Tomaschewski for the patch. -- imklog: added $klogParseKernelTimestamp option - When enabled, kernel message [timestamp] is converted for message time. - Default is to use receive time as in 5.8.x and before, because the clock - used to create the timestamp is not supposed to be as accurate as the - monotonic clock (depends on hardware and kernel) resulting in differences - between kernel and system messages which occurred at same time. - Thanks to Marius Tomaschewski for the patch. -- imklog: added $klogKeepKernelTimestamp option - When enabled, the kernel [timestamp] remains at begin of - each message, even it is used for the message time too. - Thanks to Marius Tomaschewski for the patch. -- bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds - ... actually, they are microseconds. So the fractional part of the - timestamp was not properly formatted. - Thanks to Marius Tomaschewski for the bug report and the patch idea. -- imklog: added $klogKeepKernelTimestamp option - When enabled, the kernel [timestamp] remains at begin of - each message, even it is used for the message time too. - Thanks to Marius Tomaschewski for the patch. -- bugfix: imklog mistakenly took kernel timestamp subseconds as nanoseconds - ... actually, they are microseconds. So the fractional part of the - timestamp was not properly formatted. - Thanks to Marius Tomaschewski for the bug report and the patch idea. -- bugfix: invalid DST handling under Solaris - Thanks to Scott Severtson for the patch. -- bugfix: invalid decrement in pm5424 could lead to log truncation - Thanks to Tomas Heinrich for the patch. -- bugfix[kind of]: omudpspoof discarded messages >1472 bytes (MTU size) - it now truncates these message, but ensures they are sent. Note that - 7.3.5+ will switch to fragmented UDP messages instead (up to 64K) ---------------------------------------------------------------------------- Version 5.10.1 [V5-STABLE], 2012-10-17 - bugfix: imuxsock and imklog truncated head of received message This happened only under some circumstances. Thanks to Marius - Tomaschewski, Florian Piekert and Milan Bartos for their help in + Tomaschwesky, Florian Piekert and Milan Bartos for their help in solving this issue. - enable DNS resolution in imrelp Thanks to Apollon Oikonomopoulos for the patch @@ -2074,9 +87,6 @@ for imptcp, directive is $InputPTCPServerSupportOctetCountedFraming - added capability to use a local interface IP address as fromhost-ip for locally originating messages. New directive $LocalHostIPIF -- added configuration directives to customize queue light delay marks - $MainMsgQueueLightDelayMark, $ActionQueueLightDelayMark; both - specify number of messages starting at which a delay happens. --------------------------------------------------------------------------- Version 5.9.5 [V5-DEVEL], 2012-01-27 - improved impstats subsystem, added many new counters @@ -2124,7 +134,7 @@ Version 5.9.2 [V5-DEVEL] (rgerhards), 2011-07-11 - systemd support: set stdout/stderr to null - thx to Lennart for the patch - added support for the ":omusrmsg:" syntax in configuring user messages -- added support for the ":omfile:" syntax for actions +- added support for the ":omfile:" syntax in configuring user messages --------------------------------------------------------------------------- Version 5.9.1 [V5-DEVEL] (rgerhards), 2011-06-30 - added support for obtaining timestamp for kernel message from message @@ -2371,7 +381,7 @@ Version 5.8.3 [V5-stable] (rgerhards), 2011-07-11 - systemd support: set stdout/stderr to null - thx to Lennart for the patch - added support for the ":omusrmsg:" syntax in configuring user messages -- added support for the ":omfile:" syntax for actions +- added support for the ":omfile:" syntax in configuring user messages Note: previous outchannel syntax will generate a warning message. This may be surprising to some users, but it is quite urgent to alert them of the new syntax as v6 can no longer support the previous one. @@ -2526,7 +536,7 @@ Version 5.7.4 [V5-BETA] (rgerhards), 2011-02-17 - added pmsnare parser module (written by David Lang) - enhanced imfile to support non-cancel input termination -- improved systemd socket activation thanks to Marius Tomaschewski +- improved systemd socket activation thanks to Marius Tomaschweski - improved error reporting for $WorkDirectory non-existance and other detectable problems are now reported, and the work directory is NOT set in this case @@ -3276,7 +1286,7 @@ --------------------------------------------------------------------------- Version 4.6.7 [v4-stable] (rgerhards), 2011-07-11 - added support for the ":omusrmsg:" syntax in configuring user messages -- added support for the ":omfile:" syntax for actions +- added support for the ":omfile:" syntax in configuring user messages --------------------------------------------------------------------------- Version 4.6.6 [v4-stable] (rgerhards), 2011-06-24 - bugfix: memory leak in imtcp & subsystems under some circumstances diff -Nru rsyslog-7.6.0/compat/getifaddrs.c rsyslog-5.10.1/compat/getifaddrs.c --- rsyslog-7.6.0/compat/getifaddrs.c 2014-02-04 12:06:56.000000000 +0000 +++ rsyslog-5.10.1/compat/getifaddrs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,283 +0,0 @@ -#include "config.h" -#ifndef HAVE_GETIFADDRS -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Normally this is defined in but was new for Solaris 11 */ -#ifndef LIFC_ENABLED -#define LIFC_ENABLED 0x20 -#endif - -int getallifaddrs(sa_family_t af, struct ifaddrs **ifap, int64_t flags); -int getallifs(int s, sa_family_t af, struct lifreq **lifr, int *numifs, - int64_t lifc_flags); - -/* - * Create a linked list of `struct ifaddrs' structures, one for each - * address that is UP. If successful, store the list in *ifap and - * return 0. On errors, return -1 and set `errno'. - * - * The storage returned in *ifap is allocated dynamically and can - * only be properly freed by passing it to `freeifaddrs'. - */ -int -getifaddrs(struct ifaddrs **ifap) -{ - int err; - char *cp; - struct ifaddrs *curr; - - if (ifap == NULL) { - errno = EINVAL; - return (-1); - } - *ifap = NULL; - err = getallifaddrs(AF_UNSPEC, ifap, LIFC_ENABLED); - if (err == 0) { - for (curr = *ifap; curr != NULL; curr = curr->ifa_next) { - if ((cp = strchr(curr->ifa_name, ':')) != NULL) - *cp = '\0'; - } - } - return (err); -} - -void -freeifaddrs(struct ifaddrs *ifa) -{ - struct ifaddrs *curr; - - while (ifa != NULL) { - curr = ifa; - ifa = ifa->ifa_next; - free(curr->ifa_name); - free(curr->ifa_addr); - free(curr->ifa_netmask); - free(curr->ifa_dstaddr); - free(curr); - } -} - -/* - * Returns all addresses configured on the system. If flags contain - * LIFC_ENABLED, only the addresses that are UP are returned. - * Address list that is returned by this function must be freed - * using freeifaddrs(). - */ -int -getallifaddrs(sa_family_t af, struct ifaddrs **ifap, int64_t flags) -{ - struct lifreq *buf = NULL; - struct lifreq *lifrp; - struct lifreq lifrl; - int ret; - int s, n, numifs; - struct ifaddrs *curr, *prev; - sa_family_t lifr_af; - int sock4; - int sock6; - int err; - - if ((sock4 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - return (-1); - if ((sock6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - err = errno; - close(sock4); - errno = err; - return (-1); - } - -retry: - /* Get all interfaces from SIOCGLIFCONF */ - ret = getallifs(sock4, af, &buf, &numifs, (flags & ~LIFC_ENABLED)); - if (ret != 0) - goto fail; - - /* - * Loop through the interfaces obtained from SIOCGLIFCOMF - * and retrieve the addresses, netmask and flags. - */ - prev = NULL; - lifrp = buf; - *ifap = NULL; - for (n = 0; n < numifs; n++, lifrp++) { - - /* Prepare for the ioctl call */ - (void) strncpy(lifrl.lifr_name, lifrp->lifr_name, - sizeof (lifrl.lifr_name)); - lifr_af = lifrp->lifr_addr.ss_family; - if (af != AF_UNSPEC && lifr_af != af) - continue; - - s = (lifr_af == AF_INET ? sock4 : sock6); - - if (ioctl(s, SIOCGLIFFLAGS, (caddr_t)&lifrl) < 0) - goto fail; - if ((flags & LIFC_ENABLED) && !(lifrl.lifr_flags & IFF_UP)) - continue; - - /* - * Allocate the current list node. Each node contains data - * for one ifaddrs structure. - */ - curr = calloc(1, sizeof (struct ifaddrs)); - if (curr == NULL) - goto fail; - - if (prev != NULL) { - prev->ifa_next = curr; - } else { - /* First node in the linked list */ - *ifap = curr; - } - prev = curr; - - curr->ifa_flags = lifrl.lifr_flags; - if ((curr->ifa_name = strdup(lifrp->lifr_name)) == NULL) - goto fail; - - curr->ifa_addr = malloc(sizeof (struct sockaddr_storage)); - if (curr->ifa_addr == NULL) - goto fail; - (void) memcpy(curr->ifa_addr, &lifrp->lifr_addr, - sizeof (struct sockaddr_storage)); - - /* Get the netmask */ - if (ioctl(s, SIOCGLIFNETMASK, (caddr_t)&lifrl) < 0) - goto fail; - curr->ifa_netmask = malloc(sizeof (struct sockaddr_storage)); - if (curr->ifa_netmask == NULL) - goto fail; - (void) memcpy(curr->ifa_netmask, &lifrl.lifr_addr, - sizeof (struct sockaddr_storage)); - - /* Get the destination for a pt-pt interface */ - if (curr->ifa_flags & IFF_POINTOPOINT) { - if (ioctl(s, SIOCGLIFDSTADDR, (caddr_t)&lifrl) < 0) - goto fail; - curr->ifa_dstaddr = malloc( - sizeof (struct sockaddr_storage)); - if (curr->ifa_dstaddr == NULL) - goto fail; - (void) memcpy(curr->ifa_dstaddr, &lifrl.lifr_addr, - sizeof (struct sockaddr_storage)); - } else if (curr->ifa_flags & IFF_BROADCAST) { - if (ioctl(s, SIOCGLIFBRDADDR, (caddr_t)&lifrl) < 0) - goto fail; - curr->ifa_broadaddr = malloc( - sizeof (struct sockaddr_storage)); - if (curr->ifa_broadaddr == NULL) - goto fail; - (void) memcpy(curr->ifa_broadaddr, &lifrl.lifr_addr, - sizeof (struct sockaddr_storage)); - } - - } - free(buf); - close(sock4); - close(sock6); - return (0); -fail: - err = errno; - free(buf); - freeifaddrs(*ifap); - *ifap = NULL; - if (err == ENXIO) - goto retry; - close(sock4); - close(sock6); - errno = err; - return (-1); -} - -/* - * Do a SIOCGLIFCONF and store all the interfaces in `buf'. - */ -int -getallifs(int s, sa_family_t af, struct lifreq **lifr, int *numifs, - int64_t lifc_flags) -{ - struct lifnum lifn; - struct lifconf lifc; - size_t bufsize; - char *tmp; - caddr_t *buf = (caddr_t *)lifr; - - lifn.lifn_family = af; - lifn.lifn_flags = lifc_flags; - - *buf = NULL; -retry: - if (ioctl(s, SIOCGLIFNUM, &lifn) < 0) - goto fail; - - /* - * When calculating the buffer size needed, add a small number - * of interfaces to those we counted. We do this to capture - * the interface status of potential interfaces which may have - * been plumbed between the SIOCGLIFNUM and the SIOCGLIFCONF. - */ - bufsize = (lifn.lifn_count + 4) * sizeof (struct lifreq); - - if ((tmp = realloc(*buf, bufsize)) == NULL) - goto fail; - - *buf = tmp; - lifc.lifc_family = af; - lifc.lifc_flags = lifc_flags; - lifc.lifc_len = bufsize; - lifc.lifc_buf = *buf; - if (ioctl(s, SIOCGLIFCONF, (char *)&lifc) < 0) - goto fail; - - *numifs = lifc.lifc_len / sizeof (struct lifreq); - if (*numifs >= (lifn.lifn_count + 4)) { - /* - * If every entry was filled, there are probably - * more interfaces than (lifn.lifn_count + 4). - * Redo the ioctls SIOCGLIFNUM and SIOCGLIFCONF to - * get all the interfaces. - */ - goto retry; - } - return (0); -fail: - free(*buf); - *buf = NULL; - return (-1); -} -#endif /* HAVE_GETIFADDRS */ diff -Nru rsyslog-7.6.0/compat/ifaddrs.h rsyslog-5.10.1/compat/ifaddrs.h --- rsyslog-7.6.0/compat/ifaddrs.h 2014-02-04 12:06:56.000000000 +0000 +++ rsyslog-5.10.1/compat/ifaddrs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -#include "config.h" -#ifndef HAVE_GETIFADDRS -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - */ -#ifndef _IFADDRS_H -#define _IFADDRS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* - * The `getifaddrs' function generates a linked list of these structures. - * Each element of the list describes one network interface. - */ -#if defined(_INT64_TYPE) -struct ifaddrs { - struct ifaddrs *ifa_next; /* Pointer to the next structure. */ - char *ifa_name; /* Name of this network interface. */ - uint64_t ifa_flags; /* Flags as from SIOCGLIFFLAGS ioctl. */ - struct sockaddr *ifa_addr; /* Network address of this interface. */ - struct sockaddr *ifa_netmask; /* Netmask of this interface. */ - union { - /* - * At most one of the following two is valid. If the - * IFF_BROADCAST bit is set in `ifa_flags', then - * `ifa_broadaddr' is valid. If the IFF_POINTOPOINT bit is - * set, then `ifa_dstaddr' is valid. It is never the case that - * both these bits are set at once. - */ - struct sockaddr *ifu_broadaddr; - struct sockaddr *ifu_dstaddr; - } ifa_ifu; - void *ifa_data; /* Address-specific data (may be unused). */ -/* - * This may have been defined in . - */ -#ifndef ifa_broadaddr -#define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ -#endif -#ifndef ifa_dstaddr -#define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of p-to-p link */ -#endif -}; -#endif - -/* - * Create a linked list of `struct ifaddrs' structures, one for each - * network interface on the host machine. If successful, store the - * list in *ifap and return 0. On errors, return -1 and set `errno'. - * - * The storage returned in *ifap is allocated dynamically and can - * only be properly freed by passing it to `freeifaddrs'. - */ -extern int getifaddrs(struct ifaddrs **); - -/* Reclaim the storage allocated by a previous `getifaddrs' call. */ -extern void freeifaddrs(struct ifaddrs *); - - -#ifdef __cplusplus -} -#endif - -#endif /* _IFADDRS_H */ -#endif /* HAVE_GETIFADDRS */ diff -Nru rsyslog-7.6.0/compat/Makefile.am rsyslog-5.10.1/compat/Makefile.am --- rsyslog-7.6.0/compat/Makefile.am 2014-02-04 12:06:56.000000000 +0000 +++ rsyslog-5.10.1/compat/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -noinst_LTLIBRARIES = compat.la - -compat_la_SOURCES = getifaddrs.c ifaddrs.h -compat_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -compat_la_LDFLAGS = -module -avoid-version -compat_la_LIBADD = $(IMUDP_LIBS) diff -Nru rsyslog-7.6.0/compat/Makefile.in rsyslog-5.10.1/compat/Makefile.in --- rsyslog-7.6.0/compat/Makefile.in 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/compat/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,582 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = compat -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -compat_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_compat_la_OBJECTS = compat_la-getifaddrs.lo -compat_la_OBJECTS = $(am_compat_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -compat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(compat_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(compat_la_SOURCES) -DIST_SOURCES = $(compat_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = compat.la -compat_la_SOURCES = getifaddrs.c ifaddrs.h -compat_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -compat_la_LDFLAGS = -module -avoid-version -compat_la_LIBADD = $(IMUDP_LIBS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu compat/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu compat/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -compat.la: $(compat_la_OBJECTS) $(compat_la_DEPENDENCIES) $(EXTRA_compat_la_DEPENDENCIES) - $(AM_V_CCLD)$(compat_la_LINK) $(compat_la_OBJECTS) $(compat_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat_la-getifaddrs.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -compat_la-getifaddrs.lo: getifaddrs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(compat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat_la-getifaddrs.lo -MD -MP -MF $(DEPDIR)/compat_la-getifaddrs.Tpo -c -o compat_la-getifaddrs.lo `test -f 'getifaddrs.c' || echo '$(srcdir)/'`getifaddrs.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/compat_la-getifaddrs.Tpo $(DEPDIR)/compat_la-getifaddrs.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getifaddrs.c' object='compat_la-getifaddrs.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(compat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat_la-getifaddrs.lo `test -f 'getifaddrs.c' || echo '$(srcdir)/'`getifaddrs.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/compile rsyslog-5.10.1/compile --- rsyslog-7.6.0/compile 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/compile 2012-10-17 14:42:37.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. +# Wrapper for compilers which do not understand `-c -o'. -scriptversion=2012-01-04.17; # UTC +scriptversion=2009-10-06.20; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -29,186 +29,21 @@ # bugs to or send patches to # . -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l*) - lib=${1#-l} - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - set x "$@" "$dir/$lib.dll.lib" - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - set x "$@" "$dir/$lib.lib" - break - fi - done - IFS=$save_IFS - - test "$found" != yes && set x "$@" "$lib.lib" - shift - ;; - -L*) - func_file_conv "${1#-L}" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - case $1 in '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. +right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF @@ -218,13 +53,11 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; esac ofile= cfile= +eat= for arg do @@ -233,8 +66,8 @@ else case $1 in -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) @@ -261,10 +94,10 @@ done if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a + # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also + # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi @@ -273,7 +106,7 @@ cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d diff -Nru rsyslog-7.6.0/config.guess rsyslog-5.10.1/config.guess --- rsyslog-7.6.0/config.guess 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/config.guess 2012-10-17 14:42:37.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2009-12-30' # 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 @@ -17,7 +17,9 @@ # 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 . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -55,8 +57,8 @@ Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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." @@ -143,7 +145,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -179,7 +181,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -222,7 +224,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -268,10 +270,7 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -297,7 +296,7 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -396,23 +395,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -482,8 +481,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -496,7 +495,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -553,7 +552,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[4567]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -596,52 +595,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include + sed 's/^ //' << EOF >$dummy.c - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -732,22 +731,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -771,14 +770,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -790,12 +789,13 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -804,18 +804,15 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -861,13 +858,6 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -877,7 +867,7 @@ EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -889,29 +879,20 @@ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf - fi + echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -953,7 +934,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -979,7 +960,7 @@ echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -987,17 +968,14 @@ sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1006,11 +984,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1042,7 +1020,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1070,13 +1048,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1111,8 +1089,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1155,10 +1133,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1184,11 +1162,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1253,9 +1231,6 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1301,13 +1276,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1325,9 +1300,6 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1350,11 +1322,11 @@ #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru rsyslog-7.6.0/config.h.in rsyslog-5.10.1/config.h.in --- rsyslog-7.6.0/config.h.in 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/config.h.in 2012-10-17 14:42:36.000000000 +0000 @@ -3,15 +3,6 @@ /* Defined if debug mode is enabled (its easier to check). */ #undef DEBUG -/* Defined if debugless mode is enabled. */ -#undef DEBUGLESS - -/* Indicator that GnuTLS is present */ -#undef ENABLE_GNUTLS - -/* Indicator that LIBGCRYPT is present */ -#undef ENABLE_LIBGCRYPT - /* Regular expressions support enabled. */ #undef FEATURE_REGEXP @@ -36,9 +27,6 @@ /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME -/* Define to 1 if compiler supports __builtin_expect */ -#undef HAVE_BUILTIN_EXPECT - /* Define to 1 if your system has a working `chown' function. */ #undef HAVE_CHOWN @@ -51,9 +39,6 @@ /* Define to 1 if libdbi supports the new plugin-safe interface */ #undef HAVE_DBI_R -/* Define to 1 if libdbi supports transactions */ -#undef HAVE_DBI_TXSUPP - /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R @@ -88,30 +73,18 @@ /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME -/* set define */ -#undef HAVE_GETIFADDRS - /* Define to 1 if you have the `getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* set define */ -#undef HAVE_GLOB_NOMAGIC - /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `json_object_new_int64' function. */ -#undef HAVE_JSON_OBJECT_NEW_INT64 - /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H -/* Define to 1 if you have the `json-c' library (-ljson-c). */ -#undef HAVE_LIBJSON_C - /* Define to 1 if you have the header file. */ #undef HAVE_LIBNET_H @@ -171,9 +144,6 @@ and to 0 otherwise. */ #undef HAVE_REALLOC -/* Define to 1 if you have the `recvmmsg' function. */ -#undef HAVE_RECVMMSG - /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP @@ -195,8 +165,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SEMAPHORE_H -/* Define to 1 if you have the `setsid' function. */ -#undef HAVE_SETSID +/* Define to 1 if you have the `setid' function. */ +#undef HAVE_SETID /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET @@ -259,12 +229,6 @@ /* Define to 1 if `sa_len' is a member of `struct sockaddr'. */ #undef HAVE_STRUCT_SOCKADDR_SA_LEN -/* Define to 1 if you have the `syscall' function. */ -#undef HAVE_SYSCALL - -/* set define */ -#undef HAVE_SYSINFO_UPTIME - /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H @@ -292,9 +256,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSCALL_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H @@ -304,9 +265,6 @@ /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* set define */ -#undef HAVE_SYS_gettid - /* Define to 1 if you have the `ttyname_r' function. */ #undef HAVE_TTYNAME_R @@ -418,6 +376,9 @@ /* network support is integrated. */ #undef SYSLOG_INET +/* Description */ +#undef SYSLOG_UNIXAF + /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME @@ -427,9 +388,6 @@ /* Define if you want to use GSSAPI */ #undef USE_GSSAPI -/* Define if you want to enable libuuid support */ -#undef USE_LIBUUID - /* Define if you want to enable zlib support */ #undef USE_NETZIP @@ -469,10 +427,6 @@ /* Version number of package */ #undef VERSION -/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a - `char[]'. */ -#undef YYTEXT_POINTER - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff -Nru rsyslog-7.6.0/config.log rsyslog-5.10.1/config.log --- rsyslog-7.6.0/config.log 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/config.log 2014-03-03 22:30:14.000000000 +0000 @@ -0,0 +1,355 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rsyslog configure 5.10.1, which was +generated by GNU Autoconf 2.67. Invocation command line was + + $ ./configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --mandir=${prefix}/share/man --infodir=${prefix}/share/info --enable-mysql --enable-pgsql --enable-mail --enable-imfile --enable-gssapi-krb5 --enable-gnutls --enable-relp CFLAGS=-Wall -g -O2 + +## --------- ## +## Platform. ## +## --------- ## + +hostname = oven +uname -m = x86_64 +uname -r = 2.6.32-46-server +uname -s = Linux +uname -v = #108-Ubuntu SMP Thu Apr 11 16:11:15 UTC 2013 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /usr/sbin +PATH: /usr/bin +PATH: /sbin +PATH: /bin +PATH: /usr/bin/X11 + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:2839: checking for a BSD-compatible install +configure:2907: result: /usr/bin/install -c +configure:2918: checking whether build environment is sane + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set=set +ac_cv_env_CFLAGS_value='-Wall -g -O2' +ac_cv_env_CPPFLAGS_set=set +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_GNUTLS_CFLAGS_set= +ac_cv_env_GNUTLS_CFLAGS_value= +ac_cv_env_GNUTLS_LIBS_set= +ac_cv_env_GNUTLS_LIBS_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBLOGGING_CFLAGS_set= +ac_cv_env_LIBLOGGING_CFLAGS_value= +ac_cv_env_LIBLOGGING_LIBS_set= +ac_cv_env_LIBLOGGING_LIBS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_PKG_CONFIG_LIBDIR_set= +ac_cv_env_PKG_CONFIG_LIBDIR_value= +ac_cv_env_PKG_CONFIG_PATH_set= +ac_cv_env_PKG_CONFIG_PATH_value= +ac_cv_env_PKG_CONFIG_set= +ac_cv_env_PKG_CONFIG_value= +ac_cv_env_RELP_CFLAGS_set= +ac_cv_env_RELP_CFLAGS_value= +ac_cv_env_RELP_LIBS_set= +ac_cv_env_RELP_LIBS_value= +ac_cv_env_build_alias_set=set +ac_cv_env_build_alias_value=x86_64-linux-gnu +ac_cv_env_host_alias_set=set +ac_cv_env_host_alias_value=x86_64-linux-gnu +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_path_install='/usr/bin/install -c' + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='' +AMDEPBACKSLASH='' +AMDEP_FALSE='' +AMDEP_TRUE='' +AMTAR='' +AM_BACKSLASH='' +AM_DEFAULT_VERBOSITY='' +AR='' +AUTOCONF='' +AUTOHEADER='' +AUTOMAKE='' +AWK='' +CC='' +CCDEPMODE='' +CFLAGS='-Wall -g -O2' +CPP='' +CPPFLAGS='' +CURL_CFLAGS='' +CURL_LIBS='' +CYGPATH_W='' +DEFS='' +DEPDIR='' +DL_LIBS='' +DSYMUTIL='' +DUMPBIN='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='' +ENABLE_DIAGTOOLS_FALSE='' +ENABLE_DIAGTOOLS_TRUE='' +ENABLE_ELASTICSEARCH_FALSE='' +ENABLE_ELASTICSEARCH_TRUE='' +ENABLE_EXTENDED_TESTS_FALSE='' +ENABLE_EXTENDED_TESTS_TRUE='' +ENABLE_GNUTLS_FALSE='' +ENABLE_GNUTLS_TRUE='' +ENABLE_GSSAPI_FALSE='' +ENABLE_GSSAPI_TRUE='' +ENABLE_GUI_FALSE='' +ENABLE_GUI_TRUE='' +ENABLE_IMDIAG_FALSE='' +ENABLE_IMDIAG_TRUE='' +ENABLE_IMFILE_FALSE='' +ENABLE_IMFILE_TRUE='' +ENABLE_IMKLOG_BSD_FALSE='' +ENABLE_IMKLOG_BSD_TRUE='' +ENABLE_IMKLOG_FALSE='' +ENABLE_IMKLOG_LINUX_FALSE='' +ENABLE_IMKLOG_LINUX_TRUE='' +ENABLE_IMKLOG_SOLARIS_FALSE='' +ENABLE_IMKLOG_SOLARIS_TRUE='' +ENABLE_IMKLOG_TRUE='' +ENABLE_IMPSTATS_FALSE='' +ENABLE_IMPSTATS_TRUE='' +ENABLE_IMPTCP_FALSE='' +ENABLE_IMPTCP_TRUE='' +ENABLE_IMSOLARIS_FALSE='' +ENABLE_IMSOLARIS_TRUE='' +ENABLE_IMTEMPLATE_FALSE='' +ENABLE_IMTEMPLATE_TRUE='' +ENABLE_INET_FALSE='' +ENABLE_INET_TRUE='' +ENABLE_MAIL_FALSE='' +ENABLE_MAIL_TRUE='' +ENABLE_MMSNMPTRAPD_FALSE='' +ENABLE_MMSNMPTRAPD_TRUE='' +ENABLE_MYSQL_FALSE='' +ENABLE_MYSQL_TESTS_FALSE='' +ENABLE_MYSQL_TESTS_TRUE='' +ENABLE_MYSQL_TRUE='' +ENABLE_OMDBALERTING_FALSE='' +ENABLE_OMDBALERTING_TRUE='' +ENABLE_OMHDFS_FALSE='' +ENABLE_OMHDFS_TRUE='' +ENABLE_OMLIBDBI_FALSE='' +ENABLE_OMLIBDBI_TRUE='' +ENABLE_OMPROG_FALSE='' +ENABLE_OMPROG_TRUE='' +ENABLE_OMRULESET_FALSE='' +ENABLE_OMRULESET_TRUE='' +ENABLE_OMSTDOUT_FALSE='' +ENABLE_OMSTDOUT_TRUE='' +ENABLE_OMTEMPLATE_FALSE='' +ENABLE_OMTEMPLATE_TRUE='' +ENABLE_OMUDPSPOOF_FALSE='' +ENABLE_OMUDPSPOOF_TRUE='' +ENABLE_OMUXSOCK_FALSE='' +ENABLE_OMUXSOCK_TRUE='' +ENABLE_ORACLE_FALSE='' +ENABLE_ORACLE_TRUE='' +ENABLE_PGSQL_FALSE='' +ENABLE_PGSQL_TRUE='' +ENABLE_PMAIXFORWARDEDFROM_FALSE='' +ENABLE_PMAIXFORWARDEDFROM_TRUE='' +ENABLE_PMCISCONAMES_FALSE='' +ENABLE_PMCISCONAMES_TRUE='' +ENABLE_PMLASTMSG_FALSE='' +ENABLE_PMLASTMSG_TRUE='' +ENABLE_PMRFC3164SD_FALSE='' +ENABLE_PMRFC3164SD_TRUE='' +ENABLE_PMSNARE_FALSE='' +ENABLE_PMSNARE_TRUE='' +ENABLE_REGEXP_FALSE='' +ENABLE_REGEXP_TRUE='' +ENABLE_RELP_FALSE='' +ENABLE_RELP_TRUE='' +ENABLE_RFC3195_FALSE='' +ENABLE_RFC3195_TRUE='' +ENABLE_RSYSLOGD_FALSE='' +ENABLE_RSYSLOGD_TRUE='' +ENABLE_RSYSLOGRT_FALSE='' +ENABLE_RSYSLOGRT_TRUE='' +ENABLE_SMCUSTBINDCDR_FALSE='' +ENABLE_SMCUSTBINDCDR_TRUE='' +ENABLE_SNMP_FALSE='' +ENABLE_SNMP_TRUE='' +ENABLE_TESTBENCH_FALSE='' +ENABLE_TESTBENCH_TRUE='' +ENABLE_ZLIB_FALSE='' +ENABLE_ZLIB_TRUE='' +EXEEXT='' +FGREP='' +GNUTLS_CFLAGS='' +GNUTLS_LIBS='' +GREP='' +GSS_LIBS='' +HAVE_CURL_CONFIG='' +HAVE_JAVAC='' +HAVE_MYSQL_CONFIG='' +HAVE_ORACLE_CONFIG='' +HAVE_PGSQL_CONFIG='' +HAVE_SYSTEMD_FALSE='' +HAVE_SYSTEMD_TRUE='' +HAVE_VALGRIND_FALSE='' +HAVE_VALGRIND_TRUE='' +IMUDP_LIBS='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='' +LD='' +LDFLAGS='' +LIBDBI_CFLAGS='' +LIBDBI_LIBS='' +LIBLOGGING_CFLAGS='' +LIBLOGGING_LIBS='' +LIBOBJS='' +LIBS='' +LIBTOOL='' +LIPO='' +LN_S='' +LTLIBOBJS='' +MAKEINFO='' +MKDIR_P='' +MYSQL_CFLAGS='' +MYSQL_LIBS='' +NM='' +NMEDIT='' +OBJDUMP='' +OBJEXT='' +ORACLE_CFLAGS='' +ORACLE_LIBS='' +OTOOL64='' +OTOOL='' +PACKAGE='' +PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com' +PACKAGE_NAME='rsyslog' +PACKAGE_STRING='rsyslog 5.10.1' +PACKAGE_TARNAME='rsyslog' +PACKAGE_URL='' +PACKAGE_VERSION='5.10.1' +PATH_SEPARATOR=':' +PGSQL_CFLAGS='' +PGSQL_LIBS='' +PKG_CONFIG='' +PKG_CONFIG_LIBDIR='' +PKG_CONFIG_PATH='' +PTHREADS_CFLAGS='' +PTHREADS_LIBS='' +RANLIB='' +RELP_CFLAGS='' +RELP_LIBS='' +RSRT_CFLAGS='' +RSRT_LIBS='' +RT_LIBS='' +SED='' +SET_MAKE='' +SHELL='/bin/bash' +SNMP_CFLAGS='' +SNMP_LIBS='' +SOL_LIBS='' +STRIP='' +UDPSPOOF_CFLAGS='' +UDPSPOOF_LIBS='' +VERSION='' +WITH_MODDIRS_FALSE='' +WITH_MODDIRS_TRUE='' +ZLIB_LIBS='' +ac_ct_CC='' +ac_ct_DUMPBIN='' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='' +am__fastdepCC_FALSE='' +am__fastdepCC_TRUE='' +am__include='' +am__isrc='' +am__leading_dot='' +am__quote='' +am__tar='' +am__untar='' +bindir='${exec_prefix}/bin' +build='x86_64-linux-gnu' +build_alias='x86_64-linux-gnu' +build_cpu='' +build_os='' +build_vendor='' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +dvidir='${docdir}' +exec_prefix='NONE' +have_valgrind='' +host='x86_64-linux-gnu' +host_alias='x86_64-linux-gnu' +host_cpu='' +host_os='' +host_vendor='' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${prefix}/share/info' +install_sh='' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +lt_ECHO='echo' +mandir='${prefix}/share/man' +mkdir_p='' +moddirs='' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +systemdsystemunitdir='' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "rsyslog" +#define PACKAGE_TARNAME "rsyslog" +#define PACKAGE_VERSION "5.10.1" +#define PACKAGE_STRING "rsyslog 5.10.1" +#define PACKAGE_BUGREPORT "rsyslog@lists.adiscon.com" +#define PACKAGE_URL "" + +configure: caught signal 2 +configure: exit 1 diff -Nru rsyslog-7.6.0/config.sub rsyslog-5.10.1/config.sub --- rsyslog-7.6.0/config.sub 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/config.sub 2012-10-17 14:42:37.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,7 +21,9 @@ # 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 . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -74,8 +76,8 @@ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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." @@ -122,18 +124,13 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -160,8 +157,8 @@ os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -177,10 +174,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -249,22 +246,17 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -290,39 +282,29 @@ | moxie \ | mt \ | msp430 \ - | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ - | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | rl78 | rx \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | v850 | v850e \ | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; @@ -332,21 +314,6 @@ basic_machine=mt-unknown ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -361,25 +328,21 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ - | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ - | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -405,29 +368,26 @@ | mmix-* \ | mt-* \ | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ + | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ + | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -452,7 +412,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -522,20 +482,11 @@ basic_machine=powerpc-ibm os=-cnk ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -567,7 +518,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16 | cr16-*) + cr16) basic_machine=cr16-unknown os=-elf ;; @@ -725,6 +676,7 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -782,7 +734,7 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -821,18 +773,10 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; - msys) - basic_machine=i386-pc - os=-msys - ;; mvs) basic_machine=i370-ibm os=-mvs ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -897,12 +841,6 @@ np1) basic_machine=np1-gould ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -985,10 +923,9 @@ ;; power) basic_machine=power-ibm ;; - ppc | ppcbe) basic_machine=powerpc-unknown + ppc) basic_machine=powerpc-unknown ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1082,9 +1019,6 @@ basic_machine=i860-stratus os=-sysv4 ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; sun2) basic_machine=m68000-sun ;; @@ -1141,8 +1075,25 @@ basic_machine=t90-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; tile*) - basic_machine=$basic_machine-unknown + basic_machine=tile-unknown os=-linux-gnu ;; tx39) @@ -1212,9 +1163,6 @@ xps | xps100) basic_machine=xps100-honeywell ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1312,11 +1260,11 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1352,9 +1300,8 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1401,7 +1348,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1450,7 +1397,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1495,8 +1442,8 @@ -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1519,10 +1466,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1534,17 +1481,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1564,11 +1502,14 @@ ;; m68000-sun) os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1595,7 +1536,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff -Nru rsyslog-7.6.0/configure rsyslog-5.10.1/configure --- rsyslog-7.6.0/configure 2014-02-12 12:06:30.000000000 +0000 +++ rsyslog-5.10.1/configure 2012-10-17 14:42:34.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for rsyslog 7.6.0. +# Generated by GNU Autoconf 2.67 for rsyslog 5.10.1. # # Report bugs to . # @@ -91,7 +91,6 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -174,15 +173,7 @@ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" +test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -225,18 +216,11 @@ # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -544,8 +528,155 @@ # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + test -n "$DJDIR" || exec 7<&0 &1 @@ -570,8 +701,8 @@ # Identity of this package. PACKAGE_NAME='rsyslog' PACKAGE_TARNAME='rsyslog' -PACKAGE_VERSION='7.6.0' -PACKAGE_STRING='rsyslog 7.6.0' +PACKAGE_VERSION='5.10.1' +PACKAGE_STRING='rsyslog 5.10.1' PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com' PACKAGE_URL='' @@ -615,34 +746,22 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS -ENABLE_OMHIREDIS_FALSE -ENABLE_OMHIREDIS_TRUE -HIREDIS_LIBS -HIREDIS_CFLAGS -ENABLE_OMRABBITMQ_FALSE -ENABLE_OMRABBITMQ_TRUE -RABBITMQ_LIBS -RABBITMQ_CFLAGS -ENABLE_OMZMQ3_FALSE -ENABLE_OMZMQ3_TRUE -ENABLE_IMZMQ3_FALSE -ENABLE_IMZMQ3_TRUE -CZMQ_LIBS -CZMQ_CFLAGS -ENABLE_OMMONGODB_FALSE -ENABLE_OMMONGODB_TRUE -LIBMONGO_CLIENT_LIBS -LIBMONGO_CLIENT_CFLAGS ENABLE_OMHDFS_FALSE ENABLE_OMHDFS_TRUE ENABLE_MMSNMPTRAPD_FALSE ENABLE_MMSNMPTRAPD_TRUE +ENABLE_OMTEMPLATE_FALSE +ENABLE_OMTEMPLATE_TRUE +ENABLE_IMTEMPLATE_FALSE +ENABLE_IMTEMPLATE_TRUE ENABLE_SMCUSTBINDCDR_FALSE ENABLE_SMCUSTBINDCDR_TRUE ENABLE_OMUXSOCK_FALSE ENABLE_OMUXSOCK_TRUE ENABLE_GUI_FALSE ENABLE_GUI_TRUE +ENABLE_OMDBALERTING_FALSE +ENABLE_OMDBALERTING_TRUE ENABLE_OMRULESET_FALSE ENABLE_OMRULESET_TRUE ENABLE_PMRFC3164SD_FALSE @@ -655,8 +774,6 @@ ENABLE_PMCISCONAMES_TRUE ENABLE_PMLASTMSG_FALSE ENABLE_PMLASTMSG_TRUE -ENABLE_OMJOURNAL_FALSE -ENABLE_OMJOURNAL_TRUE ENABLE_OMSTDOUT_FALSE ENABLE_OMSTDOUT_TRUE UDPSPOOF_LIBS @@ -667,8 +784,6 @@ ENABLE_OMPROG_TRUE ENABLE_IMPSTATS_FALSE ENABLE_IMPSTATS_TRUE -ENABLE_IMTTCP_FALSE -ENABLE_IMTTCP_TRUE ENABLE_IMPTCP_FALSE ENABLE_IMPTCP_TRUE ENABLE_IMSOLARIS_FALSE @@ -681,41 +796,10 @@ ENABLE_RFC3195_TRUE LIBLOGGING_LIBS LIBLOGGING_CFLAGS -RST2MAN -ENABLE_GUARDTIME_FALSE -ENABLE_GUARDTIME_TRUE -GUARDTIME_LIBS -GUARDTIME_CFLAGS ENABLE_RELP_FALSE ENABLE_RELP_TRUE RELP_LIBS RELP_CFLAGS -ENABLE_MMRFC5424ADDHMAC_FALSE -ENABLE_MMRFC5424ADDHMAC_TRUE -OPENSSL_LIBS -OPENSSL_CFLAGS -ENABLE_MMPSTRUCDATA_FALSE -ENABLE_MMPSTRUCDATA_TRUE -ENABLE_MMFIELDS_FALSE -ENABLE_MMFIELDS_TRUE -ENABLE_MMSEQUENCE_FALSE -ENABLE_MMSEQUENCE_TRUE -ENABLE_MMCOUNT_FALSE -ENABLE_MMCOUNT_TRUE -ENABLE_MMUTF8FIX_FALSE -ENABLE_MMUTF8FIX_TRUE -ENABLE_MMANON_FALSE -ENABLE_MMANON_TRUE -ENABLE_MMAUDIT_FALSE -ENABLE_MMAUDIT_TRUE -ENABLE_MMJSONPARSE_FALSE -ENABLE_MMJSONPARSE_TRUE -ENABLE_MMNORMALIZE_FALSE -ENABLE_MMNORMALIZE_TRUE -LIBLOGNORM_LIBS -LIBLOGNORM_CFLAGS -LIBEE_LIBS -LIBEE_CFLAGS ENABLE_IMDIAG_FALSE ENABLE_IMDIAG_TRUE ENABLE_MAIL_FALSE @@ -728,28 +812,17 @@ ENABLE_RSYSLOGD_TRUE RSRT_LIBS RSRT_CFLAGS -RSRT_LIBS1 -RSRT_CFLAGS1 ENABLE_RSYSLOGRT_FALSE ENABLE_RSYSLOGRT_TRUE -LIBGCRYPT_LIBS -LIBGCRYPT_CFLAGS -ENABLE_LIBGCRYPT_FALSE -ENABLE_LIBGCRYPT_TRUE -HAVE_LIBGCRYPT_CONFIG ENABLE_GNUTLS_FALSE ENABLE_GNUTLS_TRUE GNUTLS_LIBS GNUTLS_CFLAGS -ENABLE_ELASTICSEARCH_FALSE -ENABLE_ELASTICSEARCH_TRUE -LIBM CURL_LIBS CURL_CFLAGS -ENABLE_UUID_FALSE -ENABLE_UUID_TRUE -LIBUUID_LIBS -LIBUUID_CFLAGS +ENABLE_ELASTICSEARCH_FALSE +ENABLE_ELASTICSEARCH_TRUE +HAVE_CURL_CONFIG SNMP_LIBS SNMP_CFLAGS ENABLE_SNMP_FALSE @@ -773,8 +846,6 @@ ENABLE_MYSQL_FALSE ENABLE_MYSQL_TRUE HAVE_MYSQL_CONFIG -ENABLE_USERTOOLS_FALSE -ENABLE_USERTOOLS_TRUE ENABLE_DIAGTOOLS_FALSE ENABLE_DIAGTOOLS_TRUE HAVE_SYSTEMD_FALSE @@ -782,12 +853,6 @@ systemdsystemunitdir ENABLE_INET_FALSE ENABLE_INET_TRUE -ENABLE_IMJOURNAL_FALSE -ENABLE_IMJOURNAL_TRUE -LIBSYSTEMD_JOURNAL_LIBS -LIBSYSTEMD_JOURNAL_CFLAGS -ENABLE_IMKMSG_FALSE -ENABLE_IMKMSG_TRUE ENABLE_IMKLOG_SOLARIS_FALSE ENABLE_IMKLOG_SOLARIS_TRUE ENABLE_IMKLOG_LINUX_FALSE @@ -814,12 +879,6 @@ DL_LIBS RT_LIBS SOL_LIBS -JSON_C_LIBS -JSON_C_CFLAGS -LIBLOGGING_STDLOG_LIBS -LIBLOGGING_STDLOG_CFLAGS -LIBESTR_LIBS -LIBESTR_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG @@ -828,11 +887,9 @@ LIPO NMEDIT DSYMUTIL -MANIFEST_TOOL +lt_ECHO RANLIB -ac_ct_AR AR -DLLTOOL OBJDUMP LN_S NM @@ -850,11 +907,7 @@ build_cpu build LIBTOOL -YFLAGS -YACC -LEXLIB -LEX_OUTPUT_ROOT -LEX +HAVE_JAVAC HAVE_VALGRIND_FALSE HAVE_VALGRIND_TRUE have_valgrind @@ -864,7 +917,6 @@ am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE -am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -880,8 +932,6 @@ CC AM_BACKSLASH AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V am__untar am__tar AMTAR @@ -953,82 +1003,61 @@ with_pic enable_fast_install with_gnu_ld -with_sysroot enable_libtool_lock with_moddirs enable_largefile enable_regexp enable_zlib enable_gssapi_krb5 +enable_pthreads enable_klog -enable_kmsg -enable_imjournal +enable_unix enable_inet enable_fsstnd enable_unlimited_select with_systemdsystemunitdir enable_debug enable_rtinst -enable_debugless enable_valgrind enable_memcheck enable_diagtools -enable_usertools enable_mysql enable_pgsql enable_oracle enable_libdbi enable_snmp -enable_uuid enable_elasticsearch enable_gnutls -enable_libgcrypt enable_rsyslogrt enable_rsyslogd enable_extended_tests enable_mysql_tests enable_mail enable_imdiag -enable_mmnormalize -enable_mmjsonparse -enable_mmaudit -enable_mmanon -enable_mmutf8fix -enable_mmcount -enable_mmsequence -enable_mmfields -enable_mmpstrucdata -enable_mmrfc5424addhmac enable_relp -enable_guardtime -enable_cached_man_pages enable_rfc3195 enable_testbench enable_imfile enable_imsolaris enable_imptcp -enable_imttcp enable_impstats enable_omprog enable_omudpspoof enable_omstdout -enable_omjournal enable_pmlastmsg enable_pmcisconames enable_pmaixforwardedfrom enable_pmsnare enable_pmrfc3164sd enable_omruleset +enable_omdbalerting enable_gui enable_omuxsock -enable_sm_cust_bindcdr +enable_smcustbindcdr +enable_imtemplate +enable_omtemplate enable_mmsnmptrapd enable_omhdfs -enable_ommongodb -enable_imzmq3 -enable_omzmq3 -enable_omrabbitmq -enable_omhiredis ' ac_precious_vars='build_alias host_alias @@ -1039,45 +1068,15 @@ LIBS CPPFLAGS CPP -YACC -YFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR -LIBESTR_CFLAGS -LIBESTR_LIBS -LIBLOGGING_STDLOG_CFLAGS -LIBLOGGING_STDLOG_LIBS -JSON_C_CFLAGS -JSON_C_LIBS -LIBSYSTEMD_JOURNAL_CFLAGS -LIBSYSTEMD_JOURNAL_LIBS -LIBUUID_CFLAGS -LIBUUID_LIBS -CURL_CFLAGS -CURL_LIBS GNUTLS_CFLAGS GNUTLS_LIBS -LIBEE_CFLAGS -LIBEE_LIBS -LIBLOGNORM_CFLAGS -LIBLOGNORM_LIBS -OPENSSL_CFLAGS -OPENSSL_LIBS RELP_CFLAGS RELP_LIBS -GUARDTIME_CFLAGS -GUARDTIME_LIBS LIBLOGGING_CFLAGS -LIBLOGGING_LIBS -LIBMONGO_CLIENT_CFLAGS -LIBMONGO_CLIENT_LIBS -CZMQ_CFLAGS -CZMQ_LIBS -RABBITMQ_CFLAGS -RABBITMQ_LIBS -HIREDIS_CFLAGS -HIREDIS_LIBS' +LIBLOGGING_LIBS' # Initialize some variables set by options. @@ -1482,7 +1481,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1620,7 +1619,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rsyslog 7.6.0 to adapt to many kinds of systems. +\`configure' configures rsyslog 5.10.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1690,7 +1689,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rsyslog 7.6.0:";; + short | recursive ) echo "Configuration of rsyslog 5.10.1:";; esac cat <<\_ACEOF @@ -1711,32 +1710,26 @@ --enable-regexp Enable regular expressions support [default=yes] --enable-zlib Enable zlib compression support [default=yes] --enable-gssapi-krb5 Enable GSSAPI Kerberos 5 support [default=no] + --enable-pthreads Enable multithreading via pthreads [default=yes] --enable-klog Integrated klog functionality [default=yes] - --enable-kmsg Kmsg structured kernel logs functionality - [default=no] - --enable-imjournal Systemd journal message import [default=no] + --disable-unix Disable support for unix --enable-inet Enable networking support [default=yes] --disable-fsstnd Disable support for FSSTND --enable-unlimited-select Enable unlimited select() syscall [default=no] --enable-debug Enable debug mode [default=no] --enable-rtinst Enable runtime instrumentation mode [default=no] - --enable-debugless Enable runtime instrumentation mode [default=no] --enable-valgrind Enable valgrind support settings [default=no] --enable-memcheck Enable extended memory check support [default=no] --enable-diagtools Enable diagnostic tools [default=no] - --enable-usertools Enable end user tools [default=no] --enable-mysql Enable MySql database support [default=no] --enable-pgsql Enable PostgreSQL database support [default=no] --enable-oracle Enable native Oracle database support [default=no]. (Check your ORACLE_HOME environment variable!) --enable-libdbi Enable libdbi database support [default=no] --enable-snmp Enable SNMP support [default=no] - --enable-uuid Enable support for uuid generation [default=yes] --enable-elasticsearch Enable elasticsearch output module [default=no] --enable-gnutls Enable GNU TLS support [default=no] - --enable-libgcrypt Enable log file encryption support (libgcrypt) - [default=yes] --enable-rsyslogrt Build rsyslogrt [default=yes] --enable-rsyslogd Build rsyslogd [default=yes] --enable-extended-tests extended testbench [default=no] @@ -1744,62 +1737,38 @@ [default=no] --enable-mail Enable mail support [default=no] --enable-imdiag Enable imdiag [default=no] - --enable-mmnormalize Enable building mmnormalize support [default=no] - --enable-mmjsonparse Enable building mmjsonparse support [default=no] - --enable-mmaudit Enable building mmaudit support [default=no] - --enable-mmanon Enable building mmanon support [default=no] - --enable-mmutf8fix Enable building mmutf8fix support [default=no] - --enable-mmcount Enable message counting [default=no] - --enable-mmsequence Enable sequence generator [default=no] - --enable-mmfields Enable building mmfields support [default=no] - --enable-mmpstrucdata Enable building mmpstrucdata support [default=no] - --enable-mmrfc5424addhmac - Enable building mmrfc5424addhmac support - [default=no] --enable-relp Enable RELP support [default=no] - --enable-guardtime Enable log file signing support (via GuardTime) - [default=no] - --enable-cached-man-pages - Enable using cached versions of man files (avoid - rst2man) [default=no] --enable-rfc3195 Enable RFC3195 support [default=no] --enable-testbench testbench enabled [default=yes] --enable-imfile file input module enabled [default=no] --enable-imsolaris solaris input module enabled [default=no] --enable-imptcp plain tcp input module enabled [default=no] - --enable-imttcp threaded plain tcp input module enabled [default=no] --enable-impstats periodic statistics module enabled [default=no] --enable-omprog Compiles omprog module [default=no] --enable-omudpspoof Compiles omudpspoof module [default=no] --enable-omstdout Compiles stdout module [default=no] - --enable-omjournal Compiles omjournal [default=no] --enable-pmlastmsg Compiles lastmsg parser module [default=no] --enable-pmcisconames Compiles cisconames parser module [default=no] --enable-pmaixforwardedfrom Compiles aixforwardedfrom parser module [default=no] --enable-pmsnare Compiles snare parser module [default=no] --enable-pmrfc3164sd Compiles rfc3164sd parser module [default=no] - --enable-omruleset Compiles ruleset forwarding module [default=no] + --enable-omruleset Compiles ruleset forwarding module [default=yes] + --enable-omdbalerting Compiles omdbalerting module [default=no] --enable-gui Enable GUI programs [default=no] --enable-omuxsock Compiles omuxsock module [default=no] - --enable-sm_cust_bindcdr - Compiles sm_cust_bindcdr module [default=no] + --enable-smcustbindcdr Compiles smcustbindcdr module [default=no] + --enable-imtemplate Compiles imtemplate template module [default=no] + --enable-omtemplate Compiles omtemplate template module [default=no] --enable-mmsnmptrapd Compiles mmsnmptrapd module [default=no] --enable-omhdfs Compiles omhdfs template module [default=no] - --enable-ommongodb Compiles ommongodb template module [default=no] - --enable-imzmq3 Compiles imzmq3 output module [default=no] - --enable-omzmq3 Compiles omzmq3 output module [default=no] - --enable-omrabbitmq Compiles omrabbitmq output module [default=no] - --enable-omhiredis Compiles omhiredis template module [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + --with-pic try to use only PIC/non-PIC objects [default=use both] --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-moddirs=DIRS Additional module search paths appended to [$libdir/rsyslog] --with-systemdsystemunitdir=DIR @@ -1814,76 +1783,20 @@ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. - YFLAGS The list of arguments that will be passed by default to $YACC. - This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path - LIBESTR_CFLAGS - C compiler flags for LIBESTR, overriding pkg-config - LIBESTR_LIBS - linker flags for LIBESTR, overriding pkg-config - LIBLOGGING_STDLOG_CFLAGS - C compiler flags for LIBLOGGING_STDLOG, overriding pkg-config - LIBLOGGING_STDLOG_LIBS - linker flags for LIBLOGGING_STDLOG, overriding pkg-config - JSON_C_CFLAGS - C compiler flags for JSON_C, overriding pkg-config - JSON_C_LIBS linker flags for JSON_C, overriding pkg-config - LIBSYSTEMD_JOURNAL_CFLAGS - C compiler flags for LIBSYSTEMD_JOURNAL, overriding pkg-config - LIBSYSTEMD_JOURNAL_LIBS - linker flags for LIBSYSTEMD_JOURNAL, overriding pkg-config - LIBUUID_CFLAGS - C compiler flags for LIBUUID, overriding pkg-config - LIBUUID_LIBS - linker flags for LIBUUID, overriding pkg-config - CURL_CFLAGS C compiler flags for CURL, overriding pkg-config - CURL_LIBS linker flags for CURL, overriding pkg-config GNUTLS_CFLAGS C compiler flags for GNUTLS, overriding pkg-config GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config - LIBEE_CFLAGS - C compiler flags for LIBEE, overriding pkg-config - LIBEE_LIBS linker flags for LIBEE, overriding pkg-config - LIBLOGNORM_CFLAGS - C compiler flags for LIBLOGNORM, overriding pkg-config - LIBLOGNORM_LIBS - linker flags for LIBLOGNORM, overriding pkg-config - OPENSSL_CFLAGS - C compiler flags for OPENSSL, overriding pkg-config - OPENSSL_LIBS - linker flags for OPENSSL, overriding pkg-config RELP_CFLAGS C compiler flags for RELP, overriding pkg-config RELP_LIBS linker flags for RELP, overriding pkg-config - GUARDTIME_CFLAGS - C compiler flags for GUARDTIME, overriding pkg-config - GUARDTIME_LIBS - linker flags for GUARDTIME, overriding pkg-config LIBLOGGING_CFLAGS C compiler flags for LIBLOGGING, overriding pkg-config LIBLOGGING_LIBS linker flags for LIBLOGGING, overriding pkg-config - LIBMONGO_CLIENT_CFLAGS - C compiler flags for LIBMONGO_CLIENT, overriding pkg-config - LIBMONGO_CLIENT_LIBS - linker flags for LIBMONGO_CLIENT, overriding pkg-config - CZMQ_CFLAGS C compiler flags for CZMQ, overriding pkg-config - CZMQ_LIBS linker flags for CZMQ, overriding pkg-config - RABBITMQ_CFLAGS - C compiler flags for RABBITMQ, overriding pkg-config - RABBITMQ_LIBS - linker flags for RABBITMQ, overriding pkg-config - HIREDIS_CFLAGS - C compiler flags for HIREDIS, overriding pkg-config - HIREDIS_LIBS - linker flags for HIREDIS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1951,8 +1864,8 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rsyslog configure 7.6.0 -generated by GNU Autoconf 2.68 +rsyslog configure 5.10.1 +generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1998,7 +1911,7 @@ ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -2035,7 +1948,7 @@ ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -2048,10 +1961,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2118,7 +2031,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2127,7 +2040,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel @@ -2168,7 +2081,7 @@ ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -2182,7 +2095,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2200,7 +2113,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile @@ -2245,7 +2158,7 @@ # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -2258,7 +2171,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2313,7 +2226,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func @@ -2326,7 +2239,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2367,7 +2280,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type @@ -2380,7 +2293,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2420,7 +2333,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_find_uintX_t @@ -2433,7 +2346,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : +if eval "test \"\${$4+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2477,7 +2390,7 @@ eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_member @@ -2492,7 +2405,7 @@ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2523,15 +2436,15 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rsyslog $as_me 7.6.0, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by rsyslog $as_me 5.10.1, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2789,7 +2702,7 @@ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2926,7 +2839,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3013,11 +2926,11 @@ ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -3103,7 +3016,7 @@ set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -3143,7 +3056,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -3196,7 +3109,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3247,7 +3160,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -3287,7 +3200,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3345,7 +3258,7 @@ # Define the identity of the package. PACKAGE='rsyslog' - VERSION='7.6.0' + VERSION='5.10.1' cat >>confdefs.h <<_ACEOF @@ -3375,11 +3288,11 @@ # We need awk for the "check" target. 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}' +# Always define AMTAR for backward compatibility. -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' @@ -3396,33 +3309,6 @@ no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi AM_BACKSLASH='\' @@ -3483,7 +3369,6 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' - am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3504,7 +3389,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3544,7 +3429,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3597,7 +3482,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3637,7 +3522,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3696,7 +3581,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3740,7 +3625,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3795,7 +3680,7 @@ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3910,7 +3795,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3953,7 +3838,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4012,7 +3897,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -4023,7 +3908,7 @@ ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4064,7 +3949,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4074,7 +3959,7 @@ ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4111,7 +3996,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -4189,7 +4074,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -4288,7 +4173,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4297,7 +4182,6 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. - rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4357,7 +4241,7 @@ break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) + msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -4425,7 +4309,7 @@ CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -4541,7 +4425,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -4553,7 +4437,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4616,7 +4500,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4683,7 +4567,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4812,7 +4696,7 @@ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : +if test "x$ac_cv_header_minix_config_h" = x""yes; then : MINIX=yes else MINIX= @@ -4834,7 +4718,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4878,7 +4762,7 @@ set dummy valgrind; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_have_valgrind+:} false; then : +if test "${ac_cv_prog_have_valgrind+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$have_valgrind"; then @@ -4920,18 +4804,16 @@ fi -# Checks for programs. -for ac_prog in flex lex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +# check for Java compiler +# Extract the first word of "javac", so it can be a program name with args. +set dummy javac; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LEX+:} false; then : +if test "${ac_cv_prog_HAVE_JAVAC+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. + if test -n "$HAVE_JAVAC"; then + ac_cv_prog_HAVE_JAVAC="$HAVE_JAVAC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4940,7 +4822,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LEX="$ac_prog" + ac_cv_prog_HAVE_JAVAC="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4950,178 +4832,22 @@ fi fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 -$as_echo "$LEX" >&6; } +HAVE_JAVAC=$ac_cv_prog_HAVE_JAVAC +if test -n "$HAVE_JAVAC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_JAVAC" >&5 +$as_echo "$HAVE_JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$LEX" && break -done -test -n "$LEX" || LEX=":" - -if test "x$LEX" != "x:"; then - cat >conftest.l <<_ACEOF -%% -a { ECHO; } -b { REJECT; } -c { yymore (); } -d { yyless (1); } -e { yyless (input () != 0); } -f { unput (yytext[0]); } -. { BEGIN INITIAL; } -%% -#ifdef YYTEXT_POINTER -extern char *yytext; -#endif -int -main (void) -{ - return ! yylex () + ! yywrap (); -} -_ACEOF -{ { ac_try="$LEX conftest.l" -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 "$LEX conftest.l") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 -$as_echo_n "checking lex output file root... " >&6; } -if ${ac_cv_prog_lex_root+:} false; then : - $as_echo_n "(cached) " >&6 -else - -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 -$as_echo "$ac_cv_prog_lex_root" >&6; } -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -if test -z "${LEXLIB+set}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 -$as_echo_n "checking lex library... " >&6; } -if ${ac_cv_lib_lex+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ac_save_LIBS=$LIBS - ac_cv_lib_lex='none needed' - for ac_lib in '' -lfl -ll; do - LIBS="$ac_lib $ac_save_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lex=$ac_lib -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - test "$ac_cv_lib_lex" != 'none needed' && break - done - LIBS=$ac_save_LIBS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 -$as_echo "$ac_cv_lib_lex" >&6; } - test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 -$as_echo_n "checking whether yytext is a pointer... " >&6; } -if ${ac_cv_prog_lex_yytext_pointer+:} false; then : - $as_echo_n "(cached) " >&6 -else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -ac_save_LIBS=$LIBS -LIBS="$LEXLIB $ac_save_LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #define YYTEXT_POINTER 1 -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_prog_lex_yytext_pointer=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 -$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } -if test $ac_cv_prog_lex_yytext_pointer = yes; then - -$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h - -fi -rm -f conftest.l $LEX_OUTPUT_ROOT.c - -fi -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_YACC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 -$as_echo "$YACC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if test x"$HAVE_JAVAC" = x""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no javac found, disabling features depending on it" >&5 +$as_echo "$as_me: WARNING: no javac found, disabling features depending on it" >&2;} fi - - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - +# Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5132,7 +4858,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -5172,7 +4898,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -5225,7 +4951,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -5265,7 +4991,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -5324,7 +5050,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -5368,7 +5094,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -5423,7 +5149,7 @@ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -5452,7 +5178,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5489,7 +5215,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -5567,7 +5293,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -5666,7 +5392,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -5675,7 +5401,6 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. - rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -5735,7 +5460,7 @@ break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) + msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -5799,7 +5524,7 @@ 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 : +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5958,8 +5683,8 @@ -macro_version='2.4.2' -macro_revision='1.3337' +macro_version='2.2.6b' +macro_revision='1.3017' @@ -5981,7 +5706,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -5997,7 +5722,7 @@ $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -6015,7 +5740,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -6030,7 +5755,7 @@ $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -6046,78 +5771,9 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -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 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : +if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -6199,7 +5855,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -6330,7 +5986,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -6370,7 +6026,7 @@ test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -6397,7 +6053,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : +if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -6450,17 +6106,14 @@ 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 - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -6498,13 +6151,13 @@ fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -6553,15 +6206,6 @@ fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -6576,18 +6220,18 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : +if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6228: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6231: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) + (eval echo "\"\$as_me:6234: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -6611,7 +6255,7 @@ # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 @@ -6644,11 +6288,6 @@ lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -6674,11 +6313,6 @@ lt_cv_sys_max_cmd_len=196608 ;; - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -6718,8 +6352,8 @@ # 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` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -6761,8 +6395,8 @@ # 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, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -6811,107 +6445,28 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi ;; esac @@ -6928,7 +6483,7 @@ set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -6968,7 +6523,7 @@ set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -7027,7 +6582,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : +if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -7069,18 +6624,16 @@ # 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 - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -7110,10 +6663,6 @@ lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -7122,11 +6671,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -7147,7 +6696,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be glibc/ELF. +# This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -7229,21 +6778,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -7259,165 +6793,12 @@ - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -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 - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -7430,7 +6811,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7450,18 +6831,14 @@ fi - test -n "$AR" && break - done fi -if test -z "$AR"; then +if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -7474,7 +6851,7 @@ test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" + ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7493,10 +6870,6 @@ $as_echo "no" >&6; } fi - - test -n "$ac_ct_AR" && break -done - if test "x$ac_ct_AR" = x; then AR="false" else @@ -7508,72 +6881,16 @@ esac AR=$ac_ct_AR fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + AR="$ac_cv_prog_AR" +fi -int -main () -{ +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; 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 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -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 - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi @@ -7586,7 +6903,7 @@ set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -7626,7 +6943,7 @@ set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -7685,7 +7002,7 @@ set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -7725,7 +7042,7 @@ set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -7787,27 +7104,15 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - @@ -7854,7 +7159,7 @@ # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7915,8 +7220,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$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 -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'" # Handle CRLF in mingw tool chain opt_cr= @@ -7940,7 +7245,6 @@ # 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -7953,7 +7257,6 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7979,8 +7282,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -7995,18 +7298,6 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then 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 - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#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 - #ifdef __cplusplus extern "C" { #endif @@ -8018,7 +7309,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -8044,8 +7335,8 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -8055,8 +7346,8 @@ test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -8093,25 +7384,6 @@ $as_echo "ok" >&6; } fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - @@ -8126,38 +7398,8 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } @@ -8194,7 +7436,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext + echo '#line 7439 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8288,7 +7530,7 @@ 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; } -if ${lt_cv_cc_needs_belf+:} false; then : +if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -8329,7 +7571,7 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -*-*solaris*) +sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -8340,20 +7582,7 @@ case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - 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" - fi - ;; + yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -8369,132 +7598,15 @@ 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. -set dummy ${ac_tool_prefix}mt; ac_word=$2 + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -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 - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -8534,7 +7646,7 @@ set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -8586,7 +7698,7 @@ set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : +if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -8626,7 +7738,7 @@ set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -8678,7 +7790,7 @@ set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : +if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -8718,7 +7830,7 @@ set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -8770,7 +7882,7 @@ set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : +if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -8810,7 +7922,7 @@ set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -8862,7 +7974,7 @@ set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : +if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -8902,7 +8014,7 @@ set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -8977,7 +8089,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -8993,13 +8105,7 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - 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 + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 @@ -9010,10 +8116,9 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -9043,41 +8148,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _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 - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -9105,7 +8175,7 @@ else _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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -9117,7 +8187,7 @@ do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF @@ -9128,8 +8198,6 @@ - - # Set options @@ -9175,22 +8243,7 @@ # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac + withval=$with_pic; pic_mode="$withval" else pic_mode=default fi @@ -9267,11 +8320,6 @@ - - - - - test -z "$LN_S" && LN_S="ln -s" @@ -9293,7 +8341,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : +if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -9321,6 +8369,19 @@ + + + + + + + + + + + + + case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -9333,6 +8394,23 @@ ;; esac +# 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. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -9361,7 +8439,7 @@ *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -9371,7 +8449,7 @@ if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -9437,7 +8515,7 @@ if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -9570,16 +8648,11 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac + lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -9595,15 +8668,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8671: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:8675: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -9632,6 +8705,8 @@ lt_prog_compiler_pic= lt_prog_compiler_static= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -9679,12 +8754,6 @@ lt_prog_compiler_pic='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -9727,15 +8796,6 @@ lt_prog_compiler_pic='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -9798,13 +8858,7 @@ lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -9816,40 +8870,25 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' ;; esac ;; @@ -9881,7 +8920,7 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -9938,17 +8977,13 @@ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -9956,7 +8991,7 @@ if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -9972,15 +9007,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9010: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:9014: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -10009,18 +9044,13 @@ - - - - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -10033,7 +9063,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -10063,7 +9093,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -10082,16 +9112,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9115: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:9119: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -10118,7 +9148,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -10137,16 +9167,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9170: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:9174: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -10212,6 +9242,7 @@ hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported @@ -10255,39 +9286,13 @@ openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) + linux* | k*bsd*-gnu) link_all_deplibs=no ;; esac ld_shlibs=yes - - # 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 - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -10321,12 +9326,11 @@ ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -10362,12 +9366,10 @@ # _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' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' 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' @@ -10385,11 +9387,6 @@ fi ;; - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -10415,16 +9412,15 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= 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; $ECHO \"$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' + pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -10435,17 +9431,13 @@ lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[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' - 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -10461,16 +9453,17 @@ fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # 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' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -10484,8 +9477,8 @@ 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 $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' fi ;; @@ -10503,8 +9496,8 @@ _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 $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 @@ -10550,8 +9543,8 @@ *) 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 $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 @@ -10591,10 +9584,8 @@ 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". 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")) && (substr(\$ 3,1,1) != ".")) { 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' fi @@ -10682,13 +9673,7 @@ 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 - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10701,32 +9686,25 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi 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" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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' @@ -10735,13 +9713,7 @@ else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10754,42 +9726,30 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi 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" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 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 - # We only use this code for GNU lds that support --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 + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' 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' @@ -10821,64 +9781,20 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - 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=' - # 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 - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # 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' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - 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. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) @@ -10888,12 +9804,7 @@ 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\"`' - - else - whole_archive_flag_spec='' - fi + whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -10901,7 +9812,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo 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}" @@ -10919,6 +9830,10 @@ hardcode_shlibpath_var=no ;; + freebsd1*) + ld_shlibs=no + ;; + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -10931,7 +9846,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) + freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -10940,7 +9855,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -10948,7 +9863,7 @@ 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' + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $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' fi @@ -10963,13 +9878,14 @@ ;; 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 "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${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' + hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes @@ -10981,16 +9897,16 @@ ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) 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 -fPIC ${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 -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -11002,52 +9918,13 @@ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - 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 - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - 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' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: + archive_cmds='$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 + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) @@ -11069,39 +9946,26 @@ 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' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -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" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + 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; } +int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - 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' - fi + LDFLAGS="$save_LDFLAGS" 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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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' @@ -11163,17 +10027,17 @@ 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' + 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' ;; 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' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -11183,13 +10047,13 @@ 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' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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' @@ -11202,9 +10066,9 @@ 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' + archive_cmds='$CC -shared ${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 ${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"*) @@ -11392,50 +10256,44 @@ # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + 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; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi @@ -11593,6 +10451,11 @@ + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } @@ -11601,23 +10464,16 @@ 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" ;; - 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 - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -11630,7 +10486,7 @@ 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 ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -11650,13 +10506,7 @@ if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # 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'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -11682,7 +10532,7 @@ case $host_os in aix3*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -11691,7 +10541,7 @@ ;; aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -11744,7 +10594,7 @@ 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=`$ECHO "X$lib" | $Xsed -e '\''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' ;; esac ;; @@ -11756,7 +10606,7 @@ ;; bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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' @@ -11775,9 +10625,8 @@ need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -11798,83 +10647,36 @@ 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}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix 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}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - 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=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + 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}' ;; 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'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -11895,7 +10697,7 @@ ;; dgux*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -11903,6 +10705,10 @@ shlibpath_var=LD_LIBRARY_PATH ;; +freebsd1*) + dynamic_linker=no + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -11910,7 +10716,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[23].*) objformat=aout ;; + freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -11928,7 +10734,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2.*) + freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -11948,26 +10754,12 @@ ;; gnu*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -12013,14 +10805,12 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -12036,7 +10826,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux else version_type=irix fi ;; @@ -12073,9 +10863,9 @@ dynamic_linker=no ;; -# This must be glibc/ELF. +# This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -12083,17 +10873,12 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12106,17 +10891,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -12125,7 +10906,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/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' ' '` + 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;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -12169,7 +10950,7 @@ ;; newsos6) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -12238,7 +11019,7 @@ ;; solaris*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -12263,7 +11044,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -12287,7 +11068,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -12318,7 +11099,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -12328,7 +11109,7 @@ ;; uts4*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -12440,11 +11221,6 @@ - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= @@ -12517,7 +11293,7 @@ # 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 : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12551,7 +11327,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 : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -12565,12 +11341,12 @@ *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = x""yes; then : 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; } -if ${ac_cv_lib_dld_shl_load+:} false; then : +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12604,16 +11380,16 @@ 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 : +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : 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 : +if test "x$ac_cv_func_dlopen" = x""yes; then : 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; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12647,12 +11423,12 @@ 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 : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : 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; } -if ${ac_cv_lib_svld_dlopen+:} false; then : +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12686,12 +11462,12 @@ 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 : +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : 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; } -if ${ac_cv_lib_dld_dld_link+:} false; then : +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -12725,7 +11501,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 : +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -12766,7 +11542,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : +if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12775,7 +11551,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line 11554 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12816,13 +11592,7 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12831,11 +11601,7 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -12872,7 +11638,7 @@ 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 : +if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12881,7 +11647,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line 11650 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12922,13 +11688,7 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12937,11 +11697,7 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -13110,8 +11866,6 @@ - - ac_config_commands="$ac_config_commands libtool" @@ -13128,14 +11882,13 @@ - if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -13178,7 +11931,7 @@ set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in @@ -13243,2116 +11996,107 @@ fi fi -# modules we require +case "${host}" in + *-*-linux*) -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBESTR" >&5 -$as_echo_n "checking for LIBESTR... " >&6; } +$as_echo "#define OS_LINUX 1" >>confdefs.h -if test -n "$LIBESTR_CFLAGS"; then - pkg_cv_LIBESTR_CFLAGS="$LIBESTR_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libestr >= 0.1.9\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libestr >= 0.1.9") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBESTR_CFLAGS=`$PKG_CONFIG --cflags "libestr >= 0.1.9" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBESTR_LIBS"; then - pkg_cv_LIBESTR_LIBS="$LIBESTR_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libestr >= 0.1.9\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libestr >= 0.1.9") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBESTR_LIBS=`$PKG_CONFIG --libs "libestr >= 0.1.9" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi + os_type="linux" + ;; + *-*-*darwin*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) +$as_echo "#define OS_BSD 1" >>confdefs.h + os_type="bsd" + ;; + *-*-kfreebsd*) + # kernel is FreeBSD, but userspace is glibc - i.e. like linux + # do not DEFINE OS_BSD + os_type="bsd" + ;; + *-*-solaris*) + os_type="solaris" -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +$as_echo "#define OS_SOLARIS 1" >>confdefs.h -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBESTR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libestr >= 0.1.9" 2>&1` - else - LIBESTR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libestr >= 0.1.9" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBESTR_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libestr >= 0.1.9) were not met: +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h -$LIBESTR_PKG_ERRORS + SOL_LIBS="-lsocket -lnsl" -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + ;; +esac -Alternatively, you may set the environment variables LIBESTR_CFLAGS -and LIBESTR_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables LIBESTR_CFLAGS -and LIBESTR_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +cat >>confdefs.h <<_ACEOF +#define HOSTENV "$host" +_ACEOF -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } + +# Checks for libraries. +save_LIBS=$LIBS +LIBS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if test "${ac_cv_search_clock_gettime+set}" = set; then : + $as_echo_n "(cached) " >&6 else - LIBESTR_CFLAGS=$pkg_cv_LIBESTR_CFLAGS - LIBESTR_LIBS=$pkg_cv_LIBESTR_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_clock_gettime+set}" = set; then : + break +fi +done +if test "${ac_cv_search_clock_gettime+set}" = set; then : -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLOGGING_STDLOG" >&5 -$as_echo_n "checking for LIBLOGGING_STDLOG... " >&6; } - -if test -n "$LIBLOGGING_STDLOG_CFLAGS"; then - pkg_cv_LIBLOGGING_STDLOG_CFLAGS="$LIBLOGGING_STDLOG_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblogging-stdlog >= 1.0.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "liblogging-stdlog >= 1.0.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBLOGGING_STDLOG_CFLAGS=`$PKG_CONFIG --cflags "liblogging-stdlog >= 1.0.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBLOGGING_STDLOG_LIBS"; then - pkg_cv_LIBLOGGING_STDLOG_LIBS="$LIBLOGGING_STDLOG_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblogging-stdlog >= 1.0.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "liblogging-stdlog >= 1.0.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBLOGGING_STDLOG_LIBS=`$PKG_CONFIG --libs "liblogging-stdlog >= 1.0.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBLOGGING_STDLOG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblogging-stdlog >= 1.0.1" 2>&1` - else - LIBLOGGING_STDLOG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblogging-stdlog >= 1.0.1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBLOGGING_STDLOG_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (liblogging-stdlog >= 1.0.1) were not met: - -$LIBLOGGING_STDLOG_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables LIBLOGGING_STDLOG_CFLAGS -and LIBLOGGING_STDLOG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables LIBLOGGING_STDLOG_CFLAGS -and LIBLOGGING_STDLOG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - LIBLOGGING_STDLOG_CFLAGS=$pkg_cv_LIBLOGGING_STDLOG_CFLAGS - LIBLOGGING_STDLOG_LIBS=$pkg_cv_LIBLOGGING_STDLOG_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON_C" >&5 -$as_echo_n "checking for JSON_C... " >&6; } - -if test -n "$JSON_C_CFLAGS"; then - pkg_cv_JSON_C_CFLAGS="$JSON_C_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json\""; } >&5 - ($PKG_CONFIG --exists --print-errors "json") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JSON_C_CFLAGS=`$PKG_CONFIG --cflags "json" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$JSON_C_LIBS"; then - pkg_cv_JSON_C_LIBS="$JSON_C_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json\""; } >&5 - ($PKG_CONFIG --exists --print-errors "json") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JSON_C_LIBS=`$PKG_CONFIG --libs "json" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - JSON_C_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json" 2>&1` - else - JSON_C_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$JSON_C_PKG_ERRORS" >&5 - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON_C" >&5 -$as_echo_n "checking for JSON_C... " >&6; } - -if test -n "$JSON_C_CFLAGS"; then - pkg_cv_JSON_C_CFLAGS="$JSON_C_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 - ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JSON_C_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$JSON_C_LIBS"; then - pkg_cv_JSON_C_LIBS="$JSON_C_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 - ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JSON_C_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - JSON_C_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1` - else - JSON_C_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$JSON_C_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (json-c) were not met: - -$JSON_C_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables JSON_C_CFLAGS -and JSON_C_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables JSON_C_CFLAGS -and JSON_C_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - JSON_C_CFLAGS=$pkg_cv_JSON_C_CFLAGS - JSON_C_LIBS=$pkg_cv_JSON_C_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON_C" >&5 -$as_echo_n "checking for JSON_C... " >&6; } - -if test -n "$JSON_C_CFLAGS"; then - pkg_cv_JSON_C_CFLAGS="$JSON_C_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 - ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JSON_C_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$JSON_C_LIBS"; then - pkg_cv_JSON_C_LIBS="$JSON_C_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5 - ($PKG_CONFIG --exists --print-errors "json-c") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JSON_C_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - JSON_C_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1` - else - JSON_C_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$JSON_C_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (json-c) were not met: - -$JSON_C_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables JSON_C_CFLAGS -and JSON_C_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables JSON_C_CFLAGS -and JSON_C_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - JSON_C_CFLAGS=$pkg_cv_JSON_C_CFLAGS - JSON_C_LIBS=$pkg_cv_JSON_C_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - -else - JSON_C_CFLAGS=$pkg_cv_JSON_C_CFLAGS - JSON_C_LIBS=$pkg_cv_JSON_C_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - -# if int64 is supported, use it -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for json_object_new_object in -ljson-c" >&5 -$as_echo_n "checking for json_object_new_object in -ljson-c... " >&6; } -if ${ac_cv_lib_json_c_json_object_new_object+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ljson-c $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char json_object_new_object (); -int -main () -{ -return json_object_new_object (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_json_c_json_object_new_object=yes -else - ac_cv_lib_json_c_json_object_new_object=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_json_c_json_object_new_object" >&5 -$as_echo "$ac_cv_lib_json_c_json_object_new_object" >&6; } -if test "x$ac_cv_lib_json_c_json_object_new_object" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBJSON_C 1 -_ACEOF - - LIBS="-ljson-c $LIBS" - -fi - -for ac_func in json_object_new_int64 -do : - ac_fn_c_check_func "$LINENO" "json_object_new_int64" "ac_cv_func_json_object_new_int64" -if test "x$ac_cv_func_json_object_new_int64" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_JSON_OBJECT_NEW_INT64 1 -_ACEOF - -fi -done - - -case "${host}" in - *-*-linux*) - -$as_echo "#define OS_LINUX 1" >>confdefs.h - - os_type="linux" - ;; - *-*-*darwin*|*-*-dragonfly*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) - -$as_echo "#define OS_BSD 1" >>confdefs.h - - os_type="bsd" - ;; - *-*-kfreebsd*) - # kernel is FreeBSD, but userspace is glibc - i.e. like linux - # do not DEFINE OS_BSD - os_type="bsd" - ;; - *-*-solaris*) - os_type="solaris" - -$as_echo "#define OS_SOLARIS 1" >>confdefs.h - - -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - SOL_LIBS="-lsocket -lnsl" - # Solaris libuuid does not ship with a pkgconfig file so override the appropriate - # variables (but only if they have not been set by the user). - LIBUUID_CFLAGS=${LIBUUID_CFLAGS:= } - LIBUUID_LIBS=${LIBUUID_LIBS:=-luuid} - - ;; -esac - - -cat >>confdefs.h <<_ACEOF -#define HOSTENV "$host" -_ACEOF - - -# Checks for libraries. -save_LIBS=$LIBS -LIBS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : - break -fi -done -if ${ac_cv_search_clock_gettime+:} false; then : - -else - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -RT_LIBS=$LIBS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mq_getattr" >&5 -$as_echo_n "checking for library containing mq_getattr... " >&6; } -if ${ac_cv_search_mq_getattr+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char mq_getattr (); -int -main () -{ -return mq_getattr (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_mq_getattr=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_mq_getattr+:} false; then : - break -fi -done -if ${ac_cv_search_mq_getattr+:} false; then : - -else - ac_cv_search_mq_getattr=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mq_getattr" >&5 -$as_echo "$ac_cv_search_mq_getattr" >&6; } -ac_res=$ac_cv_search_mq_getattr -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -RT_LIBS="$RT_LIBS $LIBS" -LIBS= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if ${ac_cv_search_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_dlopen+:} false; then : - break -fi -done -if ${ac_cv_search_dlopen+:} false; then : - -else - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -DL_LIBS=$LIBS -LIBS=$save_LIBS - - - - -# Checks for header files. -for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include /* inet_ functions / structs */ -#endif -#ifdef HAVE_ARPA_NAMESER_H -# include /* DNS HEADER struct */ -#endif -#ifdef HAVE_NETDB_H -# include -#endif -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if ${ac_cv_header_sys_wait_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_sys_wait_h=yes -else - ac_cv_header_sys_wait_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } -if test $ac_cv_header_sys_wait_h = yes; then - -$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h - -fi - -for ac_header in arpa/inet.h libgen.h malloc.h fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h syslog.h unistd.h utmp.h utmpx.h sys/epoll.h sys/prctl.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define ssize_t int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : - ac_cv_type_uid_t=yes -else - ac_cv_type_uid_t=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then - -$as_echo "#define uid_t int" >>confdefs.h - - -$as_echo "#define gid_t int" >>confdefs.h - -fi - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } -if ${ac_cv_c_volatile+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - -volatile int x; -int * volatile y = (int *) 0; -return !x && !y; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_volatile=yes -else - ac_cv_c_volatile=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 -$as_echo "$ac_cv_c_volatile" >&6; } -if test $ac_cv_c_volatile = no; then - -$as_echo "#define volatile /**/" >>confdefs.h - -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof syntax and keyword spelling" >&5 -$as_echo_n "checking for typeof syntax and keyword spelling... " >&6; } -if ${ac_cv_c_typeof+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_typeof=no - for ac_kw in typeof __typeof__ no; do - test $ac_kw = no && break - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - int value; - typedef struct { - char a [1 - + ! (($ac_kw (value)) - (($ac_kw (value)) 0 < ($ac_kw (value)) -1 - ? ($ac_kw (value)) - 1 - : ~ (~ ($ac_kw (value)) 0 - << sizeof ($ac_kw (value)))))]; } - ac__typeof_type_; - return - (! ((void) ((ac__typeof_type_ *) 0), 0)); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_typeof=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test $ac_cv_c_typeof != no && break - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_typeof" >&5 -$as_echo "$ac_cv_c_typeof" >&6; } - if test $ac_cv_c_typeof != no; then - -$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h - - if test $ac_cv_c_typeof != typeof; then - -cat >>confdefs.h <<_ACEOF -#define typeof $ac_cv_c_typeof -_ACEOF - - fi - fi - - -sa_includes="\ -$ac_includes_default -#if HAVE_SYS_SOCKET_H -# include -#endif -" -ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "$sa_includes -" -if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 -_ACEOF - - -fi - - -# Checks for library functions. -for ac_header in unistd.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UNISTD_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 -$as_echo_n "checking for working chown... " >&6; } -if ${ac_cv_func_chown_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_chown_works=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -#include - -int -main () -{ - char *f = "conftest.chown"; - struct stat before, after; - - if (creat (f, 0600) < 0) - return 1; - if (stat (f, &before) < 0) - return 1; - if (chown (f, (uid_t) -1, (gid_t) -1) == -1) - return 1; - if (stat (f, &after) < 0) - return 1; - return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_chown_works=yes -else - ac_cv_func_chown_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -rm -f conftest.chown - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 -$as_echo "$ac_cv_func_chown_works" >&6; } -if test $ac_cv_func_chown_works = yes; then - -$as_echo "#define HAVE_CHOWN 1" >>confdefs.h - -fi - -for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF - -fi - -done - -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_fork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* By Ruediger Kuhlmann. */ - return fork () < 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_fork_works=yes -else - ac_cv_func_fork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } - -else - ac_cv_func_fork_works=$ac_cv_func_fork -fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_vfork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Thanks to Paul Eggert for this test. */ -$ac_includes_default -#include -#ifdef HAVE_VFORK_H -# include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include , but some compilers - (e.g. gcc -O) don't grok . Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static void -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} - -int -main () -{ - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (0); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - return ( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_vfork_works=yes -else - ac_cv_func_vfork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } - -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} -fi - -if test "x$ac_cv_func_vfork_works" = xyes; then - -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h - -else - -$as_echo "#define vfork fork" >>confdefs.h - -fi -if test "x$ac_cv_func_fork_works" = xyes; then - -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h - -fi - -if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if ${ac_cv_func_malloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -$as_echo "#define malloc rpl_malloc" >>confdefs.h - -fi - - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 -$as_echo_n "checking for GNU libc compatible realloc... " >&6; } -if ${ac_cv_func_realloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_realloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif - -int -main () -{ -return ! realloc (0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_realloc_0_nonnull=yes -else - ac_cv_func_realloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_REALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_REALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" - ;; -esac - - -$as_echo "#define realloc rpl_realloc" >>confdefs.h - -fi - - -for ac_header in sys/select.h sys/socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 -$as_echo_n "checking types of arguments for select... " >&6; } -if ${ac_cv_func_select_args+:} false; then : - $as_echo_n "(cached) " >&6 -else - for ac_arg234 in 'fd_set *' 'int *' 'void *'; do - for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do - for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif - -int -main () -{ -extern int select ($ac_arg1, - $ac_arg234, $ac_arg234, $ac_arg234, - $ac_arg5); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - done -done -# Provide a safe default value. -: "${ac_cv_func_select_args=int,int *,struct timeval *}" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 -$as_echo "$ac_cv_func_select_args" >&6; } -ac_save_IFS=$IFS; IFS=',' -set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` -IFS=$ac_save_IFS -shift - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG1 $1 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG234 ($2) -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG5 ($3) -_ACEOF - -rm -f conftest* - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 -$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } -if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f conftest.sym conftest.file -echo >conftest.file -if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then - if test "$cross_compiling" = yes; then : - ac_cv_func_lstat_dereferences_slashed_symlink=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -struct stat sbuf; - /* Linux will dereference the symlink and fail, as required by POSIX. - That is better in the sense that it means we will not - have to compile and use the lstat wrapper. */ - return lstat ("conftest.sym/", &sbuf) == 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_lstat_dereferences_slashed_symlink=yes -else - ac_cv_func_lstat_dereferences_slashed_symlink=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -else - # If the `ln -s' command failed, then we probably don't even - # have an lstat function. - ac_cv_func_lstat_dereferences_slashed_symlink=no -fi -rm -f conftest.sym conftest.file - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } - -test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && - -cat >>confdefs.h <<_ACEOF -#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 -_ACEOF - - -if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then - case " $LIBOBJS " in - *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" - ;; -esac - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 -$as_echo_n "checking whether stat accepts an empty string... " >&6; } -if ${ac_cv_func_stat_empty_string_bug+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_stat_empty_string_bug=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -struct stat sbuf; - return stat ("", &sbuf) == 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_stat_empty_string_bug=no -else - ac_cv_func_stat_empty_string_bug=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 -$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } -if test $ac_cv_func_stat_empty_string_bug = yes; then - case " $LIBOBJS " in - *" stat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS stat.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<_ACEOF -#define HAVE_STAT_EMPTY_STRING_BUG 1 -_ACEOF - -fi - -ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror_r" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R $ac_have_decl -_ACEOF - -for ac_func in strerror_r -do : - ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" -if test "x$ac_cv_func_strerror_r" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 -$as_echo_n "checking whether strerror_r returns char *... " >&6; } -if ${ac_cv_func_strerror_r_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - return !p || x; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 -$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } -if test $ac_cv_func_strerror_r_char_p = yes; then - -$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h - -fi - -for ac_func in vprintf -do : - ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF 1 -_ACEOF - -ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = xyes; then : - -$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h - + ac_cv_search_clock_gettime=no fi - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -done - - -for ac_func in flock recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -done - -# getifaddrs is in libc (mostly) or in libsocket (eg Solaris 11) or not defined (eg Solaris 10) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getifaddrs" >&5 -$as_echo_n "checking for library containing getifaddrs... " >&6; } -if ${ac_cv_search_getifaddrs+:} false; then : +RT_LIBS=$LIBS +LIBS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if test "${ac_cv_search_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -15365,299 +12109,70 @@ #ifdef __cplusplus extern "C" #endif -char getifaddrs (); -int -main () -{ -return getifaddrs (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_getifaddrs=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_getifaddrs+:} false; then : - break -fi -done -if ${ac_cv_search_getifaddrs+:} false; then : - -else - ac_cv_search_getifaddrs=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getifaddrs" >&5 -$as_echo "$ac_cv_search_getifaddrs" >&6; } -ac_res=$ac_cv_search_getifaddrs -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -$as_echo "#define HAVE_GETIFADDRS 1" >>confdefs.h - -fi - - -# the check below is probably ugly. If someone knows how to do it in a better way, please -# let me know! -- rgerhards, 2010-10-06 -ac_fn_c_check_decl "$LINENO" "SCM_CREDENTIALS" "ac_cv_have_decl_SCM_CREDENTIALS" "#include -#include -" -if test "x$ac_cv_have_decl_SCM_CREDENTIALS" = xyes; then : - -$as_echo "#define HAVE_SCM_CREDENTIALS 1" >>confdefs.h - -fi - -ac_fn_c_check_decl "$LINENO" "SO_TIMESTAMP" "ac_cv_have_decl_SO_TIMESTAMP" "#include -#include -" -if test "x$ac_cv_have_decl_SO_TIMESTAMP" = xyes; then : - -$as_echo "#define HAVE_SO_TIMESTAMP 1" >>confdefs.h - -fi - -ac_fn_c_check_decl "$LINENO" "SYS_gettid" "ac_cv_have_decl_SYS_gettid" "#include -" -if test "x$ac_cv_have_decl_SYS_gettid" = xyes; then : - -$as_echo "#define HAVE_SYS_gettid 1" >>confdefs.h - -fi - -ac_fn_c_check_member "$LINENO" "struct sysinfo" "uptime" "ac_cv_member_struct_sysinfo_uptime" "#include -" -if test "x$ac_cv_member_struct_sysinfo_uptime" = xyes; then : - -$as_echo "#define HAVE_SYSINFO_UPTIME 1" >>confdefs.h - -fi - -ac_fn_c_check_decl "$LINENO" "GLOB_NOMAGIC" "ac_cv_have_decl_GLOB_NOMAGIC" "#include -" -if test "x$ac_cv_have_decl_GLOB_NOMAGIC" = xyes; then : - -$as_echo "#define HAVE_GLOB_NOMAGIC 1" >>confdefs.h - -fi - - -# Check for MAXHOSTNAMELEN -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAXHOSTNAMELEN" >&5 -$as_echo_n "checking for MAXHOSTNAMELEN... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - return MAXHOSTNAMELEN; - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - # note: we use 1024 here, which should be far more than needed by any system. If that's too low, we simply - # life with the need to change it. Most of the code doesn't need it anyways, but there are a few places - # where it actually is needed and it makes no sense to change them. - -$as_echo "#define MAXHOSTNAMELEN 1024" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; defined as 64" >&5 -$as_echo "no; defined as 64" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -# Check for __builtin_expect() -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect()" >&5 -$as_echo_n "checking for __builtin_expect()... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - +char dlopen (); int main () { -return __builtin_expect(main != 0, 1) +return dlopen (); ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_BUILTIN_EXPECT 1" >>confdefs.h - - { $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; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -# check for availability of atomic operations -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler provides atomic builtins" >&5 -$as_echo_n "checking whether the compiler provides atomic builtins... " >&6; } -if ${ap_cv_atomic_builtins+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ap_cv_atomic_builtins=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int main() -{ - unsigned long val = 1010, tmp, *mem = &val; - - if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) - return 1; - - tmp = val; - - if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) - return 1; - - if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) - return 1; - - tmp = 3030; - - if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) - return 1; - - if (__sync_lock_test_and_set(&val, 4040) != 3030) - return 1; - - mem = &tmp; - - if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) - return 1; - - __sync_synchronize(); - - if (mem != &val) - return 1; - - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ap_cv_atomic_builtins=yes -else - ap_cv_atomic_builtins=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ap_cv_atomic_builtins" >&5 -$as_echo "$ap_cv_atomic_builtins" >&6; } - -if test "$ap_cv_atomic_builtins" = "yes"; then - -$as_echo "#define HAVE_ATOMIC_BUILTINS 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler provides atomic builtins for 64 bit data types" >&5 -$as_echo_n "checking whether the compiler provides atomic builtins for 64 bit data types... " >&6; } -if ${ap_cv_atomic_builtins_64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ap_cv_atomic_builtins_64=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int main() -{ - unsigned long long val = 1010, tmp, *mem = &val; - - if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) - return 1; - - tmp = val; - - if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) - return 1; - - if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) - return 1; - - tmp = 3030; - - if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) - return 1; - - if (__sync_lock_test_and_set(&val, 4040) != 3030) - return 1; - - mem = &tmp; - - if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) - return 1; - - __sync_synchronize(); - - if (mem != &val) - return 1; - - return 0; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ap_cv_atomic_builtins_64=yes -else - ap_cv_atomic_builtins_64=no +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_dlopen+set}" = set; then : + break fi +done +if test "${ac_cv_search_dlopen+set}" = set; then : +else + ac_cv_search_dlopen=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ap_cv_atomic_builtins_64" >&5 -$as_echo "$ap_cv_atomic_builtins_64" >&6; } +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -if test "$ap_cv_atomic_builtins_64" = "yes"; then +fi -$as_echo "#define HAVE_ATOMIC_BUILTINS_64BIT 1" >>confdefs.h +DL_LIBS=$LIBS +LIBS=$save_LIBS -fi -# fall back to POSIX sems for atomic operations (cpu expensive) -for ac_header in semaphore.h sys/syscall.h +# Checks for header files. +for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -15668,1684 +12183,1883 @@ done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include -# Additional module directories +int +main () +{ -# Check whether --with-moddirs was given. -if test "${with_moddirs+set}" = set; then : - withval=$with_moddirs; _save_IFS=$IFS ; IFS=$PATH_SEPARATOR ; moddirs="" - for w in ${with_moddirs} ; - do - case $w in - "") continue ;; */) ;; *) w="${w}/" ;; - esac - for m in ${moddirs} ; - do - test "x$w" = "x${libdir}/${PACKAGE}/" || \ - test "x$w" = "x$m" || test "x$w" = "x/" && \ - continue 2 - done - case $moddirs in - "") moddirs="$w" ;; *) moddirs="${moddirs}:${w}" ;; - esac - done ; IFS=$_save_IFS + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else - moddirs="" - + ac_cv_header_stdc=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : - if test x$moddirs != x; then - WITH_MODDIRS_TRUE= - WITH_MODDIRS_FALSE='#' else - WITH_MODDIRS_TRUE='#' - WITH_MODDIRS_FALSE= + ac_cv_header_stdc=no fi +rm -f conftest* +fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : -# Large file support -# http://www.gnu.org/software/autoconf/manual/html_node/System-Services.html#index-AC_005fSYS_005fLARGEFILE-1028 -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; +else + ac_cv_header_stdc=no fi +rm -f conftest* -if test "$enable_largefile" != no; then +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { - - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : - break +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_largefile_CC=' -n32'; break +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then : $as_echo_n "(cached) " >&6 else - while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; int main () { - + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=64; break + ac_cv_header_sys_wait_h=yes +else + ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + +for ac_header in arpa/inet.h libgen.h malloc.h fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h syslog.h unistd.h utmp.h utmpx.h sys/epoll.h sys/prctl.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else - while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + int main () { +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break + ac_cv_c_const=yes +else + ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif - ; - return 0; -} _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=1; break + ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break + test "$ac_cv_c_inline" != no && break done + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif _ACEOF -;; + ;; esac -rm -rf conftest* - fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + fi -case "${enable_largefile}" in - no) ;; - *) enable_largefile="yes" ;; -esac +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : -# Regular expressions -# Check whether --enable-regexp was given. -if test "${enable_regexp+set}" = set; then : - enableval=$enable_regexp; case "${enableval}" in - yes) enable_regexp="yes" ;; - no) enable_regexp="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-regexp" "$LINENO" 5 ;; - esac else - enable_regexp=yes + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF fi - if test x$enable_regexp = xyes; then - ENABLE_REGEXP_TRUE= - ENABLE_REGEXP_FALSE='#' +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + else - ENABLE_REGEXP_TRUE='#' - ENABLE_REGEXP_FALSE= + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if test "${ac_cv_type_uid_t+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h -if test "$enable_regexp" = "yes"; then -$as_echo "#define FEATURE_REGEXP 1" >>confdefs.h +$as_echo "#define gid_t int" >>confdefs.h fi +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) +$as_echo "#define _UINT8_T 1" >>confdefs.h -# zlib compression -# Check whether --enable-zlib was given. -if test "${enable_zlib+set}" = set; then : - enableval=$enable_zlib; case "${enableval}" in - yes) enable_zlib="yes" ;; - no) enable_zlib="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-zlib" "$LINENO" 5 ;; - esac -else - enable_zlib=yes -fi +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac - if test x$enable_zlib = xyes; then - ENABLE_ZLIB_TRUE= - ENABLE_ZLIB_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if test "${ac_cv_header_time+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_ZLIB_TRUE='#' - ENABLE_ZLIB_FALSE= -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include -if test "$enable_zlib" = "yes"; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - zlib_header="yes" +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes else - zlib_header="no" enable_zlib="false" + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - if test "$zlib_header" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 -$as_echo_n "checking for deflate in -lz... " >&6; } -if ${ac_cv_lib_z_deflate+:} false; then : +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test "${ac_cv_struct_tm+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char deflate (); int main () { -return deflate (); +struct tm tm; + int *p = &tm.tm_sec; + return !p; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_deflate=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h else - ac_cv_lib_z_deflate=no + ac_cv_struct_tm=sys/time.h fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 -$as_echo "$ac_cv_lib_z_deflate" >&6; } -if test "x$ac_cv_lib_z_deflate" = xyes; then : - -$as_echo "#define USE_NETZIP 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then - ZLIB_LIBS="-lz" +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h -else - enable_zlib="false" fi - fi -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } +if test "${ac_cv_c_volatile+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ -#gssapi -# Check whether --enable-gssapi_krb5 was given. -if test "${enable_gssapi_krb5+set}" = set; then : - enableval=$enable_gssapi_krb5; case "${enableval}" in - yes) enable_gssapi_krb5="yes" ;; - no) enable_gssapi_krb5="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gssapi-krb5" "$LINENO" 5 ;; - esac +volatile int x; +int * volatile y = (int *) 0; +return !x && !y; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_volatile=yes else - enable_gssapi_krb5=no + ac_cv_c_volatile=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +$as_echo "$ac_cv_c_volatile" >&6; } +if test $ac_cv_c_volatile = no; then + +$as_echo "#define volatile /**/" >>confdefs.h fi -if test $enable_gssapi_krb5 = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_acquire_cred in -lgssapi_krb5" >&5 -$as_echo_n "checking for gss_acquire_cred in -lgssapi_krb5... " >&6; } -if ${ac_cv_lib_gssapi_krb5_gss_acquire_cred+:} false; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof syntax and keyword spelling" >&5 +$as_echo_n "checking for typeof syntax and keyword spelling... " >&6; } +if test "${ac_cv_c_typeof+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgssapi_krb5 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_c_typeof=no + for ac_kw in typeof __typeof__ no; do + test $ac_kw = no && break + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gss_acquire_cred (); int main () { -return gss_acquire_cred (); + + int value; + typedef struct { + char a [1 + + ! (($ac_kw (value)) + (($ac_kw (value)) 0 < ($ac_kw (value)) -1 + ? ($ac_kw (value)) - 1 + : ~ (~ ($ac_kw (value)) 0 + << sizeof ($ac_kw (value)))))]; } + ac__typeof_type_; + return + (! ((void) ((ac__typeof_type_ *) 0), 0)); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gssapi_krb5_gss_acquire_cred=yes -else - ac_cv_lib_gssapi_krb5_gss_acquire_cred=no +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_typeof=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test $ac_cv_c_typeof != no && break + done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_krb5_gss_acquire_cred" >&5 -$as_echo "$ac_cv_lib_gssapi_krb5_gss_acquire_cred" >&6; } -if test "x$ac_cv_lib_gssapi_krb5_gss_acquire_cred" = xyes; then : - - ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" -if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_typeof" >&5 +$as_echo "$ac_cv_c_typeof" >&6; } + if test $ac_cv_c_typeof != no; then +$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h -$as_echo "#define USE_GSSAPI /**/" >>confdefs.h + if test $ac_cv_c_typeof != typeof; then - GSS_LIBS="-lgssapi_krb5" +cat >>confdefs.h <<_ACEOF +#define typeof $ac_cv_c_typeof +_ACEOF + fi + fi -fi +sa_includes="\ +$ac_includes_default +#if HAVE_SYS_SOCKET_H +# include +#endif +" +ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "$sa_includes +" +if test "x$ac_cv_member_struct_sockaddr_sa_len" = x""yes; then : +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_SA_LEN 1 +_ACEOF -fi fi - if test x$enable_gssapi_krb5 = xyes; then - ENABLE_GSSAPI_TRUE= - ENABLE_GSSAPI_FALSE='#' -else - ENABLE_GSSAPI_TRUE='#' - ENABLE_GSSAPI_FALSE= -fi - -# multithreading via pthreads -for ac_header in pthread.h +# Checks for library functions. +for ac_header in unistd.h do : - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 +#define HAVE_UNISTD_H 1 _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 +$as_echo_n "checking for working chown... " >&6; } +if test "${ac_cv_func_chown_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread -lpthread - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + ac_cv_func_chown_works=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default +#include -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_create (); int main () { -return pthread_create (); + char *f = "conftest.chown"; + struct stat before, after; + + if (creat (f, 0600) < 0) + return 1; + if (stat (f, &before) < 0) + return 1; + if (chown (f, (uid_t) -1, (gid_t) -1) == -1) + return 1; + if (stat (f, &after) < 0) + return 1; + return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_chown_works=yes else - ac_cv_lib_pthread_pthread_create=no + ac_cv_func_chown_works=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - - -$as_echo "#define USE_PTHREADS 1" >>confdefs.h - - PTHREADS_LIBS="-lpthread" - case "${os_type}" in - solaris) PTHREADS_CFLAGS="-pthreads" ;; - *) PTHREADS_CFLAGS="-pthread" ;; - esac - +rm -f conftest.chown -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "pthread is missing -See \`config.log' for more details" "$LINENO" 5; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 +$as_echo "$ac_cv_func_chown_works" >&6; } +if test $ac_cv_func_chown_works = yes; then - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "pthread is missing -See \`config.log' for more details" "$LINENO" 5; } +$as_echo "#define HAVE_CHOWN 1" >>confdefs.h fi -done - - -for ac_func in pthread_setschedparam +for ac_header in vfork.h do : - ac_fn_c_check_func "$LINENO" "pthread_setschedparam" "ac_cv_func_pthread_setschedparam" -if test "x$ac_cv_func_pthread_setschedparam" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_SETSCHEDPARAM 1 +#define HAVE_VFORK_H 1 _ACEOF - rsyslog_have_pthread_setschedparam=yes - -else - - rsyslog_have_pthread_setschedparam=no - - fi + done -for ac_header in sched.h +for ac_func in fork vfork do : - ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" -if test "x$ac_cv_header_sched_h" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SCHED_H 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - rsyslog_have_sched_h=yes +fi +done +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if test "${ac_cv_func_fork_works+set}" = set; then : + $as_echo_n "(cached) " >&6 else + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ - rsyslog_have_sched_h=no - + /* By Ruediger Kuhlmann. */ + return fork () < 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes +else + ac_cv_func_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } -if test "$rsyslog_have_pthread_setschedparam" = "yes" -a "$rsyslog_have_sched_h" = "yes"; then - save_LIBS=$LIBS - LIBS= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_get_priority_max" >&5 -$as_echo_n "checking for library containing sched_get_priority_max... " >&6; } -if ${ac_cv_search_sched_get_priority_max+:} false; then : +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if test "${ac_cv_func_vfork_works+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void #ifdef __cplusplus -extern "C" +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; #endif -char sched_get_priority_max (); +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + int main () { -return sched_get_priority_max (); - ; - return 0; + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } } _ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_sched_get_priority_max=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_sched_get_priority_max+:} false; then : - break -fi -done -if ${ac_cv_search_sched_get_priority_max+:} false; then : - +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes else - ac_cv_search_sched_get_priority_max=no + ac_cv_func_vfork_works=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_get_priority_max" >&5 -$as_echo "$ac_cv_search_sched_get_priority_max" >&6; } -ac_res=$ac_cv_search_sched_get_priority_max -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } - if test "x$ac_cv_search" != "xno"; then - for ac_func in sched_get_priority_max -do : - ac_fn_c_check_func "$LINENO" "sched_get_priority_max" "ac_cv_func_sched_get_priority_max" -if test "x$ac_cv_func_sched_get_priority_max" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SCHED_GET_PRIORITY_MAX 1 -_ACEOF - +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi -done - - fi - IMUDP_LIBS=$LIBS - LIBS=$save_LIBS -fi +if test "x$ac_cv_func_vfork_works" = xyes; then +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h -# klog -# Check whether --enable-klog was given. -if test "${enable_klog+set}" = set; then : - enableval=$enable_klog; case "${enableval}" in - yes) enable_klog="yes" ;; - no) enable_klog="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-klog" "$LINENO" 5 ;; - esac else - enable_klog="yes" -fi +$as_echo "#define vfork fork" >>confdefs.h - if test x$enable_klog = xyes; then - ENABLE_IMKLOG_TRUE= - ENABLE_IMKLOG_FALSE='#' -else - ENABLE_IMKLOG_TRUE='#' - ENABLE_IMKLOG_FALSE= fi +if test "x$ac_cv_func_fork_works" = xyes; then - if test x$os_type = xbsd; then - ENABLE_IMKLOG_BSD_TRUE= - ENABLE_IMKLOG_BSD_FALSE='#' -else - ENABLE_IMKLOG_BSD_TRUE='#' - ENABLE_IMKLOG_BSD_FALSE= -fi +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h - if test x$os_type = xlinux; then - ENABLE_IMKLOG_LINUX_TRUE= - ENABLE_IMKLOG_LINUX_FALSE='#' -else - ENABLE_IMKLOG_LINUX_TRUE='#' - ENABLE_IMKLOG_LINUX_FALSE= fi - if test x$os_type = xsolaris; then - ENABLE_IMKLOG_SOLARIS_TRUE= - ENABLE_IMKLOG_SOLARIS_FALSE='#' +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_IMKLOG_SOLARIS_TRUE='#' - ENABLE_IMKLOG_SOLARIS_FALSE= + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no fi +rm -f conftest* -# kmsg -# Check whether --enable-kmsg was given. -if test "${enable_kmsg+set}" = set; then : - enableval=$enable_kmsg; case "${enableval}" in - yes) enable_kmsg="yes" ;; - no) enable_kmsg="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-kmsg" "$LINENO" 5 ;; - esac -else - enable_kmsg="no" - + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes fi +rm -f conftest* - if test x$enable_kmsg = xyes; then - ENABLE_IMKMSG_TRUE= - ENABLE_IMKMSG_FALSE='#' -else - ENABLE_IMKMSG_TRUE='#' - ENABLE_IMKMSG_FALSE= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi fi - -# imjournal -# Check whether --enable-imjournal was given. -if test "${enable_imjournal+set}" = set; then : - enableval=$enable_imjournal; case "${enableval}" in - yes) enable_imjournal="yes" ;; - no) enable_imjournal="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imjournal" "$LINENO" 5 ;; - esac -else - enable_imjournal="no" +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF fi -if test "x$enable_imjournal" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSYSTEMD_JOURNAL" >&5 -$as_echo_n "checking for LIBSYSTEMD_JOURNAL... " >&6; } +done -if test -n "$LIBSYSTEMD_JOURNAL_CFLAGS"; then - pkg_cv_LIBSYSTEMD_JOURNAL_CFLAGS="$LIBSYSTEMD_JOURNAL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal >= 197\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-journal >= 197") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBSYSTEMD_JOURNAL_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-journal >= 197" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBSYSTEMD_JOURNAL_LIBS"; then - pkg_cv_LIBSYSTEMD_JOURNAL_LIBS="$LIBSYSTEMD_JOURNAL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal >= 197\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-journal >= 197") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBSYSTEMD_JOURNAL_LIBS=`$PKG_CONFIG --libs "libsystemd-journal >= 197" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no else - pkg_failed=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no fi - else - pkg_failed=untried +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBSYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-journal >= 197" 2>&1` - else - LIBSYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-journal >= 197" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBSYSTEMD_JOURNAL_PKG_ERRORS" >&5 + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - as_fn_error $? "Package requirements (libsystemd-journal >= 197) were not met: + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac -$LIBSYSTEMD_JOURNAL_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +$as_echo "#define malloc rpl_malloc" >>confdefs.h -Alternatively, you may set the environment variables LIBSYSTEMD_JOURNAL_CFLAGS -and LIBSYSTEMD_JOURNAL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +fi -Alternatively, you may set the environment variables LIBSYSTEMD_JOURNAL_CFLAGS -and LIBSYSTEMD_JOURNAL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - LIBSYSTEMD_JOURNAL_CFLAGS=$pkg_cv_LIBSYSTEMD_JOURNAL_CFLAGS - LIBSYSTEMD_JOURNAL_LIBS=$pkg_cv_LIBSYSTEMD_JOURNAL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF fi -fi - if test x$enable_imjournal = xyes; then - ENABLE_IMJOURNAL_TRUE= - ENABLE_IMJOURNAL_FALSE='#' -else - ENABLE_IMJOURNAL_TRUE='#' - ENABLE_IMJOURNAL_FALSE= -fi +done -# inet -# Check whether --enable-inet was given. -if test "${enable_inet+set}" = set; then : - enableval=$enable_inet; case "${enableval}" in - yes) enable_inet="yes" ;; - no) enable_inet="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-inet" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : + $as_echo_n "(cached) " >&6 else - enable_inet="yes" - -fi + if test "$cross_compiling" = yes; then : + ac_cv_func_realloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif - if test x$enable_inet = xyes; then - ENABLE_INET_TRUE= - ENABLE_INET_FALSE='#' +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_realloc_0_nonnull=yes else - ENABLE_INET_TRUE='#' - ENABLE_INET_FALSE= + ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - -if test "$enable_inet" = "yes"; then - -$as_echo "#define SYSLOG_INET 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then : +$as_echo "#define HAVE_REALLOC 1" >>confdefs.h -# -# The following define determines whether the package adheres to the -# file system standard. -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FSSTND support" >&5 -$as_echo_n "checking for FSSTND support... " >&6; } -# Check whether --enable-fsstnd was given. -if test "${enable_fsstnd+set}" = set; then : - enableval=$enable_fsstnd; - if test "x${enableval}" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +else + $as_echo "#define HAVE_REALLOC 0" >>confdefs.h -$as_echo "#define FSSTND 1" >>confdefs.h + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi -else +$as_echo "#define realloc rpl_realloc" >>confdefs.h - # enabled by default - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +fi -$as_echo "#define FSSTND 1" >>confdefs.h +for ac_header in sys/select.h sys/socket.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi +done - -# support for unlimited select() syscall -# Check whether --enable-unlimited_select was given. -if test "${enable_unlimited_select+set}" = set; then : - enableval=$enable_unlimited_select; case "${enableval}" in - yes) enable_unlimited_select="yes" ;; - no) enable_unlimited_select="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-unlimited-select" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 +$as_echo_n "checking types of arguments for select... " >&6; } +if test "${ac_cv_func_select_args+set}" = set; then : + $as_echo_n "(cached) " >&6 else - enable_unlimited_select="no" + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} -if test "$enable_unlimited_select" = "yes"; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 +$as_echo "$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift -$as_echo "#define USE_UNLIMITED_SELECT 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF -fi +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF -# support for systemd unit files -# Check whether --with-systemdsystemunitdir was given. -if test "${with_systemdsystemunitdir+set}" = set; then : - withval=$with_systemdsystemunitdir; -else - with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) -fi +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF -if test "x$with_systemdsystemunitdir" != xno; then - systemdsystemunitdir=$with_systemdsystemunitdir +rm -f conftest* -fi - if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then - HAVE_SYSTEMD_TRUE= - HAVE_SYSTEMD_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if test "${ac_cv_type_signal+set}" = set; then : + $as_echo_n "(cached) " >&6 else - HAVE_SYSTEMD_TRUE='#' - HAVE_SYSTEMD_FALSE= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_signal=int +else + ac_cv_type_signal=void +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF -# debug -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; case "${enableval}" in - yes) enable_debug="yes" ;; - no) enable_debug="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 +$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : + $as_echo_n "(cached) " >&6 else - enable_debug="no" + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then : + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail, as required by POSIX. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } -if test "$enable_debug" = "yes"; then +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && -$as_echo "#define DEBUG 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF -fi -if test "$enable_debug" = "no"; then -$as_echo "#define NDEBUG 1" >>confdefs.h +if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then + case " $LIBOBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; +esac fi - -# runtime instrumentation -# Check whether --enable-rtinst was given. -if test "${enable_rtinst+set}" = set; then : - enableval=$enable_rtinst; case "${enableval}" in - yes) enable_rtinst="yes" ;; - no) enable_rtinst="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-rtinst" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 +$as_echo_n "checking whether stat accepts an empty string... " >&6; } +if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : + $as_echo_n "(cached) " >&6 else - enable_rtinst="no" + if test "$cross_compiling" = yes; then : + ac_cv_func_stat_empty_string_bug=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_stat_empty_string_bug=no +else + ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 +$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIBOBJS " in + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; +esac -if test "$enable_rtinst" = "yes"; then -$as_echo "#define RTINST 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF fi - -# total debugless: highest performance, but no way at all to enable debug -# logging -# Check whether --enable-debugless was given. -if test "${enable_debugless+set}" = set; then : - enableval=$enable_debugless; case "${enableval}" in - yes) enable_debugless="yes" ;; - no) enable_debugless="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-debugless" "$LINENO" 5 ;; - esac +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = x""yes; then : + ac_have_decl=1 else - enable_debugless="no" - + ac_have_decl=0 fi -if test "$enable_debugless" = "yes"; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $ac_have_decl +_ACEOF -$as_echo "#define DEBUGLESS 1" >>confdefs.h +for ac_func in strerror_r +do : + ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" +if test "x$ac_cv_func_strerror_r" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRERROR_R 1 +_ACEOF fi +done - -# valgrind -# Check whether --enable-valgrind was given. -if test "${enable_valgrind+set}" = set; then : - enableval=$enable_valgrind; case "${enableval}" in - yes) enable_valgrind="yes" ;; - no) enable_valgrind="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-valgrind" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +$as_echo_n "checking whether strerror_r returns char *... " >&6; } +if test "${ac_cv_func_strerror_r_char_p+set}" = set; then : + $as_echo_n "(cached) " >&6 else - enable_valgrind="no" -fi - -if test "$enable_valgrind" = "yes"; then + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ -$as_echo "#define VALGRIND 1" >>confdefs.h + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_strerror_r_char_p=yes fi - - -# memcheck -# Check whether --enable-memcheck was given. -if test "${enable_memcheck+set}" = set; then : - enableval=$enable_memcheck; case "${enableval}" in - yes) enable_memcheck="yes" ;; - no) enable_memcheck="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-memcheck" "$LINENO" 5 ;; - esac +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then : + : else - enable_memcheck="no" - + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if test "$enable_memcheck" = "yes"; then - -$as_echo "#define MEMCHECK 1" >>confdefs.h + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then - -# compile diagnostic tools (small helpers usually not needed) -# Check whether --enable-diagtools was given. -if test "${enable_diagtools+set}" = set; then : - enableval=$enable_diagtools; case "${enableval}" in - yes) enable_diagtools="yes" ;; - no) enable_diagtools="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-diagtools" "$LINENO" 5 ;; - esac -else - enable_diagtools=no +$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi - if test x$enable_diagtools = xyes; then - ENABLE_DIAGTOOLS_TRUE= - ENABLE_DIAGTOOLS_FALSE='#' -else - ENABLE_DIAGTOOLS_TRUE='#' - ENABLE_DIAGTOOLS_FALSE= -fi +for ac_func in vprintf +do : + ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" +if test "x$ac_cv_func_vprintf" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF 1 +_ACEOF +ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" +if test "x$ac_cv_func__doprnt" = x""yes; then : +$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h -# compile end-user tools -# Check whether --enable-usertools was given. -if test "${enable_usertools+set}" = set; then : - enableval=$enable_usertools; case "${enableval}" in - yes) enable_usertools="yes" ;; - no) enable_usertools="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-usertools" "$LINENO" 5 ;; - esac -else - enable_usertools=no +fi fi +done + + +for ac_func in flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync lseek64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF - if test x$enable_usertools = xyes; then - ENABLE_USERTOOLS_TRUE= - ENABLE_USERTOOLS_FALSE='#' -else - ENABLE_USERTOOLS_TRUE='#' - ENABLE_USERTOOLS_FALSE= fi +done +# the check below is probably ugly. If someone knows how to do it in a better way, please +# let me know! -- rgerhards, 2010-10-06 +ac_fn_c_check_decl "$LINENO" "SCM_CREDENTIALS" "ac_cv_have_decl_SCM_CREDENTIALS" "#include +#include +" +if test "x$ac_cv_have_decl_SCM_CREDENTIALS" = x""yes; then : -# MySQL support -# Check whether --enable-mysql was given. -if test "${enable_mysql+set}" = set; then : - enableval=$enable_mysql; case "${enableval}" in - yes) enable_mysql="yes" ;; - no) enable_mysql="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mysql" "$LINENO" 5 ;; - esac -else - enable_mysql=no +$as_echo "#define HAVE_SCM_CREDENTIALS 1" >>confdefs.h fi -if test "x$enable_mysql" = "xyes"; then - # Extract the first word of "mysql_config", so it can be a program name with args. -set dummy mysql_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_MYSQL_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_MYSQL_CONFIG"; then - ac_cv_prog_HAVE_MYSQL_CONFIG="$HAVE_MYSQL_CONFIG" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_HAVE_MYSQL_CONFIG="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +ac_fn_c_check_decl "$LINENO" "SO_TIMESTAMP" "ac_cv_have_decl_SO_TIMESTAMP" "#include +#include +" +if test "x$ac_cv_have_decl_SO_TIMESTAMP" = x""yes; then : + +$as_echo "#define HAVE_SO_TIMESTAMP 1" >>confdefs.h -fi -fi -HAVE_MYSQL_CONFIG=$ac_cv_prog_HAVE_MYSQL_CONFIG -if test -n "$HAVE_MYSQL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_MYSQL_CONFIG" >&5 -$as_echo "$HAVE_MYSQL_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi - if test "x${HAVE_MYSQL_CONFIG}" != "xyes"; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "mysql_config not found in PATH - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue -See \`config.log' for more details" "$LINENO" 5; } - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5 -$as_echo_n "checking for mysql_init in -lmysqlclient... " >&6; } -if ${ac_cv_lib_mysqlclient_mysql_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmysqlclient `mysql_config --libs` - $LIBS" +# Check for MAXHOSTNAMELEN +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAXHOSTNAMELEN" >&5 +$as_echo_n "checking for MAXHOSTNAMELEN... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char mysql_init (); -int -main () -{ -return mysql_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mysqlclient_mysql_init=yes -else - ac_cv_lib_mysqlclient_mysql_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_init" >&5 -$as_echo "$ac_cv_lib_mysqlclient_mysql_init" >&6; } -if test "x$ac_cv_lib_mysqlclient_mysql_init" = xyes; then : - MYSQL_CFLAGS=`mysql_config --cflags` - MYSQL_LIBS=`mysql_config --libs` - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "MySQL library is missing -See \`config.log' for more details" "$LINENO" 5; } -fi + #include - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have mysql_library_init" >&5 -$as_echo_n "checking if we have mysql_library_init... " >&6; } - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $MYSQL_CFLAGS" - save_LIBS="$LIBS" - LIBS="$LIBS $MYSQL_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include int main () { -mysql_library_init(0, NULL, NULL) + + return MAXHOSTNAMELEN; + + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_mysql_library_init=yes +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else - have_mysql_library_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$save_CFLAGS" - LIBS="$save_LIBS" + # note: we use 1024 here, which should be far more than needed by any system. If that's too low, we simply + # life with the need to change it. Most of the code doesn't need it anyways, but there are a few places + # where it actually is needed and it makes no sense to change them. + +$as_echo "#define MAXHOSTNAMELEN 1024" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; defined as 64" >&5 +$as_echo "no; defined as 64" >&6; } + fi - if test x$enable_mysql = xyes; then - ENABLE_MYSQL_TRUE= - ENABLE_MYSQL_FALSE='#' +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +# check for availability of atomic operations +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler provides atomic builtins" >&5 +$as_echo_n "checking whether the compiler provides atomic builtins... " >&6; } +if test "${ap_cv_atomic_builtins+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_MYSQL_TRUE='#' - ENABLE_MYSQL_FALSE= -fi + if test "$cross_compiling" = yes; then : + ap_cv_atomic_builtins=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if test "$have_mysql_library_init" = "yes"; then +int main() +{ + unsigned long val = 1010, tmp, *mem = &val; -$as_echo "#define HAVE_MYSQL_LIBRARY_INIT 1" >>confdefs.h + if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + return 1; -fi + tmp = val; + if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + return 1; + if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + return 1; + tmp = 3030; -# PostgreSQL support -# Check whether --enable-pgsql was given. -if test "${enable_pgsql+set}" = set; then : - enableval=$enable_pgsql; case "${enableval}" in - yes) enable_pgsql="yes" ;; - no) enable_pgsql="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pgsql" "$LINENO" 5 ;; - esac -else - enable_pgsql=no + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + return 1; -fi + if (__sync_lock_test_and_set(&val, 4040) != 3030) + return 1; -if test "x$enable_pgsql" = "xyes"; then - # Extract the first word of "pg_config", so it can be a program name with args. -set dummy pg_config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_PGSQL_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_PGSQL_CONFIG"; then - ac_cv_prog_HAVE_PGSQL_CONFIG="$HAVE_PGSQL_CONFIG" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_HAVE_PGSQL_CONFIG="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + mem = &tmp; + + if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) + return 1; + + __sync_synchronize(); + if (mem != &val) + return 1; + + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ap_cv_atomic_builtins=yes +else + ap_cv_atomic_builtins=no fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -HAVE_PGSQL_CONFIG=$ac_cv_prog_HAVE_PGSQL_CONFIG -if test -n "$HAVE_PGSQL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PGSQL_CONFIG" >&5 -$as_echo "$HAVE_PGSQL_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ap_cv_atomic_builtins" >&5 +$as_echo "$ap_cv_atomic_builtins" >&6; } +if test "$ap_cv_atomic_builtins" = "yes"; then - if test "x${HAVE_PGSQL_CONFIG}" != "xyes"; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "pg_config not found in PATH -See \`config.log' for more details" "$LINENO" 5; } - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQconnectdb in -lpq" >&5 -$as_echo_n "checking for PQconnectdb in -lpq... " >&6; } -if ${ac_cv_lib_pq_PQconnectdb+:} false; then : +$as_echo "#define HAVE_ATOMIC_BUILTINS 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler provides atomic builtins for 64 bit data types" >&5 +$as_echo_n "checking whether the compiler provides atomic builtins for 64 bit data types... " >&6; } +if test "${ap_cv_atomic_builtins_64+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpq -L`pg_config --libdir` - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + ap_cv_atomic_builtins_64=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char PQconnectdb (); -int -main () +int main() { -return PQconnectdb (); - ; - return 0; + unsigned long long val = 1010, tmp, *mem = &val; + + if (__sync_fetch_and_add(&val, 1010) != 1010 || val != 2020) + return 1; + + tmp = val; + + if (__sync_fetch_and_sub(mem, 1010) != tmp || val != 1010) + return 1; + + if (__sync_sub_and_fetch(&val, 1010) != 0 || val != 0) + return 1; + + tmp = 3030; + + if (__sync_val_compare_and_swap(mem, 0, tmp) != 0 || val != tmp) + return 1; + + if (__sync_lock_test_and_set(&val, 4040) != 3030) + return 1; + + mem = &tmp; + + if (__sync_val_compare_and_swap(&mem, &tmp, &val) != &tmp) + return 1; + + __sync_synchronize(); + + if (mem != &val) + return 1; + + return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pq_PQconnectdb=yes +if ac_fn_c_try_run "$LINENO"; then : + ap_cv_atomic_builtins_64=yes else - ac_cv_lib_pq_PQconnectdb=no + ap_cv_atomic_builtins_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQconnectdb" >&5 -$as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; } -if test "x$ac_cv_lib_pq_PQconnectdb" = xyes; then : - PGSQL_CFLAGS="-I`pg_config --includedir`" - PGSQL_LIBS="-L`pg_config --libdir` -lpq" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "PgSQL library is missing -See \`config.log' for more details" "$LINENO" 5; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ap_cv_atomic_builtins_64" >&5 +$as_echo "$ap_cv_atomic_builtins_64" >&6; } + +if test "$ap_cv_atomic_builtins_64" = "yes"; then + +$as_echo "#define HAVE_ATOMIC_BUILTINS_64BIT 1" >>confdefs.h fi - if test x$enable_pgsql = xyes; then - ENABLE_PGSQL_TRUE= - ENABLE_PGSQL_FALSE='#' -else - ENABLE_PGSQL_TRUE='#' - ENABLE_PGSQL_FALSE= + + + +# fall back to POSIX sems for atomic operations (cpu expensive) +for ac_header in semaphore.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "semaphore.h" "ac_cv_header_semaphore_h" "$ac_includes_default" +if test "x$ac_cv_header_semaphore_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEMAPHORE_H 1 +_ACEOF + fi +done + + + +# Additional module directories + +# Check whether --with-moddirs was given. +if test "${with_moddirs+set}" = set; then : + withval=$with_moddirs; _save_IFS=$IFS ; IFS=$PATH_SEPARATOR ; moddirs="" + for w in ${with_moddirs} ; + do + case $w in + "") continue ;; */) ;; *) w="${w}/" ;; + esac + for m in ${moddirs} ; + do + test "x$w" = "x${libdir}/${PACKAGE}/" || \ + test "x$w" = "x$m" || test "x$w" = "x/" && \ + continue 2 + done + case $moddirs in + "") moddirs="$w" ;; *) moddirs="${moddirs}:${w}" ;; + esac + done ; IFS=$_save_IFS +else + moddirs="" + +fi + if test x$moddirs != x; then + WITH_MODDIRS_TRUE= + WITH_MODDIRS_FALSE='#' +else + WITH_MODDIRS_TRUE='#' + WITH_MODDIRS_FALSE= +fi -# oracle (OCI) support -# Check whether --enable-oracle was given. -if test "${enable_oracle+set}" = set; then : - enableval=$enable_oracle; case "${enableval}" in - yes) enable_oracle="yes" ;; - no) enable_oracle="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-oracle" "$LINENO" 5 ;; - esac -else - enable_oracle=no +# Large file support +# http://www.gnu.org/software/autoconf/manual/html_node/System-Services.html#index-AC_005fSYS_005fLARGEFILE-1028 +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; fi -if test "x$enable_oracle" = "xyes"; then - if test -d "$ORACLE_HOME" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCIEnvCreate in -locci" >&5 -$as_echo_n "checking for OCIEnvCreate in -locci... " >&6; } -if ${ac_cv_lib_occi_OCIEnvCreate+:} false; then : +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-locci -I$ORACLE_HOME/rdbms/public/ -L$ORACLE_HOME/lib -locci -lclntsh - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char OCIEnvCreate (); +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -return OCIEnvCreate (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_occi_OCIEnvCreate=yes -else - ac_cv_lib_occi_OCIEnvCreate=no + if ac_fn_c_try_compile "$LINENO"; then : + break fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_occi_OCIEnvCreate" >&5 -$as_echo "$ac_cv_lib_occi_OCIEnvCreate" >&6; } -if test "x$ac_cv_lib_occi_OCIEnvCreate" = xyes; then : - ORACLE_CFLAGS=-I$ORACLE_HOME/rdbms/public - ORACLE_LIBS=-L$ORACLE_HOME/lib -locci -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Oracle (OCI) library is missing: wrong oracle home -See \`config.log' for more details" "$LINENO" 5; } +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi - elif test -d "$ORACLE_LIB_PATH" -a -d "$ORACLE_INCLUDE_PATH" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCIEnvCreate in -locci" >&5 -$as_echo_n "checking for OCIEnvCreate in -locci... " >&6; } -if ${ac_cv_lib_occi_OCIEnvCreate+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-locci -I$ORACLE_INCLUDE_PATH -L$ORACLE_LIB_PATH -locci -lclntsh - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char OCIEnvCreate (); +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -return OCIEnvCreate (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_occi_OCIEnvCreate=yes -else - ac_cv_lib_occi_OCIEnvCreate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_occi_OCIEnvCreate" >&5 -$as_echo "$ac_cv_lib_occi_OCIEnvCreate" >&6; } -if test "x$ac_cv_lib_occi_OCIEnvCreate" = xyes; then : - ORACLE_CFLAGS=-I$ORACLE_INCLUDE_PATH - ORACLE_LIBS=-L$ORACLE_LIB_PATH -locci -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Oracle (OCI) library is missing: wrong oracle directories -See \`config.log' for more details" "$LINENO" 5; } +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ - else - # Extract the first word of "oracle-instantclient-config", so it can be a program name with args. -set dummy oracle-instantclient-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_ORACLE_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_ORACLE_CONFIG"; then - ac_cv_prog_HAVE_ORACLE_CONFIG="$HAVE_ORACLE_CONFIG" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_HAVE_ORACLE_CONFIG="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break fi -HAVE_ORACLE_CONFIG=$ac_cv_prog_HAVE_ORACLE_CONFIG -if test -n "$HAVE_ORACLE_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ORACLE_CONFIG" >&5 -$as_echo "$HAVE_ORACLE_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done fi - - - if test "x${HAVE_ORACLE_CONFIG}" != "xyes"; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "oracle-instantclient-config not found in PATH -See \`config.log' for more details" "$LINENO" 5; } - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCIEnvCreate in -locci" >&5 -$as_echo_n "checking for OCIEnvCreate in -locci... " >&6; } -if ${ac_cv_lib_occi_OCIEnvCreate+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-locci `oracle-instantclient-config --libs --cflags` - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char OCIEnvCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -return OCIEnvCreate (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_occi_OCIEnvCreate=yes -else - ac_cv_lib_occi_OCIEnvCreate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_occi_OCIEnvCreate" >&5 -$as_echo "$ac_cv_lib_occi_OCIEnvCreate" >&6; } -if test "x$ac_cv_lib_occi_OCIEnvCreate" = xyes; then : - ORACLE_CFLAGS="`oracle-instantclient-config --cflags`" - ORACLE_LIBS="`oracle-instantclient-config --libs`" - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Oracle (OCI) libraray is missing -See \`config.log' for more details" "$LINENO" 5; } +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break fi - - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done fi - if test x$enable_oracle = xyes; then - ENABLE_ORACLE_TRUE= - ENABLE_ORACLE_FALSE='#' -else - ENABLE_ORACLE_TRUE='#' - ENABLE_ORACLE_FALSE= +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi fi +case "${enable_largefile}" in + no) ;; + *) enable_largefile="yes" ;; +esac - - - -# libdbi support -# Check whether --enable-libdbi was given. -if test "${enable_libdbi+set}" = set; then : - enableval=$enable_libdbi; case "${enableval}" in - yes) enable_libdbi="yes" ;; - no) enable_libdbi="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-libdbi" "$LINENO" 5 ;; +# Regular expressions +# Check whether --enable-regexp was given. +if test "${enable_regexp+set}" = set; then : + enableval=$enable_regexp; case "${enableval}" in + yes) enable_regexp="yes" ;; + no) enable_regexp="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-regexp" "$LINENO" 5 ;; esac else - enable_libdbi=no + enable_regexp=yes fi -if test "x$enable_libdbi" = "xyes"; then - for ac_header in dbi/dbi.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dbi/dbi.h" "ac_cv_header_dbi_dbi_h" "$ac_includes_default" -if test "x$ac_cv_header_dbi_dbi_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DBI_DBI_H 1 -_ACEOF - + if test x$enable_regexp = xyes; then + ENABLE_REGEXP_TRUE= + ENABLE_REGEXP_FALSE='#' else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "libdbi is missing -See \`config.log' for more details" "$LINENO" 5; } - + ENABLE_REGEXP_TRUE='#' + ENABLE_REGEXP_FALSE= fi -done +if test "$enable_regexp" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbi_initialize in -ldbi" >&5 -$as_echo_n "checking for dbi_initialize in -ldbi... " >&6; } -if ${ac_cv_lib_dbi_dbi_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbi $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define FEATURE_REGEXP 1" >>confdefs.h -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbi_initialize (); -int -main () -{ -return dbi_initialize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dbi_dbi_initialize=yes -else - ac_cv_lib_dbi_dbi_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbi_dbi_initialize" >&5 -$as_echo "$ac_cv_lib_dbi_dbi_initialize" >&6; } -if test "x$ac_cv_lib_dbi_dbi_initialize" = xyes; then : - LIBDBI_CFLAGS="" - LIBDBI_LIBS="-ldbi" + + +# zlib compression +# Check whether --enable-zlib was given. +if test "${enable_zlib+set}" = set; then : + enableval=$enable_zlib; case "${enableval}" in + yes) enable_zlib="yes" ;; + no) enable_zlib="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-zlib" "$LINENO" 5 ;; + esac else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "libdbi library is missing -See \`config.log' for more details" "$LINENO" 5; } + enable_zlib=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbi_initialize_r in -ldbi" >&5 -$as_echo_n "checking for dbi_initialize_r in -ldbi... " >&6; } -if ${ac_cv_lib_dbi_dbi_initialize_r+:} false; then : - $as_echo_n "(cached) " >&6 + if test x$enable_zlib = xyes; then + ENABLE_ZLIB_TRUE= + ENABLE_ZLIB_FALSE='#' else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbi $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ENABLE_ZLIB_TRUE='#' + ENABLE_ZLIB_FALSE= +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbi_initialize_r (); -int -main () -{ -return dbi_initialize_r (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dbi_dbi_initialize_r=yes +if test "$enable_zlib" = "yes"; then + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = x""yes; then : + zlib_header="yes" else - ac_cv_lib_dbi_dbi_initialize_r=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + zlib_header="no" enable_zlib="false" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbi_dbi_initialize_r" >&5 -$as_echo "$ac_cv_lib_dbi_dbi_initialize_r" >&6; } -if test "x$ac_cv_lib_dbi_dbi_initialize_r" = xyes; then : - -$as_echo "#define HAVE_DBI_R 1" >>confdefs.h -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbi_conn_transaction_begin in -ldbi" >&5 -$as_echo_n "checking for dbi_conn_transaction_begin in -ldbi... " >&6; } -if ${ac_cv_lib_dbi_dbi_conn_transaction_begin+:} false; then : + if test "$zlib_header" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 +$as_echo_n "checking for deflate in -lz... " >&6; } +if test "${ac_cv_lib_z_deflate+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbi $LIBS" +LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17355,84 +14069,61 @@ #ifdef __cplusplus extern "C" #endif -char dbi_conn_transaction_begin (); +char deflate (); int main () { -return dbi_conn_transaction_begin (); +return deflate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dbi_dbi_conn_transaction_begin=yes + ac_cv_lib_z_deflate=yes else - ac_cv_lib_dbi_dbi_conn_transaction_begin=no + ac_cv_lib_z_deflate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbi_dbi_conn_transaction_begin" >&5 -$as_echo "$ac_cv_lib_dbi_dbi_conn_transaction_begin" >&6; } -if test "x$ac_cv_lib_dbi_dbi_conn_transaction_begin" = xyes; then : - -$as_echo "#define HAVE_DBI_TXSUPP 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 +$as_echo "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = x""yes; then : +$as_echo "#define USE_NETZIP 1" >>confdefs.h -fi + ZLIB_LIBS="-lz" -fi - if test x$enable_libdbi = xyes; then - ENABLE_OMLIBDBI_TRUE= - ENABLE_OMLIBDBI_FALSE='#' else - ENABLE_OMLIBDBI_TRUE='#' - ENABLE_OMLIBDBI_FALSE= + enable_zlib="false" fi - - - -# SNMP support -# Check whether --enable-snmp was given. -if test "${enable_snmp+set}" = set; then : - enableval=$enable_snmp; case "${enableval}" in - yes) enable_snmp="yes" ;; - no) enable_snmp="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-snmp" "$LINENO" 5 ;; - esac -else - enable_snmp=no - + fi fi -if test "x$enable_snmp" = "xyes"; then - for ac_header in net-snmp/net-snmp-config.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "net-snmp/net-snmp-config.h" "ac_cv_header_net_snmp_net_snmp_config_h" "$ac_includes_default" -if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_SNMP_NET_SNMP_CONFIG_H 1 -_ACEOF +#gssapi +# Check whether --enable-gssapi_krb5 was given. +if test "${enable_gssapi_krb5+set}" = set; then : + enableval=$enable_gssapi_krb5; case "${enableval}" in + yes) enable_gssapi_krb5="yes" ;; + no) enable_gssapi_krb5="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gssapi-krb5" "$LINENO" 5 ;; + esac else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Net-SNMP is missing -See \`config.log' for more details" "$LINENO" 5; } + enable_gssapi_krb5=no fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snmp_timeout in -lnetsnmp" >&5 -$as_echo_n "checking for snmp_timeout in -lnetsnmp... " >&6; } -if ${ac_cv_lib_netsnmp_snmp_timeout+:} false; then : +if test $enable_gssapi_krb5 = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gss_acquire_cred in -lgssapi_krb5" >&5 +$as_echo_n "checking for gss_acquire_cred in -lgssapi_krb5... " >&6; } +if test "${ac_cv_lib_gssapi_krb5_gss_acquire_cred+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lnetsnmp $LIBS" +LIBS="-lgssapi_krb5 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17442,288 +14133,89 @@ #ifdef __cplusplus extern "C" #endif -char snmp_timeout (); +char gss_acquire_cred (); int main () { -return snmp_timeout (); +return gss_acquire_cred (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_netsnmp_snmp_timeout=yes + ac_cv_lib_gssapi_krb5_gss_acquire_cred=yes else - ac_cv_lib_netsnmp_snmp_timeout=no + ac_cv_lib_gssapi_krb5_gss_acquire_cred=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_snmp_timeout" >&5 -$as_echo "$ac_cv_lib_netsnmp_snmp_timeout" >&6; } -if test "x$ac_cv_lib_netsnmp_snmp_timeout" = xyes; then : - SNMP_CFLAGS="" - SNMP_LIBS="-lnetsnmp" - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Net-SNMP library is missing -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi - if test x$enable_snmp = xyes; then - ENABLE_SNMP_TRUE= - ENABLE_SNMP_FALSE='#' -else - ENABLE_SNMP_TRUE='#' - ENABLE_SNMP_FALSE= -fi - - - - - -# uuid support -# Check whether --enable-uuid was given. -if test "${enable_uuid+set}" = set; then : - enableval=$enable_uuid; case "${enableval}" in - yes) enable_uuid="yes" ;; - no) enable_uuid="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-uuid" "$LINENO" 5 ;; - esac -else - enable_uuid=yes - -fi - -if test "x$enable_uuid" = "xyes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_krb5_gss_acquire_cred" >&5 +$as_echo "$ac_cv_lib_gssapi_krb5_gss_acquire_cred" >&6; } +if test "x$ac_cv_lib_gssapi_krb5_gss_acquire_cred" = x""yes; then : -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUUID" >&5 -$as_echo_n "checking for LIBUUID... " >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" +if test "x$ac_cv_header_gssapi_gssapi_h" = x""yes; then : -if test -n "$LIBUUID_CFLAGS"; then - pkg_cv_LIBUUID_CFLAGS="$LIBUUID_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 - ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBUUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBUUID_LIBS"; then - pkg_cv_LIBUUID_LIBS="$LIBUUID_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 - ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBUUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi +$as_echo "#define USE_GSSAPI /**/" >>confdefs.h + GSS_LIBS="-lgssapi_krb5" -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no fi - if test $_pkg_short_errors_supported = yes; then - LIBUUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "uuid" 2>&1` - else - LIBUUID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "uuid" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBUUID_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (uuid) were not met: - -$LIBUUID_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables LIBUUID_CFLAGS -and LIBUUID_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables LIBUUID_CFLAGS -and LIBUUID_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - LIBUUID_CFLAGS=$pkg_cv_LIBUUID_CFLAGS - LIBUUID_LIBS=$pkg_cv_LIBUUID_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } fi -$as_echo "#define USE_LIBUUID 1" >>confdefs.h - fi - if test x$enable_uuid = xyes; then - ENABLE_UUID_TRUE= - ENABLE_UUID_FALSE='#' + if test x$enable_gssapi_krb5 = xyes; then + ENABLE_GSSAPI_TRUE= + ENABLE_GSSAPI_FALSE='#' else - ENABLE_UUID_TRUE='#' - ENABLE_UUID_FALSE= + ENABLE_GSSAPI_TRUE='#' + ENABLE_GSSAPI_FALSE= fi -# elasticsearch support -# Check whether --enable-elasticsearch was given. -if test "${enable_elasticsearch+set}" = set; then : - enableval=$enable_elasticsearch; case "${enableval}" in - yes) enable_elasticsearch="yes" ;; - no) enable_elasticsearch="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-elasticsearch" "$LINENO" 5 ;; +# multithreading via pthreads +# Check whether --enable-pthreads was given. +if test "${enable_pthreads+set}" = set; then : + enableval=$enable_pthreads; case "${enableval}" in + yes) enable_pthreads="yes" ;; + no) enable_pthreads="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pthreads" "$LINENO" 5 ;; esac else - enable_elasticsearch=no + enable_pthreads=yes fi -if test "x$enable_elasticsearch" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CURL" >&5 -$as_echo_n "checking for CURL... " >&6; } - -if test -n "$CURL_CFLAGS"; then - pkg_cv_CURL_CFLAGS="$CURL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_CURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$CURL_LIBS"; then - pkg_cv_CURL_LIBS="$CURL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_CURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no +if test "x$enable_pthreads" = "xno"; then + as_fn_error $? "rsyslog v3+ does no longer support single threading mode -- use a previous version for that" "$LINENO" 5 ; fi - if test $_pkg_short_errors_supported = yes; then - CURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl" 2>&1` - else - CURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$CURL_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libcurl) were not met: - -$CURL_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables CURL_CFLAGS -and CURL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables CURL_CFLAGS -and CURL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - CURL_CFLAGS=$pkg_cv_CURL_CFLAGS - CURL_LIBS=$pkg_cv_CURL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if test "x$enable_pthreads" != "xno"; then + for ac_header in pthread.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_H 1 +_ACEOF -fi - LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 -$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } -if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lmw $LIBS" +LIBS="-lpthread -lpthread + $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17733,79 +14225,105 @@ #ifdef __cplusplus extern "C" #endif -char _mwvalidcheckl (); +char pthread_create (); int main () { -return _mwvalidcheckl (); +return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mw__mwvalidcheckl=yes + ac_cv_lib_pthread_pthread_create=yes else - ac_cv_lib_mw__mwvalidcheckl=no + ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 -$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } -if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : - LIBM="-lmw" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : + + +$as_echo "#define USE_PTHREADS 1" >>confdefs.h + + PTHREADS_LIBS="-lpthread" + case "${os_type}" in + solaris) PTHREADS_CFLAGS="-pthreads" ;; + *) PTHREADS_CFLAGS="-pthread" ;; + esac + + + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "pthread is missing +See \`config.log' for more details" "$LINENO" 5 ; } +fi + + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "pthread is missing +See \`config.log' for more details" "$LINENO" 5 ; } + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 -$as_echo_n "checking for cos in -lm... " >&6; } -if ${ac_cv_lib_m_cos+:} false; then : - $as_echo_n "(cached) " >&6 +done + +fi + +for ac_func in pthread_setschedparam +do : + ac_fn_c_check_func "$LINENO" "pthread_setschedparam" "ac_cv_func_pthread_setschedparam" +if test "x$ac_cv_func_pthread_setschedparam" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PTHREAD_SETSCHEDPARAM 1 +_ACEOF + + rsyslog_have_pthread_setschedparam=yes + else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cos (); -int -main () -{ -return cos (); - ; - return 0; -} + rsyslog_have_pthread_setschedparam=no + + +fi +done + +for ac_header in sched.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sched_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SCHED_H 1 _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_cos=yes + + rsyslog_have_sched_h=yes + else - ac_cv_lib_m_cos=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 -$as_echo "$ac_cv_lib_m_cos" >&6; } -if test "x$ac_cv_lib_m_cos" = xyes; then : - LIBM="$LIBM -lm" + + rsyslog_have_sched_h=no + + fi - ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 -$as_echo_n "checking for cos in -lm... " >&6; } -if ${ac_cv_lib_m_cos+:} false; then : +done + +if test "$rsyslog_have_pthread_setschedparam" = "yes" -a "$rsyslog_have_sched_h" = "yes"; then + save_LIBS=$LIBS + LIBS= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_get_priority_max" >&5 +$as_echo_n "checking for library containing sched_get_priority_max... " >&6; } +if test "${ac_cv_search_sched_get_priority_max+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17815,1223 +14333,1105 @@ #ifdef __cplusplus extern "C" #endif -char cos (); +char sched_get_priority_max (); int main () { -return cos (); +return sched_get_priority_max (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_cos=yes -else - ac_cv_lib_m_cos=no +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_sched_get_priority_max=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if test "${ac_cv_search_sched_get_priority_max+set}" = set; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 -$as_echo "$ac_cv_lib_m_cos" >&6; } -if test "x$ac_cv_lib_m_cos" = xyes; then : - LIBM="-lm" +done +if test "${ac_cv_search_sched_get_priority_max+set}" = set; then : + +else + ac_cv_search_sched_get_priority_max=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_get_priority_max" >&5 +$as_echo "$ac_cv_search_sched_get_priority_max" >&6; } +ac_res=$ac_cv_search_sched_get_priority_max +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ;; -esac +fi + if test "x$ac_cv_search" != "xno"; then + for ac_func in sched_get_priority_max +do : + ac_fn_c_check_func "$LINENO" "sched_get_priority_max" "ac_cv_func_sched_get_priority_max" +if test "x$ac_cv_func_sched_get_priority_max" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SCHED_GET_PRIORITY_MAX 1 +_ACEOF fi - if test x$enable_elasticsearch = xyes; then - ENABLE_ELASTICSEARCH_TRUE= - ENABLE_ELASTICSEARCH_FALSE='#' -else - ENABLE_ELASTICSEARCH_TRUE='#' - ENABLE_ELASTICSEARCH_FALSE= -fi +done + fi + IMUDP_LIBS=$LIBS + LIBS=$save_LIBS +fi -# GnuTLS support -# Check whether --enable-gnutls was given. -if test "${enable_gnutls+set}" = set; then : - enableval=$enable_gnutls; case "${enableval}" in - yes) enable_gnutls="yes" ;; - no) enable_gnutls="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gnutls" "$LINENO" 5 ;; + +# klog +# Check whether --enable-klog was given. +if test "${enable_klog+set}" = set; then : + enableval=$enable_klog; case "${enableval}" in + yes) enable_klog="yes" ;; + no) enable_klog="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-klog" "$LINENO" 5 ;; esac else - enable_gnutls=no + enable_klog="yes" fi -if test "x$enable_gnutls" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS" >&5 -$as_echo_n "checking for GNUTLS... " >&6; } - -if test -n "$GNUTLS_CFLAGS"; then - pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.4.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gnutls >= 1.4.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 1.4.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test x$enable_klog = xyes; then + ENABLE_IMKLOG_TRUE= + ENABLE_IMKLOG_FALSE='#' else - pkg_failed=yes + ENABLE_IMKLOG_TRUE='#' + ENABLE_IMKLOG_FALSE= fi - else - pkg_failed=untried + + if test x$os_type = xbsd; then + ENABLE_IMKLOG_BSD_TRUE= + ENABLE_IMKLOG_BSD_FALSE='#' +else + ENABLE_IMKLOG_BSD_TRUE='#' + ENABLE_IMKLOG_BSD_FALSE= fi -if test -n "$GNUTLS_LIBS"; then - pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.4.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gnutls >= 1.4.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 1.4.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + if test x$os_type = xlinux; then + ENABLE_IMKLOG_LINUX_TRUE= + ENABLE_IMKLOG_LINUX_FALSE='#' else - pkg_failed=yes + ENABLE_IMKLOG_LINUX_TRUE='#' + ENABLE_IMKLOG_LINUX_FALSE= fi - else - pkg_failed=untried + + if test x$os_type = xsolaris; then + ENABLE_IMKLOG_SOLARIS_TRUE= + ENABLE_IMKLOG_SOLARIS_FALSE='#' +else + ENABLE_IMKLOG_SOLARIS_TRUE='#' + ENABLE_IMKLOG_SOLARIS_FALSE= fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +# +# SYSLOG_UNIXAF +# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSLOG_UNIXAF support" >&5 +$as_echo_n "checking for SYSLOG_UNIXAF support... " >&6; } +# Check whether --enable-unix was given. +if test "${enable_unix+set}" = set; then : + enableval=$enable_unix; + if test "x${enableval}" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define SYSLOG_UNIXAF 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + fi -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes else - _pkg_short_errors_supported=no + + # enabled by default + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define SYSLOG_UNIXAF 1" >>confdefs.h + + fi - if test $_pkg_short_errors_supported = yes; then - GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 1.4.0" 2>&1` - else - GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 1.4.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GNUTLS_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gnutls >= 1.4.0) were not met: -$GNUTLS_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +# inet +# Check whether --enable-inet was given. +if test "${enable_inet+set}" = set; then : + enableval=$enable_inet; case "${enableval}" in + yes) enable_inet="yes" ;; + no) enable_inet="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-inet" "$LINENO" 5 ;; + esac +else + enable_inet="yes" -Alternatively, you may set the environment variables GNUTLS_CFLAGS -and GNUTLS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +fi -Alternatively, you may set the environment variables GNUTLS_CFLAGS -and GNUTLS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. + if test x$enable_inet = xyes; then + ENABLE_INET_TRUE= + ENABLE_INET_FALSE='#' +else + ENABLE_INET_TRUE='#' + ENABLE_INET_FALSE= +fi + +if test "$enable_inet" = "yes"; then + +$as_echo "#define SYSLOG_INET 1" >>confdefs.h + +fi + + +# +# The following define determines whether the package adheres to the +# file system standard. +# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FSSTND support" >&5 +$as_echo_n "checking for FSSTND support... " >&6; } +# Check whether --enable-fsstnd was given. +if test "${enable_fsstnd+set}" = set; then : + enableval=$enable_fsstnd; + if test "x${enableval}" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define FSSTND 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS - GNUTLS_LIBS=$pkg_cv_GNUTLS_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + + # enabled by default + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -fi +$as_echo "#define FSSTND 1" >>confdefs.h -$as_echo "#define ENABLE_GNUTLS 1" >>confdefs.h fi - if test x$enable_gnutls = xyes; then - ENABLE_GNUTLS_TRUE= - ENABLE_GNUTLS_FALSE='#' + + + +# support for unlimited select() syscall +# Check whether --enable-unlimited_select was given. +if test "${enable_unlimited_select+set}" = set; then : + enableval=$enable_unlimited_select; case "${enableval}" in + yes) enable_unlimited_select="yes" ;; + no) enable_unlimited_select="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-unlimited-select" "$LINENO" 5 ;; + esac else - ENABLE_GNUTLS_TRUE='#' - ENABLE_GNUTLS_FALSE= + enable_unlimited_select="no" + fi +if test "$enable_unlimited_select" = "yes"; then -# libgcrypt support -# Check whether --enable-libgcrypt was given. -if test "${enable_libgcrypt+set}" = set; then : - enableval=$enable_libgcrypt; case "${enableval}" in - yes) enable_libgcrypt="yes" ;; - no) enable_libgcrypt="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-libgcrypt" "$LINENO" 5 ;; - esac -else - enable_libgcrypt=yes +$as_echo "#define USE_UNLIMITED_SELECT 1" >>confdefs.h fi -if test "x$enable_libgcrypt" = "xyes"; then - # Extract the first word of "libgcrypt-config", so it can be a program name with args. -set dummy libgcrypt-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_LIBGCRYPT_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$HAVE_LIBGCRYPT_CONFIG"; then - ac_cv_prog_HAVE_LIBGCRYPT_CONFIG="$HAVE_LIBGCRYPT_CONFIG" # Let the user override the test. -else -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_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_HAVE_LIBGCRYPT_CONFIG="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +# support for systemd unit files + +# Check whether --with-systemdsystemunitdir was given. +if test "${with_systemdsystemunitdir+set}" = set; then : + withval=$with_systemdsystemunitdir; +else + with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) fi + +if test "x$with_systemdsystemunitdir" != xno; then + systemdsystemunitdir=$with_systemdsystemunitdir + fi -HAVE_LIBGCRYPT_CONFIG=$ac_cv_prog_HAVE_LIBGCRYPT_CONFIG -if test -n "$HAVE_LIBGCRYPT_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_LIBGCRYPT_CONFIG" >&5 -$as_echo "$HAVE_LIBGCRYPT_CONFIG" >&6; } + if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then + HAVE_SYSTEMD_TRUE= + HAVE_SYSTEMD_FALSE='#' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + HAVE_SYSTEMD_TRUE='#' + HAVE_SYSTEMD_FALSE= fi - if test "x${HAVE_LIBGCRYPT_CONFIG}" != "xyes"; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "libgcrypt-config not found in PATH -See \`config.log' for more details" "$LINENO" 5; } - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_cipher_open in -lgcrypt" >&5 -$as_echo_n "checking for gcry_cipher_open in -lgcrypt... " >&6; } -if ${ac_cv_lib_gcrypt_gcry_cipher_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgcrypt `libgcrypt-config --libs --cflags` - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gcry_cipher_open (); -int -main () -{ -return gcry_cipher_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gcrypt_gcry_cipher_open=yes +# debug +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; case "${enableval}" in + yes) enable_debug="yes" ;; + no) enable_debug="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; + esac else - ac_cv_lib_gcrypt_gcry_cipher_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_cipher_open" >&5 -$as_echo "$ac_cv_lib_gcrypt_gcry_cipher_open" >&6; } -if test "x$ac_cv_lib_gcrypt_gcry_cipher_open" = xyes; then : - LIBGCRYPT_CFLAGS="`libgcrypt-config --cflags`" - LIBGCRYPT_LIBS="`libgcrypt-config --libs`" + enable_debug="no" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "libgcrypt is missing -See \`config.log' for more details" "$LINENO" 5; } fi +if test "$enable_debug" = "yes"; then -$as_echo "#define ENABLE_LIBGCRYPT 1" >>confdefs.h +$as_echo "#define DEBUG 1" >>confdefs.h fi - if test x$enable_libgcrypt = xyes; then - ENABLE_LIBGCRYPT_TRUE= - ENABLE_LIBGCRYPT_FALSE='#' -else - ENABLE_LIBGCRYPT_TRUE='#' - ENABLE_LIBGCRYPT_FALSE= -fi - +if test "$enable_debug" = "no"; then +$as_echo "#define NDEBUG 1" >>confdefs.h +fi -# support for building the rsyslogd runtime -# Check whether --enable-rsyslogrt was given. -if test "${enable_rsyslogrt+set}" = set; then : - enableval=$enable_rsyslogrt; case "${enableval}" in - yes) enable_rsyslogrt="yes" ;; - no) enable_rsyslogrt="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-rsyslogrt" "$LINENO" 5 ;; +# runtime instrumentation +# Check whether --enable-rtinst was given. +if test "${enable_rtinst+set}" = set; then : + enableval=$enable_rtinst; case "${enableval}" in + yes) enable_rtinst="yes" ;; + no) enable_rtinst="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-rtinst" "$LINENO" 5 ;; esac else - enable_rsyslogrt=yes - -fi + enable_rtinst="no" -if test "x$enable_rsyslogrt" = "xyes"; then - RSRT_CFLAGS1="-I\$(top_srcdir)/runtime -I\$(top_srcdir) -I\$(top_srcdir)/grammar" - RSRT_LIBS1="\$(top_builddir)/runtime/librsyslog.la" -fi - if test x$enable_rsyslogrt = xyes; then - ENABLE_RSYSLOGRT_TRUE= - ENABLE_RSYSLOGRT_FALSE='#' -else - ENABLE_RSYSLOGRT_TRUE='#' - ENABLE_RSYSLOGRT_FALSE= fi -RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)" -RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)" - - +if test "$enable_rtinst" = "yes"; then +$as_echo "#define RTINST 1" >>confdefs.h +fi -# support for NOT building rsyslogd (useful for source-based packaging systems) -# Check whether --enable-rsyslogd was given. -if test "${enable_rsyslogd+set}" = set; then : - enableval=$enable_rsyslogd; case "${enableval}" in - yes) enable_rsyslogd="yes" ;; - no) enable_rsyslogd="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-rsyslogd" "$LINENO" 5 ;; +# valgrind +# Check whether --enable-valgrind was given. +if test "${enable_valgrind+set}" = set; then : + enableval=$enable_valgrind; case "${enableval}" in + yes) enable_valgrind="yes" ;; + no) enable_valgrind="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-valgrind" "$LINENO" 5 ;; esac else - enable_rsyslogd=yes + enable_valgrind="no" fi - if test x$enable_rsyslogd = xyes; then - ENABLE_RSYSLOGD_TRUE= - ENABLE_RSYSLOGD_FALSE='#' -else - ENABLE_RSYSLOGD_TRUE='#' - ENABLE_RSYSLOGD_FALSE= -fi +if test "$enable_valgrind" = "yes"; then + +$as_echo "#define VALGRIND 1" >>confdefs.h +fi -# capability to enable an extended testbench. By default, this is off. The reason -# for this switch is that some test simply take too long to execute them on a regular -# basis. So we enable to skip them, while the majority of tests can still be used. The -# idea is that at least "make distcheck" executes the extended testbench, and also -# developers should explicitely enable it after important changes. -- rgerhards, 2010-04-12 -# Check whether --enable-extended_tests was given. -if test "${enable_extended_tests+set}" = set; then : - enableval=$enable_extended_tests; case "${enableval}" in - yes) enable_rsyslogd="yes" ;; - no) enable_rsyslogd="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-extended-tests" "$LINENO" 5 ;; +# memcheck +# Check whether --enable-memcheck was given. +if test "${enable_memcheck+set}" = set; then : + enableval=$enable_memcheck; case "${enableval}" in + yes) enable_memcheck="yes" ;; + no) enable_memcheck="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-memcheck" "$LINENO" 5 ;; esac else - enable_extended_tests=no + enable_memcheck="no" fi - if test x$enable_extended_tests = xyes; then - ENABLE_EXTENDED_TESTS_TRUE= - ENABLE_EXTENDED_TESTS_FALSE='#' -else - ENABLE_EXTENDED_TESTS_TRUE='#' - ENABLE_EXTENDED_TESTS_FALSE= -fi +if test "$enable_memcheck" = "yes"; then +$as_echo "#define MEMCHECK 1" >>confdefs.h +fi -# capability to enable MySQL testbench tests. This requries that a Syslog database -# with the default schema has been created on the local (127.0.0.1) MySQL server and -# a user "rsyslog" with password "testbench" exists, is able to login with default -# parameters and has sufficient (read: all) privileges on that database. -# rgerhards, 2011-03-09 -# Check whether --enable-mysql_tests was given. -if test "${enable_mysql_tests+set}" = set; then : - enableval=$enable_mysql_tests; case "${enableval}" in - yes) enable_mysql_tests="yes" ;; - no) enable_mysql_tests="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mysql-tests" "$LINENO" 5 ;; + +# compile diagnostic tools (small helpers usually not needed) +# Check whether --enable-diagtools was given. +if test "${enable_diagtools+set}" = set; then : + enableval=$enable_diagtools; case "${enableval}" in + yes) enable_diagtools="yes" ;; + no) enable_diagtools="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-diagtools" "$LINENO" 5 ;; esac else - enable_mysql_tests=no + enable_diagtools=no fi - if test x$enable_mysql_tests = xyes; then - ENABLE_MYSQL_TESTS_TRUE= - ENABLE_MYSQL_TESTS_FALSE='#' + if test x$enable_diagtools = xyes; then + ENABLE_DIAGTOOLS_TRUE= + ENABLE_DIAGTOOLS_FALSE='#' else - ENABLE_MYSQL_TESTS_TRUE='#' - ENABLE_MYSQL_TESTS_FALSE= + ENABLE_DIAGTOOLS_TRUE='#' + ENABLE_DIAGTOOLS_FALSE= fi -# Mail support (so far we do not need a library, but we need to turn this on and off) -# Check whether --enable-mail was given. -if test "${enable_mail+set}" = set; then : - enableval=$enable_mail; case "${enableval}" in - yes) enable_mail="yes" ;; - no) enable_mail="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mail" "$LINENO" 5 ;; + +# MySQL support +# Check whether --enable-mysql was given. +if test "${enable_mysql+set}" = set; then : + enableval=$enable_mysql; case "${enableval}" in + yes) enable_mysql="yes" ;; + no) enable_mysql="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-mysql" "$LINENO" 5 ;; esac else - enable_mail=no + enable_mysql=no fi - if test x$enable_mail = xyes; then - ENABLE_MAIL_TRUE= - ENABLE_MAIL_FALSE='#' +if test "x$enable_mysql" = "xyes"; then + # Extract the first word of "mysql_config", so it can be a program name with args. +set dummy mysql_config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_HAVE_MYSQL_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_MAIL_TRUE='#' - ENABLE_MAIL_FALSE= -fi - - - -# imdiag support (so far we do not need a library, but we need to turn this on and off) -# note that we enable this be default, because an important point is to make -# it available to users who do not know much about how to handle things. It -# would complicate things if we first needed to tell them how to enable imdiag. -# rgerhards, 2008-07-25 -# Check whether --enable-imdiag was given. -if test "${enable_imdiag+set}" = set; then : - enableval=$enable_imdiag; case "${enableval}" in - yes) enable_imdiag="yes" ;; - no) enable_imdiag="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imdiag" "$LINENO" 5 ;; - esac + if test -n "$HAVE_MYSQL_CONFIG"; then + ac_cv_prog_HAVE_MYSQL_CONFIG="$HAVE_MYSQL_CONFIG" # Let the user override the test. else - enable_imdiag=no +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_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_HAVE_MYSQL_CONFIG="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - - if test x$enable_imdiag = xyes; then - ENABLE_IMDIAG_TRUE= - ENABLE_IMDIAG_FALSE='#' +fi +HAVE_MYSQL_CONFIG=$ac_cv_prog_HAVE_MYSQL_CONFIG +if test -n "$HAVE_MYSQL_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_MYSQL_CONFIG" >&5 +$as_echo "$HAVE_MYSQL_CONFIG" >&6; } else - ENABLE_IMDIAG_TRUE='#' - ENABLE_IMDIAG_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - -# mmnormalize -# Check whether --enable-mmnormalize was given. -if test "${enable_mmnormalize+set}" = set; then : - enableval=$enable_mmnormalize; case "${enableval}" in - yes) enable_mmnormalize="yes" ;; - no) enable_mmnormalize="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmnormalize" "$LINENO" 5 ;; - esac + if test "x${HAVE_MYSQL_CONFIG}" != "xyes"; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "mysql_config not found in PATH - usually a package named mysql-dev, libmysql-dev or similar, is missing - install it to fix this issue +See \`config.log' for more details" "$LINENO" 5 ; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5 +$as_echo_n "checking for mysql_init in -lmysqlclient... " >&6; } +if test "${ac_cv_lib_mysqlclient_mysql_init+set}" = set; then : + $as_echo_n "(cached) " >&6 else - enable_mmnormalize=no + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmysqlclient `mysql_config --libs` + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mysql_init (); +int +main () +{ +return mysql_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mysqlclient_mysql_init=yes +else + ac_cv_lib_mysqlclient_mysql_init=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_init" >&5 +$as_echo "$ac_cv_lib_mysqlclient_mysql_init" >&6; } +if test "x$ac_cv_lib_mysqlclient_mysql_init" = x""yes; then : + MYSQL_CFLAGS=`mysql_config --cflags` + MYSQL_LIBS=`mysql_config --libs` -if test "x$enable_mmnormalize" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEE" >&5 -$as_echo_n "checking for LIBEE... " >&6; } +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "MySQL library is missing +See \`config.log' for more details" "$LINENO" 5 ; } +fi -if test -n "$LIBEE_CFLAGS"; then - pkg_cv_LIBEE_CFLAGS="$LIBEE_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libee >= 0.4.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libee >= 0.4.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBEE_CFLAGS=`$PKG_CONFIG --cflags "libee >= 0.4.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have mysql_library_init" >&5 +$as_echo_n "checking if we have mysql_library_init... " >&6; } + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $MYSQL_CFLAGS" + save_LIBS="$LIBS" + LIBS="$LIBS $MYSQL_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ +mysql_library_init(0, NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_mysql_library_init=yes else - pkg_failed=yes + have_mysql_library_init=no fi - else - pkg_failed=untried +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" fi -if test -n "$LIBEE_LIBS"; then - pkg_cv_LIBEE_LIBS="$LIBEE_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libee >= 0.4.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libee >= 0.4.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBEE_LIBS=`$PKG_CONFIG --libs "libee >= 0.4.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test x$enable_mysql = xyes; then + ENABLE_MYSQL_TRUE= + ENABLE_MYSQL_FALSE='#' else - pkg_failed=yes -fi - else - pkg_failed=untried + ENABLE_MYSQL_TRUE='#' + ENABLE_MYSQL_FALSE= fi +if test "$have_mysql_library_init" = "yes"; then +$as_echo "#define HAVE_MYSQL_LIBRARY_INIT 1" >>confdefs.h -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no fi - if test $_pkg_short_errors_supported = yes; then - LIBEE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libee >= 0.4.0" 2>&1` - else - LIBEE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libee >= 0.4.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBEE_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libee >= 0.4.0) were not met: -$LIBEE_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables LIBEE_CFLAGS -and LIBEE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables LIBEE_CFLAGS -and LIBEE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +# PostgreSQL support +# Check whether --enable-pgsql was given. +if test "${enable_pgsql+set}" = set; then : + enableval=$enable_pgsql; case "${enableval}" in + yes) enable_pgsql="yes" ;; + no) enable_pgsql="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pgsql" "$LINENO" 5 ;; + esac else - LIBEE_CFLAGS=$pkg_cv_LIBEE_CFLAGS - LIBEE_LIBS=$pkg_cv_LIBEE_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + enable_pgsql=no fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLOGNORM" >&5 -$as_echo_n "checking for LIBLOGNORM... " >&6; } - -if test -n "$LIBLOGNORM_CFLAGS"; then - pkg_cv_LIBLOGNORM_CFLAGS="$LIBLOGNORM_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lognorm >= 0.3.1 lognorm < 1.0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lognorm >= 0.3.1 lognorm < 1.0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBLOGNORM_CFLAGS=`$PKG_CONFIG --cflags "lognorm >= 0.3.1 lognorm < 1.0.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +if test "x$enable_pgsql" = "xyes"; then + # Extract the first word of "pg_config", so it can be a program name with args. +set dummy pg_config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_HAVE_PGSQL_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBLOGNORM_LIBS"; then - pkg_cv_LIBLOGNORM_LIBS="$LIBLOGNORM_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lognorm >= 0.3.1 lognorm < 1.0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lognorm >= 0.3.1 lognorm < 1.0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBLOGNORM_LIBS=`$PKG_CONFIG --libs "lognorm >= 0.3.1 lognorm < 1.0.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test -n "$HAVE_PGSQL_CONFIG"; then + ac_cv_prog_HAVE_PGSQL_CONFIG="$HAVE_PGSQL_CONFIG" # Let the user override the test. else - pkg_failed=yes +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_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_HAVE_PGSQL_CONFIG="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi - else - pkg_failed=untried fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +HAVE_PGSQL_CONFIG=$ac_cv_prog_HAVE_PGSQL_CONFIG +if test -n "$HAVE_PGSQL_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PGSQL_CONFIG" >&5 +$as_echo "$HAVE_PGSQL_CONFIG" >&6; } else - _pkg_short_errors_supported=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if test $_pkg_short_errors_supported = yes; then - LIBLOGNORM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lognorm >= 0.3.1 lognorm < 1.0.0" 2>&1` - else - LIBLOGNORM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lognorm >= 0.3.1 lognorm < 1.0.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBLOGNORM_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (lognorm >= 0.3.1 lognorm < 1.0.0) were not met: -$LIBLOGNORM_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables LIBLOGNORM_CFLAGS -and LIBLOGNORM_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + if test "x${HAVE_PGSQL_CONFIG}" != "xyes"; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables LIBLOGNORM_CFLAGS -and LIBLOGNORM_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +as_fn_error $? "pg_config not found in PATH +See \`config.log' for more details" "$LINENO" 5 ; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQconnectdb in -lpq" >&5 +$as_echo_n "checking for PQconnectdb in -lpq... " >&6; } +if test "${ac_cv_lib_pq_PQconnectdb+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpq -L`pg_config --libdir` + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char PQconnectdb (); +int +main () +{ +return PQconnectdb (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pq_PQconnectdb=yes else - LIBLOGNORM_CFLAGS=$pkg_cv_LIBLOGNORM_CFLAGS - LIBLOGNORM_LIBS=$pkg_cv_LIBLOGNORM_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi + ac_cv_lib_pq_PQconnectdb=no fi - if test x$enable_mmnormalize = xyes; then - ENABLE_MMNORMALIZE_TRUE= - ENABLE_MMNORMALIZE_FALSE='#' -else - ENABLE_MMNORMALIZE_TRUE='#' - ENABLE_MMNORMALIZE_FALSE= +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQconnectdb" >&5 +$as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; } +if test "x$ac_cv_lib_pq_PQconnectdb" = x""yes; then : + PGSQL_CFLAGS="-I`pg_config --includedir`" + PGSQL_LIBS="-L`pg_config --libdir` -lpq" - - -# mmnjsonparse -# Check whether --enable-mmjsonparse was given. -if test "${enable_mmjsonparse+set}" = set; then : - enableval=$enable_mmjsonparse; case "${enableval}" in - yes) enable_mmjsonparse="yes" ;; - no) enable_mmjsonparse="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmjsonparse" "$LINENO" 5 ;; - esac else - enable_mmjsonparse=no - + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "PgSQL library is missing +See \`config.log' for more details" "$LINENO" 5 ; } fi - if test x$enable_mmjsonparse = xyes; then - ENABLE_MMJSONPARSE_TRUE= - ENABLE_MMJSONPARSE_FALSE='#' -else - ENABLE_MMJSONPARSE_TRUE='#' - ENABLE_MMJSONPARSE_FALSE= fi - - - -# mmaudit -# Check whether --enable-mmaudit was given. -if test "${enable_mmaudit+set}" = set; then : - enableval=$enable_mmaudit; case "${enableval}" in - yes) enable_mmaudit="yes" ;; - no) enable_mmaudit="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmaudit" "$LINENO" 5 ;; - esac + if test x$enable_pgsql = xyes; then + ENABLE_PGSQL_TRUE= + ENABLE_PGSQL_FALSE='#' else - enable_mmaudit=no - + ENABLE_PGSQL_TRUE='#' + ENABLE_PGSQL_FALSE= fi - if test x$enable_mmaudit = xyes; then - ENABLE_MMAUDIT_TRUE= - ENABLE_MMAUDIT_FALSE='#' -else - ENABLE_MMAUDIT_TRUE='#' - ENABLE_MMAUDIT_FALSE= -fi -# mmanon -# Check whether --enable-mmanon was given. -if test "${enable_mmanon+set}" = set; then : - enableval=$enable_mmanon; case "${enableval}" in - yes) enable_mmanon="yes" ;; - no) enable_mmanon="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmanon" "$LINENO" 5 ;; - esac + +# oracle (OCI) support +# Check whether --enable-oracle was given. +if test "${enable_oracle+set}" = set; then : + enableval=$enable_oracle; case "${enableval}" in + yes) enable_oracle="yes" ;; + no) enable_oracle="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-oracle" "$LINENO" 5 ;; + esac else - enable_mmanon=no + enable_oracle=no fi - if test x$enable_mmanon = xyes; then - ENABLE_MMANON_TRUE= - ENABLE_MMANON_FALSE='#' +if test "x$enable_oracle" = "xyes"; then + if test -d "$ORACLE_HOME" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCIEnvCreate in -locci" >&5 +$as_echo_n "checking for OCIEnvCreate in -locci... " >&6; } +if test "${ac_cv_lib_occi_OCIEnvCreate+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_MMANON_TRUE='#' - ENABLE_MMANON_FALSE= -fi - - + ac_check_lib_save_LIBS=$LIBS +LIBS="-locci -I$ORACLE_HOME/rdbms/public/ -L$ORACLE_HOME/lib -locci -lclntsh + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# mmutf8fix -# Check whether --enable-mmutf8fix was given. -if test "${enable_mmutf8fix+set}" = set; then : - enableval=$enable_mmutf8fix; case "${enableval}" in - yes) enable_mmutf8fix="yes" ;; - no) enable_mmutf8fix="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmutf8fix" "$LINENO" 5 ;; - esac +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char OCIEnvCreate (); +int +main () +{ +return OCIEnvCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_occi_OCIEnvCreate=yes else - enable_mmutf8fix=no - + ac_cv_lib_occi_OCIEnvCreate=no fi - - if test x$enable_mmutf8fix = xyes; then - ENABLE_MMUTF8FIX_TRUE= - ENABLE_MMUTF8FIX_FALSE='#' -else - ENABLE_MMUTF8FIX_TRUE='#' - ENABLE_MMUTF8FIX_FALSE= +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - - - -# mmcount -# Check whether --enable-mmcount was given. -if test "${enable_mmcount+set}" = set; then : - enableval=$enable_mmcount; case "${enableval}" in - yes) enable_mmcount="yes" ;; - no) enable_mmcount="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmcount" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_occi_OCIEnvCreate" >&5 +$as_echo "$ac_cv_lib_occi_OCIEnvCreate" >&6; } +if test "x$ac_cv_lib_occi_OCIEnvCreate" = x""yes; then : + ORACLE_CFLAGS=-I$ORACLE_HOME/rdbms/public + ORACLE_LIBS=-L$ORACLE_HOME/lib -locci else - enable_mmcount=no - + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Oracle (OCI) library is missing: wrong oracle home +See \`config.log' for more details" "$LINENO" 5 ; } fi - if test x$enable_mmcount = xyes; then - ENABLE_MMCOUNT_TRUE= - ENABLE_MMCOUNT_FALSE='#' + elif test -d "$ORACLE_LIB_PATH" -a -d "$ORACLE_INCLUDE_PATH" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCIEnvCreate in -locci" >&5 +$as_echo_n "checking for OCIEnvCreate in -locci... " >&6; } +if test "${ac_cv_lib_occi_OCIEnvCreate+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_MMCOUNT_TRUE='#' - ENABLE_MMCOUNT_FALSE= -fi - - + ac_check_lib_save_LIBS=$LIBS +LIBS="-locci -I$ORACLE_INCLUDE_PATH -L$ORACLE_LIB_PATH -locci -lclntsh + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# mmsequence -# Check whether --enable-mmsequence was given. -if test "${enable_mmsequence+set}" = set; then : - enableval=$enable_mmsequence; case "${enableval}" in - yes) enable_mmsequence="yes" ;; - no) enable_mmsequence="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmsequence" "$LINENO" 5 ;; - esac +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char OCIEnvCreate (); +int +main () +{ +return OCIEnvCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_occi_OCIEnvCreate=yes else - enable_mmsequence=no - + ac_cv_lib_occi_OCIEnvCreate=no fi - - if test x$enable_mmsequence = xyes; then - ENABLE_MMSEQUENCE_TRUE= - ENABLE_MMSEQUENCE_FALSE='#' -else - ENABLE_MMSEQUENCE_TRUE='#' - ENABLE_MMSEQUENCE_FALSE= +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - - - -# mmfields -# Check whether --enable-mmfields was given. -if test "${enable_mmfields+set}" = set; then : - enableval=$enable_mmfields; case "${enableval}" in - yes) enable_mmfields="yes" ;; - no) enable_mmfields="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmfields" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_occi_OCIEnvCreate" >&5 +$as_echo "$ac_cv_lib_occi_OCIEnvCreate" >&6; } +if test "x$ac_cv_lib_occi_OCIEnvCreate" = x""yes; then : + ORACLE_CFLAGS=-I$ORACLE_INCLUDE_PATH + ORACLE_LIBS=-L$ORACLE_LIB_PATH -locci else - enable_mmfields=no - + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Oracle (OCI) library is missing: wrong oracle directories +See \`config.log' for more details" "$LINENO" 5 ; } fi - if test x$enable_mmfields = xyes; then - ENABLE_MMFIELDS_TRUE= - ENABLE_MMFIELDS_FALSE='#' + else + # Extract the first word of "oracle-instantclient-config", so it can be a program name with args. +set dummy oracle-instantclient-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_HAVE_ORACLE_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ENABLE_MMFIELDS_TRUE='#' - ENABLE_MMFIELDS_FALSE= -fi - - -# mmpstrucdata -# Check whether --enable-mmpstrucdata was given. -if test "${enable_mmpstrucdata+set}" = set; then : - enableval=$enable_mmpstrucdata; case "${enableval}" in - yes) enable_mmpstrucdata="yes" ;; - no) enable_mmpstrucdata="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmpstrucdata" "$LINENO" 5 ;; - esac + if test -n "$HAVE_ORACLE_CONFIG"; then + ac_cv_prog_HAVE_ORACLE_CONFIG="$HAVE_ORACLE_CONFIG" # Let the user override the test. else - enable_mmpstrucdata=no +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_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_HAVE_ORACLE_CONFIG="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - - if test x$enable_mmpstrucdata = xyes; then - ENABLE_MMPSTRUCDATA_TRUE= - ENABLE_MMPSTRUCDATA_FALSE='#' -else - ENABLE_MMPSTRUCDATA_TRUE='#' - ENABLE_MMPSTRUCDATA_FALSE= fi - - - -# mmrfc5424addhmac -# Check whether --enable-mmrfc5424addhmac was given. -if test "${enable_mmrfc5424addhmac+set}" = set; then : - enableval=$enable_mmrfc5424addhmac; case "${enableval}" in - yes) enable_mmrfc5424addhmac="yes" ;; - no) enable_mmrfc5424addhmac="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmrfc5424addhmac" "$LINENO" 5 ;; - esac +HAVE_ORACLE_CONFIG=$ac_cv_prog_HAVE_ORACLE_CONFIG +if test -n "$HAVE_ORACLE_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ORACLE_CONFIG" >&5 +$as_echo "$HAVE_ORACLE_CONFIG" >&6; } else - enable_mmrfc5424addhmac=no - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test "x$enable_mmrfc5424addhmac" = "xyes"; then -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 -$as_echo_n "checking for OPENSSL... " >&6; } - -if test -n "$OPENSSL_CFLAGS"; then - pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.7\""; } >&5 - ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.7") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 0.9.7" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test "x${HAVE_ORACLE_CONFIG}" != "xyes"; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "oracle-instantclient-config not found in PATH +See \`config.log' for more details" "$LINENO" 5 ; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCIEnvCreate in -locci" >&5 +$as_echo_n "checking for OCIEnvCreate in -locci... " >&6; } +if test "${ac_cv_lib_occi_OCIEnvCreate+set}" = set; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$OPENSSL_LIBS"; then - pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.7\""; } >&5 - ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.7") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl >= 0.9.7" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + ac_check_lib_save_LIBS=$LIBS +LIBS="-locci `oracle-instantclient-config --libs --cflags` + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char OCIEnvCreate (); +int +main () +{ +return OCIEnvCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_occi_OCIEnvCreate=yes else - pkg_failed=yes + ac_cv_lib_occi_OCIEnvCreate=no fi - else - pkg_failed=untried +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_occi_OCIEnvCreate" >&5 +$as_echo "$ac_cv_lib_occi_OCIEnvCreate" >&6; } +if test "x$ac_cv_lib_occi_OCIEnvCreate" = x""yes; then : + ORACLE_CFLAGS="`oracle-instantclient-config --cflags`" + ORACLE_LIBS="`oracle-instantclient-config --libs`" + else - _pkg_short_errors_supported=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Oracle (OCI) libraray is missing +See \`config.log' for more details" "$LINENO" 5 ; } fi - if test $_pkg_short_errors_supported = yes; then - OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 0.9.7" 2>&1` - else - OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 0.9.7" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$OPENSSL_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (openssl >= 0.9.7) were not met: + fi +fi + if test x$enable_oracle = xyes; then + ENABLE_ORACLE_TRUE= + ENABLE_ORACLE_FALSE='#' +else + ENABLE_ORACLE_TRUE='#' + ENABLE_ORACLE_FALSE= +fi -$OPENSSL_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. -Alternatively, you may set the environment variables OPENSSL_CFLAGS -and OPENSSL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables OPENSSL_CFLAGS -and OPENSSL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +# libdbi support +# Check whether --enable-libdbi was given. +if test "${enable_libdbi+set}" = set; then : + enableval=$enable_libdbi; case "${enableval}" in + yes) enable_libdbi="yes" ;; + no) enable_libdbi="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-libdbi" "$LINENO" 5 ;; + esac else - OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS - OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + enable_libdbi=no fi -#AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data], [], [AC_MSG_ERROR([OpenSSL libraries required])]) -#AC_CHECK_LIB([ssl],[SSL_library_init], [], [AC_MSG_ERROR([OpenSSL libraries required])]) -#AC_CHECK_HEADERS([openssl/crypto.h openssl/x509.h openssl/pem.h openssl/ssl.h openssl/err.h],[],[AC_MSG_ERROR([OpenSSL headers required])]) -fi - if test x$enable_mmrfc5424addhmac = xyes; then - ENABLE_MMRFC5424ADDHMAC_TRUE= - ENABLE_MMRFC5424ADDHMAC_FALSE='#' -else - ENABLE_MMRFC5424ADDHMAC_TRUE='#' - ENABLE_MMRFC5424ADDHMAC_FALSE= -fi - +if test "x$enable_libdbi" = "xyes"; then + for ac_header in dbi/dbi.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dbi/dbi.h" "ac_cv_header_dbi_dbi_h" "$ac_includes_default" +if test "x$ac_cv_header_dbi_dbi_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DBI_DBI_H 1 +_ACEOF -# RELP support -# Check whether --enable-relp was given. -if test "${enable_relp+set}" = set; then : - enableval=$enable_relp; case "${enableval}" in - yes) enable_relp="yes" ;; - no) enable_relp="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-relp" "$LINENO" 5 ;; - esac else - enable_relp=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "libdbi is missing +See \`config.log' for more details" "$LINENO" 5 ; } fi -if test "x$enable_relp" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RELP" >&5 -$as_echo_n "checking for RELP... " >&6; } +done -if test -n "$RELP_CFLAGS"; then - pkg_cv_RELP_CFLAGS="$RELP_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"relp >= 1.2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "relp >= 1.2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_RELP_CFLAGS=`$PKG_CONFIG --cflags "relp >= 1.2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbi_initialize in -ldbi" >&5 +$as_echo_n "checking for dbi_initialize in -ldbi... " >&6; } +if test "${ac_cv_lib_dbi_dbi_initialize+set}" = set; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$RELP_LIBS"; then - pkg_cv_RELP_LIBS="$RELP_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"relp >= 1.2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "relp >= 1.2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_RELP_LIBS=`$PKG_CONFIG --libs "relp >= 1.2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldbi $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dbi_initialize (); +int +main () +{ +return dbi_initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dbi_dbi_initialize=yes else - pkg_failed=yes + ac_cv_lib_dbi_dbi_initialize=no fi - else - pkg_failed=untried +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbi_dbi_initialize" >&5 +$as_echo "$ac_cv_lib_dbi_dbi_initialize" >&6; } +if test "x$ac_cv_lib_dbi_dbi_initialize" = x""yes; then : + LIBDBI_CFLAGS="" + LIBDBI_LIBS="-ldbi" +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "libdbi library is missing +See \`config.log' for more details" "$LINENO" 5 ; } +fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbi_initialize_r in -ldbi" >&5 +$as_echo_n "checking for dbi_initialize_r in -ldbi... " >&6; } +if test "${ac_cv_lib_dbi_dbi_initialize_r+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldbi $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dbi_initialize_r (); +int +main () +{ +return dbi_initialize_r (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dbi_dbi_initialize_r=yes else - _pkg_short_errors_supported=no + ac_cv_lib_dbi_dbi_initialize_r=no fi - if test $_pkg_short_errors_supported = yes; then - RELP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "relp >= 1.2.0" 2>&1` - else - RELP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "relp >= 1.2.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$RELP_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (relp >= 1.2.0) were not met: - -$RELP_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables RELP_CFLAGS -and RELP_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbi_dbi_initialize_r" >&5 +$as_echo "$ac_cv_lib_dbi_dbi_initialize_r" >&6; } +if test "x$ac_cv_lib_dbi_dbi_initialize_r" = x""yes; then : -Alternatively, you may set the environment variables RELP_CFLAGS -and RELP_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +$as_echo "#define HAVE_DBI_R 1" >>confdefs.h -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - RELP_CFLAGS=$pkg_cv_RELP_CFLAGS - RELP_LIBS=$pkg_cv_RELP_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } fi + fi - if test x$enable_relp = xyes; then - ENABLE_RELP_TRUE= - ENABLE_RELP_FALSE='#' + if test x$enable_libdbi = xyes; then + ENABLE_OMLIBDBI_TRUE= + ENABLE_OMLIBDBI_FALSE='#' else - ENABLE_RELP_TRUE='#' - ENABLE_RELP_FALSE= + ENABLE_OMLIBDBI_TRUE='#' + ENABLE_OMLIBDBI_FALSE= fi -# GuardTime support -# Check whether --enable-guardtime was given. -if test "${enable_guardtime+set}" = set; then : - enableval=$enable_guardtime; case "${enableval}" in - yes) enable_guardtime="yes" ;; - no) enable_guardtime="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-guardtime" "$LINENO" 5 ;; - esac -else - enable_guardtime=no - -fi - -if test "x$enable_guardtime" = "xyes"; then -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUARDTIME" >&5 -$as_echo_n "checking for GUARDTIME... " >&6; } -if test -n "$GUARDTIME_CFLAGS"; then - pkg_cv_GUARDTIME_CFLAGS="$GUARDTIME_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgt >= 0.3.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libgt >= 0.3.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GUARDTIME_CFLAGS=`$PKG_CONFIG --cflags "libgt >= 0.3.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$GUARDTIME_LIBS"; then - pkg_cv_GUARDTIME_LIBS="$GUARDTIME_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgt >= 0.3.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libgt >= 0.3.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GUARDTIME_LIBS=`$PKG_CONFIG --libs "libgt >= 0.3.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +# SNMP support +# Check whether --enable-snmp was given. +if test "${enable_snmp+set}" = set; then : + enableval=$enable_snmp; case "${enableval}" in + yes) enable_snmp="yes" ;; + no) enable_snmp="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-snmp" "$LINENO" 5 ;; + esac else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - + enable_snmp=no +fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if test "x$enable_snmp" = "xyes"; then + for ac_header in net-snmp/net-snmp-config.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "net-snmp/net-snmp-config.h" "ac_cv_header_net_snmp_net_snmp_config_h" "$ac_includes_default" +if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NET_SNMP_NET_SNMP_CONFIG_H 1 +_ACEOF -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - GUARDTIME_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libgt >= 0.3.1" 2>&1` - else - GUARDTIME_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libgt >= 0.3.1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GUARDTIME_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libgt >= 0.3.1) were not met: + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Net-SNMP is missing +See \`config.log' for more details" "$LINENO" 5 ; } -$GUARDTIME_PKG_ERRORS +fi -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +done -Alternatively, you may set the environment variables GUARDTIME_CFLAGS -and GUARDTIME_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snmp_timeout in -lnetsnmp" >&5 +$as_echo_n "checking for snmp_timeout in -lnetsnmp... " >&6; } +if test "${ac_cv_lib_netsnmp_snmp_timeout+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetsnmp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -Alternatively, you may set the environment variables GUARDTIME_CFLAGS -and GUARDTIME_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char snmp_timeout (); +int +main () +{ +return snmp_timeout (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_netsnmp_snmp_timeout=yes +else + ac_cv_lib_netsnmp_snmp_timeout=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netsnmp_snmp_timeout" >&5 +$as_echo "$ac_cv_lib_netsnmp_snmp_timeout" >&6; } +if test "x$ac_cv_lib_netsnmp_snmp_timeout" = x""yes; then : + SNMP_CFLAGS="" + SNMP_LIBS="-lnetsnmp" -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } else - GUARDTIME_CFLAGS=$pkg_cv_GUARDTIME_CFLAGS - GUARDTIME_LIBS=$pkg_cv_GUARDTIME_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Net-SNMP library is missing +See \`config.log' for more details" "$LINENO" 5 ; } fi + fi - if test x$enable_guardtime = xyes; then - ENABLE_GUARDTIME_TRUE= - ENABLE_GUARDTIME_FALSE='#' + if test x$enable_snmp = xyes; then + ENABLE_SNMP_TRUE= + ENABLE_SNMP_FALSE='#' else - ENABLE_GUARDTIME_TRUE='#' - ENABLE_GUARDTIME_FALSE= + ENABLE_SNMP_TRUE='#' + ENABLE_SNMP_FALSE= fi -# Support using cached man file copies, to avoid the need for rst2man -# in the build environment -# Check whether --enable-cached_man_pages was given. -if test "${enable_cached_man_pages+set}" = set; then : - enableval=$enable_cached_man_pages; case "${enableval}" in - yes) enable_cached_man_pages="yes" ;; - no) enable_cached_man_pages="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-cached-man-pages" "$LINENO" 5 ;; + + +# elasticsearch support +# Check whether --enable-elasticsearch was given. +if test "${enable_elasticsearch+set}" = set; then : + enableval=$enable_elasticsearch; case "${enableval}" in + yes) enable_elasticsearch="yes" ;; + no) enable_elasticsearch="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-elasticsearch" "$LINENO" 5 ;; esac else - enable_cached_man_pages=no + enable_elasticsearch=no fi -if test "x$enable_cached_man_pages" = "xno"; then -# obtain path for rst2man - if test "x$enable_libgcrypt" = "xyes" || \ - test "x$enable_guardtime" = "xyes"; then - # Extract the first word of "rst2man", so it can be a program name with args. -set dummy rst2man; ac_word=$2 +if test "x$enable_elasticsearch" = "xyes"; then + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RST2MAN+:} false; then : +if test "${ac_cv_prog_HAVE_CURL_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else - case $RST2MAN in - [\\/]* | ?:[\\/]*) - ac_cv_path_RST2MAN="$RST2MAN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$HAVE_CURL_CONFIG"; then + ac_cv_prog_HAVE_CURL_CONFIG="$HAVE_CURL_CONFIG" # Let the user override the test. +else +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_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RST2MAN="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_HAVE_CURL_CONFIG="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -19039,77 +15439,130 @@ done IFS=$as_save_IFS - ;; -esac fi -RST2MAN=$ac_cv_path_RST2MAN -if test -n "$RST2MAN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RST2MAN" >&5 -$as_echo "$RST2MAN" >&6; } +fi +HAVE_CURL_CONFIG=$ac_cv_prog_HAVE_CURL_CONFIG +if test -n "$HAVE_CURL_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_CURL_CONFIG" >&5 +$as_echo "$HAVE_CURL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x${RST2MAN}" == "x"; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + if test "x${HAVE_CURL_CONFIG}" != "xyes"; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "rst2man not found in PATH -See \`config.log' for more details" "$LINENO" 5; } - fi +as_fn_error $? "curl-config not found in PATH +See \`config.log' for more details" "$LINENO" 5 ; } fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_global_init in -lcurl" >&5 +$as_echo_n "checking for curl_global_init in -lcurl... " >&6; } +if test "${ac_cv_lib_curl_curl_global_init+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurl `curl-config --libs --cflags` + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char curl_global_init (); +int +main () +{ +return curl_global_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curl_curl_global_init=yes +else + ac_cv_lib_curl_curl_global_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_global_init" >&5 +$as_echo "$ac_cv_lib_curl_curl_global_init" >&6; } +if test "x$ac_cv_lib_curl_curl_global_init" = x""yes; then : + CURL_CFLAGS="`curl-config --cflags`" + CURL_LIBS="`curl-config --libs`" + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "curl library is missing +See \`config.log' for more details" "$LINENO" 5 ; } +fi + +fi + if test x$enable_elasticsearch = xyes; then + ENABLE_ELASTICSEARCH_TRUE= + ENABLE_ELASTICSEARCH_FALSE='#' +else + ENABLE_ELASTICSEARCH_TRUE='#' + ENABLE_ELASTICSEARCH_FALSE= fi -# RFC 3195 support -# Check whether --enable-rfc3195 was given. -if test "${enable_rfc3195+set}" = set; then : - enableval=$enable_rfc3195; case "${enableval}" in - yes) enable_rfc3195="yes" ;; - no) enable_rfc3195="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-rfc3195" "$LINENO" 5 ;; + + +# GnuTLS support +# Check whether --enable-gnutls was given. +if test "${enable_gnutls+set}" = set; then : + enableval=$enable_gnutls; case "${enableval}" in + yes) enable_gnutls="yes" ;; + no) enable_gnutls="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gnutls" "$LINENO" 5 ;; esac else - enable_rfc3195=no + enable_gnutls=no fi -if test "x$enable_rfc3195" = "xyes"; then +if test "x$enable_gnutls" = "xyes"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLOGGING" >&5 -$as_echo_n "checking for LIBLOGGING... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS" >&5 +$as_echo_n "checking for GNUTLS... " >&6; } -if test -n "$LIBLOGGING_CFLAGS"; then - pkg_cv_LIBLOGGING_CFLAGS="$LIBLOGGING_CFLAGS" +if test -n "$GNUTLS_CFLAGS"; then + pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblogging >= 0.7.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "liblogging >= 0.7.1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls >= 1.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBLOGGING_CFLAGS=`$PKG_CONFIG --cflags "liblogging >= 0.7.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 1.4.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$LIBLOGGING_LIBS"; then - pkg_cv_LIBLOGGING_LIBS="$LIBLOGGING_LIBS" +if test -n "$GNUTLS_LIBS"; then + pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblogging >= 0.7.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "liblogging >= 0.7.1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls >= 1.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBLOGGING_LIBS=`$PKG_CONFIG --libs "liblogging >= 0.7.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 1.4.0" 2>/dev/null` else pkg_failed=yes fi @@ -19129,22 +15582,22 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBLOGGING_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblogging >= 0.7.1" 2>&1` + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gnutls >= 1.4.0" 2>&1` else - LIBLOGGING_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblogging >= 0.7.1" 2>&1` + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors "gnutls >= 1.4.0" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$LIBLOGGING_PKG_ERRORS" >&5 + echo "$GNUTLS_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (liblogging >= 0.7.1) were not met: + as_fn_error $? "Package requirements (gnutls >= 1.4.0) were not met: -$LIBLOGGING_PKG_ERRORS +$GNUTLS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables LIBLOGGING_CFLAGS -and LIBLOGGING_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables GNUTLS_CFLAGS +and GNUTLS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -19153,356 +15606,235 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables LIBLOGGING_CFLAGS -and LIBLOGGING_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - LIBLOGGING_CFLAGS=$pkg_cv_LIBLOGGING_CFLAGS - LIBLOGGING_LIBS=$pkg_cv_LIBLOGGING_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi -fi - if test x$enable_rfc3195 = xyes; then - ENABLE_RFC3195_TRUE= - ENABLE_RFC3195_FALSE='#' -else - ENABLE_RFC3195_TRUE='#' - ENABLE_RFC3195_FALSE= -fi - - - -# enable/disable the testbench (e.g. because some important parts -# are missing) -# Check whether --enable-testbench was given. -if test "${enable_testbench+set}" = set; then : - enableval=$enable_testbench; case "${enableval}" in - yes) enable_testbench="yes" ;; - no) enable_testbench="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-testbench" "$LINENO" 5 ;; - esac -else - enable_testbench=yes - -fi - - if test x$enable_testbench = xyes; then - ENABLE_TESTBENCH_TRUE= - ENABLE_TESTBENCH_FALSE='#' -else - ENABLE_TESTBENCH_TRUE='#' - ENABLE_TESTBENCH_FALSE= -fi - - - -# settings for the file input module -# Check whether --enable-imfile was given. -if test "${enable_imfile+set}" = set; then : - enableval=$enable_imfile; case "${enableval}" in - yes) enable_imfile="yes" ;; - no) enable_imfile="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imfile" "$LINENO" 5 ;; - esac -else - enable_imfile=no - -fi - - if test x$enable_imfile = xyes; then - ENABLE_IMFILE_TRUE= - ENABLE_IMFILE_FALSE='#' -else - ENABLE_IMFILE_TRUE='#' - ENABLE_IMFILE_FALSE= -fi - +path to pkg-config. +Alternatively, you may set the environment variables GNUTLS_CFLAGS +and GNUTLS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. -# settings for the door input module (under solaris, thus default off) -# Check whether --enable-imsolaris was given. -if test "${enable_imsolaris+set}" = set; then : - enableval=$enable_imsolaris; case "${enableval}" in - yes) enable_imsolaris="yes" ;; - no) enable_imsolaris="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imsolaris" "$LINENO" 5 ;; - esac +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } else - enable_imsolaris=no + GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS + GNUTLS_LIBS=$pkg_cv_GNUTLS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - - if test x$enable_imsolaris = xyes; then - ENABLE_IMSOLARIS_TRUE= - ENABLE_IMSOLARIS_FALSE='#' -else - ENABLE_IMSOLARIS_TRUE='#' - ENABLE_IMSOLARIS_FALSE= fi - - -# settings for the ptcp input module -# Check whether --enable-imptcp was given. -if test "${enable_imptcp+set}" = set; then : - enableval=$enable_imptcp; case "${enableval}" in - yes) enable_imptcp="yes" ;; - no) enable_imptcp="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imptcp" "$LINENO" 5 ;; - esac + if test x$enable_gnutls = xyes; then + ENABLE_GNUTLS_TRUE= + ENABLE_GNUTLS_FALSE='#' else - enable_imptcp=no - + ENABLE_GNUTLS_TRUE='#' + ENABLE_GNUTLS_FALSE= fi - if test x$enable_imptcp = xyes; then - ENABLE_IMPTCP_TRUE= - ENABLE_IMPTCP_FALSE='#' -else - ENABLE_IMPTCP_TRUE='#' - ENABLE_IMPTCP_FALSE= -fi -# settings for the ttcp input module -# Check whether --enable-imttcp was given. -if test "${enable_imttcp+set}" = set; then : - enableval=$enable_imttcp; case "${enableval}" in - yes) enable_imttcp="yes" ;; - no) enable_imttcp="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imttcp" "$LINENO" 5 ;; + +# support for building the rsyslogd runtime +# Check whether --enable-rsyslogrt was given. +if test "${enable_rsyslogrt+set}" = set; then : + enableval=$enable_rsyslogrt; case "${enableval}" in + yes) enable_rsyslogrt="yes" ;; + no) enable_rsyslogrt="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-rsyslogrt" "$LINENO" 5 ;; esac else - enable_imttcp=no + enable_rsyslogrt=yes fi - if test x$enable_imttcp = xyes; then - ENABLE_IMTTCP_TRUE= - ENABLE_IMTTCP_FALSE='#' +if test "x$enable_rsyslogrt" = "xyes"; then + RSRT_CFLAGS="-I\$(top_srcdir)/runtime -I\$(top_srcdir)" + RSRT_LIBS="\$(top_builddir)/runtime/librsyslog.la" +fi + if test x$enable_rsyslogrt = xyes; then + ENABLE_RSYSLOGRT_TRUE= + ENABLE_RSYSLOGRT_FALSE='#' else - ENABLE_IMTTCP_TRUE='#' - ENABLE_IMTTCP_FALSE= + ENABLE_RSYSLOGRT_TRUE='#' + ENABLE_RSYSLOGRT_FALSE= fi -# settings for the pstats input module -# Check whether --enable-impstats was given. -if test "${enable_impstats+set}" = set; then : - enableval=$enable_impstats; case "${enableval}" in - yes) enable_impstats="yes" ;; - no) enable_impstats="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-impstats" "$LINENO" 5 ;; + + +# support for NOT building rsyslogd (useful for source-based packaging systems) +# Check whether --enable-rsyslogd was given. +if test "${enable_rsyslogd+set}" = set; then : + enableval=$enable_rsyslogd; case "${enableval}" in + yes) enable_rsyslogd="yes" ;; + no) enable_rsyslogd="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-rsyslogd" "$LINENO" 5 ;; esac else - enable_impstats=no + enable_rsyslogd=yes fi - if test x$enable_impstats = xyes; then - ENABLE_IMPSTATS_TRUE= - ENABLE_IMPSTATS_FALSE='#' + if test x$enable_rsyslogd = xyes; then + ENABLE_RSYSLOGD_TRUE= + ENABLE_RSYSLOGD_FALSE='#' else - ENABLE_IMPSTATS_TRUE='#' - ENABLE_IMPSTATS_FALSE= + ENABLE_RSYSLOGD_TRUE='#' + ENABLE_RSYSLOGD_FALSE= fi -# settings for the omprog output module -# Check whether --enable-omprog was given. -if test "${enable_omprog+set}" = set; then : - enableval=$enable_omprog; case "${enableval}" in - yes) enable_omprog="yes" ;; - no) enable_omprog="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omprog" "$LINENO" 5 ;; +# capability to enable an extended testbench. By default, this is off. The reason +# for this switch is that some test simply take too long to execute them on a regular +# basis. So we enable to skip them, while the majority of tests can still be used. The +# idea is that at least "make distcheck" executes the extended testbench, and also +# developers should explicitely enable it after important changes. -- rgerhards, 2010-04-12 +# Check whether --enable-extended_tests was given. +if test "${enable_extended_tests+set}" = set; then : + enableval=$enable_extended_tests; case "${enableval}" in + yes) enable_rsyslogd="yes" ;; + no) enable_rsyslogd="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-extended-tests" "$LINENO" 5 ;; esac else - enable_omprog=no + enable_extended_tests=no fi - if test x$enable_omprog = xyes; then - ENABLE_OMPROG_TRUE= - ENABLE_OMPROG_FALSE='#' + if test x$enable_extended_tests = xyes; then + ENABLE_EXTENDED_TESTS_TRUE= + ENABLE_EXTENDED_TESTS_FALSE='#' else - ENABLE_OMPROG_TRUE='#' - ENABLE_OMPROG_FALSE= + ENABLE_EXTENDED_TESTS_TRUE='#' + ENABLE_EXTENDED_TESTS_FALSE= fi -# settings for omudpspoof -# Check whether --enable-omudpspoof was given. -if test "${enable_omudpspoof+set}" = set; then : - enableval=$enable_omudpspoof; case "${enableval}" in - yes) enable_omudpspoof="yes" ;; - no) enable_omudpspoof="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omudpspoof" "$LINENO" 5 ;; +# capability to enable MySQL testbench tests. This requries that a Syslog database +# with the default schema has been created on the local (127.0.0.1) MySQL server and +# a user "rsyslog" with password "testbench" exists, is able to login with default +# parameters and has sufficient (read: all) privileges on that database. +# rgerhards, 2011-03-09 +# Check whether --enable-mysql_tests was given. +if test "${enable_mysql_tests+set}" = set; then : + enableval=$enable_mysql_tests; case "${enableval}" in + yes) enable_mysql_tests="yes" ;; + no) enable_mysql_tests="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-mysql-tests" "$LINENO" 5 ;; esac else - enable_omudpspoof=no + enable_mysql_tests=no fi - -if test "x$enable_omudpspoof" = "xyes"; then - for ac_header in libnet.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libnet.h" "ac_cv_header_libnet_h" "$ac_includes_default" -if test "x$ac_cv_header_libnet_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNET_H 1 -_ACEOF - + if test x$enable_mysql_tests = xyes; then + ENABLE_MYSQL_TESTS_TRUE= + ENABLE_MYSQL_TESTS_FALSE='#' else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "libnet is missing -See \`config.log' for more details" "$LINENO" 5; } - + ENABLE_MYSQL_TESTS_TRUE='#' + ENABLE_MYSQL_TESTS_FALSE= fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnet_init in -lnet" >&5 -$as_echo_n "checking for libnet_init in -lnet... " >&6; } -if ${ac_cv_lib_net_libnet_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnet $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libnet_init (); -int -main () -{ -return libnet_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_net_libnet_init=yes -else - ac_cv_lib_net_libnet_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_libnet_init" >&5 -$as_echo "$ac_cv_lib_net_libnet_init" >&6; } -if test "x$ac_cv_lib_net_libnet_init" = xyes; then : - UDPSPOOF_CFLAGS="" - UDPSPOOF_LIBS="-lnet" +# Mail support (so far we do not need a library, but we need to turn this on and off) +# Check whether --enable-mail was given. +if test "${enable_mail+set}" = set; then : + enableval=$enable_mail; case "${enableval}" in + yes) enable_mail="yes" ;; + no) enable_mail="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-mail" "$LINENO" 5 ;; + esac else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "libnet is missing -See \`config.log' for more details" "$LINENO" 5; } + enable_mail=no fi -fi - if test x$enable_omudpspoof = xyes; then - ENABLE_OMUDPSPOOF_TRUE= - ENABLE_OMUDPSPOOF_FALSE='#' + if test x$enable_mail = xyes; then + ENABLE_MAIL_TRUE= + ENABLE_MAIL_FALSE='#' else - ENABLE_OMUDPSPOOF_TRUE='#' - ENABLE_OMUDPSPOOF_FALSE= + ENABLE_MAIL_TRUE='#' + ENABLE_MAIL_FALSE= fi - - -# settings for omstdout -# Check whether --enable-omstdout was given. -if test "${enable_omstdout+set}" = set; then : - enableval=$enable_omstdout; case "${enableval}" in - yes) enable_omstdout="yes" ;; - no) enable_omstdout="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omstdout" "$LINENO" 5 ;; +# imdiag support (so far we do not need a library, but we need to turn this on and off) +# note that we enable this be default, because an important point is to make +# it available to users who do not know much about how to handle things. It +# would complicate things if we first needed to tell them how to enable imdiag. +# rgerhards, 2008-07-25 +# Check whether --enable-imdiag was given. +if test "${enable_imdiag+set}" = set; then : + enableval=$enable_imdiag; case "${enableval}" in + yes) enable_imdiag="yes" ;; + no) enable_imdiag="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-imdiag" "$LINENO" 5 ;; esac else - enable_omstdout=no + enable_imdiag=no fi - if test x$enable_omstdout = xyes; then - ENABLE_OMSTDOUT_TRUE= - ENABLE_OMSTDOUT_FALSE='#' + if test x$enable_imdiag = xyes; then + ENABLE_IMDIAG_TRUE= + ENABLE_IMDIAG_FALSE='#' else - ENABLE_OMSTDOUT_TRUE='#' - ENABLE_OMSTDOUT_FALSE= + ENABLE_IMDIAG_TRUE='#' + ENABLE_IMDIAG_FALSE= fi -# settings for omjournal -# Check whether --enable-omjournal was given. -if test "${enable_omjournal+set}" = set; then : - enableval=$enable_omjournal; case "${enableval}" in - yes) enable_omjournal="yes" ;; - no) enable_omjournal="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omjournal" "$LINENO" 5 ;; + +# RELP support +# Check whether --enable-relp was given. +if test "${enable_relp+set}" = set; then : + enableval=$enable_relp; case "${enableval}" in + yes) enable_relp="yes" ;; + no) enable_relp="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-relp" "$LINENO" 5 ;; esac else - enable_omjournal=no + enable_relp=no fi -if test "x$enable_omjournal" = "xyes"; then +if test "x$enable_relp" = "xyes"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSYSTEMD_JOURNAL" >&5 -$as_echo_n "checking for LIBSYSTEMD_JOURNAL... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RELP" >&5 +$as_echo_n "checking for RELP... " >&6; } -if test -n "$LIBSYSTEMD_JOURNAL_CFLAGS"; then - pkg_cv_LIBSYSTEMD_JOURNAL_CFLAGS="$LIBSYSTEMD_JOURNAL_CFLAGS" +if test -n "$RELP_CFLAGS"; then + pkg_cv_RELP_CFLAGS="$RELP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal >= 197\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-journal >= 197") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"relp >= 0.1.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "relp >= 0.1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBSYSTEMD_JOURNAL_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-journal >= 197" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_RELP_CFLAGS=`$PKG_CONFIG --cflags "relp >= 0.1.1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$LIBSYSTEMD_JOURNAL_LIBS"; then - pkg_cv_LIBSYSTEMD_JOURNAL_LIBS="$LIBSYSTEMD_JOURNAL_LIBS" +if test -n "$RELP_LIBS"; then + pkg_cv_RELP_LIBS="$RELP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal >= 197\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-journal >= 197") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"relp >= 0.1.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "relp >= 0.1.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBSYSTEMD_JOURNAL_LIBS=`$PKG_CONFIG --libs "libsystemd-journal >= 197" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + pkg_cv_RELP_LIBS=`$PKG_CONFIG --libs "relp >= 0.1.1" 2>/dev/null` else pkg_failed=yes fi @@ -19522,22 +15854,22 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBSYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-journal >= 197" 2>&1` + RELP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "relp >= 0.1.1" 2>&1` else - LIBSYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-journal >= 197" 2>&1` + RELP_PKG_ERRORS=`$PKG_CONFIG --print-errors "relp >= 0.1.1" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$LIBSYSTEMD_JOURNAL_PKG_ERRORS" >&5 + echo "$RELP_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libsystemd-journal >= 197) were not met: + as_fn_error $? "Package requirements (relp >= 0.1.1) were not met: -$LIBSYSTEMD_JOURNAL_PKG_ERRORS +$RELP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables LIBSYSTEMD_JOURNAL_CFLAGS -and LIBSYSTEMD_JOURNAL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables RELP_CFLAGS +and RELP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -19548,884 +15880,754 @@ is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables LIBSYSTEMD_JOURNAL_CFLAGS -and LIBSYSTEMD_JOURNAL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables RELP_CFLAGS +and RELP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else - LIBSYSTEMD_JOURNAL_CFLAGS=$pkg_cv_LIBSYSTEMD_JOURNAL_CFLAGS - LIBSYSTEMD_JOURNAL_LIBS=$pkg_cv_LIBSYSTEMD_JOURNAL_LIBS + RELP_CFLAGS=$pkg_cv_RELP_CFLAGS + RELP_LIBS=$pkg_cv_RELP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi - if test x$enable_omjournal = xyes; then - ENABLE_OMJOURNAL_TRUE= - ENABLE_OMJOURNAL_FALSE='#' + if test x$enable_relp = xyes; then + ENABLE_RELP_TRUE= + ENABLE_RELP_FALSE='#' else - ENABLE_OMJOURNAL_TRUE='#' - ENABLE_OMJOURNAL_FALSE= + ENABLE_RELP_TRUE='#' + ENABLE_RELP_FALSE= fi -# settings for pmlastmsg -# Check whether --enable-pmlastmsg was given. -if test "${enable_pmlastmsg+set}" = set; then : - enableval=$enable_pmlastmsg; case "${enableval}" in - yes) enable_pmlastmsg="yes" ;; - no) enable_pmlastmsg="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pmlastmsg" "$LINENO" 5 ;; - esac -else - enable_pmlastmsg=no - -fi - - if test x$enable_pmlastmsg = xyes; then - ENABLE_PMLASTMSG_TRUE= - ENABLE_PMLASTMSG_FALSE='#' -else - ENABLE_PMLASTMSG_TRUE='#' - ENABLE_PMLASTMSG_FALSE= -fi - -# settings for pmcisconames -# Check whether --enable-pmcisconames was given. -if test "${enable_pmcisconames+set}" = set; then : - enableval=$enable_pmcisconames; case "${enableval}" in - yes) enable_pmcisconames="yes" ;; - no) enable_pmcisconames="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pmcisconames" "$LINENO" 5 ;; +# RFC 3195 support +# Check whether --enable-rfc3195 was given. +if test "${enable_rfc3195+set}" = set; then : + enableval=$enable_rfc3195; case "${enableval}" in + yes) enable_rfc3195="yes" ;; + no) enable_rfc3195="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-rfc3195" "$LINENO" 5 ;; esac else - enable_pmcisconames=no - -fi + enable_rfc3195=no - if test x$enable_pmcisconames = xyes; then - ENABLE_PMCISCONAMES_TRUE= - ENABLE_PMCISCONAMES_FALSE='#' -else - ENABLE_PMCISCONAMES_TRUE='#' - ENABLE_PMCISCONAMES_FALSE= fi +if test "x$enable_rfc3195" = "xyes"; then +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLOGGING" >&5 +$as_echo_n "checking for LIBLOGGING... " >&6; } -# settings for pmaixforwardedfrom -# Check whether --enable-pmaixforwardedfrom was given. -if test "${enable_pmaixforwardedfrom+set}" = set; then : - enableval=$enable_pmaixforwardedfrom; case "${enableval}" in - yes) enable_pmaixforwardedfrom="yes" ;; - no) enable_pmaixforwardedfrom="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pmaixforwardedfrom" "$LINENO" 5 ;; - esac +if test -n "$LIBLOGGING_CFLAGS"; then + pkg_cv_LIBLOGGING_CFLAGS="$LIBLOGGING_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblogging >= 0.7.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "liblogging >= 0.7.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBLOGGING_CFLAGS=`$PKG_CONFIG --cflags "liblogging >= 0.7.1" 2>/dev/null` else - enable_pmaixforwardedfrom=no - + pkg_failed=yes fi - - if test x$enable_pmaixforwardedfrom = xyes; then - ENABLE_PMAIXFORWARDEDFROM_TRUE= - ENABLE_PMAIXFORWARDEDFROM_FALSE='#' + else + pkg_failed=untried +fi +if test -n "$LIBLOGGING_LIBS"; then + pkg_cv_LIBLOGGING_LIBS="$LIBLOGGING_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblogging >= 0.7.1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "liblogging >= 0.7.1") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBLOGGING_LIBS=`$PKG_CONFIG --libs "liblogging >= 0.7.1" 2>/dev/null` else - ENABLE_PMAIXFORWARDEDFROM_TRUE='#' - ENABLE_PMAIXFORWARDEDFROM_FALSE= + pkg_failed=yes +fi + else + pkg_failed=untried fi -# settings for pmsnare -# Check whether --enable-pmsnare was given. -if test "${enable_pmsnare+set}" = set; then : - enableval=$enable_pmsnare; case "${enableval}" in - yes) enable_pmsnare="yes" ;; - no) enable_pmsnare="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pmsnare" "$LINENO" 5 ;; - esac -else - enable_pmsnare=no - -fi +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } - if test x$enable_pmsnare = xyes; then - ENABLE_PMSNARE_TRUE= - ENABLE_PMSNARE_FALSE='#' +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - ENABLE_PMSNARE_TRUE='#' - ENABLE_PMSNARE_FALSE= + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + LIBLOGGING_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "liblogging >= 0.7.1" 2>&1` + else + LIBLOGGING_PKG_ERRORS=`$PKG_CONFIG --print-errors "liblogging >= 0.7.1" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBLOGGING_PKG_ERRORS" >&5 + as_fn_error $? "Package requirements (liblogging >= 0.7.1) were not met: +$LIBLOGGING_PKG_ERRORS -# settings for pmrfc3164sd -# Check whether --enable-pmrfc3164sd was given. -if test "${enable_pmrfc3164sd+set}" = set; then : - enableval=$enable_pmrfc3164sd; case "${enableval}" in - yes) enable_pmrfc3164sd="yes" ;; - no) enable_pmrfc3164sd="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pmrfc3164sd" "$LINENO" 5 ;; - esac -else - enable_pmrfc3164sd=no - -fi - - if test x$enable_pmrfc3164sd = xyes; then - ENABLE_PMRFC3164SD_TRUE= - ENABLE_PMRFC3164SD_FALSE='#' -else - ENABLE_PMRFC3164SD_TRUE='#' - ENABLE_PMRFC3164SD_FALSE= -fi +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. +Alternatively, you may set the environment variables LIBLOGGING_CFLAGS +and LIBLOGGING_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. +Alternatively, you may set the environment variables LIBLOGGING_CFLAGS +and LIBLOGGING_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. -# settings for omruleset -# Check whether --enable-omruleset was given. -if test "${enable_omruleset+set}" = set; then : - enableval=$enable_omruleset; case "${enableval}" in - yes) enable_omruleset="yes" ;; - no) enable_omruleset="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omruleset" "$LINENO" 5 ;; - esac +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5 ; } else - enable_omruleset=yes + LIBLOGGING_CFLAGS=$pkg_cv_LIBLOGGING_CFLAGS + LIBLOGGING_LIBS=$pkg_cv_LIBLOGGING_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - - if test x$enable_omruleset = xyes; then - ENABLE_OMRULESET_TRUE= - ENABLE_OMRULESET_FALSE='#' +fi + if test x$enable_rfc3195 = xyes; then + ENABLE_RFC3195_TRUE= + ENABLE_RFC3195_FALSE='#' else - ENABLE_OMRULESET_TRUE='#' - ENABLE_OMRULESET_FALSE= + ENABLE_RFC3195_TRUE='#' + ENABLE_RFC3195_FALSE= fi -# building the GUI (mostly for diagnostic reasons) -# Check whether --enable-gui was given. -if test "${enable_gui+set}" = set; then : - enableval=$enable_gui; case "${enableval}" in - yes) enable_gui="yes" ;; - no) enable_gui="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gui" "$LINENO" 5 ;; + + +# enable/disable the testbench (e.g. because some important parts +# are missing) +# Check whether --enable-testbench was given. +if test "${enable_testbench+set}" = set; then : + enableval=$enable_testbench; case "${enableval}" in + yes) enable_testbench="yes" ;; + no) enable_testbench="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-testbench" "$LINENO" 5 ;; esac else - enable_gui=no + enable_testbench=yes fi -if test "x$enable_gui" = "xyes"; then - if test x$HAVE_JAVAC = x; then - as_fn_error $? "GUI components need Java, but Java development system is not installed on this system" "$LINENO" 5 - fi -fi - if test x$enable_gui = xyes; then - ENABLE_GUI_TRUE= - ENABLE_GUI_FALSE='#' + if test x$enable_testbench = xyes; then + ENABLE_TESTBENCH_TRUE= + ENABLE_TESTBENCH_FALSE='#' else - ENABLE_GUI_TRUE='#' - ENABLE_GUI_FALSE= + ENABLE_TESTBENCH_TRUE='#' + ENABLE_TESTBENCH_FALSE= fi -# settings for omuxsock -# Check whether --enable-omuxsock was given. -if test "${enable_omuxsock+set}" = set; then : - enableval=$enable_omuxsock; case "${enableval}" in - yes) enable_omuxsock="yes" ;; - no) enable_omuxsock="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omuxsock" "$LINENO" 5 ;; +# settings for the file input module +# Check whether --enable-imfile was given. +if test "${enable_imfile+set}" = set; then : + enableval=$enable_imfile; case "${enableval}" in + yes) enable_imfile="yes" ;; + no) enable_imfile="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-imfile" "$LINENO" 5 ;; esac else - enable_omuxsock=no + enable_imfile=no fi - if test x$enable_omuxsock = xyes; then - ENABLE_OMUXSOCK_TRUE= - ENABLE_OMUXSOCK_FALSE='#' + if test x$enable_imfile = xyes; then + ENABLE_IMFILE_TRUE= + ENABLE_IMFILE_FALSE='#' else - ENABLE_OMUXSOCK_TRUE='#' - ENABLE_OMUXSOCK_FALSE= + ENABLE_IMFILE_TRUE='#' + ENABLE_IMFILE_FALSE= fi -# A custom strgen that also serves as a sample of how to do -# SQL-generating strgen's -# Check whether --enable-sm_cust_bindcdr was given. -if test "${enable_sm_cust_bindcdr+set}" = set; then : - enableval=$enable_sm_cust_bindcdr; case "${enableval}" in - yes) enable_sm_cust_bindcdr="yes" ;; - no) enable_sm_cust_bindcdr="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-sm_cust_bindcdr" "$LINENO" 5 ;; +# settings for the door input module (under solaris, thus default off) +# Check whether --enable-imsolaris was given. +if test "${enable_imsolaris+set}" = set; then : + enableval=$enable_imsolaris; case "${enableval}" in + yes) enable_imsolaris="yes" ;; + no) enable_imsolaris="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-imsolaris" "$LINENO" 5 ;; esac else - enable_sm_cust_bindcdr=no + enable_imsolaris=no fi - if test x$enable_sm_cust_bindcdr = xyes; then - ENABLE_SMCUSTBINDCDR_TRUE= - ENABLE_SMCUSTBINDCDR_FALSE='#' + if test x$enable_imsolaris = xyes; then + ENABLE_IMSOLARIS_TRUE= + ENABLE_IMSOLARIS_FALSE='#' else - ENABLE_SMCUSTBINDCDR_TRUE='#' - ENABLE_SMCUSTBINDCDR_FALSE= + ENABLE_IMSOLARIS_TRUE='#' + ENABLE_IMSOLARIS_FALSE= fi - -# settings for mmsnmptrapd message modification module -# Check whether --enable-mmsnmptrapd was given. -if test "${enable_mmsnmptrapd+set}" = set; then : - enableval=$enable_mmsnmptrapd; case "${enableval}" in - yes) enable_mmsnmptrapd="yes" ;; - no) enable_mmsnmptrapd="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-mmsnmptrapd" "$LINENO" 5 ;; +# settings for the ptcp input module +# Check whether --enable-imptcp was given. +if test "${enable_imptcp+set}" = set; then : + enableval=$enable_imptcp; case "${enableval}" in + yes) enable_imptcp="yes" ;; + no) enable_imptcp="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-imptcp" "$LINENO" 5 ;; esac else - enable_mmsnmptrapd=no + enable_imptcp=no fi - if test x$enable_mmsnmptrapd = xyes; then - ENABLE_MMSNMPTRAPD_TRUE= - ENABLE_MMSNMPTRAPD_FALSE='#' + if test x$enable_imptcp = xyes; then + ENABLE_IMPTCP_TRUE= + ENABLE_IMPTCP_FALSE='#' else - ENABLE_MMSNMPTRAPD_TRUE='#' - ENABLE_MMSNMPTRAPD_FALSE= + ENABLE_IMPTCP_TRUE='#' + ENABLE_IMPTCP_FALSE= fi -# settings for the omhdfs; -# Check whether --enable-omhdfs was given. -if test "${enable_omhdfs+set}" = set; then : - enableval=$enable_omhdfs; case "${enableval}" in - yes) enable_omhdfs="yes" ;; - no) enable_omhdfs="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omhdfs" "$LINENO" 5 ;; +# settings for the pstats input module +# Check whether --enable-impstats was given. +if test "${enable_impstats+set}" = set; then : + enableval=$enable_impstats; case "${enableval}" in + yes) enable_impstats="yes" ;; + no) enable_impstats="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-impstats" "$LINENO" 5 ;; esac else - enable_omhdfs=no + enable_impstats=no fi -# -# you may want to do some library checks here - see snmp, mysql, pgsql modules -# for samples -# - if test x$enable_omhdfs = xyes; then - ENABLE_OMHDFS_TRUE= - ENABLE_OMHDFS_FALSE='#' + if test x$enable_impstats = xyes; then + ENABLE_IMPSTATS_TRUE= + ENABLE_IMPSTATS_FALSE='#' else - ENABLE_OMHDFS_TRUE='#' - ENABLE_OMHDFS_FALSE= + ENABLE_IMPSTATS_TRUE='#' + ENABLE_IMPSTATS_FALSE= fi -#MONGODB SUPPORT - -# Check whether --enable-ommongodb was given. -if test "${enable_ommongodb+set}" = set; then : - enableval=$enable_ommongodb; case "${enableval}" in - yes) enable_ommongodb="yes" ;; - no) enable_ommongodb="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-ommongodb" "$LINENO" 5 ;; +# settings for the omprog output module +# Check whether --enable-omprog was given. +if test "${enable_omprog+set}" = set; then : + enableval=$enable_omprog; case "${enableval}" in + yes) enable_omprog="yes" ;; + no) enable_omprog="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omprog" "$LINENO" 5 ;; esac else - enable_ommongodb=no + enable_omprog=no fi -if test "x$enable_ommongodb" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBMONGO_CLIENT" >&5 -$as_echo_n "checking for LIBMONGO_CLIENT... " >&6; } - -if test -n "$LIBMONGO_CLIENT_CFLAGS"; then - pkg_cv_LIBMONGO_CLIENT_CFLAGS="$LIBMONGO_CLIENT_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmongo-client >= 0.1.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libmongo-client >= 0.1.4") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBMONGO_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "libmongo-client >= 0.1.4" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LIBMONGO_CLIENT_LIBS"; then - pkg_cv_LIBMONGO_CLIENT_LIBS="$LIBMONGO_CLIENT_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmongo-client >= 0.1.4\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libmongo-client >= 0.1.4") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LIBMONGO_CLIENT_LIBS=`$PKG_CONFIG --libs "libmongo-client >= 0.1.4" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test x$enable_omprog = xyes; then + ENABLE_OMPROG_TRUE= + ENABLE_OMPROG_FALSE='#' else - pkg_failed=yes -fi - else - pkg_failed=untried + ENABLE_OMPROG_TRUE='#' + ENABLE_OMPROG_FALSE= fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +# settings for omudpspoof +# Check whether --enable-omudpspoof was given. +if test "${enable_omudpspoof+set}" = set; then : + enableval=$enable_omudpspoof; case "${enableval}" in + yes) enable_omudpspoof="yes" ;; + no) enable_omudpspoof="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omudpspoof" "$LINENO" 5 ;; + esac else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBMONGO_CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmongo-client >= 0.1.4" 2>&1` - else - LIBMONGO_CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmongo-client >= 0.1.4" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBMONGO_CLIENT_PKG_ERRORS" >&5 + enable_omudpspoof=no - as_fn_error $? "Package requirements (libmongo-client >= 0.1.4) were not met: +fi -$LIBMONGO_CLIENT_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. +if test "x$enable_omudpspoof" = "xyes"; then + for ac_header in libnet.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libnet.h" "ac_cv_header_libnet_h" "$ac_includes_default" +if test "x$ac_cv_header_libnet_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBNET_H 1 +_ACEOF -Alternatively, you may set the environment variables LIBMONGO_CLIENT_CFLAGS -and LIBMONGO_CLIENT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. +as_fn_error $? "libnet is missing +See \`config.log' for more details" "$LINENO" 5 ; } -Alternatively, you may set the environment variables LIBMONGO_CLIENT_CFLAGS -and LIBMONGO_CLIENT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +fi -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnet_init in -lnet" >&5 +$as_echo_n "checking for libnet_init in -lnet... " >&6; } +if test "${ac_cv_lib_net_libnet_init+set}" = set; then : + $as_echo_n "(cached) " >&6 else - LIBMONGO_CLIENT_CFLAGS=$pkg_cv_LIBMONGO_CLIENT_CFLAGS - LIBMONGO_CLIENT_LIBS=$pkg_cv_LIBMONGO_CLIENT_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char libnet_init (); +int +main () +{ +return libnet_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_net_libnet_init=yes +else + ac_cv_lib_net_libnet_init=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - if test x$enable_ommongodb = xyes; then - ENABLE_OMMONGODB_TRUE= - ENABLE_OMMONGODB_FALSE='#' -else - ENABLE_OMMONGODB_TRUE='#' - ENABLE_OMMONGODB_FALSE= -fi - -# end of mongodb code - -# BEGIN ZMQ3 INPUT SUPPORT -# Check whether --enable-imzmq3 was given. -if test "${enable_imzmq3+set}" = set; then : - enableval=$enable_imzmq3; case "${enableval}" in - yes) enable_imzmq3="yes" ;; - no) enable_imzmq3="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-imzmq3" "$LINENO" 5 ;; - esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_libnet_init" >&5 +$as_echo "$ac_cv_lib_net_libnet_init" >&6; } +if test "x$ac_cv_lib_net_libnet_init" = x""yes; then : + UDPSPOOF_CFLAGS="" + UDPSPOOF_LIBS="-lnet" + else - enable_imzmq3=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "libnet is missing +See \`config.log' for more details" "$LINENO" 5 ; } fi -if test "x$enable_imzmq3" = "xyes"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CZMQ" >&5 -$as_echo_n "checking for CZMQ... " >&6; } - -if test -n "$CZMQ_CFLAGS"; then - pkg_cv_CZMQ_CFLAGS="$CZMQ_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libczmq >= 1.1.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libczmq >= 1.1.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_CZMQ_CFLAGS=`$PKG_CONFIG --cflags "libczmq >= 1.1.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried fi -if test -n "$CZMQ_LIBS"; then - pkg_cv_CZMQ_LIBS="$CZMQ_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libczmq >= 1.1.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libczmq >= 1.1.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_CZMQ_LIBS=`$PKG_CONFIG --libs "libczmq >= 1.1.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test x$enable_omudpspoof = xyes; then + ENABLE_OMUDPSPOOF_TRUE= + ENABLE_OMUDPSPOOF_FALSE='#' else - pkg_failed=yes -fi - else - pkg_failed=untried + ENABLE_OMUDPSPOOF_TRUE='#' + ENABLE_OMUDPSPOOF_FALSE= fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - CZMQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libczmq >= 1.1.0" 2>&1` - else - CZMQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libczmq >= 1.1.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$CZMQ_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libczmq >= 1.1.0) were not met: +# settings for omstdout +# Check whether --enable-omstdout was given. +if test "${enable_omstdout+set}" = set; then : + enableval=$enable_omstdout; case "${enableval}" in + yes) enable_omstdout="yes" ;; + no) enable_omstdout="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omstdout" "$LINENO" 5 ;; + esac +else + enable_omstdout=no -$CZMQ_PKG_ERRORS +fi -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + if test x$enable_omstdout = xyes; then + ENABLE_OMSTDOUT_TRUE= + ENABLE_OMSTDOUT_FALSE='#' +else + ENABLE_OMSTDOUT_TRUE='#' + ENABLE_OMSTDOUT_FALSE= +fi -Alternatively, you may set the environment variables CZMQ_CFLAGS -and CZMQ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables CZMQ_CFLAGS -and CZMQ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +# settings for pmlastmsg +# Check whether --enable-pmlastmsg was given. +if test "${enable_pmlastmsg+set}" = set; then : + enableval=$enable_pmlastmsg; case "${enableval}" in + yes) enable_pmlastmsg="yes" ;; + no) enable_pmlastmsg="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pmlastmsg" "$LINENO" 5 ;; + esac else - CZMQ_CFLAGS=$pkg_cv_CZMQ_CFLAGS - CZMQ_LIBS=$pkg_cv_CZMQ_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + enable_pmlastmsg=no fi -fi - if test x$enable_imzmq3 = xyes; then - ENABLE_IMZMQ3_TRUE= - ENABLE_IMZMQ3_FALSE='#' + + if test x$enable_pmlastmsg = xyes; then + ENABLE_PMLASTMSG_TRUE= + ENABLE_PMLASTMSG_FALSE='#' else - ENABLE_IMZMQ3_TRUE='#' - ENABLE_IMZMQ3_FALSE= + ENABLE_PMLASTMSG_TRUE='#' + ENABLE_PMLASTMSG_FALSE= fi -# END ZMQ3 INPUT SUPPORT -# BEGIN ZMQ3 OUTPUT SUPPORT -# Check whether --enable-omzmq3 was given. -if test "${enable_omzmq3+set}" = set; then : - enableval=$enable_omzmq3; case "${enableval}" in - yes) enable_omzmq3="yes" ;; - no) enable_omzmq3="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omzmq3" "$LINENO" 5 ;; +# settings for pmcisconames +# Check whether --enable-pmcisconames was given. +if test "${enable_pmcisconames+set}" = set; then : + enableval=$enable_pmcisconames; case "${enableval}" in + yes) enable_pmcisconames="yes" ;; + no) enable_pmcisconames="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pmcisconames" "$LINENO" 5 ;; esac else - enable_omzmq3=no + enable_pmcisconames=no fi -if test "x$enable_omzmq3" = "xyes"; then + if test x$enable_pmcisconames = xyes; then + ENABLE_PMCISCONAMES_TRUE= + ENABLE_PMCISCONAMES_FALSE='#' +else + ENABLE_PMCISCONAMES_TRUE='#' + ENABLE_PMCISCONAMES_FALSE= +fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CZMQ" >&5 -$as_echo_n "checking for CZMQ... " >&6; } -if test -n "$CZMQ_CFLAGS"; then - pkg_cv_CZMQ_CFLAGS="$CZMQ_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libczmq >= 1.1.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libczmq >= 1.1.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_CZMQ_CFLAGS=`$PKG_CONFIG --cflags "libczmq >= 1.1.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + +# settings for pmaixforwardedfrom +# Check whether --enable-pmaixforwardedfrom was given. +if test "${enable_pmaixforwardedfrom+set}" = set; then : + enableval=$enable_pmaixforwardedfrom; case "${enableval}" in + yes) enable_pmaixforwardedfrom="yes" ;; + no) enable_pmaixforwardedfrom="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pmaixforwardedfrom" "$LINENO" 5 ;; + esac else - pkg_failed=yes -fi - else - pkg_failed=untried + enable_pmaixforwardedfrom=no + fi -if test -n "$CZMQ_LIBS"; then - pkg_cv_CZMQ_LIBS="$CZMQ_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libczmq >= 1.1.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libczmq >= 1.1.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_CZMQ_LIBS=`$PKG_CONFIG --libs "libczmq >= 1.1.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + if test x$enable_pmaixforwardedfrom = xyes; then + ENABLE_PMAIXFORWARDEDFROM_TRUE= + ENABLE_PMAIXFORWARDEDFROM_FALSE='#' else - pkg_failed=yes -fi - else - pkg_failed=untried + ENABLE_PMAIXFORWARDEDFROM_TRUE='#' + ENABLE_PMAIXFORWARDEDFROM_FALSE= fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +# settings for pmsnare +# Check whether --enable-pmsnare was given. +if test "${enable_pmsnare+set}" = set; then : + enableval=$enable_pmsnare; case "${enableval}" in + yes) enable_pmsnare="yes" ;; + no) enable_pmsnare="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pmsnare" "$LINENO" 5 ;; + esac else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - CZMQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libczmq >= 1.1.0" 2>&1` - else - CZMQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libczmq >= 1.1.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$CZMQ_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libczmq >= 1.1.0) were not met: + enable_pmsnare=no -$CZMQ_PKG_ERRORS +fi -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + if test x$enable_pmsnare = xyes; then + ENABLE_PMSNARE_TRUE= + ENABLE_PMSNARE_FALSE='#' +else + ENABLE_PMSNARE_TRUE='#' + ENABLE_PMSNARE_FALSE= +fi -Alternatively, you may set the environment variables CZMQ_CFLAGS -and CZMQ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables CZMQ_CFLAGS -and CZMQ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +# settings for pmrfc3164sd +# Check whether --enable-pmrfc3164sd was given. +if test "${enable_pmrfc3164sd+set}" = set; then : + enableval=$enable_pmrfc3164sd; case "${enableval}" in + yes) enable_pmrfc3164sd="yes" ;; + no) enable_pmrfc3164sd="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pmrfc3164sd" "$LINENO" 5 ;; + esac else - CZMQ_CFLAGS=$pkg_cv_CZMQ_CFLAGS - CZMQ_LIBS=$pkg_cv_CZMQ_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + enable_pmrfc3164sd=no fi -fi - if test x$enable_omzmq3 = xyes; then - ENABLE_OMZMQ3_TRUE= - ENABLE_OMZMQ3_FALSE='#' + + if test x$enable_pmrfc3164sd = xyes; then + ENABLE_PMRFC3164SD_TRUE= + ENABLE_PMRFC3164SD_FALSE='#' else - ENABLE_OMZMQ3_TRUE='#' - ENABLE_OMZMQ3_FALSE= + ENABLE_PMRFC3164SD_TRUE='#' + ENABLE_PMRFC3164SD_FALSE= fi -# END ZMQ3 SUPPORT - -# BEGIN RABBITMQ OUTPUT SUPPORT -# Check whether --enable-omrabbitmq was given. -if test "${enable_omrabbitmq+set}" = set; then : - enableval=$enable_omrabbitmq; case "${enableval}" in - yes) enable_omrabbitmq="yes" ;; - no) enable_omrabbitmq="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omrabbitmq" "$LINENO" 5 ;; +# settings for omruleset +# Check whether --enable-omruleset was given. +if test "${enable_omruleset+set}" = set; then : + enableval=$enable_omruleset; case "${enableval}" in + yes) enable_omruleset="yes" ;; + no) enable_omruleset="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omruleset" "$LINENO" 5 ;; esac else - enable_omrabbitmq=no + enable_omruleset=yes fi -if test "x$enable_omrabbitmq" = "xyes"; then + if test x$enable_omruleset = xyes; then + ENABLE_OMRULESET_TRUE= + ENABLE_OMRULESET_FALSE='#' +else + ENABLE_OMRULESET_TRUE='#' + ENABLE_OMRULESET_FALSE= +fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RABBITMQ" >&5 -$as_echo_n "checking for RABBITMQ... " >&6; } -if test -n "$RABBITMQ_CFLAGS"; then - pkg_cv_RABBITMQ_CFLAGS="$RABBITMQ_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"librabbitmq >= 0.2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "librabbitmq >= 0.2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_RABBITMQ_CFLAGS=`$PKG_CONFIG --cflags "librabbitmq >= 0.2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + +# settings for omdbalerting +# Check whether --enable-omdbalerting was given. +if test "${enable_omdbalerting+set}" = set; then : + enableval=$enable_omdbalerting; case "${enableval}" in + yes) enable_omdbalerting="yes" ;; + no) enable_omdbalerting="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omdbalerting" "$LINENO" 5 ;; + esac else - pkg_failed=yes -fi - else - pkg_failed=untried + enable_omdbalerting=no + fi -if test -n "$RABBITMQ_LIBS"; then - pkg_cv_RABBITMQ_LIBS="$RABBITMQ_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"librabbitmq >= 0.2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "librabbitmq >= 0.2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_RABBITMQ_LIBS=`$PKG_CONFIG --libs "librabbitmq >= 0.2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + if test x$enable_omdbalerting = xyes; then + ENABLE_OMDBALERTING_TRUE= + ENABLE_OMDBALERTING_FALSE='#' else - pkg_failed=yes -fi - else - pkg_failed=untried + ENABLE_OMDBALERTING_TRUE='#' + ENABLE_OMDBALERTING_FALSE= fi -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +# building the GUI (mostly for diagnostic reasons) +# Check whether --enable-gui was given. +if test "${enable_gui+set}" = set; then : + enableval=$enable_gui; case "${enableval}" in + yes) enable_gui="yes" ;; + no) enable_gui="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gui" "$LINENO" 5 ;; + esac else - _pkg_short_errors_supported=no + enable_gui=no + +fi + +if test "x$enable_gui" = "xyes"; then + if test x$HAVE_JAVAC = x; then + as_fn_error $? "GUI components need Java, but Java development system is not installed on this system" "$LINENO" 5 + fi +fi + if test x$enable_gui = xyes; then + ENABLE_GUI_TRUE= + ENABLE_GUI_FALSE='#' +else + ENABLE_GUI_TRUE='#' + ENABLE_GUI_FALSE= fi - if test $_pkg_short_errors_supported = yes; then - RABBITMQ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "librabbitmq >= 0.2.0" 2>&1` - else - RABBITMQ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "librabbitmq >= 0.2.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$RABBITMQ_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (librabbitmq >= 0.2.0) were not met: -$RABBITMQ_PKG_ERRORS -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. -Alternatively, you may set the environment variables RABBITMQ_CFLAGS -and RABBITMQ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables RABBITMQ_CFLAGS -and RABBITMQ_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +# settings for omuxsock +# Check whether --enable-omuxsock was given. +if test "${enable_omuxsock+set}" = set; then : + enableval=$enable_omuxsock; case "${enableval}" in + yes) enable_omuxsock="yes" ;; + no) enable_omuxsock="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omuxsock" "$LINENO" 5 ;; + esac else - RABBITMQ_CFLAGS=$pkg_cv_RABBITMQ_CFLAGS - RABBITMQ_LIBS=$pkg_cv_RABBITMQ_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + enable_omuxsock=no fi - -fi - if test x$enable_omrabbitmq = xyes; then - ENABLE_OMRABBITMQ_TRUE= - ENABLE_OMRABBITMQ_FALSE='#' + if test x$enable_omuxsock = xyes; then + ENABLE_OMUXSOCK_TRUE= + ENABLE_OMUXSOCK_FALSE='#' else - ENABLE_OMRABBITMQ_TRUE='#' - ENABLE_OMRABBITMQ_FALSE= + ENABLE_OMUXSOCK_TRUE='#' + ENABLE_OMUXSOCK_FALSE= fi -# END RABBITMQ SUPPORT - -# HIREDIS SUPPORT -# Check whether --enable-omhiredis was given. -if test "${enable_omhiredis+set}" = set; then : - enableval=$enable_omhiredis; case "${enableval}" in - yes) enable_omhiredis="yes" ;; - no) enable_omhiredis="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-omhiredis" "$LINENO" 5 ;; +# A custom strgen that also serves as a sample of how to do +# SQL-generating strgen's +# Check whether --enable-smcustbindcdr was given. +if test "${enable_smcustbindcdr+set}" = set; then : + enableval=$enable_smcustbindcdr; case "${enableval}" in + yes) enable_smcustbindcdr="yes" ;; + no) enable_smcustbindcdr="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-smcustbindcdr" "$LINENO" 5 ;; esac else - enable_omhiredis=no + enable_smcustbindcdr=no fi -# -if test "x$enable_omhiredis" = "xyes"; then + if test x$enable_smcustbindcdr = xyes; then + ENABLE_SMCUSTBINDCDR_TRUE= + ENABLE_SMCUSTBINDCDR_FALSE='#' +else + ENABLE_SMCUSTBINDCDR_TRUE='#' + ENABLE_SMCUSTBINDCDR_FALSE= +fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HIREDIS" >&5 -$as_echo_n "checking for HIREDIS... " >&6; } -if test -n "$HIREDIS_CFLAGS"; then - pkg_cv_HIREDIS_CFLAGS="$HIREDIS_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hiredis >= 0.10.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "hiredis >= 0.10.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_HIREDIS_CFLAGS=`$PKG_CONFIG --cflags "hiredis >= 0.10.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + +# settings for the template input module; copy and modify this code +# if you intend to add your own module. Be sure to replace imtemplate +# by the actual name of your module. +# Check whether --enable-imtemplate was given. +if test "${enable_imtemplate+set}" = set; then : + enableval=$enable_imtemplate; case "${enableval}" in + yes) enable_imtemplate="yes" ;; + no) enable_imtemplate="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-imtemplate" "$LINENO" 5 ;; + esac else - pkg_failed=yes -fi - else - pkg_failed=untried + enable_imtemplate=no + fi -if test -n "$HIREDIS_LIBS"; then - pkg_cv_HIREDIS_LIBS="$HIREDIS_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hiredis >= 0.10.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "hiredis >= 0.10.1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_HIREDIS_LIBS=`$PKG_CONFIG --libs "hiredis >= 0.10.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + +# +# you may want to do some library checks here - see snmp, mysql, pgsql modules +# for samples +# + if test x$enable_imtemplate = xyes; then + ENABLE_IMTEMPLATE_TRUE= + ENABLE_IMTEMPLATE_FALSE='#' +else + ENABLE_IMTEMPLATE_TRUE='#' + ENABLE_IMTEMPLATE_FALSE= +fi + +# end of copy template - be sure to search for imtemplate to find everything! + + +# settings for the template output module; copy and modify this code +# if you intend to add your own module. Be sure to replace omtemplate +# by the actual name of your module. +# Check whether --enable-omtemplate was given. +if test "${enable_omtemplate+set}" = set; then : + enableval=$enable_omtemplate; case "${enableval}" in + yes) enable_omtemplate="yes" ;; + no) enable_omtemplate="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omtemplate" "$LINENO" 5 ;; + esac else - pkg_failed=yes -fi - else - pkg_failed=untried + enable_omtemplate=no + fi +# +# you may want to do some library checks here - see snmp, mysql, pgsql modules +# for samples +# + if test x$enable_omtemplate = xyes; then + ENABLE_OMTEMPLATE_TRUE= + ENABLE_OMTEMPLATE_FALSE='#' +else + ENABLE_OMTEMPLATE_TRUE='#' + ENABLE_OMTEMPLATE_FALSE= +fi +# end of copy template - be sure to search for omtemplate to find everything! -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +# settings for mmsnmptrapd message modification module +# Check whether --enable-mmsnmptrapd was given. +if test "${enable_mmsnmptrapd+set}" = set; then : + enableval=$enable_mmsnmptrapd; case "${enableval}" in + yes) enable_mmsnmptrapd="yes" ;; + no) enable_mmsnmptrapd="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-mmsnmptrapd" "$LINENO" 5 ;; + esac else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - HIREDIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hiredis >= 0.10.1" 2>&1` - else - HIREDIS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hiredis >= 0.10.1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$HIREDIS_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (hiredis >= 0.10.1) were not met: + enable_mmsnmptrapd=no -$HIREDIS_PKG_ERRORS +fi -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + if test x$enable_mmsnmptrapd = xyes; then + ENABLE_MMSNMPTRAPD_TRUE= + ENABLE_MMSNMPTRAPD_FALSE='#' +else + ENABLE_MMSNMPTRAPD_TRUE='#' + ENABLE_MMSNMPTRAPD_FALSE= +fi -Alternatively, you may set the environment variables HIREDIS_CFLAGS -and HIREDIS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. -Alternatively, you may set the environment variables HIREDIS_CFLAGS -and HIREDIS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +# settings for the omhdfs; +# Check whether --enable-omhdfs was given. +if test "${enable_omhdfs+set}" = set; then : + enableval=$enable_omhdfs; case "${enableval}" in + yes) enable_omhdfs="yes" ;; + no) enable_omhdfs="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-omhdfs" "$LINENO" 5 ;; + esac else - HIREDIS_CFLAGS=$pkg_cv_HIREDIS_CFLAGS - HIREDIS_LIBS=$pkg_cv_HIREDIS_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + enable_omhdfs=no fi -fi - if test x$enable_omhiredis = xyes; then - ENABLE_OMHIREDIS_TRUE= - ENABLE_OMHIREDIS_FALSE='#' + +# +# you may want to do some library checks here - see snmp, mysql, pgsql modules +# for samples +# + if test x$enable_omhdfs = xyes; then + ENABLE_OMHDFS_TRUE= + ENABLE_OMHDFS_FALSE='#' else - ENABLE_OMHIREDIS_TRUE='#' - ENABLE_OMHIREDIS_FALSE= + ENABLE_OMHDFS_TRUE='#' + ENABLE_OMHDFS_FALSE= fi -# END HIREDIS SUPPORT -ac_config_files="$ac_config_files Makefile runtime/Makefile compat/Makefile grammar/Makefile tools/Makefile doc/Makefile plugins/imudp/Makefile plugins/imtcp/Makefile plugins/im3195/Makefile plugins/imgssapi/Makefile plugins/imuxsock/Makefile plugins/imjournal/Makefile plugins/immark/Makefile plugins/imklog/Makefile plugins/imkmsg/Makefile plugins/omhdfs/Makefile plugins/omprog/Makefile plugins/omstdout/Makefile plugins/omjournal/Makefile plugins/pmrfc3164sd/Makefile plugins/pmlastmsg/Makefile plugins/pmcisconames/Makefile plugins/pmsnare/Makefile plugins/pmaixforwardedfrom/Makefile plugins/omruleset/Makefile plugins/omuxsock/Makefile plugins/imfile/Makefile plugins/imsolaris/Makefile plugins/imptcp/Makefile plugins/imttcp/Makefile plugins/impstats/Makefile plugins/imrelp/Makefile plugins/imdiag/Makefile plugins/imzmq3/Makefile plugins/omtesting/Makefile plugins/omgssapi/Makefile plugins/ommysql/Makefile plugins/ompgsql/Makefile plugins/omrelp/Makefile plugins/omlibdbi/Makefile plugins/ommail/Makefile plugins/omsnmp/Makefile plugins/omoracle/Makefile plugins/omudpspoof/Makefile plugins/ommongodb/Makefile plugins/omhiredis/Makefile plugins/omzmq3/Makefile plugins/omrabbitmq/Makefile plugins/mmnormalize/Makefile plugins/mmjsonparse/Makefile plugins/mmaudit/Makefile plugins/mmanon/Makefile plugins/mmutf8fix/Makefile plugins/mmcount/Makefile plugins/mmsequence/Makefile plugins/mmfields/Makefile plugins/mmpstrucdata/Makefile plugins/mmrfc5424addhmac/Makefile plugins/omelasticsearch/Makefile plugins/sm_cust_bindcdr/Makefile plugins/mmsnmptrapd/Makefile java/Makefile tests/Makefile" +ac_config_files="$ac_config_files Makefile runtime/Makefile tools/Makefile doc/Makefile plugins/imudp/Makefile plugins/imtcp/Makefile plugins/im3195/Makefile plugins/imgssapi/Makefile plugins/imuxsock/Makefile plugins/immark/Makefile plugins/imklog/Makefile plugins/imtemplate/Makefile plugins/omtemplate/Makefile plugins/omhdfs/Makefile plugins/omprog/Makefile plugins/omstdout/Makefile plugins/pmrfc3164sd/Makefile plugins/pmlastmsg/Makefile plugins/pmcisconames/Makefile plugins/pmsnare/Makefile plugins/pmaixforwardedfrom/Makefile plugins/omruleset/Makefile plugins/omdbalerting/Makefile plugins/omuxsock/Makefile plugins/imfile/Makefile plugins/imsolaris/Makefile plugins/imptcp/Makefile plugins/impstats/Makefile plugins/imrelp/Makefile plugins/imdiag/Makefile plugins/omtesting/Makefile plugins/omgssapi/Makefile plugins/ommysql/Makefile plugins/ompgsql/Makefile plugins/omrelp/Makefile plugins/omlibdbi/Makefile plugins/ommail/Makefile plugins/omsnmp/Makefile plugins/omoracle/Makefile plugins/omudpspoof/Makefile plugins/omelasticsearch/Makefile plugins/sm_cust_bindcdr/Makefile plugins/mmsnmptrapd/Makefile java/Makefile tests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20491,21 +16693,10 @@ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then + test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -20592,14 +16783,6 @@ as_fn_error $? "conditional \"ENABLE_IMKLOG_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_IMKMSG_TRUE}" && test -z "${ENABLE_IMKMSG_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_IMKMSG\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_IMJOURNAL_TRUE}" && test -z "${ENABLE_IMJOURNAL_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_IMJOURNAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_INET_TRUE}" && test -z "${ENABLE_INET_FALSE}"; then as_fn_error $? "conditional \"ENABLE_INET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20612,10 +16795,6 @@ as_fn_error $? "conditional \"ENABLE_DIAGTOOLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_USERTOOLS_TRUE}" && test -z "${ENABLE_USERTOOLS_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_USERTOOLS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_MYSQL_TRUE}" && test -z "${ENABLE_MYSQL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_MYSQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20636,10 +16815,6 @@ as_fn_error $? "conditional \"ENABLE_SNMP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_UUID_TRUE}" && test -z "${ENABLE_UUID_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_UUID\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_ELASTICSEARCH_TRUE}" && test -z "${ENABLE_ELASTICSEARCH_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ELASTICSEARCH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20648,10 +16823,6 @@ as_fn_error $? "conditional \"ENABLE_GNUTLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_LIBGCRYPT_TRUE}" && test -z "${ENABLE_LIBGCRYPT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_LIBGCRYPT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_RSYSLOGRT_TRUE}" && test -z "${ENABLE_RSYSLOGRT_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RSYSLOGRT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20676,54 +16847,10 @@ as_fn_error $? "conditional \"ENABLE_IMDIAG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_MMNORMALIZE_TRUE}" && test -z "${ENABLE_MMNORMALIZE_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMNORMALIZE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMJSONPARSE_TRUE}" && test -z "${ENABLE_MMJSONPARSE_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMJSONPARSE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMAUDIT_TRUE}" && test -z "${ENABLE_MMAUDIT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMAUDIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMANON_TRUE}" && test -z "${ENABLE_MMANON_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMANON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMUTF8FIX_TRUE}" && test -z "${ENABLE_MMUTF8FIX_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMUTF8FIX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMCOUNT_TRUE}" && test -z "${ENABLE_MMCOUNT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMCOUNT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMSEQUENCE_TRUE}" && test -z "${ENABLE_MMSEQUENCE_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMSEQUENCE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMFIELDS_TRUE}" && test -z "${ENABLE_MMFIELDS_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMFIELDS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMPSTRUCDATA_TRUE}" && test -z "${ENABLE_MMPSTRUCDATA_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMPSTRUCDATA\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_MMRFC5424ADDHMAC_TRUE}" && test -z "${ENABLE_MMRFC5424ADDHMAC_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMRFC5424ADDHMAC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_RELP_TRUE}" && test -z "${ENABLE_RELP_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RELP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_GUARDTIME_TRUE}" && test -z "${ENABLE_GUARDTIME_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_GUARDTIME\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_RFC3195_TRUE}" && test -z "${ENABLE_RFC3195_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RFC3195\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20744,10 +16871,6 @@ as_fn_error $? "conditional \"ENABLE_IMPTCP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_IMTTCP_TRUE}" && test -z "${ENABLE_IMTTCP_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_IMTTCP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_IMPSTATS_TRUE}" && test -z "${ENABLE_IMPSTATS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_IMPSTATS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20764,10 +16887,6 @@ as_fn_error $? "conditional \"ENABLE_OMSTDOUT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_OMJOURNAL_TRUE}" && test -z "${ENABLE_OMJOURNAL_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_OMJOURNAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_PMLASTMSG_TRUE}" && test -z "${ENABLE_PMLASTMSG_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PMLASTMSG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20792,6 +16911,10 @@ as_fn_error $? "conditional \"ENABLE_OMRULESET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_OMDBALERTING_TRUE}" && test -z "${ENABLE_OMDBALERTING_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_OMDBALERTING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_GUI_TRUE}" && test -z "${ENABLE_GUI_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GUI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20804,36 +16927,24 @@ as_fn_error $? "conditional \"ENABLE_SMCUSTBINDCDR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_MMSNMPTRAPD_TRUE}" && test -z "${ENABLE_MMSNMPTRAPD_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_MMSNMPTRAPD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_OMHDFS_TRUE}" && test -z "${ENABLE_OMHDFS_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_OMHDFS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_OMMONGODB_TRUE}" && test -z "${ENABLE_OMMONGODB_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_OMMONGODB\" was never defined. +if test -z "${ENABLE_IMTEMPLATE_TRUE}" && test -z "${ENABLE_IMTEMPLATE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_IMTEMPLATE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_IMZMQ3_TRUE}" && test -z "${ENABLE_IMZMQ3_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_IMZMQ3\" was never defined. +if test -z "${ENABLE_OMTEMPLATE_TRUE}" && test -z "${ENABLE_OMTEMPLATE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_OMTEMPLATE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_OMZMQ3_TRUE}" && test -z "${ENABLE_OMZMQ3_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_OMZMQ3\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${ENABLE_OMRABBITMQ_TRUE}" && test -z "${ENABLE_OMRABBITMQ_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_OMRABBITMQ\" was never defined. +if test -z "${ENABLE_MMSNMPTRAPD_TRUE}" && test -z "${ENABLE_MMSNMPTRAPD_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_MMSNMPTRAPD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_OMHIREDIS_TRUE}" && test -z "${ENABLE_OMHIREDIS_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_OMHIREDIS\" was never defined. +if test -z "${ENABLE_OMHDFS_TRUE}" && test -z "${ENABLE_OMHDFS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_OMHDFS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -20934,7 +17045,6 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -21241,8 +17351,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rsyslog $as_me 7.6.0, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by rsyslog $as_me 5.10.1, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -21307,8 +17417,8 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rsyslog config.status 7.6.0 -configured by $0, generated by GNU Autoconf 2.68, +rsyslog config.status 5.10.1 +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -21436,154 +17546,131 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -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"`' -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"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -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_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"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $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"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -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"`' -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"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - # Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ +for var in SED \ GREP \ EGREP \ FGREP \ @@ -21596,13 +17683,8 @@ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ -archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -21612,14 +17694,14 @@ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ +SHELL \ +ECHO \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ lt_prog_compiler_wl \ +lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ -MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -21633,7 +17715,9 @@ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ +fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -21641,13 +17725,12 @@ libname_spec \ library_names_spec \ soname_spec \ -install_override_mode \ finish_eval \ old_striplib \ striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -21669,15 +17752,14 @@ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ -postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -21685,6 +17767,12 @@ esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -21718,8 +17806,6 @@ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "runtime/Makefile") CONFIG_FILES="$CONFIG_FILES runtime/Makefile" ;; - "compat/Makefile") CONFIG_FILES="$CONFIG_FILES compat/Makefile" ;; - "grammar/Makefile") CONFIG_FILES="$CONFIG_FILES grammar/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "plugins/imudp/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imudp/Makefile" ;; @@ -21727,29 +17813,27 @@ "plugins/im3195/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/im3195/Makefile" ;; "plugins/imgssapi/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imgssapi/Makefile" ;; "plugins/imuxsock/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imuxsock/Makefile" ;; - "plugins/imjournal/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imjournal/Makefile" ;; "plugins/immark/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/immark/Makefile" ;; "plugins/imklog/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imklog/Makefile" ;; - "plugins/imkmsg/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imkmsg/Makefile" ;; + "plugins/imtemplate/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imtemplate/Makefile" ;; + "plugins/omtemplate/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omtemplate/Makefile" ;; "plugins/omhdfs/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omhdfs/Makefile" ;; "plugins/omprog/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omprog/Makefile" ;; "plugins/omstdout/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omstdout/Makefile" ;; - "plugins/omjournal/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omjournal/Makefile" ;; "plugins/pmrfc3164sd/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pmrfc3164sd/Makefile" ;; "plugins/pmlastmsg/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pmlastmsg/Makefile" ;; "plugins/pmcisconames/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pmcisconames/Makefile" ;; "plugins/pmsnare/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pmsnare/Makefile" ;; "plugins/pmaixforwardedfrom/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pmaixforwardedfrom/Makefile" ;; "plugins/omruleset/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omruleset/Makefile" ;; + "plugins/omdbalerting/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omdbalerting/Makefile" ;; "plugins/omuxsock/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omuxsock/Makefile" ;; "plugins/imfile/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imfile/Makefile" ;; "plugins/imsolaris/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imsolaris/Makefile" ;; "plugins/imptcp/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imptcp/Makefile" ;; - "plugins/imttcp/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imttcp/Makefile" ;; "plugins/impstats/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/impstats/Makefile" ;; "plugins/imrelp/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imrelp/Makefile" ;; "plugins/imdiag/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imdiag/Makefile" ;; - "plugins/imzmq3/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/imzmq3/Makefile" ;; "plugins/omtesting/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omtesting/Makefile" ;; "plugins/omgssapi/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omgssapi/Makefile" ;; "plugins/ommysql/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/ommysql/Makefile" ;; @@ -21760,27 +17844,13 @@ "plugins/omsnmp/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omsnmp/Makefile" ;; "plugins/omoracle/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omoracle/Makefile" ;; "plugins/omudpspoof/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omudpspoof/Makefile" ;; - "plugins/ommongodb/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/ommongodb/Makefile" ;; - "plugins/omhiredis/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omhiredis/Makefile" ;; - "plugins/omzmq3/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omzmq3/Makefile" ;; - "plugins/omrabbitmq/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omrabbitmq/Makefile" ;; - "plugins/mmnormalize/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmnormalize/Makefile" ;; - "plugins/mmjsonparse/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmjsonparse/Makefile" ;; - "plugins/mmaudit/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmaudit/Makefile" ;; - "plugins/mmanon/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmanon/Makefile" ;; - "plugins/mmutf8fix/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmutf8fix/Makefile" ;; - "plugins/mmcount/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmcount/Makefile" ;; - "plugins/mmsequence/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmsequence/Makefile" ;; - "plugins/mmfields/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmfields/Makefile" ;; - "plugins/mmpstrucdata/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmpstrucdata/Makefile" ;; - "plugins/mmrfc5424addhmac/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmrfc5424addhmac/Makefile" ;; "plugins/omelasticsearch/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/omelasticsearch/Makefile" ;; "plugins/sm_cust_bindcdr/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sm_cust_bindcdr/Makefile" ;; "plugins/mmsnmptrapd/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/mmsnmptrapd/Makefile" ;; "java/Makefile") CONFIG_FILES="$CONFIG_FILES java/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -21803,10 +17873,9 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -21814,13 +17883,12 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -21842,7 +17910,7 @@ ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -21870,7 +17938,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -21918,7 +17986,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -21950,7 +18018,7 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -21984,7 +18052,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || +cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -21996,8 +18064,8 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -22098,7 +18166,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -22117,7 +18185,7 @@ for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -22126,7 +18194,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -22152,8 +18220,8 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -22289,22 +18357,21 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -22315,20 +18382,20 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ + mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. @@ -22490,8 +18557,7 @@ # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -22539,15 +18605,6 @@ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - # The host system. host_alias=$host_alias host=$host @@ -22597,11 +18654,9 @@ # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -22609,30 +18664,13 @@ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method = "file_magic". +# Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - # The archiver. AR=$lt_AR - -# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - # A symbol stripping program. STRIP=$lt_STRIP @@ -22641,9 +18679,6 @@ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - # A C compiler. LTCC=$lt_CC @@ -22662,24 +18697,21 @@ # 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 -# 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. -lt_sysroot=$lt_sysroot - # The name of the directory that contains temporary libtool files. objdir=$objdir +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -22736,9 +18768,6 @@ # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -22778,10 +18807,6 @@ # The linker used to build libraries. LD=$lt_LD -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -22794,12 +18819,12 @@ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -22849,6 +18874,10 @@ # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator @@ -22882,6 +18911,9 @@ # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -22897,9 +18929,6 @@ # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -22932,169 +18961,212 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_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}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac - 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 + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -23148,39 +19220,28 @@ echo " rsyslog runtime will be built: $enable_rsyslogrt" echo " rsyslogd will be built: $enable_rsyslogd" echo " GUI components will be built: $enable_gui" -echo " cached man files will be used: $enable_cached_man_pages" echo " Unlimited select() support enabled: $enable_unlimited_select" -echo " uuid support enabled: $enable_uuid" -echo " Log file signing support: $enable_guardtime" -echo " Log file encryption support: $enable_libgcrypt" -echo " anonymization support enabled: $enable_mmanon" -echo " message counting support enabled: $enable_mmcount" -echo " mmfields enabled: $enable_mmfields" echo echo "---{ input plugins }---" echo " Klog functionality enabled: $enable_klog ($os_type)" -echo " /dev/kmsg functionality enabled: $enable_kmsg" echo " plain tcp input module enabled: $enable_imptcp" -echo " threaded plain tcp input module enabled: $enable_imttcp" echo " imdiag enabled: $enable_imdiag" echo " file input module enabled: $enable_imfile" echo " Solaris input module enabled: $enable_imsolaris" echo " periodic statistics module enabled: $enable_impstats" -echo " imzmq3 input module enabled: $enable_imzmq3" -echo " imjournal input module enabled: $enable_imjournal" +echo " input template module will be compiled: $enable_imtemplate" echo echo "---{ output plugins }---" echo " Mail support enabled: $enable_mail" echo " omprog module will be compiled: $enable_omprog" echo " omstdout module will be compiled: $enable_omstdout" -echo " omjournal module will be compiled: $enable_omjournal" echo " omhdfs module will be compiled: $enable_omhdfs" echo " omelasticsearch module will be compiled: $enable_elasticsearch" echo " omruleset module will be compiled: $enable_omruleset" +echo " omdbalerting module will be compiled: $enable_omdbalerting" echo " omudpspoof module will be compiled: $enable_omudpspoof" echo " omuxsock module will be compiled: $enable_omuxsock" -echo " omzmq3 module will be compiled: $enable_omzmq3" -echo " omrabbitmq module will be compiled: $enable_omrabbitmq" +echo " output template module will be compiled: $enable_omtemplate" echo echo "---{ parser modules }---" echo " pmrfc3164sd module will be compiled: $enable_pmrfc3164sd" @@ -23190,14 +19251,7 @@ echo " pmsnare module will be compiled: $enable_pmsnare" echo echo "---{ message modification modules }---" -echo " mmnormalize module will be compiled: $enable_mmnormalize" -echo " mmjsonparse module will be compiled: $enable_mmjsonparse" -echo " mmjaduit module will be compiled: $enable_mmaudit" echo " mmsnmptrapd module will be compiled: $enable_mmsnmptrapd" -echo " mmutf8fix enabled: $enable_mmutf8fix" -echo " mmrfc5424addhmac enabled: $enable_mmrfc5424addhmac" -echo " mmpstrucdata enabled: $enable_mmpstrucdata" -echo " mmsequence enabled: $enable_mmsequence" echo echo "---{ strgen modules }---" echo " sm_cust_bindcdr module will be compiled: $enable_sm_cust_bindcdr" @@ -23206,8 +19260,6 @@ echo " MySql support enabled: $enable_mysql" echo " libdbi support enabled: $enable_libdbi" echo " PostgreSQL support enabled: $enable_pgsql" -echo " mongodb support enabled: $enable_ommongodb" -echo " hiredis support enabled: $enable_omhiredis" echo " Oracle (OCI) support enabled: $enable_oracle" echo echo "---{ protocol support }---" @@ -23222,9 +19274,7 @@ echo " MySQL Tests enabled: $enable_mysql_tests" echo " Debug mode enabled: $enable_debug" echo " Runtime Instrumentation enabled: $enable_rtinst" -echo " (total) debugless mode enabled: $enable_debugless" echo " Diagnostic tools enabled: $enable_diagtools" -echo " End-User tools enabled: $enable_usertools" echo " Enhanced memory checking enabled: $enable_memcheck" echo " Valgrind support settings enabled: $enable_valgrind" echo diff -Nru rsyslog-7.6.0/configure.ac rsyslog-5.10.1/configure.ac --- rsyslog-7.6.0/configure.ac 2014-02-12 12:02:42.000000000 +0000 +++ rsyslog-5.10.1/configure.ac 2012-10-17 14:42:05.000000000 +0000 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[7.6.0],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[5.10.1],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -17,9 +17,13 @@ AC_CHECK_PROG(have_valgrind, [valgrind], [yes]) AM_CONDITIONAL(HAVE_VALGRIND, test x$have_valgrind = xyes) +# check for Java compiler +AC_CHECK_PROG(HAVE_JAVAC, [javac], [yes]) +if test x"$HAVE_JAVAC" = x""; then + AC_MSG_WARN([no javac found, disabling features depending on it]) +fi + # Checks for programs. -AC_PROG_LEX -AC_PROG_YACC AC_PROG_CC AM_PROG_CC_C_O if test "$GCC" = "yes" @@ -31,23 +35,12 @@ PKG_PROG_PKG_CONFIG -# modules we require -PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.9) -PKG_CHECK_MODULES(LIBLOGGING_STDLOG, liblogging-stdlog >= 1.0.1) -PKG_CHECK_MODULES([JSON_C], [json],, [ - PKG_CHECK_MODULES([JSON_C], [json-c]) -]) - -# if int64 is supported, use it -AC_CHECK_LIB(json-c, json_object_new_object,,) -AC_CHECK_FUNCS(json_object_new_int64,,) - case "${host}" in *-*-linux*) AC_DEFINE([OS_LINUX], [1], [Indicator for a Linux OS]) os_type="linux" ;; - *-*-*darwin*|*-*-dragonfly*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) + *-*-*darwin*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*) AC_DEFINE([OS_BSD], [1], [Indicator for a BSD OS]) os_type="bsd" ;; @@ -61,10 +54,6 @@ AC_DEFINE([OS_SOLARIS], [1], [Indicator for a Solaris OS]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Use POSIX pthread semantics]) SOL_LIBS="-lsocket -lnsl" - # Solaris libuuid does not ship with a pkgconfig file so override the appropriate - # variables (but only if they have not been set by the user). - LIBUUID_CFLAGS=${LIBUUID_CFLAGS:= } - LIBUUID_LIBS=${LIBUUID_LIBS:=-luuid} AC_SUBST(SOL_LIBS) ;; esac @@ -76,8 +65,6 @@ LIBS= AC_SEARCH_LIBS(clock_gettime, rt) RT_LIBS=$LIBS -AC_SEARCH_LIBS(mq_getattr, rt) -RT_LIBS="$RT_LIBS $LIBS" LIBS= AC_SEARCH_LIBS(dlopen, dl) DL_LIBS=$LIBS @@ -126,10 +113,7 @@ AC_FUNC_STAT AC_FUNC_STRERROR_R AC_FUNC_VPRINTF -AC_CHECK_FUNCS([flock recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64]) - -# getifaddrs is in libc (mostly) or in libsocket (eg Solaris 11) or not defined (eg Solaris 10) -AC_SEARCH_LIBS([getifaddrs], [socket], [AC_DEFINE(HAVE_GETIFADDRS, [1], [set define])]) +AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync lseek64]) # the check below is probably ugly. If someone knows how to do it in a better way, please # let me know! -- rgerhards, 2010-10-06 @@ -137,9 +121,6 @@ #include ]) AC_CHECK_DECL([SO_TIMESTAMP], [AC_DEFINE(HAVE_SO_TIMESTAMP, [1], [set define])], [], [#include #include ]) -AC_CHECK_DECL([SYS_gettid], [AC_DEFINE(HAVE_SYS_gettid, [1], [set define])], [], [#include ]) -AC_CHECK_MEMBER([struct sysinfo.uptime], [AC_DEFINE(HAVE_SYSINFO_UPTIME, [1], [set define])], [], [#include ]) -AC_CHECK_DECL([GLOB_NOMAGIC], [AC_DEFINE(HAVE_GLOB_NOMAGIC, [1], [set define])], [], [#include ]) # Check for MAXHOSTNAMELEN AC_MSG_CHECKING(for MAXHOSTNAMELEN) @@ -158,20 +139,12 @@ AC_MSG_RESULT(no; defined as 64) ) -# Check for __builtin_expect() -AC_MSG_CHECKING([for __builtin_expect()]) -AC_LINK_IFELSE([AC_LANG_PROGRAM(, return __builtin_expect(main != 0, 1))], - [AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, - Define to 1 if compiler supports __builtin_expect) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - # check for availability of atomic operations RS_ATOMIC_OPERATIONS RS_ATOMIC_OPERATIONS_64BIT # fall back to POSIX sems for atomic operations (cpu expensive) -AC_CHECK_HEADERS([semaphore.h sys/syscall.h]) +AC_CHECK_HEADERS([semaphore.h]) # Additional module directories @@ -269,7 +242,22 @@ # multithreading via pthreads -AC_CHECK_HEADERS( +AC_ARG_ENABLE(pthreads, + [AS_HELP_STRING([--enable-pthreads],[Enable multithreading via pthreads @<:@default=yes@:>@])], + [case "${enableval}" in + yes) enable_pthreads="yes" ;; + no) enable_pthreads="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-pthreads) ;; + esac], + [enable_pthreads=yes] +) + +if test "x$enable_pthreads" = "xno"; then + AC_MSG_ERROR(rsyslog v3+ does no longer support single threading mode -- use a previous version for that); +fi + +if test "x$enable_pthreads" != "xno"; then + AC_CHECK_HEADERS( [pthread.h], [ AC_CHECK_LIB( @@ -290,7 +278,8 @@ ) ], [AC_MSG_FAILURE([pthread is missing])] -) + ) +fi AC_CHECK_FUNCS( [pthread_setschedparam], @@ -338,32 +327,27 @@ AM_CONDITIONAL(ENABLE_IMKLOG_LINUX, test x$os_type = xlinux) AM_CONDITIONAL(ENABLE_IMKLOG_SOLARIS, test x$os_type = xsolaris) -# kmsg -AC_ARG_ENABLE(kmsg, - [AS_HELP_STRING([--enable-kmsg],[Kmsg structured kernel logs functionality @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_kmsg="yes" ;; - no) enable_kmsg="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-kmsg) ;; - esac], - [enable_kmsg="no"] -) -AM_CONDITIONAL(ENABLE_IMKMSG, test x$enable_kmsg = xyes) -# imjournal -AC_ARG_ENABLE(imjournal, - [AS_HELP_STRING([--enable-imjournal],[Systemd journal message import @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_imjournal="yes" ;; - no) enable_imjournal="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-imjournal) ;; - esac], - [enable_imjournal="no"] -) -if test "x$enable_imjournal" = "xyes"; then - PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd-journal >= 197]) -fi -AM_CONDITIONAL(ENABLE_IMJOURNAL, test x$enable_imjournal = xyes) +# +# SYSLOG_UNIXAF +# +AC_MSG_CHECKING(for SYSLOG_UNIXAF support) +AC_ARG_ENABLE([unix], + [AS_HELP_STRING([--disable-unix], [Disable support for unix])], + [ + if test "x${enableval}" = "xyes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([SYSLOG_UNIXAF], [1], [Description]) + else + AC_MSG_RESULT([no]) + fi + ], + [ + # enabled by default + AC_MSG_RESULT([yes]) + AC_DEFINE([SYSLOG_UNIXAF], [1], [Description]) + ]) + # inet AC_ARG_ENABLE(inet, @@ -461,22 +445,6 @@ fi -# total debugless: highest performance, but no way at all to enable debug -# logging -AC_ARG_ENABLE(debugless, - [AS_HELP_STRING([--enable-debugless],[Enable runtime instrumentation mode @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_debugless="yes" ;; - no) enable_debugless="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-debugless) ;; - esac], - [enable_debugless="no"] -) -if test "$enable_debugless" = "yes"; then - AC_DEFINE(DEBUGLESS, 1, [Defined if debugless mode is enabled.]) -fi - - # valgrind AC_ARG_ENABLE(valgrind, [AS_HELP_STRING([--enable-valgrind],[Enable valgrind support settings @<:@default=no@:>@])], @@ -520,18 +488,6 @@ AM_CONDITIONAL(ENABLE_DIAGTOOLS, test x$enable_diagtools = xyes) -# compile end-user tools -AC_ARG_ENABLE(usertools, - [AS_HELP_STRING([--enable-usertools],[Enable end user tools @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_usertools="yes" ;; - no) enable_usertools="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-usertools) ;; - esac], - [enable_usertools=no] -) -AM_CONDITIONAL(ENABLE_USERTOOLS, test x$enable_usertools = xyes) - # MySQL support AC_ARG_ENABLE(mysql, @@ -697,16 +653,12 @@ [dbi_initialize_r], [AC_DEFINE([HAVE_DBI_R], [1], [Define to 1 if libdbi supports the new plugin-safe interface])] ) - AC_CHECK_LIB( - [dbi], - [dbi_conn_transaction_begin], - [AC_DEFINE([HAVE_DBI_TXSUPP], [1], [Define to 1 if libdbi supports transactions])] - ) fi AM_CONDITIONAL(ENABLE_OMLIBDBI, test x$enable_libdbi = xyes) AC_SUBST(LIBDBI_CFLAGS) AC_SUBST(LIBDBI_LIBS) + # SNMP support AC_ARG_ENABLE(snmp, [AS_HELP_STRING([--enable-snmp],[Enable SNMP support @<:@default=no@:>@])], @@ -736,23 +688,6 @@ AC_SUBST(SNMP_LIBS) -# uuid support -AC_ARG_ENABLE(uuid, - [AS_HELP_STRING([--enable-uuid],[Enable support for uuid generation @<:@default=yes@:>@])], - [case "${enableval}" in - yes) enable_uuid="yes" ;; - no) enable_uuid="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-uuid) ;; - esac], - [enable_uuid=yes] -) -if test "x$enable_uuid" = "xyes"; then - PKG_CHECK_MODULES([LIBUUID], [uuid]) - AC_DEFINE(USE_LIBUUID, 1, [Define if you want to enable libuuid support]) -fi -AM_CONDITIONAL(ENABLE_UUID, test x$enable_uuid = xyes) - - # elasticsearch support AC_ARG_ENABLE(elasticsearch, [AS_HELP_STRING([--enable-elasticsearch],[Enable elasticsearch output module @<:@default=no@:>@])], @@ -764,10 +699,27 @@ [enable_elasticsearch=no] ) if test "x$enable_elasticsearch" = "xyes"; then - PKG_CHECK_MODULES([CURL], [libcurl]) - LT_LIB_M + AC_CHECK_PROG( + [HAVE_CURL_CONFIG], + [curl-config], + [yes],,, + ) + if test "x${HAVE_CURL_CONFIG}" != "xyes"; then + AC_MSG_FAILURE([curl-config not found in PATH]) + fi + AC_CHECK_LIB( + [curl], + [curl_global_init], + [CURL_CFLAGS="`curl-config --cflags`" + CURL_LIBS="`curl-config --libs`" + ], + [AC_MSG_FAILURE([curl library is missing])], + [`curl-config --libs --cflags`] + ) fi AM_CONDITIONAL(ENABLE_ELASTICSEARCH, test x$enable_elasticsearch = xyes) +AC_SUBST(CURL_CFLAGS) +AC_SUBST(CURL_LIBS) # GnuTLS support @@ -782,43 +734,10 @@ ) if test "x$enable_gnutls" = "xyes"; then PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.0) - AC_DEFINE([ENABLE_GNUTLS], [1], [Indicator that GnuTLS is present]) fi AM_CONDITIONAL(ENABLE_GNUTLS, test x$enable_gnutls = xyes) - -# libgcrypt support -AC_ARG_ENABLE(libgcrypt, - [AS_HELP_STRING([--enable-libgcrypt],[Enable log file encryption support (libgcrypt) @<:@default=yes@:>@])], - [case "${enableval}" in - yes) enable_libgcrypt="yes" ;; - no) enable_libgcrypt="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-libgcrypt) ;; - esac], - [enable_libgcrypt=yes] -) -if test "x$enable_libgcrypt" = "xyes"; then - AC_CHECK_PROG( - [HAVE_LIBGCRYPT_CONFIG], - [libgcrypt-config], - [yes],,, - ) - if test "x${HAVE_LIBGCRYPT_CONFIG}" != "xyes"; then - AC_MSG_FAILURE([libgcrypt-config not found in PATH]) - fi - AC_CHECK_LIB( - [gcrypt], - [gcry_cipher_open], - [LIBGCRYPT_CFLAGS="`libgcrypt-config --cflags`" - LIBGCRYPT_LIBS="`libgcrypt-config --libs`" - ], - [AC_MSG_FAILURE([libgcrypt is missing])], - [`libgcrypt-config --libs --cflags`] - ) - AC_DEFINE([ENABLE_LIBGCRYPT], [1], [Indicator that LIBGCRYPT is present]) -fi -AM_CONDITIONAL(ENABLE_LIBGCRYPT, test x$enable_libgcrypt = xyes) -AC_SUBST(LIBGCRYPT_CFLAGS) -AC_SUBST(LIBGCRYPT_LIBS) +AC_SUBST(GNUTLS_CFLAGS) +AC_SUBST(GNUTLS_LIBS) # support for building the rsyslogd runtime @@ -832,14 +751,10 @@ [enable_rsyslogrt=yes] ) if test "x$enable_rsyslogrt" = "xyes"; then - RSRT_CFLAGS1="-I\$(top_srcdir)/runtime -I\$(top_srcdir) -I\$(top_srcdir)/grammar" - RSRT_LIBS1="\$(top_builddir)/runtime/librsyslog.la" + RSRT_CFLAGS="-I\$(top_srcdir)/runtime -I\$(top_srcdir)" + RSRT_LIBS="\$(top_builddir)/runtime/librsyslog.la" fi AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes) -RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)" -RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)" -AC_SUBST(RSRT_CFLAGS1) -AC_SUBST(RSRT_LIBS1) AC_SUBST(RSRT_CFLAGS) AC_SUBST(RSRT_LIBS) @@ -921,145 +836,6 @@ AM_CONDITIONAL(ENABLE_IMDIAG, test x$enable_imdiag = xyes) -# mmnormalize -AC_ARG_ENABLE(mmnormalize, - [AS_HELP_STRING([--enable-mmnormalize],[Enable building mmnormalize support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmnormalize="yes" ;; - no) enable_mmnormalize="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmnormalize) ;; - esac], - [enable_mmnormalize=no] -) -if test "x$enable_mmnormalize" = "xyes"; then - PKG_CHECK_MODULES(LIBEE, libee >= 0.4.0) - PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 0.3.1 lognorm < 1.0.0) -fi -AM_CONDITIONAL(ENABLE_MMNORMALIZE, test x$enable_mmnormalize = xyes) - - -# mmnjsonparse -AC_ARG_ENABLE(mmjsonparse, - [AS_HELP_STRING([--enable-mmjsonparse],[Enable building mmjsonparse support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmjsonparse="yes" ;; - no) enable_mmjsonparse="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmjsonparse) ;; - esac], - [enable_mmjsonparse=no] -) -AM_CONDITIONAL(ENABLE_MMJSONPARSE, test x$enable_mmjsonparse = xyes) - - -# mmaudit -AC_ARG_ENABLE(mmaudit, - [AS_HELP_STRING([--enable-mmaudit],[Enable building mmaudit support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmaudit="yes" ;; - no) enable_mmaudit="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmaudit) ;; - esac], - [enable_mmaudit=no] -) -AM_CONDITIONAL(ENABLE_MMAUDIT, test x$enable_mmaudit = xyes) - - -# mmanon -AC_ARG_ENABLE(mmanon, - [AS_HELP_STRING([--enable-mmanon],[Enable building mmanon support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmanon="yes" ;; - no) enable_mmanon="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmanon) ;; - esac], - [enable_mmanon=no] -) -AM_CONDITIONAL(ENABLE_MMANON, test x$enable_mmanon = xyes) - - -# mmutf8fix -AC_ARG_ENABLE(mmutf8fix, - [AS_HELP_STRING([--enable-mmutf8fix],[Enable building mmutf8fix support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmutf8fix="yes" ;; - no) enable_mmutf8fix="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmutf8fix) ;; - esac], - [enable_mmutf8fix=no] -) -AM_CONDITIONAL(ENABLE_MMUTF8FIX, test x$enable_mmutf8fix = xyes) - - -# mmcount -AC_ARG_ENABLE(mmcount, - [AS_HELP_STRING([--enable-mmcount],[Enable message counting @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmcount="yes" ;; - no) enable_mmcount="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmcount) ;; - esac], - [enable_mmcount=no] -) -AM_CONDITIONAL(ENABLE_MMCOUNT, test x$enable_mmcount = xyes) - - -# mmsequence -AC_ARG_ENABLE(mmsequence, - [AS_HELP_STRING([--enable-mmsequence],[Enable sequence generator @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmsequence="yes" ;; - no) enable_mmsequence="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmsequence) ;; - esac], - [enable_mmsequence=no] -) -AM_CONDITIONAL(ENABLE_MMSEQUENCE, test x$enable_mmsequence = xyes) - - -# mmfields -AC_ARG_ENABLE(mmfields, - [AS_HELP_STRING([--enable-mmfields],[Enable building mmfields support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmfields="yes" ;; - no) enable_mmfields="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmfields) ;; - esac], - [enable_mmfields=no] -) -AM_CONDITIONAL(ENABLE_MMFIELDS, test x$enable_mmfields = xyes) - -# mmpstrucdata -AC_ARG_ENABLE(mmpstrucdata, - [AS_HELP_STRING([--enable-mmpstrucdata],[Enable building mmpstrucdata support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmpstrucdata="yes" ;; - no) enable_mmpstrucdata="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmpstrucdata) ;; - esac], - [enable_mmpstrucdata=no] -) -AM_CONDITIONAL(ENABLE_MMPSTRUCDATA, test x$enable_mmpstrucdata = xyes) - - -# mmrfc5424addhmac -AC_ARG_ENABLE(mmrfc5424addhmac, - [AS_HELP_STRING([--enable-mmrfc5424addhmac],[Enable building mmrfc5424addhmac support @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_mmrfc5424addhmac="yes" ;; - no) enable_mmrfc5424addhmac="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-mmrfc5424addhmac) ;; - esac], - [enable_mmrfc5424addhmac=no] -) -if test "x$enable_mmrfc5424addhmac" = "xyes"; then - PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7) -#AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data], [], [AC_MSG_ERROR([OpenSSL libraries required])]) -#AC_CHECK_LIB([ssl],[SSL_library_init], [], [AC_MSG_ERROR([OpenSSL libraries required])]) -#AC_CHECK_HEADERS([openssl/crypto.h openssl/x509.h openssl/pem.h openssl/ssl.h openssl/err.h],[],[AC_MSG_ERROR([OpenSSL headers required])]) -fi -AM_CONDITIONAL(ENABLE_MMRFC5424ADDHMAC, test x$enable_mmrfc5424addhmac = xyes) - - # RELP support AC_ARG_ENABLE(relp, [AS_HELP_STRING([--enable-relp],[Enable RELP support @<:@default=no@:>@])], @@ -1071,49 +847,11 @@ [enable_relp=no] ) if test "x$enable_relp" = "xyes"; then - PKG_CHECK_MODULES(RELP, relp >= 1.2.0) + PKG_CHECK_MODULES(RELP, relp >= 0.1.1) fi AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes) - - -# GuardTime support -AC_ARG_ENABLE(guardtime, - [AS_HELP_STRING([--enable-guardtime],[Enable log file signing support (via GuardTime) @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_guardtime="yes" ;; - no) enable_guardtime="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-guardtime) ;; - esac], - [enable_guardtime=no] -) -if test "x$enable_guardtime" = "xyes"; then - PKG_CHECK_MODULES(GUARDTIME, libgt >= 0.3.1) -fi -AM_CONDITIONAL(ENABLE_GUARDTIME, test x$enable_guardtime = xyes) - - -# Support using cached man file copies, to avoid the need for rst2man -# in the build environment -AC_ARG_ENABLE(cached_man_pages, - [AS_HELP_STRING([--enable-cached-man-pages],[Enable using cached versions of man files (avoid rst2man) @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_cached_man_pages="yes" ;; - no) enable_cached_man_pages="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-cached-man-pages) ;; - esac], - [enable_cached_man_pages=no] -) -if test "x$enable_cached_man_pages" = "xno"; then -# obtain path for rst2man - if test "x$enable_libgcrypt" = "xyes" || \ - test "x$enable_guardtime" = "xyes"; then - AC_PATH_PROG([RST2MAN], [rst2man]) - if test "x${RST2MAN}" == "x"; then - AC_MSG_FAILURE([rst2man not found in PATH]) - fi - fi -fi - +AC_SUBST(RELP_CFLAGS) +AC_SUBST(RELP_LIBS) # RFC 3195 support @@ -1130,6 +868,8 @@ PKG_CHECK_MODULES(LIBLOGGING, liblogging >= 0.7.1) fi AM_CONDITIONAL(ENABLE_RFC3195, test x$enable_rfc3195 = xyes) +AC_SUBST(LIBLOGGING_CFLAGS) +AC_SUBST(LIBLOGGING_LIBS) # enable/disable the testbench (e.g. because some important parts @@ -1184,19 +924,6 @@ AM_CONDITIONAL(ENABLE_IMPTCP, test x$enable_imptcp = xyes) -# settings for the ttcp input module -AC_ARG_ENABLE(imttcp, - [AS_HELP_STRING([--enable-imttcp],[threaded plain tcp input module enabled @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_imttcp="yes" ;; - no) enable_imttcp="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-imttcp) ;; - esac], - [enable_imttcp=no] -) -AM_CONDITIONAL(ENABLE_IMTTCP, test x$enable_imttcp = xyes) - - # settings for the pstats input module AC_ARG_ENABLE(impstats, [AS_HELP_STRING([--enable-impstats],[periodic statistics module enabled @<:@default=no@:>@])], @@ -1265,21 +992,6 @@ ) AM_CONDITIONAL(ENABLE_OMSTDOUT, test x$enable_omstdout = xyes) -# settings for omjournal -AC_ARG_ENABLE(omjournal, - [AS_HELP_STRING([--enable-omjournal],[Compiles omjournal @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_omjournal="yes" ;; - no) enable_omjournal="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-omjournal) ;; - esac], - [enable_omjournal=no] -) -if test "x$enable_omjournal" = "xyes"; then - PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd-journal >= 197]) -fi -AM_CONDITIONAL(ENABLE_OMJOURNAL, test x$enable_omjournal = xyes) - # settings for pmlastmsg AC_ARG_ENABLE(pmlastmsg, @@ -1348,7 +1060,7 @@ # settings for omruleset AC_ARG_ENABLE(omruleset, - [AS_HELP_STRING([--enable-omruleset],[Compiles ruleset forwarding module @<:@default=no@:>@])], + [AS_HELP_STRING([--enable-omruleset],[Compiles ruleset forwarding module @<:@default=yes@:>@])], [case "${enableval}" in yes) enable_omruleset="yes" ;; no) enable_omruleset="no" ;; @@ -1359,6 +1071,20 @@ AM_CONDITIONAL(ENABLE_OMRULESET, test x$enable_omruleset = xyes) +# settings for omdbalerting +AC_ARG_ENABLE(omdbalerting, + [AS_HELP_STRING([--enable-omdbalerting],[Compiles omdbalerting module @<:@default=no@:>@])], + [case "${enableval}" in + yes) enable_omdbalerting="yes" ;; + no) enable_omdbalerting="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-omdbalerting) ;; + esac], + [enable_omdbalerting=no] +) +AM_CONDITIONAL(ENABLE_OMDBALERTING, test x$enable_omdbalerting = xyes) + + + # building the GUI (mostly for diagnostic reasons) AC_ARG_ENABLE(gui, [AS_HELP_STRING([--enable-gui],[Enable GUI programs @<:@default=no@:>@])], @@ -1377,6 +1103,9 @@ AM_CONDITIONAL(ENABLE_GUI, test x$enable_gui = xyes) +AC_SUBST(RELP_CFLAGS) +AC_SUBST(RELP_LIBS) + # settings for omuxsock AC_ARG_ENABLE(omuxsock, [AS_HELP_STRING([--enable-omuxsock],[Compiles omuxsock module @<:@default=no@:>@])], @@ -1392,16 +1121,56 @@ # A custom strgen that also serves as a sample of how to do # SQL-generating strgen's -AC_ARG_ENABLE(sm_cust_bindcdr, - [AS_HELP_STRING([--enable-sm_cust_bindcdr],[Compiles sm_cust_bindcdr module @<:@default=no@:>@])], +AC_ARG_ENABLE(smcustbindcdr, + [AS_HELP_STRING([--enable-smcustbindcdr],[Compiles smcustbindcdr module @<:@default=no@:>@])], + [case "${enableval}" in + yes) enable_smcustbindcdr="yes" ;; + no) enable_smcustbindcdr="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-smcustbindcdr) ;; + esac], + [enable_smcustbindcdr=no] +) +AM_CONDITIONAL(ENABLE_SMCUSTBINDCDR, test x$enable_smcustbindcdr = xyes) + + +# settings for the template input module; copy and modify this code +# if you intend to add your own module. Be sure to replace imtemplate +# by the actual name of your module. +AC_ARG_ENABLE(imtemplate, + [AS_HELP_STRING([--enable-imtemplate],[Compiles imtemplate template module @<:@default=no@:>@])], + [case "${enableval}" in + yes) enable_imtemplate="yes" ;; + no) enable_imtemplate="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-imtemplate) ;; + esac], + [enable_imtemplate=no] +) +# +# you may want to do some library checks here - see snmp, mysql, pgsql modules +# for samples +# +AM_CONDITIONAL(ENABLE_IMTEMPLATE, test x$enable_imtemplate = xyes) +# end of copy template - be sure to search for imtemplate to find everything! + + +# settings for the template output module; copy and modify this code +# if you intend to add your own module. Be sure to replace omtemplate +# by the actual name of your module. +AC_ARG_ENABLE(omtemplate, + [AS_HELP_STRING([--enable-omtemplate],[Compiles omtemplate template module @<:@default=no@:>@])], [case "${enableval}" in - yes) enable_sm_cust_bindcdr="yes" ;; - no) enable_sm_cust_bindcdr="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-sm_cust_bindcdr) ;; + yes) enable_omtemplate="yes" ;; + no) enable_omtemplate="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-omtemplate) ;; esac], - [enable_sm_cust_bindcdr=no] + [enable_omtemplate=no] ) -AM_CONDITIONAL(ENABLE_SMCUSTBINDCDR, test x$enable_sm_cust_bindcdr = xyes) +# +# you may want to do some library checks here - see snmp, mysql, pgsql modules +# for samples +# +AM_CONDITIONAL(ENABLE_OMTEMPLATE, test x$enable_omtemplate = xyes) +# end of copy template - be sure to search for omtemplate to find everything! # settings for mmsnmptrapd message modification module @@ -1434,100 +1203,8 @@ AM_CONDITIONAL(ENABLE_OMHDFS, test x$enable_omhdfs = xyes) -#MONGODB SUPPORT - -AC_ARG_ENABLE(ommongodb, - [AS_HELP_STRING([--enable-ommongodb],[Compiles ommongodb template module @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_ommongodb="yes" ;; - no) enable_ommongodb="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-ommongodb) ;; - esac], - [enable_ommongodb=no] -) -if test "x$enable_ommongodb" = "xyes"; then - PKG_CHECK_MODULES(LIBMONGO_CLIENT, libmongo-client >= 0.1.4) -fi -AM_CONDITIONAL(ENABLE_OMMONGODB, test x$enable_ommongodb = xyes) -# end of mongodb code - -# BEGIN ZMQ3 INPUT SUPPORT -AC_ARG_ENABLE(imzmq3, - [AS_HELP_STRING([--enable-imzmq3],[Compiles imzmq3 output module @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_imzmq3="yes" ;; - no) enable_imzmq3="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-imzmq3) ;; - esac], - [enable_imzmq3=no] -) -if test "x$enable_imzmq3" = "xyes"; then - PKG_CHECK_MODULES(CZMQ, libczmq >= 1.1.0) -fi -AM_CONDITIONAL(ENABLE_IMZMQ3, test x$enable_imzmq3 = xyes) - -# END ZMQ3 INPUT SUPPORT - -# BEGIN ZMQ3 OUTPUT SUPPORT -AC_ARG_ENABLE(omzmq3, - [AS_HELP_STRING([--enable-omzmq3],[Compiles omzmq3 output module @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_omzmq3="yes" ;; - no) enable_omzmq3="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-omzmq3) ;; - esac], - [enable_omzmq3=no] -) -if test "x$enable_omzmq3" = "xyes"; then - PKG_CHECK_MODULES(CZMQ, libczmq >= 1.1.0) -fi -AM_CONDITIONAL(ENABLE_OMZMQ3, test x$enable_omzmq3 = xyes) - -# END ZMQ3 SUPPORT - -# BEGIN RABBITMQ OUTPUT SUPPORT - -AC_ARG_ENABLE(omrabbitmq, - [AS_HELP_STRING([--enable-omrabbitmq],[Compiles omrabbitmq output module @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_omrabbitmq="yes" ;; - no) enable_omrabbitmq="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-omrabbitmq) ;; - esac], - [enable_omrabbitmq=no] -) -if test "x$enable_omrabbitmq" = "xyes"; then - PKG_CHECK_MODULES(RABBITMQ, librabbitmq >= 0.2.0) - AC_SUBST(RABBITMQ_CFLAGS) - AC_SUBST(RABBITMQ_LIBS) -fi -AM_CONDITIONAL(ENABLE_OMRABBITMQ, test x$enable_omrabbitmq = xyes) - -# END RABBITMQ SUPPORT - -# HIREDIS SUPPORT - -AC_ARG_ENABLE(omhiredis, - [AS_HELP_STRING([--enable-omhiredis],[Compiles omhiredis template module @<:@default=no@:>@])], - [case "${enableval}" in - yes) enable_omhiredis="yes" ;; - no) enable_omhiredis="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-omhiredis) ;; - esac], - [enable_omhiredis=no] -) -# -if test "x$enable_omhiredis" = "xyes"; then - PKG_CHECK_MODULES(HIREDIS, hiredis >= 0.10.1) -fi -AM_CONDITIONAL(ENABLE_OMHIREDIS, test x$enable_omhiredis = xyes) - -# END HIREDIS SUPPORT - AC_CONFIG_FILES([Makefile \ runtime/Makefile \ - compat/Makefile \ - grammar/Makefile \ tools/Makefile \ doc/Makefile \ plugins/imudp/Makefile \ @@ -1535,29 +1212,27 @@ plugins/im3195/Makefile \ plugins/imgssapi/Makefile \ plugins/imuxsock/Makefile \ - plugins/imjournal/Makefile \ plugins/immark/Makefile \ plugins/imklog/Makefile \ - plugins/imkmsg/Makefile \ + plugins/imtemplate/Makefile \ + plugins/omtemplate/Makefile \ plugins/omhdfs/Makefile \ plugins/omprog/Makefile \ plugins/omstdout/Makefile \ - plugins/omjournal/Makefile \ plugins/pmrfc3164sd/Makefile \ plugins/pmlastmsg/Makefile \ plugins/pmcisconames/Makefile \ plugins/pmsnare/Makefile \ plugins/pmaixforwardedfrom/Makefile \ plugins/omruleset/Makefile \ + plugins/omdbalerting/Makefile \ plugins/omuxsock/Makefile \ plugins/imfile/Makefile \ plugins/imsolaris/Makefile \ plugins/imptcp/Makefile \ - plugins/imttcp/Makefile \ plugins/impstats/Makefile \ plugins/imrelp/Makefile \ plugins/imdiag/Makefile \ - plugins/imzmq3/Makefile \ plugins/omtesting/Makefile \ plugins/omgssapi/Makefile \ plugins/ommysql/Makefile \ @@ -1568,20 +1243,6 @@ plugins/omsnmp/Makefile \ plugins/omoracle/Makefile \ plugins/omudpspoof/Makefile \ - plugins/ommongodb/Makefile \ - plugins/omhiredis/Makefile \ - plugins/omzmq3/Makefile \ - plugins/omrabbitmq/Makefile \ - plugins/mmnormalize/Makefile \ - plugins/mmjsonparse/Makefile \ - plugins/mmaudit/Makefile \ - plugins/mmanon/Makefile \ - plugins/mmutf8fix/Makefile \ - plugins/mmcount/Makefile \ - plugins/mmsequence/Makefile \ - plugins/mmfields/Makefile \ - plugins/mmpstrucdata/Makefile \ - plugins/mmrfc5424addhmac/Makefile \ plugins/omelasticsearch/Makefile \ plugins/sm_cust_bindcdr/Makefile \ plugins/mmsnmptrapd/Makefile \ @@ -1599,39 +1260,28 @@ echo " rsyslog runtime will be built: $enable_rsyslogrt" echo " rsyslogd will be built: $enable_rsyslogd" echo " GUI components will be built: $enable_gui" -echo " cached man files will be used: $enable_cached_man_pages" echo " Unlimited select() support enabled: $enable_unlimited_select" -echo " uuid support enabled: $enable_uuid" -echo " Log file signing support: $enable_guardtime" -echo " Log file encryption support: $enable_libgcrypt" -echo " anonymization support enabled: $enable_mmanon" -echo " message counting support enabled: $enable_mmcount" -echo " mmfields enabled: $enable_mmfields" echo echo "---{ input plugins }---" echo " Klog functionality enabled: $enable_klog ($os_type)" -echo " /dev/kmsg functionality enabled: $enable_kmsg" echo " plain tcp input module enabled: $enable_imptcp" -echo " threaded plain tcp input module enabled: $enable_imttcp" echo " imdiag enabled: $enable_imdiag" echo " file input module enabled: $enable_imfile" echo " Solaris input module enabled: $enable_imsolaris" echo " periodic statistics module enabled: $enable_impstats" -echo " imzmq3 input module enabled: $enable_imzmq3" -echo " imjournal input module enabled: $enable_imjournal" +echo " input template module will be compiled: $enable_imtemplate" echo echo "---{ output plugins }---" echo " Mail support enabled: $enable_mail" echo " omprog module will be compiled: $enable_omprog" echo " omstdout module will be compiled: $enable_omstdout" -echo " omjournal module will be compiled: $enable_omjournal" echo " omhdfs module will be compiled: $enable_omhdfs" echo " omelasticsearch module will be compiled: $enable_elasticsearch" echo " omruleset module will be compiled: $enable_omruleset" +echo " omdbalerting module will be compiled: $enable_omdbalerting" echo " omudpspoof module will be compiled: $enable_omudpspoof" echo " omuxsock module will be compiled: $enable_omuxsock" -echo " omzmq3 module will be compiled: $enable_omzmq3" -echo " omrabbitmq module will be compiled: $enable_omrabbitmq" +echo " output template module will be compiled: $enable_omtemplate" echo echo "---{ parser modules }---" echo " pmrfc3164sd module will be compiled: $enable_pmrfc3164sd" @@ -1641,14 +1291,7 @@ echo " pmsnare module will be compiled: $enable_pmsnare" echo echo "---{ message modification modules }---" -echo " mmnormalize module will be compiled: $enable_mmnormalize" -echo " mmjsonparse module will be compiled: $enable_mmjsonparse" -echo " mmjaduit module will be compiled: $enable_mmaudit" echo " mmsnmptrapd module will be compiled: $enable_mmsnmptrapd" -echo " mmutf8fix enabled: $enable_mmutf8fix" -echo " mmrfc5424addhmac enabled: $enable_mmrfc5424addhmac" -echo " mmpstrucdata enabled: $enable_mmpstrucdata" -echo " mmsequence enabled: $enable_mmsequence" echo echo "---{ strgen modules }---" echo " sm_cust_bindcdr module will be compiled: $enable_sm_cust_bindcdr" @@ -1657,8 +1300,6 @@ echo " MySql support enabled: $enable_mysql" echo " libdbi support enabled: $enable_libdbi" echo " PostgreSQL support enabled: $enable_pgsql" -echo " mongodb support enabled: $enable_ommongodb" -echo " hiredis support enabled: $enable_omhiredis" echo " Oracle (OCI) support enabled: $enable_oracle" echo echo "---{ protocol support }---" @@ -1673,9 +1314,7 @@ echo " MySQL Tests enabled: $enable_mysql_tests" echo " Debug mode enabled: $enable_debug" echo " Runtime Instrumentation enabled: $enable_rtinst" -echo " (total) debugless mode enabled: $enable_debugless" echo " Diagnostic tools enabled: $enable_diagtools" -echo " End-User tools enabled: $enable_usertools" echo " Enhanced memory checking enabled: $enable_memcheck" echo " Valgrind support settings enabled: $enable_valgrind" echo diff -Nru rsyslog-7.6.0/debian/50-default.conf rsyslog-5.10.1/debian/50-default.conf --- rsyslog-7.6.0/debian/50-default.conf 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/50-default.conf 2014-03-03 22:30:14.000000000 +0000 @@ -6,21 +6,20 @@ # First some standard log files. Log by facility. # auth,authpriv.* /var/log/auth.log -*.*;auth,authpriv.none /var/log/syslog -syslog.* /var/log/rsyslog.log #rsyslog error messages +*.*;auth,authpriv.none -/var/log/syslog #cron.* /var/log/cron.log -#daemon.* /var/log/daemon.log -kern.* /var/log/kern.log -#lpr.* /var/log/lpr.log -mail.* /var/log/mail.log -#user.* /var/log/user.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +lpr.* -/var/log/lpr.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log # # Logging for the mail system. Split it up so that # it is easy to write scripts to parse these files. # -#mail.info /var/log/mail.info -#mail.warn /var/log/mail.warn +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn mail.err /var/log/mail.err # @@ -28,23 +27,23 @@ # news.crit /var/log/news/news.crit news.err /var/log/news/news.err -news.notice /var/log/news/news.notice +news.notice -/var/log/news/news.notice # # Some "catch-all" log files. # -#*.=debug;\ -# auth,authpriv.none;\ -# news.none;mail.none /var/log/debug -#*.=info;*.=notice;*.=warn;\ -# auth,authpriv.none;\ -# cron,daemon.none;\ -# mail,news.none /var/log/messages +*.=debug;\ + auth,authpriv.none;\ + news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail,news.none -/var/log/messages # # Emergencies are sent to everybody logged in. # -*.emerg :omusrmsg:* +*.emerg * # # I like to have messages displayed on the console, but only on a virtual @@ -63,9 +62,7 @@ # NOTE: adjust the list below, or you'll go crazy if you have a reasonably # busy site.. # -# As this functionality is almost never needed, it is commented out. If you -# need it, be sure to remove the comment characters below. -#daemon.*;mail.*;\ -# news.err;\ -# *.=debug;*.=info;\ -# *.=notice;*.=warn |/dev/xconsole +daemon.*;mail.*;\ + news.err;\ + *.=debug;*.=info;\ + *.=notice;*.=warn |/dev/xconsole diff -Nru rsyslog-7.6.0/debian/changelog rsyslog-5.10.1/debian/changelog --- rsyslog-7.6.0/debian/changelog 2014-02-28 00:29:58.000000000 +0000 +++ rsyslog-5.10.1/debian/changelog 2014-03-03 22:30:14.000000000 +0000 @@ -1,735 +1,32 @@ -rsyslog (7.6.0-0ubuntu0ppa1) lucid; urgency=low +rsyslog (5.10.1-0ubuntu1~lucid1) lucid; urgency=low - * Rebuild for lucid + * New upstream release - -- W. Andrew Loe III (loe) Thu, 27 Feb 2014 16:29:35 -0800 + -- W. Andrew Loe III (loe) Mon, 03 Mar 2014 14:12:13 -0800 -rsyslog (7.6.0-0adiscon2precise3) precise; urgency=low +rsyslog (5.8.5-0ubuntu1~lucid3) lucid; urgency=low - * Repackaged for PPA + * Build with LDFLAGS="" - -- Andre Lorbach Tue, 18 Feb 2014 19:51:03 +0100 + -- W. Andrew Loe III (loe) Mon, 26 Sep 2011 11:12:51 -0700 -rsyslog (7.5.8-0adiscon2) precise; urgency=low +rsyslog (5.8.5-0ubuntu1~lucid2) lucid; urgency=low - * repacked to use propper librelp version + * Bump PPA Revision - -- Andre Lorbach Tue, 21 Jan 2014 10:59:51 +0100 + -- W. Andrew Loe III (loe) Mon, 26 Sep 2011 10:13:01 -0700 -rsyslog (7.5.8-0adiscon1) precise; urgency=low +rsyslog (5.8.5-0ubuntu1~lucid1) lucid; urgency=low - * Updated debs for RSyslog v7-devel 7.5.8 + * New upstream release - -- Andre Lorbach Thu, 09 Jan 2014 13:17:33 +0100 + -- W. Andrew Loe III (loe) Mon, 26 Sep 2011 09:50:57 -0700 -rsyslog (7.5.7-0adiscon1) precise; urgency=low +rsyslog (5.6.3-0ubuntu1~lucid1) lucid; urgency=low - * Updated debs for RSyslog v7-devel 7.5.7 + * New upstream release - -- Andre Lorbach Mon, 25 Nov 2013 10:21:43 +0100 - -rsyslog (7.5.6-0adiscon2) precise; urgency=low - - * Added mmsequence into base package - - -- Andre Lorbach Wed, 30 Oct 2013 12:37:48 +0100 - -rsyslog (7.5.5-0adiscon2) precise; urgency=low - - * Updated packages - - -- Andre Lorbach Wed, 16 Oct 2013 12:20:25 +0200 - -rsyslog (7.5.5-0adiscon1) precise; urgency=low - - * Updated debs for RSyslog v7-devel 7.5.5 - - -- Andre Lorbach Wed, 16 Oct 2013 12:16:27 +0200 - -rsyslog (7.5.4-0adiscon1) precise; urgency=low - - * Updated debs for RSyslog v7-devel 7.5.4 - - -- Andre Lorbach Mon, 07 Oct 2013 15:00:10 +0200 - -rsyslog (7.5.3-0adiscon2) precise; urgency=low - - * Updated debs for RSyslog v7-devel 7.5.3 - - -- Andre Lorbach Wed, 11 Sep 2013 15:16:17 +0200 - -rsyslog (7.5.3-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.5.3 - - -- Andre Lorbach Wed, 11 Sep 2013 15:06:21 +0200 - -rsyslog (7.4.4-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.4.4 - - -- Andre Lorbach Tue, 03 Sep 2013 15:58:08 +0200 - -rsyslog (7.4.3-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.4.3 - - -- Andre Lorbach Fri, 19 Jul 2013 08:48:59 +0200 - -rsyslog (7.5.2-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.5.2 - - -- Andre Lorbach Thu, 04 Jul 2013 14:18:14 +0200 - -rsyslog (7.4.2-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.4.2 - - -- Andre Lorbach Thu, 04 Jul 2013 11:31:12 +0200 - -rsyslog (7.5.1-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.5.1 - - -- Andre Lorbach Wed, 26 Jun 2013 16:59:43 +0200 - -rsyslog (7.4.1-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.4.1 - - -- Andre Lorbach Mon, 17 Jun 2013 15:49:13 +0200 - -rsyslog (7.5.0-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.5.0 - - -- Andre Lorbach Wed, 12 Jun 2013 16:19:36 +0200 - -rsyslog (7.4.0-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.4.0 - - -- Andre Lorbach Mon, 10 Jun 2013 11:36:55 +0200 - -rsyslog (7.3.15-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.15 - - -- Andre Lorbach Thu, 16 May 2013 11:03:06 +0200 - -rsyslog (7.3.14-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.14 - - -- Andre Lorbach Wed, 08 May 2013 15:55:56 +0200 - -rsyslog (7.3.13-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.13 - - -- Andre Lorbach Mon, 29 Apr 2013 06:50:03 -0700 - -rsyslog (7.3.10-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.10 - - -- Andre Lorbach Thu, 11 Apr 2013 00:07:49 -0700 - -rsyslog (7.3.9-0adiscon2) precise; urgency=low - - * removed libgt dependency - - -- Andre Lorbach Tue, 02 Apr 2013 07:40:25 -0700 - -rsyslog (7.3.9-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.9 including new - GuardTime feature - - -- Andre Lorbach Thu, 28 Mar 2013 06:52:37 -0700 - -rsyslog (7.3.8-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.8 - - -- Andre Lorbach Mon, 18 Mar 2013 05:04:45 -0700 - -rsyslog (7.3.7-0adiscon2) precise; urgency=low - - * Added packages for rsyslog-mmanon and rsyslog-mongodb - - -- Andre Lorbach Thu, 14 Mar 2013 03:48:18 -0700 - -rsyslog (7.3.7-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.7 - * Added mmnormalize package - - -- Andre Lorbach Wed, 13 Mar 2013 07:54:45 -0700 - -rsyslog (7.3.6-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.6 - - -- Andre Lorbach Tue, 29 Jan 2013 04:50:00 -0800 - -rsyslog (7.3.5-0adiscon2) precise; urgency=low - - * Added package for imzmq3 and omzmq3 plugins - - -- Andre Lorbach Fri, 18 Jan 2013 02:59:51 -0800 - -rsyslog (7.3.5-0adiscon1) precise; urgency=low - - * Build new debs for RSyslog v7-devel 7.3.5 - - -- Andre Lorbach Wed, 19 Dec 2012 00:55:17 -0800 - -rsyslog (7.3.4-1adiscon4) precise; urgency=low - - * Added Michael Biebl's fix on debian rules, now theomelasticsearch - patch is applied and has an effect. Thanks again. - - -- Andre Lorbach Mon, 17 Dec 2012 06:36:28 -0800 - -rsyslog (7.3.4-1adiscon3) precise; urgency=low - - * Added patch for omelasticsearch from Michael Biebl. - - -- Andre Lorbach Thu, 13 Dec 2012 07:11:33 -0800 - -rsyslog (7.3.4-1adiscon2) precise; urgency=low - - * Updated Build for V7, added new Packages for elasticsearch, imptcp, - ommongodb and mmjsonparse. Thanks to Radu Gheorghe for sending the - configuration files for them - - -- Andre Lorbach Thu, 06 Dec 2012 00:32:12 -0800 - -rsyslog (7.3.4-0ubuntu1) precise; urgency=low - - * Build for RSyslog V7 devel - - -- Andre Lorbach Thu, 29 Nov 2012 17:30:14 -0800 - -rsyslog (7.2.3-0ubuntu3) precise; urgency=low - - * Updated dependencies - - -- Andre Lorbach Thu, 22 Nov 2012 14:39:47 -0800 - -rsyslog (7.2.3-0ubuntu2) precise; urgency=low - - * First test for RSyslog v7 packages on Ubuntu - - -- Andre Lorbach Thu, 22 Nov 2012 14:28:09 -0800 - -rsyslog (5.10.1-0ubuntu1) precise; urgency=low - - * Build Package for 5.10.1 - - -- root Thu, 22 Nov 2012 06:47:27 -0800 - -rsyslog (5.8.6-1ubuntu8) precise; urgency=low - - * debian/rsyslog.postrm: fixed typo "dissappear" to "disappear" (LP: #846818) - - -- Aditya Vaidya Fri, 23 Mar 2012 19:31:37 -0500 - -rsyslog (5.8.6-1ubuntu7) precise; urgency=low - - * debian/rsyslog.conf: set $WorkDirectory to /var/spool/rsyslog, which is - the example location in documentation. When not configured it defaults to - '/', which is undesirable. (LP: #918947, Closes: #656535) - * debian/rsyslog.dirs: add /var/spool/rsyslog/ - * debian/usr.sbin.rsyslogd: - - adjust for $WorkDirectory - - allow 'r' on /var/log/** too (for imfile) - - -- Jamie Strandboge Wed, 07 Mar 2012 08:26:54 -0600 - -rsyslog (5.8.6-1ubuntu6) precise; urgency=low - - * debian/control: Build-Depends on dh-apparmor (LP: #948120) - - -- Jamie Strandboge Tue, 06 Mar 2012 09:47:22 -0600 - -rsyslog (5.8.6-1ubuntu5) precise; urgency=low - - * Add disabled by default AppArmor profile (LP: #914820) - - debian/rsyslog.upstart: add pre-start stanza to load profile - - add debian/usr.sbin.rsyslogd profile - - debian/rules: use dh_apparmor to install profile before rsyslog is - restarted - - debian/control: suggests apparmor (>= 2.3) - - debian/rsyslog.install: install profile to /etc/apparmor.d - - debian/rsyslog.dirs: install /etc/apparmor.d/force-complain, - and /etc/apparmor.d/disable - - debian/rsyslog.preinst: disable profile on clean install or upgrades - from earlier than when we shipped the profile - - -- Jamie Strandboge Wed, 11 Jan 2012 17:10:41 +0100 - -rsyslog (5.8.6-1ubuntu4) precise; urgency=low - - * debian/patches/100-imuxsock-allow-missing-date.patch - fix bug in imuxsock that truncated messages if they did not - contain a date field (LP: #905419). - - -- Scott Moser Tue, 20 Dec 2011 11:55:11 -0500 - -rsyslog (5.8.6-1ubuntu3) precise; urgency=low - - * No-change rebuild to drop spurious libsfgcc1 dependency on armhf. - - -- Adam Conrad Fri, 02 Dec 2011 17:39:39 -0700 - -rsyslog (5.8.6-1ubuntu2) precise; urgency=low - - * Rebuild for libmysqlclient transition - - -- Clint Byrum Thu, 24 Nov 2011 00:23:23 -0800 - -rsyslog (5.8.6-1ubuntu1) precise; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Run as rsyslog:rsyslog, set $FileOwner to syslog - - Replace init script with debian/rsyslog.upstart. - - debian/rsyslog.logrotate: Use reload command to restart rsyslog - - debian/rsyslog.conf: enable $RepeatedMsgReduction - to avoid bloating the syslog file (LP #453444) - - Add debian/rsyslog.dmesg.upstart to save initial dmesg into a file. - Install it in debian/rules. - - debian/50-default.conf: set of default rules for syslog (forwarded to - Debian #603160). remove file in postrm on purge. manage with ucf. - - debian/rules: build with LDFLAGS="" - * Dropped: - - debian/patches/02-CVE-2011-3200.patch (fixed in upstream release) - - -- Scott Moser Mon, 07 Nov 2011 13:54:56 -0500 - -rsyslog (5.8.6-1) unstable; urgency=low - - * New upstream release. - - Fix regression in imuxsock to ignore message-provided timestamp by - default which broke high precision timestamps. (Closes: #638147) - * debian/control: - - Wrap (build-)dependencies. - * Enable default hardening options from dpkg-buildflags. (Closes: #644303) - - Use buildflags.mk snippet in debian/rules. - - Add Build-Depends on dpkg-dev (>= 1.6.1). - - -- Michael Biebl Wed, 02 Nov 2011 23:31:41 +0100 - -rsyslog (5.8.5-1) unstable; urgency=low - - * New upstream release. - - -- Michael Biebl Thu, 01 Sep 2011 23:29:45 +0200 - -rsyslog (5.8.4-1) unstable; urgency=low - - * New upstream release. - - -- Michael Biebl Tue, 30 Aug 2011 23:58:11 +0200 - -rsyslog (5.8.3-1) unstable; urgency=low - - * New upstream release. - * debian/rsyslog.conf: Use new ":omusrmsg:*" syntax (write to all) for - *.emerg messages in preparation for future config format changes. - - -- Michael Biebl Mon, 11 Jul 2011 12:33:27 +0200 - -rsyslog (5.8.2-2) unstable; urgency=low - - * Transition to /run/sendsigs.omit.d. (Closes: #633036) - - Use /run/sendsigs.omit.d/rsyslog in debian/rsyslog.init. - - Add Depends on initscripts (>= 2.88dsf-13.3) to ensure /run is usable. - - Remove /lib/init/rw/sendsigs.omit.d/rsyslog on upgrades. - - -- Michael Biebl Fri, 08 Jul 2011 01:36:20 +0200 - -rsyslog (5.8.2-1) unstable; urgency=low - - * New upstream release. - - -- Michael Biebl Tue, 21 Jun 2011 16:26:54 +0200 - -rsyslog (5.8.1-1ubuntu2) oneiric; urgency=low - - * debian/patches/02-CVE-2011-3200.patch: fix denial of service via off by - two - - CVE-2011-3200 - - -- Jamie Strandboge Mon, 03 Oct 2011 12:13:42 -0500 - -rsyslog (5.8.1-1ubuntu1) oneiric; urgency=low - - * Resynchronise with Debian (LP: #794230). Remaining changes: - - Run as rsyslog:rsyslog, set $FileOwner to syslog - - Replace init script with debian/rsyslog.upstart. - - debian/rsyslog.logrotate: Use reload command to restart rsyslog - - debian/rsyslog.conf: enable $RepeatedMsgReduction - to avoid bloating the syslog file (LP #453444) - - Add debian/rsyslog.dmesg.upstart to save initial dmesg into a file. - Install it in debian/rules. - - debian/50-default.conf: set of default rules for syslog (forwarded to - Debian #603160). remove file in postrm on purge. manage with ucf. - - debian/rules: build with LDFLAGS="" - * Dropped: - - debian/control: Bump build-dependency on debhelper - debian now depends on dh >= 8 - - -- Scott Moser Thu, 02 Jun 2011 15:17:32 -0400 - -rsyslog (5.8.1-1) unstable; urgency=low - - * New upstream release. - * Bump Standards-Version to 3.9.2. No further changes. - * Enable and install impstats module. (Closes: #620114) - * Update logcheck rule. (Closes: #616659) - * debian/rsyslog.init: Set correct compat level (5). - * The way rsyslog processes SIGHUP has changed. It no longer does a reload - of its configuration, but simply closes all open files. To apply a changed - configuration, rsyslogd needs to be restarted now. - - Drop "reload" action from debian/rsyslog.init, map "force-reload" to - "restart". (Closes: #580897) - - Add "rotate" action to debian/rsyslog.init which sends SIGHUP to - rsyslogd. Use that in debian/rsyslog.logrotate. (Closes: #626365) - - Update debian/rsyslog-mysql.postinst and rsyslog-pgsql.postinst to use - restart instead of reload. - - Add a NEWS file explaining the changed SIGHUP handling. - - -- Michael Biebl Mon, 30 May 2011 18:40:12 +0200 - -rsyslog (5.8.0-1) unstable; urgency=low - - * New upstream stable release. - - -- Michael Biebl Tue, 12 Apr 2011 14:34:57 +0200 - -rsyslog (5.7.10-1) unstable; urgency=low - - * New upstream release. - - Properly handle ANSI SQL strings in ompgsql. (Closes: #600479) - - -- Michael Biebl Tue, 29 Mar 2011 18:41:28 +0200 - -rsyslog (5.7.9-1) unstable; urgency=low - - * New upstream release. - * debian/patches/02-pmaixforwardedfrom_type_nokeep.patch - - Remove, merged upstream. - * debian/patches/03-epoll_create1-fallback.patch - - Remove, merged upstream. - - -- Michael Biebl Sat, 26 Mar 2011 19:31:28 +0100 - -rsyslog (5.7.8-2) unstable; urgency=low - - * debian/patches/03-epoll_create1-fallback.patch - - If epoll_create1() is not available during runtime, fall back to - epoll_create(). This fixes remote syslog when runnig rsyslog on a - lenny kernel. (Closes: #617996) - - -- Michael Biebl Mon, 14 Mar 2011 12:13:14 +0100 - -rsyslog (5.7.8-1) unstable; urgency=low - - * New upstream release. - * debian/rsyslog.links - - Create symlink for rsyslog.service in multi-user.target.wants so rsyslog - is enabled by default when using systemd. - * debian/patches/02-pmaixforwardedfrom_type_nokeep.patch - - Fix build failure in aixforwardedfrom parser module by setting the - module type to NOKEEP. - * debian/rsyslog.preinst - - Remove old rsyslog.socket symlink from sockets.target.wants on upgrades - as rsyslog uses syslog.socket now which is provided by systemd. - * debian/rsyslog.install - - Stop installing rsyslog.socket. - - -- Michael Biebl Thu, 10 Mar 2011 08:50:29 +0100 - -rsyslog (5.7.6-1) unstable; urgency=low - - * New upstream release. - - -- Michael Biebl Fri, 25 Feb 2011 17:14:46 +0100 - -rsyslog (5.7.5-1) unstable; urgency=low - - * New upstream release. - - Fix regression in imuxsock plugin which did no longer sanitize received - messages. This makes 02-cleanup-trailing-lf.patch obsolete and also - fixes the SQL syntax errors in the mysql output if the input contained - NUL bytes. Closes: #614061 - * Enable and install omprog output plugin. Closes: #552095 - * Improve package description. Closes: #612948 - Thanks to Justin B Rye for the patch. - - -- Michael Biebl Wed, 23 Feb 2011 12:03:06 +0100 - -rsyslog (5.7.4-2) unstable; urgency=low - - * debian/patches/02-cleanup-trailing-lf.patch - - Fix regression in imuxsock plugin which did not remove a trailing LF - anymore. Patch cherry-picked from upstream Git. Closes: #612829 - - -- Michael Biebl Mon, 21 Feb 2011 12:04:13 +0100 - -rsyslog (5.7.4-1) unstable; urgency=low - - * New upstream release. - * Enable and install parser modules. - - -- Michael Biebl Sat, 19 Feb 2011 00:45:43 +0100 - -rsyslog (5.7.3-1) unstable; urgency=low - - * New upstream release. - * Upload to unstable. - * debian/patches/02-typo_fix_equation_sign.patch - - Removed, merged upstream. - * debian/patches/03-atomic_operations.patch - - Removed, merged upstream. - - -- Michael Biebl Wed, 09 Feb 2011 06:10:46 +0100 - -rsyslog (5.7.2-2) experimental; urgency=low - - * debian/patches/03-atomic_operations.patch - - Fix build failures on platforms which don't have 64 bit atomic - operations. Patch cherry-picked from upstream Git. Closes: #600930 - - -- Michael Biebl Wed, 01 Dec 2010 21:20:28 +0100 - -rsyslog (5.7.2-1) experimental; urgency=low - - * New upstream development release. - * Remove patches, merged upstream - - debian/patches/02-install_also_rsyslog_socket.patch - - debian/patches/02-tls_loop_fix.patch - * debian/patches/02-typo_fix_equation_sign.patch - - Fix small typo ("equation sign"). Closes: #575589 - * debian/rsyslog.postinst - - Remove pre-lenny migration code to rotate old log files from sysklogd. - - -- Michael Biebl Tue, 30 Nov 2010 15:30:56 +0100 - -rsyslog (5.7.1-1) experimental; urgency=low - - * New upstream development release. - * debian/rsyslog.install - - Install omruleset.so plugin: http://www.rsyslog.com/doc/omruleset.html - * debian/rsyslog.default - - Start rsyslogd with native -c5 mode. - * Install systemd unit files which allow to run rsyslog in socket activation - mode when systemd is used. - * debian/patches/02-install_also_rsyslog_socket.patch - - When enabling rsyslog.service also enable rsyslog.socket. Patch - cherry-picked from upstream Git. - * Bump debhelper compatibility level to 8. Update Build-Depends accordingly. - - -- Michael Biebl Wed, 20 Oct 2010 01:48:39 +0200 - -rsyslog (4.6.4-2ubuntu4) natty; urgency=low - - * debian/50-default.conf: Disable redundant and non-synchronous log files by - default (this will only affect new installations), to reduce disk size - overhead and unnecessary wakeups and IO: daemon.log, lpr.log, user.log, - mail.{info,warn) (these are already in mail.log and syslog), debug, - messages. - - -- Martin Pitt Wed, 12 Jan 2011 15:43:14 -0600 - -rsyslog (4.6.4-2ubuntu3) natty; urgency=low - - * Instead of removing /etc/default/rsyslog, patch the upstart job to - parse it as the old init script used to (LP: #570103) - - -- Stéphane Graber Mon, 06 Dec 2010 14:56:18 -0500 - -rsyslog (4.6.4-2ubuntu2) natty; urgency=low - - * Remove debian/rsyslog.default as the upstart init script doesn't read - /etc/default/rsyslog (LP: #570103) - - -- Stéphane Graber Mon, 06 Dec 2010 14:47:32 -0500 - -rsyslog (4.6.4-2ubuntu1) natty; urgency=low - - * Resynchronise with Debian. Remaining changes: - - Run as rsyslog:rsyslog, set $FileOwner to syslog - - Replace init script with debian/rsyslog.upstart. - - debian/control: Bump build-dependency on debhelper for Upstart-aware - dh_installinit - - debian/rsyslog.logrotate: Use reload command to restart rsyslog - - debian/rsyslog.conf: enable $RepeatedMsgReduction - to avoid bloating the syslog file (LP #453444) - - Add debian/rsyslog.dmesg.upstart to save initial dmesg into a file. - Install it in debian/rules. - - debian/50-default.conf: set of default rules for syslog (forwarded to - Debian #603160) - - -- Colin Watson Mon, 06 Dec 2010 14:33:42 +0000 - -rsyslog (4.6.4-2) unstable; urgency=low - - * debian/patches/02-tls_loop_fix.patch - - Fix bug in TLS handling which could cause rsyslog to loop in a tight - loop and eating up all CPU and RAM resources. Closes: #549168 - Patch cherry-picked from upstream Git. - - -- Michael Biebl Tue, 30 Nov 2010 14:50:15 +0100 - -rsyslog (4.6.4-1ubuntu2) natty; urgency=low - - * Restore maintainer script code to install - /etc/rsyslog.d/50-default.conf, and refer to it again from rsyslog.conf. - - -- Colin Watson Fri, 19 Nov 2010 18:31:24 +0000 - -rsyslog (4.6.4-1ubuntu1) natty; urgency=low - - * Merge from debian unstable (LP: #671533), remaining changes: - - Run as rsyslog:rsyslog, set $FileOwner to syslog - - Replace init script with debian/rsyslog.upstart. - - debian/control: Bump build-dependency on debhelper for Upstart-aware - dh_installinit - - debian/rsyslog.logrotate: Use reload command to restart rsyslog - - debian/rsyslog.conf: enable $RepeatedMsgReduction - to avoid bloating the syslog file (LP #453444) - - Add debian/rsyslog.dmesg.upstart to save initial dmesg into a file. - Install it in debian/rules. - - debian/50-default.conf: set of default rules for syslog (forwarded to - Debian #603160) - * Dropped changes: - - debian/patches/deroot.patch: this patch was introduced to support - earlier kernels and we don't support running natty on pre-karmic - kernels - - sysklogd → rsyslog upgrade was done pre-lucid (LTS) so drop all - the upgrade handling - - Restore to reading from /proc/kmsg: rsyslog can read directly from - /proc/kmsg now; dropped init script changes as they're obsolete - (even when actually using the init script which we don't, we have - the upstart script) - - -- Lorenzo De Liso Fri, 05 Nov 2010 15:52:21 +0100 - -rsyslog (4.6.4-1) unstable; urgency=low - - * New upstream release. - - bugfix: programname filter in ! configuration can not be reset. - Thanks to Kiss Gabor for the patch. Closes: #540807 - * Bump Standards-Version to 3.9.1. No further changes. - - -- Michael Biebl Thu, 05 Aug 2010 18:35:37 +0200 - -rsyslog (4.6.3-1) unstable; urgency=low - - * New upstream release. - * debian/patches/02-set-correct-default-for-buffered-writing.patch - - Removed, merged upstream. - * Switch to source format 3.0 (quilt). - - Add debian/source/format. - - Drop Build-Depends on quilt. - - Remove debian/README.source. - - Remove /usr/share/quilt/quilt.make include from debian/rules. - * Switch to dh v7. - - Bump Build-Depends on debhelper to (>= 7.0.50). - - Bump Build-Depends on autotools-dev to (>= 20100122.1) for the - autotools_dev dh addon. - - Convert debian/rules to dh. - * Bump Standards-Version to 3.9.0. Use Breaks instead of Conflicts as - recommended by the new policy. - - -- Michael Biebl Wed, 07 Jul 2010 19:07:03 +0200 - -rsyslog (4.6.2-1) unstable; urgency=low - - * New upstream release. - * debian/patches/02-set-correct-default-for-buffered-writing.patch - - The default for $OMFileFlushOnTXEnd was wrong ("off"). Patch pulled from - upstream Git. - - -- Michael Biebl Wed, 07 Apr 2010 16:42:56 +0200 - -rsyslog (4.6.1-1) unstable; urgency=low - - * New upstream release. - - Fix error in rsyslog.conf(5) man page. The configuration variable - $InputUDPServerRun does not exist, it should be $UDPServerRun instead. - Thanks to Alexander Gerasiov for spotting this. Closes: #571202 - * debian/rsyslog-doc.install - - Install png image files. - * debian/patches/doc_typo_fix.patch - - Removed, merged upstream. - * debian/patches/no_create_db.patch - - Refresh to apply cleanly. - * debian/control - - Bump Standards-Version to 3.8.4. No further changes. - * debian/rsyslog.install - - Install new lmstrmsrv.so and lmzlibw.so plugins. - * debian/rsyslog.lintian-overrides - - Add lintian override for init.d-script-missing-dependency-on-remote_fs - false positive. See also the corresponding lintian bug: #571280. - * debian/rules - - Add call to dh_lintian. - * debian/rsyslog.init - - GNU/kFreeBSD does not allow to create pipes in /dev. So for xconsole - create the pipe as /var/run/xconsole and a /dev/xconsole symlink. - Closes: #537170 - - -- Michael Biebl Fri, 05 Mar 2010 01:07:53 +0100 - -rsyslog (4.4.2-2) unstable; urgency=low - - * debian/control - - Demote mysql-server and postgresql from Recommends to Suggests. The - server packages are not strictly necessary for dbconfig-common's - autoconfiguration to work and one might want to use a remote server. - - Add Recommends: mysql-client for rsyslog-mysql. - - Add Recommends: postgresql-client for rsyslog-pgsql. - * debian/patches/doc_typo_fix.patch - - Fix a typo in the html documentation and man page regarding the syslog.h - header file and the syslog(3) man page. Closes: #559334 - Thanks to Alexander Gerasiov for spotting this. - - -- Michael Biebl Mon, 18 Jan 2010 15:31:40 +0100 - -rsyslog (4.4.2-1) unstable; urgency=low - - * New upstream release. - - -- Michael Biebl Sat, 10 Oct 2009 14:08:16 +0200 - -rsyslog (4.4.1-1) unstable; urgency=low - - * New upstream release. - - Fix invalid double-quoted PRI in log messages. Closes: #543505 - * debian/watch - - Only check for stable upstream releases. - * debian/patches/testbench-java.patch - - Removed, merged upstream. - - -- Michael Biebl Wed, 02 Sep 2009 17:19:05 +0200 - -rsyslog (4.4.0-1) unstable; urgency=low - - * New upstream release. - * Removed patches - - debian/patches/manpage_pidfile.patch (merged upstream) - - debian/patches/close-stdout-stderr.patch (merged upstream) - * Bump Standards-Version to 3.8.3. No further changes. - * Disable testbench as it requires java. - * debian/patches/testbench-java.patch - - Move check_JAVA inside the ENABLE_TESTBENCH section so the tests are not - run unless the testbench is enabled. - - -- Michael Biebl Fri, 21 Aug 2009 23:08:45 +0200 + -- Evax Software Mon, 31 Jan 2011 18:00:40 +0100 rsyslog (4.2.0-2ubuntu8) lucid; urgency=low @@ -847,7 +144,7 @@ * Strip local from rsyslog's postinst as it shouldn't be used outside of functions; LP: #401060. - -- Loïc Minier Mon, 20 Jul 2009 14:30:14 +0200 + -- Loïc Minier Mon, 20 Jul 2009 14:30:14 +0200 rsyslog (4.2.0-1ubuntu1) karmic; urgency=low diff -Nru rsyslog-7.6.0/debian/control rsyslog-5.10.1/debian/control --- rsyslog-7.6.0/debian/control 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/control 2014-03-03 22:30:14.000000000 +0000 @@ -1,34 +1,10 @@ Source: rsyslog Section: admin Priority: important -Maintainer: Andre Lorbach +Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Michael Biebl -Build-Depends: debhelper (>= 8), - dpkg-dev (>= 1.6.1), - autotools-dev (>= 20100122.1), - dh-autoreconf, - zlib1g-dev, - libmysqlclient-dev, - libpq-dev, - libmongo-client-dev (>= 0.1.4), - librelp-dev (>= 1.0.2), - libestr-dev (>= 0.1.2), - libee-dev (>= 0.4.0), - liblognorm0-dev (>= 0.3.1), - libjson0-dev, - libmongo-client-dev, - libglib2.0-dev, - uuid-dev, - libkrb5-dev, - libgnutls-dev, - pkg-config, - dh-apparmor, - libcurl4-gnutls-dev, - bison, - libgt-dev, - liblogging-stdlog-dev, - python-docutils -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 7.3.15ubuntu2), quilt, autotools-dev, zlib1g-dev, libmysqlclient-dev, libpq-dev, libkrb5-dev, libgnutls-dev, librelp-dev, pkg-config +Standards-Version: 3.8.2 XSBC-Original-Vcs-Git: git://git.debian.org/git/collab-maint/rsyslog.git XSBC-Original-Vcs-Browser: http://git.debian.org/?p=collab-maint/rsyslog.git;a=summary Homepage: http://www.rsyslog.com/ @@ -36,106 +12,64 @@ Package: rsyslog Architecture: any Priority: important -Conflicts: system-log-daemon, - linux-kernel-log-daemon -Provides: system-log-daemon, - linux-kernel-log-daemon -Depends: ${shlibs:Depends}, - ${misc:Depends}, - lsb-base (>= 3.2-14), - initscripts (>= 2.88dsf-13.3), - adduser, - ucf, - libjson0, - liblogging-stdlog1 -# libgt0 +Conflicts: system-log-daemon, linux-kernel-log-daemon +Provides: system-log-daemon, linux-kernel-log-daemon +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.2-14), adduser, ucf (>= 0.8) Recommends: logrotate -Suggests: rsyslog-mysql | rsyslog-pgsql, - rsyslog-doc, - rsyslog-gnutls, - rsyslog-gssapi, - rsyslog-relp, - rsyslog-elasticsearch, - rsyslog-mmjsonparse, - rsyslog-imptcp, - apparmor (>= 2.3) -Description: a rocket-fast system for log processing - Rsyslog is a multi-threaded implementation of syslogd (a system utility - providing support for message logging), with features that include: - * reliable syslog over TCP, SSL/TLS and RELP +Suggests: rsyslog-mysql | rsyslog-pgsql, rsyslog-doc, rsyslog-gnutls, rsyslog-gssapi, rsyslog-relp +Description: enhanced multi-threaded syslogd + Rsyslog is an enhanced syslogd supporting, amongst others: + * reliable syslog over TCP and SSL/TLS * on-demand disk buffering * email alerting * writing to MySQL or PostgreSQL databases (via separate output plugins) * permitted sender lists * filtering on any part of the syslog message * on-the-wire message compression - * fine-grained output format control - * failover to backup destinations - * enterprise-class encrypted syslog relaying + * fine grained output format control + * backup log destinations . - It is the default syslogd on Debian systems. + It is quite compatible to stock sysklogd and can be used as a drop-in + replacement. Its advanced features make it suitable for enterprise-class, + encryption protected syslog relay chains while at the same time being very + easy to setup for the novice user. Package: rsyslog-doc Section: doc Priority: extra Architecture: all -Breaks: rsyslog (<< 2.0.1-2) +Conflicts: rsyslog (<< 2.0.1-2) Replaces: rsyslog (<< 2.0.1-2) Depends: ${misc:Depends} -Suggests: doc-base, - www-browser +Suggests: doc-base, www-browser Description: documentation for rsyslog - This package contains detailed HTML documentation for rsyslog. + This package contains detailed HTML documentation of rsyslog. . - It describes the general configuration file syntax for filters, actions, - templates, etc, and has detailed information for all available configuration + It describes the general configuration file syntax, like filters, actions and + templates and has detailed information for all available configuration directives. Package: rsyslog-mysql Architecture: any Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - dbconfig-common, - ucf -Recommends: mysql-client -Suggests: mysql-server +Depends: ${shlibs:Depends}, ${misc:Depends}, rsyslog (= ${binary:Version}), dbconfig-common, ucf +Recommends: mysql-server Description: MySQL output plugin for rsyslog This plugin allows rsyslog to write the syslog messages into a MySQL database. Package: rsyslog-pgsql Architecture: any Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - dbconfig-common, - ucf -Recommends: postgresql-client -Suggests: postgresql +Depends: ${shlibs:Depends}, ${misc:Depends}, rsyslog (= ${binary:Version}), dbconfig-common, ucf +Recommends: postgresql Description: PostgreSQL output plugin for rsyslog - This plugin allows rsyslog to write the syslog messages into a PostgreSQL + This plugin allows rsyslog to write the syslog messages into a PostgreSQL database. -Package: rsyslog-mongodb -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - libmongo-client0 -Recommends: mongodb-server -Description: MongoDB output plugin for rsyslog - This plugin allows rsyslog to write the syslog messages to MongoDB, a - scalable, high-performance, open source NoSQL database. - Package: rsyslog-gssapi Architecture: any Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, rsyslog (= ${binary:Version}) Suggests: krb5-user Description: GSSAPI authentication and encryption support for rsyslog These plugins allow rsyslog to write and/or receive GSSAPI authenticated and @@ -145,9 +79,7 @@ Package: rsyslog-gnutls Architecture: any Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, rsyslog (= ${binary:Version}) Suggests: gnutls-bin Description: TLS protocol support for rsyslog This netstream plugin allows rsyslog to send and receive encrypted syslog @@ -156,87 +88,8 @@ Package: rsyslog-relp Architecture: any Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - librelp0 (>= 1.0.2) +Depends: ${shlibs:Depends}, ${misc:Depends}, rsyslog (= ${binary:Version}) Description: RELP protocol support for rsyslog These plugins allows rsyslog to send and receive syslog messages via the - RELP protocol. RELP ensures reliable transport over the network even on + RELP protocol. RELP ensures the reliable transport over the network even on connection loss or if a peer becomes unavailable. - -Package: rsyslog-elasticsearch -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}) -Description: Elasticsearch output support for rsyslog - This output plugin is for indexing your syslog messages in - Elasticsearch, via JSON over HTTP. - -Package: rsyslog-mmjsonparse -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - liblognorm0, - libjson0 -Description: Parsing/handling of CEE/Lumberjack JSON messages in rsyslog - This plugin parses the message part of syslog. If there's a CEE cookie - "@cee:" followed by a valid JSON, you can use properties from that JSON - to build custom templates. - -Package: rsyslog-imptcp -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}) -Description: High-performance, threaded TCP input module for rsyslog - This is a plugin which offers similar functionality to imtcp, - only it's optimized for performance and you can configure multiple - threads. - -Package: rsyslog-mmnormalize -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - liblognorm0 -Description: The rsyslog-mmnormalize package provides log normalization - by using the liblognorm and it's Rulebase format. - -Package: rsyslog-mmanon -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}) -Description: IP Address Anonimization Module (mmanon). - The mmanon module permits to anonymize IP addresses. It is a message - modification module that actually changes the IP address inside the message, - so after calling mmanon, the original message can no longer be obtained. - Note that anonymization will break digital signatures on the message, if they exist. - -Package: rsyslog-mmfields -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, - ${misc:Depends}, - rsyslog (= ${binary:Version}), - liblognorm0 -Description: Parse all fields of the message into structured data inside the JSON tree. - -#Package: rsyslog-zmq -#Architecture: any -#Priority: extra -#Depends: ${shlibs:Depends}, -# ${misc:Depends}, -# rsyslog (= ${binary:Version}), -# libzmq1 -#Description: zmq3 support for RSyslog. -# These plugins allows you to push data from and into rsyslog from a -# zeromq socket. diff -Nru rsyslog-7.6.0/debian/gbp.conf rsyslog-5.10.1/debian/gbp.conf --- rsyslog-7.6.0/debian/gbp.conf 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/gbp.conf 2014-03-03 22:30:14.000000000 +0000 @@ -1,3 +1,2 @@ [DEFAULT] pristine-tar = True -debian-branch = master diff -Nru rsyslog-7.6.0/debian/NEWS rsyslog-5.10.1/debian/NEWS --- rsyslog-7.6.0/debian/NEWS 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/NEWS 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -rsyslog (5.8.1-1) unstable; urgency=low - - The way rsyslog processes SIGHUP has changed. It no longer does a reload - of its configuration, but simply closes all open files, which is a much more - lightweight operation. - To apply a changed configuration, rsyslogd needs to be restarted now. - As a consequence, the reload action has been dropped from the init script. - - A new action called "rotate" was added to the init script, which signals - rsyslogd to close all open files. This new action is used in the rsyslog - logrotate configuration file. - - For more information, see: - http://www.rsyslog.com/doc/v4compatibility.html - http://www.rsyslog.com/doc/v5compatibility.html - - -- Michael Biebl Mon, 30 May 2011 18:26:51 +0200 diff -Nru rsyslog-7.6.0/debian/patches/0001-build-link-omelasticsearch-against-lm.patch rsyslog-5.10.1/debian/patches/0001-build-link-omelasticsearch-against-lm.patch --- rsyslog-7.6.0/debian/patches/0001-build-link-omelasticsearch-against-lm.patch 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/patches/0001-build-link-omelasticsearch-against-lm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -From 9cff8dd1c0bf1ef07595fee080dcef3978a0b991 Mon Sep 17 00:00:00 2001 -From: Michael Biebl -Date: Mon, 10 Dec 2012 15:38:28 +0100 -Subject: [PATCH] build: link omelasticsearch against -lm - -Use LT_LIB_M to find the math library which is needed for pow(). ---- - configure.ac | 2 ++ - plugins/omelasticsearch/Makefile.am | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 1b203ac..0088672 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -720,6 +720,8 @@ AC_ARG_ENABLE(elasticsearch, - ) - if test "x$enable_elasticsearch" = "xyes"; then - PKG_CHECK_MODULES([CURL], [libcurl]) -+ LT_LIB_M -+ - fi - AM_CONDITIONAL(ENABLE_ELASTICSEARCH, test x$enable_elasticsearch = xyes) - -diff --git a/plugins/omelasticsearch/Makefile.am b/plugins/omelasticsearch/Makefile.am -index 059bdf8..ba85a89 100644 ---- a/plugins/omelasticsearch/Makefile.am -+++ b/plugins/omelasticsearch/Makefile.am -@@ -4,6 +4,6 @@ pkglib_LTLIBRARIES = omelasticsearch.la - omelasticsearch_la_SOURCES = omelasticsearch.c cJSON/cjson.c cJSON/cjson.h - omelasticsearch_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) - omelasticsearch_la_LDFLAGS = -module -avoid-version --omelasticsearch_la_LIBADD = $(CURL_LIBS) -+omelasticsearch_la_LIBADD = $(CURL_LIBS) $(LIBM) - - EXTRA_DIST = --- -1.7.10.4 - diff -Nru rsyslog-7.6.0/debian/patches/01-dont_create_db.patch rsyslog-5.10.1/debian/patches/01-dont_create_db.patch --- rsyslog-7.6.0/debian/patches/01-dont_create_db.patch 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/patches/01-dont_create_db.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Index: rsyslog/plugins/ommysql/createDB.sql -=================================================================== ---- rsyslog.orig/plugins/ommysql/createDB.sql 2007-12-12 18:18:29.000000000 +0100 -+++ rsyslog/plugins/ommysql/createDB.sql 2008-02-12 16:03:04.000000000 +0100 -@@ -1,6 +1,4 @@ --CREATE DATABASE Syslog; --USE Syslog; --CREATE TABLE SystemEvents -+CREATE TABLE IF NOT EXISTS SystemEvents - ( - ID int unsigned not null auto_increment primary key, - CustomerID bigint, -@@ -28,7 +26,7 @@ - SystemID int NULL - ); - --CREATE TABLE SystemEventsProperties -+CREATE TABLE IF NOT EXISTS SystemEventsProperties - ( - ID int unsigned not null auto_increment primary key, - SystemEventID int NULL , -Index: rsyslog/plugins/ompgsql/createDB.sql -=================================================================== ---- rsyslog.orig/plugins/ompgsql/createDB.sql 2007-12-12 18:18:29.000000000 +0100 -+++ rsyslog/plugins/ompgsql/createDB.sql 2008-02-12 16:03:04.000000000 +0100 -@@ -1,5 +1,3 @@ --CREATE DATABASE 'Syslog' WITH ENCODING 'SQL_ASCII'; --\c Syslog; - CREATE TABLE SystemEvents - ( - ID serial not null primary key, diff -Nru rsyslog-7.6.0/debian/patches/100-imuxsock-allow-missing-date.patch rsyslog-5.10.1/debian/patches/100-imuxsock-allow-missing-date.patch --- rsyslog-7.6.0/debian/patches/100-imuxsock-allow-missing-date.patch 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/patches/100-imuxsock-allow-missing-date.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From: Rainer Gerhards -Date: Tue, 20 Dec 2011 15:39:39 +0000 (+0100) -Subject: bugfix: imuxsock did truncate part of received message if it did not contain a proper... -X-Git-Url: http://git.adiscon.com/?p=rsyslog.git;a=commitdiff_plain;h=f112b51b8d6c358b87ac608112d393adb047ea0f - -bugfix: imuxsock did truncate part of received message if it did not contain a proper date. - -The truncation occured because we removed that part of the messages -that was expected to be the date. -closes: http://bugzilla.adiscon.com/show_bug.cgi?id=295 - -Origin: upstream, http://git.adiscon.com/?p=rsyslog.git;a=commitdiff_plain;h=f112b51b8d6c358b87ac608112d393adb047ea0f -Bug: http://bugzilla.adiscon.com/show_bug.cgi?id=295 -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/905419 ---- - -diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c -index 2697c48..feddb20 100644 ---- a/plugins/imuxsock/imuxsock.c -+++ b/plugins/imuxsock/imuxsock.c -@@ -565,8 +565,11 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred) - parse++; lenMsg--; /* '>' */ - - if((pLstn->flags & IGNDATE)) { -- parse += 16; /* just skip timestamp */ -- lenMsg -= 16; -+ /* in this case, we still need to find out if we have a valid -+ * datestamp or not .. and advance the parse pointer accordingly. -+ */ -+ struct syslogTime dummy; -+ datetime.ParseTIMESTAMP3164(&dummy, &parse, &lenMsg); - } else { - if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) { - DBGPRINTF("we have a problem, invalid timestamp in msg!\n"); diff -Nru rsyslog-7.6.0/debian/patches/series rsyslog-5.10.1/debian/patches/series --- rsyslog-7.6.0/debian/patches/series 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# Debian patches for rsyslog -01-dont_create_db.patch -# 0001-build-link-omelasticsearch-against-lm.patch -# Ubuntu patches for rsyslog -# 100-imuxsock-allow-missing-date.patch diff -Nru rsyslog-7.6.0/debian/README.Debian rsyslog-5.10.1/debian/README.Debian --- rsyslog-7.6.0/debian/README.Debian 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/README.Debian 2014-03-03 22:30:14.000000000 +0000 @@ -17,8 +17,8 @@ $IncludeConfig /etc/rsyslog.d/*.conf That means, all configuration files in /etc/rsyslog.d/ with a .conf file -extension are read by rsyslog. This way the rsyslog configuration can be -extended easily (either by package maintainers or local administrators). +extension are read by rsyslog. This allows to easily extend the rsyslog +configuration (either by package maintainers or local administrators). Command line arguments, modules and compatibility levels diff -Nru rsyslog-7.6.0/debian/README.source rsyslog-5.10.1/debian/README.source --- rsyslog-7.6.0/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/debian/README.source 2014-03-03 22:30:14.000000000 +0000 @@ -0,0 +1,3 @@ +This package uses the quilt patch management system. + +Please refer to /usr/share/doc/quilt/README.source for further information. diff -Nru rsyslog-7.6.0/debian/rsyslog.conf rsyslog-5.10.1/debian/rsyslog.conf --- rsyslog-7.6.0/debian/rsyslog.conf 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.conf 2014-03-03 22:30:14.000000000 +0000 @@ -14,6 +14,8 @@ $ModLoad imklog # provides kernel logging support (previously done by rklogd) #$ModLoad immark # provides --MARK-- message capability +$KLogPath /proc/kmsg + # provides UDP syslog reception #$ModLoad imudp #$UDPServerRun 514 @@ -48,11 +50,6 @@ $PrivDropToGroup syslog # -# Where to place spool files -# -$WorkDirectory /var/spool/rsyslog - -# # Include all config files in /etc/rsyslog.d/ # $IncludeConfig /etc/rsyslog.d/*.conf diff -Nru rsyslog-7.6.0/debian/rsyslog.default rsyslog-5.10.1/debian/rsyslog.default --- rsyslog-7.6.0/debian/rsyslog.default 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.default 2014-03-03 22:30:14.000000000 +0000 @@ -4,5 +4,5 @@ # -x disables DNS lookups on messages received with -r # -c compatibility mode # See rsyslogd(8) for more details -RSYSLOGD_OPTIONS="" +RSYSLOGD_OPTIONS="-c4" diff -Nru rsyslog-7.6.0/debian/rsyslog.dirs rsyslog-5.10.1/debian/rsyslog.dirs --- rsyslog-7.6.0/debian/rsyslog.dirs 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.dirs 2014-03-03 22:30:14.000000000 +0000 @@ -1,5 +1 @@ /etc/rsyslog.d/ -/etc/apparmor.d/force-complain/ -/etc/apparmor.d/disable/ -/etc/apparmor.d/local/ -/var/spool/rsyslog/ diff -Nru rsyslog-7.6.0/debian/rsyslog-doc.install rsyslog-5.10.1/debian/rsyslog-doc.install --- rsyslog-7.6.0/debian/rsyslog-doc.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-doc.install 2014-03-03 22:30:14.000000000 +0000 @@ -1,4 +1,3 @@ doc/*.html usr/share/doc/rsyslog-doc/html/ -#doc/*.jpg usr/share/doc/rsyslog-doc/html/ -doc/*.png usr/share/doc/rsyslog-doc/html/ +doc/*.jpg usr/share/doc/rsyslog-doc/html/ doc/*.conf usr/share/doc/rsyslog-doc/html/ diff -Nru rsyslog-7.6.0/debian/rsyslog-elasticsearch.install rsyslog-5.10.1/debian/rsyslog-elasticsearch.install --- rsyslog-7.6.0/debian/rsyslog-elasticsearch.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-elasticsearch.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/omelasticsearch.so diff -Nru rsyslog-7.6.0/debian/rsyslog-imptcp.install rsyslog-5.10.1/debian/rsyslog-imptcp.install --- rsyslog-7.6.0/debian/rsyslog-imptcp.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-imptcp.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/imptcp.so diff -Nru rsyslog-7.6.0/debian/rsyslog.init rsyslog-5.10.1/debian/rsyslog.init --- rsyslog-7.6.0/debian/rsyslog.init 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.init 2014-03-03 22:30:14.000000000 +0000 @@ -23,8 +23,10 @@ RSYSLOGD=rsyslogd RSYSLOGD_BIN=/usr/sbin/rsyslogd -RSYSLOGD_OPTIONS="-c5" +RSYSLOGD_OPTIONS="-c4" RSYSLOGD_PIDFILE=/var/run/rsyslogd.pid +KMSG_PIDFILE=/var/run/rsyslog/kmsgpipe.pid +KMSG_PIPE=/var/run/rsyslog/kmsg SCRIPTNAME=/etc/init.d/$NAME @@ -43,6 +45,15 @@ DAEMON_ARGS="$RSYSLOGD_OPTIONS" PIDFILE="$RSYSLOGD_PIDFILE" + # create syslog-writeable pid and fifo directory + mkdir -p /var/run/rsyslog + chown syslog:syslog /var/run/rsyslog + mkfifo -m 600 $KMSG_PIPE + chown syslog:syslog $KMSG_PIPE + + # shovel /proc/kmsg to pipe readable by syslog user + start-stop-daemon --start --pidfile $KMSG_PIDFILE --exec /bin/dd -b -m -- bs=1 if=/proc/kmsg of=$KMSG_PIPE + # Return # 0 if daemon has been started # 1 if daemon was already running @@ -59,13 +70,17 @@ # 0 if daemon has been stopped # 1 if daemon was already stopped # other if daemon could not be stopped or a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/15 --pidfile $PIDFILE --name $NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + + # stop kmsgpipe + start-stop-daemon --stop --quiet --oknodo --pidfile $KMSG_PIDFILE + rm -f $KMSG_PIDFILE $KMSG_PIPE } # -# Tell rsyslogd to close all open files +# Tell rsyslogd to reload its configuration # -do_rotate() { +do_reload() { NAME="$RSYSLOGD" PIDFILE="$RSYSLOGD_PIDFILE" @@ -73,22 +88,21 @@ } create_xconsole() { - XCONSOLE=/dev/xconsole - if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then - XCONSOLE=/var/run/xconsole - ln -sf $XCONSOLE /dev/xconsole - fi - if [ ! -e $XCONSOLE ]; then - mknod -m 640 $XCONSOLE p - chown root:adm $XCONSOLE - [ -x /sbin/restorecon ] && /sbin/restorecon $XCONSOLE + if [ ! -e /dev/xconsole ] + then + mknod -m 640 /dev/xconsole p + chown root:adm /dev/xconsole + [ -x /sbin/restorecon ] && /sbin/restorecon /dev/xconsole fi } sendsigs_omit() { - OMITDIR=/run/sendsigs.omit.d + OMITDIR=/lib/init/rw/sendsigs.omit.d mkdir -p $OMITDIR - ln -sf $RSYSLOGD_PIDFILE $OMITDIR/rsyslog + rm -f $OMITDIR/rsyslog + ln -s $RSYSLOGD_PIDFILE $OMITDIR/rsyslog + rm -f $OMITDIR/rsyslog-kmsg + ln -s $KMSG_PIDFILE $OMITDIR/rsyslog-kmsg } case "$1" in @@ -116,12 +130,12 @@ esac ;; - rotate) - log_daemon_msg "Closing open files" "$RSYSLOGD" - do_rotate + reload|force-reload) + log_daemon_msg "Reloading $DESC" "$RSYSLOGD" + do_reload log_end_msg $? ;; - restart|force-reload) + restart) $0 stop $0 start ;; @@ -129,7 +143,7 @@ status_of_proc -p $RSYSLOGD_PIDFILE $RSYSLOGD_BIN $RSYSLOGD && exit 0 || exit $? ;; *) - echo "Usage: $SCRIPTNAME {start|stop|rotate|restart|force-reload|status}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2 exit 3 ;; esac diff -Nru rsyslog-7.6.0/debian/rsyslog.install rsyslog-5.10.1/debian/rsyslog.install --- rsyslog-7.6.0/debian/rsyslog.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.install 2014-03-03 22:30:14.000000000 +0000 @@ -5,7 +5,6 @@ debian/tmp/usr/lib/rsyslog/imfile.so debian/tmp/usr/lib/rsyslog/imklog.so debian/tmp/usr/lib/rsyslog/immark.so -debian/tmp/usr/lib/rsyslog/impstats.so debian/tmp/usr/lib/rsyslog/imtcp.so debian/tmp/usr/lib/rsyslog/imudp.so debian/tmp/usr/lib/rsyslog/imuxsock.so @@ -13,15 +12,6 @@ debian/tmp/usr/lib/rsyslog/lmnetstrms.so debian/tmp/usr/lib/rsyslog/lmnsd_ptcp.so debian/tmp/usr/lib/rsyslog/lmregexp.so -debian/tmp/usr/lib/rsyslog/lmstrmsrv.so debian/tmp/usr/lib/rsyslog/lmtcpclt.so debian/tmp/usr/lib/rsyslog/lmtcpsrv.so -debian/tmp/usr/lib/rsyslog/lmzlibw.so debian/tmp/usr/lib/rsyslog/ommail.so -debian/tmp/usr/lib/rsyslog/omprog.so -debian/tmp/usr/lib/rsyslog/omruleset.so -debian/tmp/usr/lib/rsyslog/mmpstrucdata.so -debian/tmp/usr/lib/rsyslog/mmsequence.so -debian/tmp/usr/lib/rsyslog/pm*.so -debian/tmp/lib/systemd/system/rsyslog.service -debian/usr.sbin.rsyslogd etc/apparmor.d/ diff -Nru rsyslog-7.6.0/debian/rsyslog.links rsyslog-5.10.1/debian/rsyslog.links --- rsyslog-7.6.0/debian/rsyslog.links 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -lib/systemd/system/rsyslog.service etc/systemd/system/multi-user.target.wants/rsyslog.service diff -Nru rsyslog-7.6.0/debian/rsyslog.lintian-overrides rsyslog-5.10.1/debian/rsyslog.lintian-overrides --- rsyslog-7.6.0/debian/rsyslog.lintian-overrides 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -rsyslog: init.d-script-missing-dependency-on-remote_fs /etc/init.d/rsyslog: required-stop diff -Nru rsyslog-7.6.0/debian/rsyslog.logcheck.ignore.server rsyslog-5.10.1/debian/rsyslog.logcheck.ignore.server --- rsyslog-7.6.0/debian/rsyslog.logcheck.ignore.server 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.logcheck.ignore.server 2014-03-03 22:30:14.000000000 +0000 @@ -1,5 +1,5 @@ ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ kernel: imklog [0-9.]+, log source = /proc/kmsg started.$ ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ kernel: Kernel logging \(proc\) stopped.$ -^\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \[origin software="rsyslogd" swVersion="[0-9.]+" x-pid="[0-9]+" x-info="http://www.rsyslog.com"\] start$ +^\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \[origin software="rsyslogd" swVersion="[0-9.]+" x-pid="[0-9]+" x-info="http://www.rsyslog.com"\] \(re\)start$ ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \[origin software="rsyslogd" swVersion="[0-9.]+" x-pid="[0-9]+" x-info="http://www.rsyslog.com"\] exiting on signal [0-9]+.$ -^\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \[origin software="rsyslogd" swVersion="[0-9.]+" x-pid="[0-9]+" x-info="http://www.rsyslog.com"\] rsyslogd was HUPed$ +^\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \[origin software="rsyslogd" swVersion="[0-9.]+" x-pid="[0-9]+" x-info="http://www.rsyslog.com"\] rsyslogd was HUPed, type '(restart|lightweight)'\.$ diff -Nru rsyslog-7.6.0/debian/rsyslog.logrotate rsyslog-5.10.1/debian/rsyslog.logrotate --- rsyslog-7.6.0/debian/rsyslog.logrotate 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.logrotate 2014-03-03 22:30:14.000000000 +0000 @@ -21,7 +21,6 @@ /var/log/user.log /var/log/lpr.log /var/log/cron.log -/var/log/rsyslog.log /var/log/debug /var/log/messages { diff -Nru rsyslog-7.6.0/debian/rsyslog-mmanon.install rsyslog-5.10.1/debian/rsyslog-mmanon.install --- rsyslog-7.6.0/debian/rsyslog-mmanon.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-mmanon.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/mmanon.so diff -Nru rsyslog-7.6.0/debian/rsyslog-mmfields.install rsyslog-5.10.1/debian/rsyslog-mmfields.install --- rsyslog-7.6.0/debian/rsyslog-mmfields.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-mmfields.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/mmfields.so diff -Nru rsyslog-7.6.0/debian/rsyslog-mmjsonparse.install rsyslog-5.10.1/debian/rsyslog-mmjsonparse.install --- rsyslog-7.6.0/debian/rsyslog-mmjsonparse.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-mmjsonparse.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/mmjsonparse.so diff -Nru rsyslog-7.6.0/debian/rsyslog-mmnormalize.install rsyslog-5.10.1/debian/rsyslog-mmnormalize.install --- rsyslog-7.6.0/debian/rsyslog-mmnormalize.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-mmnormalize.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/mmnormalize.so diff -Nru rsyslog-7.6.0/debian/rsyslog-mongodb.install rsyslog-5.10.1/debian/rsyslog-mongodb.install --- rsyslog-7.6.0/debian/rsyslog-mongodb.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-mongodb.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/rsyslog/ommongodb.so diff -Nru rsyslog-7.6.0/debian/rsyslog-mysql.postinst rsyslog-5.10.1/debian/rsyslog-mysql.postinst --- rsyslog-7.6.0/debian/rsyslog-mysql.postinst 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-mysql.postinst 2014-03-03 22:30:14.000000000 +0000 @@ -27,7 +27,7 @@ configure) ucfr rsyslog-mysql /etc/rsyslog.d/mysql.conf - invoke-rc.d rsyslog restart + invoke-rc.d rsyslog reload ;; abort-upgrade|abort-remove|abort-deconfigure) diff -Nru rsyslog-7.6.0/debian/rsyslog-pgsql.postinst rsyslog-5.10.1/debian/rsyslog-pgsql.postinst --- rsyslog-7.6.0/debian/rsyslog-pgsql.postinst 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-pgsql.postinst 2014-03-03 22:30:14.000000000 +0000 @@ -27,7 +27,7 @@ configure) ucfr rsyslog-pgsql /etc/rsyslog.d/pgsql.conf - invoke-rc.d rsyslog restart + invoke-rc.d rsyslog reload ;; abort-upgrade|abort-remove|abort-deconfigure) diff -Nru rsyslog-7.6.0/debian/rsyslog.postinst rsyslog-5.10.1/debian/rsyslog.postinst --- rsyslog-7.6.0/debian/rsyslog.postinst 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.postinst 2014-03-03 22:30:14.000000000 +0000 @@ -14,20 +14,80 @@ # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package +rotate_old_log_files() +{ + log_files="syslog mail.info mail.warn mail.err mail.log daemon.log \ + kern.log auth.log user.log lpr.log cron.log debug messages" + skipped_files="" + dir=/var/log + + for f in $log_files; do + if [ -e $dir/$f.0 ]; then + rotate="yes" + if [ -e $dir/$f.1.gz ]; then + date0=$(stat --format=%Y $dir/$f.0) + date1=$(stat --format=%Y $dir/$f.1.gz) + if [ $date0 -lt $date1 ] ; then + # .0 log file is older than .1 + skipped_files="$dir/$f.0\n$skipped_files" + rotate="no" + fi + fi + if [ "$rotate" = "yes" ] ; then + for s in $(seq 9 -1 1) ; do + if [ -e $dir/$f.$s.gz ]; then + mv $dir/$f.$s.gz $dir/$f.$(($s+1)).gz + fi + done + mv $dir/$f.0 $dir/$f.1 + fi + fi + done + if [ -n "$skipped_files" ]; then + printf "The following old log files were found which could not be rotated safely.\n" + printf "\n$skipped_files\n" + printf "Please inspect them manually and delete them, if no longer required.\n" + fi +} + + case "$1" in configure) + # Rotate .0 log files when migrating from sysklogd + if dpkg --compare-versions "$2" lt "3.18.5-1"; then + rotate_old_log_files + fi user_conf=/etc/rsyslog.d/50-default.conf default_conf=/usr/share/rsyslog/50-default.conf + # Upgrade handling for config file. We copy syslog.conf if it exists and + # is modified, else use our default fresh-install config. + if dpkg --compare-versions "$2" lt "3.22.0-1ubuntu1"; then + pkg_name=sysklogd + old_conf=/etc/syslog.conf + if [ -e $old_conf ]; then + md5sum="`md5sum \"$old_conf\" | sed -e \"s/ .*//\"`" + old_md5sum="$(dpkg-query -W -f='${Conffiles}' $pkg_name | \ + sed -n -e "\' $old_conf ' { s/ obsolete$//; s/.* //; p }")" + if [ "$md5sum" != "$old_md5sum" ]; then + cp -n $old_conf $user_conf + fi + fi + fi + ucf --three-way --debconf-ok $default_conf $user_conf ucfr rsyslog $user_conf adduser --system --group --no-create-home --quiet syslog || true - # /run transition (see #633036) - if dpkg --compare-versions "$2" lt "5.8.2-2"; then - rm -f /lib/init/rw/sendsigs.omit.d/rsyslog + # Gross hack to stop an error when upgrading from sysklogd to rsyslog. + # sysklogd tries to 'deluser syslog' but rsyslog will be running by then. + # It was decided sysklogd should not be trying to delete the user at all. + # So we correct that mistake by sed'ing sysklogd's postrm script. + # See LP: #401056 + if [ -e /var/lib/dpkg/info/sysklogd.postrm ]; then + sed -i -e '/deluser/d' /var/lib/dpkg/info/sysklogd.postrm fi ;; diff -Nru rsyslog-7.6.0/debian/rsyslog.postrm rsyslog-5.10.1/debian/rsyslog.postrm --- rsyslog-7.6.0/debian/rsyslog.postrm 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.postrm 2014-03-03 22:30:14.000000000 +0000 @@ -6,6 +6,16 @@ [ -f /etc/logrotate.d/rsyslog ] && mv -f /etc/logrotate.d/rsyslog /etc/logrotate.d/rsyslog.disabled fi +if [ "$1" = "purge" -o "$1" = "dissappear" ]; then + [ -f /etc/logrotate.d/rsyslog.disabled ] && rm -f /etc/logrotate.d/rsyslog.disabled +fi + +if [ "$1" = "remove" ]; then + # Cleanup sendsigs omit file to avoid false positives from piuparts + rm -f /lib/init/rw/sendsigs.omit.d/rsyslog + rm -f /lib/init/rw/sendsigs.omit.d/rsyslog-kmsg +fi + if [ "$1" = "purge" ]; then if which ucfr >/dev/null; then ucfr --purge rsyslog /etc/rsyslog.d/50-default.conf @@ -19,15 +29,6 @@ fi fi -if [ "$1" = "purge" -o "$1" = "disappear" ]; then - [ -f /etc/logrotate.d/rsyslog.disabled ] && rm -f /etc/logrotate.d/rsyslog.disabled -fi - -if [ "$1" = "remove" ]; then - # Cleanup sendsigs omit file to avoid false positives from piuparts - rm -f /run/sendsigs.omit.d/rsyslog -fi - #DEBHELPER# exit 0 diff -Nru rsyslog-7.6.0/debian/rsyslog.preinst rsyslog-5.10.1/debian/rsyslog.preinst --- rsyslog-7.6.0/debian/rsyslog.preinst 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.preinst 2014-03-03 22:30:14.000000000 +0000 @@ -6,27 +6,17 @@ [ -f /etc/logrotate.d/rsyslog.disabled ] && mv -f /etc/logrotate.d/rsyslog.disabled /etc/logrotate.d/rsyslog fi -if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.7.8-1" ; then - rm -f /etc/systemd/system/sockets.target.wants/rsyslog.socket -fi - -disable_profile() { - APP_CONFFILE="/etc/apparmor.d/usr.sbin.rsyslogd" - APP_DISABLE="/etc/apparmor.d/disable/usr.sbin.rsyslogd" - # Create a symlink to the yet-to-be-unpacked profile - if [ ! -e "$APP_CONFFILE" ]; then - mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true - ln -sf $APP_CONFFILE $APP_DISABLE - fi -} - -if [ "$1" = "install" ]; then - # Disable AppArmor profile on install - disable_profile -elif [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" lt "5.8.6-1ubuntu5" ; then - # Disable AppArmor on upgrade from earlier than when we first shipped - # the profile if the user does not already have a profile defined - disable_profile +if [ "$1" = install ] || [ "$1" = upgrade ]; then + if [ -e "/etc/init/rsyslog-kmsg.conf" ] && [ ! -L "/etc/init/rsyslog-kmsg.conf" ]; then + if [ "`md5sum \"/etc/init/rsyslog-kmsg.conf\" | sed -e \"s/ .*//\"`" != \ + "`dpkg-query -W -f='${Conffiles}' rsyslog | sed -n -e \"\\\\' /etc/init/rsyslog-kmsg.conf '{s/ obsolete$//;s/.* //p}\"`" ] + then + echo "Obsolete conffile /etc/init/rsyslog-kmsg.conf has been modified by you, renaming to .dpkg-bak" + mv -f "/etc/init/rsyslog-kmsg.conf" "/etc/init/rsyslog-kmsg.conf.dpkg-bak" + else + rm -f "/etc/init/rsyslog-kmsg.conf" + fi + fi fi #DEBHELPER# diff -Nru rsyslog-7.6.0/debian/rsyslog.upstart rsyslog-5.10.1/debian/rsyslog.upstart --- rsyslog-7.6.0/debian/rsyslog.upstart 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog.upstart 2014-03-03 22:30:14.000000000 +0000 @@ -9,14 +9,6 @@ stop on runlevel [06] expect fork -kill timeout 30 respawn -pre-start script - /lib/init/apparmor-profile-load usr.sbin.rsyslogd -end script - -script - . /etc/default/rsyslog - exec rsyslogd $RSYSLOGD_OPTIONS -end script +exec rsyslogd -c4 diff -Nru rsyslog-7.6.0/debian/rsyslog-zmq.install rsyslog-5.10.1/debian/rsyslog-zmq.install --- rsyslog-7.6.0/debian/rsyslog-zmq.install 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rsyslog-zmq.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -debian/tmp/usr/lib/rsyslog/imzmq3.so -debian/tmp/usr/lib/rsyslog/omzmq3.so diff -Nru rsyslog-7.6.0/debian/rules rsyslog-5.10.1/debian/rules --- rsyslog-7.6.0/debian/rules 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/rules 2014-03-03 22:30:14.000000000 +0000 @@ -1,61 +1,134 @@ #!/usr/bin/make -f +# -*- makefile -*- +# debian/rules file for the rsyslog package. +# Author: Michael Biebl -DPKG_EXPORT_BUILDFLAGS = 1 -#include /usr/share/dpkg/buildflags.mk +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS # the default LDFLAGS="-Wl,-Bsymbolic-functions" caused rsyslog to # segfault on receipt of first message (see LP: #794230) unexport LDFLAGS -%: - dh $@ --with autoreconf -#org dh $@ --with autotools_dev +# For quilt patch management. +include /usr/share/quilt/quilt.make -override_dh_auto_configure: - dh_auto_configure -- \ +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: $(QUILT_STAMPFN) configure + dh_testdir + # Add here commands to configure the package. +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info \ --enable-mysql \ --enable-pgsql \ --enable-mail \ --enable-imfile \ - --enable-impstats \ --enable-gssapi-krb5 \ --enable-gnutls \ --enable-relp \ - --enable-pmaixforwardedfrom \ - --enable-pmcisconames \ - --enable-pmlastmsg \ - --enable-pmrfc3164sd \ - --enable-pmsnare \ - --enable-omprog \ - --enable-elasticsearch \ - --enable-mmjsonparse \ - --enable-imptcp \ - --enable-mmnormalize \ - --enable-mmanon \ - --enable-ommongodb \ - --enable-guardtime \ - --enable-mmfields \ - --enable-mmpstrucdata \ - --enable-mmsequence \ - --disable-testbench \ - --with-systemdsystemunitdir=/lib/systemd/system - -# --enable-guardtime \ -# --enable-ommongodb \ -# --enable-mmnormalize \ -# --enable-imzmq3 \ -# --enable-omzmq3 \ + CFLAGS="$(CFLAGS)" + + +build: build-stamp + +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch $@ + +clean: clean-source unpatch +clean-source: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + rm -f config.sub config.guess + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + + # Add here commands to install the package into debian/rsyslog. + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install -override_dh_auto_install: - dh_auto_install install --mode=644 -D plugins/ommysql/createDB.sql debian/rsyslog-mysql/usr/share/dbconfig-common/data/rsyslog-mysql/install/mysql install --mode=644 -D plugins/ompgsql/createDB.sql debian/rsyslog-pgsql/usr/share/dbconfig-common/data/rsyslog-pgsql/install/pgsql -override_dh_compress: - dh_compress -X rsyslog-example.conf - -override_dh_installinit: - dh_apparmor --profile-name=usr.sbin.rsyslogd -prsyslog +# Build architecture-independent files here. +binary-indep: DH_OPTIONS=-i +binary-indep: build install + dh_testdir + dh_testroot + dh_installdirs + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install + dh_link + dh_compress -X .conf + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: DH_OPTIONS=-a +binary-arch: build install + dh_testdir + dh_testroot + dh_installdirs + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_installlogcheck + dh_install + dh_installlogrotate dh_installinit -R -- start 10 2 3 4 5 . start 30 0 6 . stop 90 1 . dh_installinit --upstart-only --name=dmesg --no-start + dh_installman + dh_installdebconf + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff -Nru rsyslog-7.6.0/debian/source/format rsyslog-5.10.1/debian/source/format --- rsyslog-7.6.0/debian/source/format 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/source/format 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -3.0 (quilt) diff -Nru rsyslog-7.6.0/debian/usr.sbin.rsyslogd rsyslog-5.10.1/debian/usr.sbin.rsyslogd --- rsyslog-7.6.0/debian/usr.sbin.rsyslogd 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/usr.sbin.rsyslogd 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -# Last Modified: Sun Sep 25 08:58:35 2011 -#include - -# Debugging the syslogger can be difficult if it can't write to the file -# that the kernel is logging denials to. In these cases, you can do the -# following: -# watch -n 1 'dmesg | tail -5' - -/usr/sbin/rsyslogd { - #include - #include - - capability sys_tty_config, - capability dac_override, - capability dac_read_search, - capability setuid, - capability setgid, - capability sys_nice, - capability syslog, - - # rsyslog configuration - /etc/rsyslog.conf r, - /etc/rsyslog.d/ r, - /etc/rsyslog.d/** r, - /{,var/}run/rsyslogd.pid rwk, - /var/spool/rsyslog/ r, - /var/spool/rsyslog/** rwk, - - /usr/lib{,32,64}/rsyslog/*.so mr, - - /dev/tty* rw, - /dev/xconsole rw, - @{PROC}/kmsg r, - - /dev/log wl, - /var/lib/*/dev/log wl, - /var/spool/postfix/dev/log wl, - - # 'r' is needed when using imfile - /var/log/** rw, - - # Add these for mysql support - #/etc/mysql/my.cnf r, - #/{,var/}run/mysqld/mysqld.sock rw, - - # Add thes for postgresql support - ##include - ##include - #/{,var/}run/postgresql/.s.PGSQL.*[0-9] rw, - - # Site-specific additions and overrides. See local/README for details. - #include -} diff -Nru rsyslog-7.6.0/debian/watch rsyslog-5.10.1/debian/watch --- rsyslog-7.6.0/debian/watch 2014-02-28 00:29:35.000000000 +0000 +++ rsyslog-5.10.1/debian/watch 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -version=3 -http://download.rsyslog.com/rsyslog/rsyslog-([\d]+\.[\d]*[02468]\.[\d]+)\.tar\.gz diff -Nru rsyslog-7.6.0/depcomp rsyslog-5.10.1/depcomp --- rsyslog-7.6.0/depcomp 2014-02-12 12:06:38.000000000 +0000 +++ rsyslog-5.10.1/depcomp 2012-10-17 14:42:46.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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 @@ -44,7 +44,7 @@ object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. + tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -90,18 +90,10 @@ # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' + cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -166,12 +158,10 @@ ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. +## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -415,52 +405,6 @@ rm -f "$tmpdepfile" ;; -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/ \1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/ / - G - p -}' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -559,9 +503,7 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation diff -Nru rsyslog-7.6.0/dirty.h rsyslog-5.10.1/dirty.h --- rsyslog-7.6.0/dirty.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/dirty.h 2012-10-17 14:41:20.000000000 +0000 @@ -5,7 +5,7 @@ * yet a runtime library, because it depends on some functionality * residing somewhere else. * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -27,18 +27,26 @@ #ifndef DIRTY_H_INCLUDED #define DIRTY_H_INCLUDED 1 -rsRetVal __attribute__((deprecated)) multiSubmitMsg(multi_submit_t *pMultiSub); -rsRetVal multiSubmitMsg2(multi_submit_t *pMultiSub); /* friends only! */ -rsRetVal submitMsg2(msg_t *pMsg); -rsRetVal __attribute__((deprecated)) submitMsg(msg_t *pMsg); -rsRetVal multiSubmitFlush(multi_submit_t *pMultiSub); -rsRetVal logmsgInternal(const int iErr, const int pri, const uchar *const msg, int flags); -rsRetVal __attribute__((deprecated)) parseAndSubmitMessage(uchar *hname, uchar *hnameIP, uchar *msg, int len, int flags, flowControl_t flowCtlTypeu, prop_t *pInputName, struct syslogTime *stTime, time_t ttGenTime, ruleset_t *pRuleset); +rsRetVal multiSubmitMsg(multi_submit_t *pMultiSub); +rsRetVal submitMsg(msg_t *pMsg); +rsRetVal logmsgInternal(int iErr, int pri, uchar *msg, int flags); +rsRetVal parseAndSubmitMessage(uchar *hname, uchar *hnameIP, uchar *msg, int len, int flags, flowControl_t flowCtlTypeu, prop_t *pInputName, struct syslogTime *stTime, time_t ttGenTime); rsRetVal diagGetMainMsgQSize(int *piSize); /* for imdiag */ -rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName, struct nvlst *lst); +rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName); +/* Intervals at which we flush out "message repeated" messages, + * in seconds after previous message is logged. After each flush, + * we move to the next interval until we reach the largest. + * TODO: move this to action object! Only action.c and syslogd.c use it. + */ +extern int bActExecWhenPrevSusp; extern int MarkInterval; +extern int repeatinterval[2]; +extern int bReduceRepeatMsgs; extern qqueue_t *pMsgQueue; /* the main message queue */ -extern int iConfigVerify; /* is this just a config verify run? */ -extern int bHaveMainQueue; +#define MAXREPEAT ((int)((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1)) +#define REPEATTIME(f) ((f)->f_time + repeatinterval[(f)->f_repeatcount]) +#define BACKOFF(f) { if (++(f)->f_repeatcount > MAXREPEAT) \ + (f)->f_repeatcount = MAXREPEAT; \ + } #endif /* #ifndef DIRTY_H_INCLUDED */ diff -Nru rsyslog-7.6.0/doc/build_from_repo.html rsyslog-5.10.1/doc/build_from_repo.html --- rsyslog-7.6.0/doc/build_from_repo.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/build_from_repo.html 2012-09-18 15:03:57.000000000 +0000 @@ -8,13 +8,21 @@ to build directly from the source repository. This is useful for people who would like to participate in development or who would like to use the latest, not-yet-released code. The later may especially be the case if you are asked to try out an experimental version. -

Building from the repository is not much different than building from the source +

Building from the repsitory is not much different than building from the source tarball, but some files are missing because they are output files and thus do not belong into the repository.

Obtaining the Source

-

First of all, you need to download the sources. Rsyslog is kept in git. The -"Where to find the rsyslog -source code" page on the project site will point you to the current repository location. +

First of all, you need to download the sources. Rsyslog is currently kept in a git +repository. You can clone this repository either via http or git protocol (with the later +being much faster. URLS are: +

    +
  • git://git.adiscon.com/git/rsyslog.git +
  • http://git.adiscon.com/git/rsyslog.git +
+

There is also a browsable version (gitweb) available at +http://git.adiscon.com/?p=rsyslog.git;a=summary. +This version also offers snapshots of each commit for easy download. You can use these if +you do not have git present on your system.

After you have cloned the repository, you are in the master branch by default. This is where we keep the devel branch. If you need any other branch, you need to do a "git checkout --track -b branch origin/branch". For example, the command to check out @@ -58,13 +66,13 @@


 ./configure CFLAGS="-march=i586 -mcpu=i686" --enable-imfile ... (whatever you need)
 
-

These settings should resolve the issue. +

These settings should resolve the issue .

[manual index] [rsyslog site]

This documentation is part of the rsyslog project.
-Copyright © 2008-2013 by Rainer Gerhards and +Copyright © 2008, 2009 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

diff -Nru rsyslog-7.6.0/doc/debug.html rsyslog-5.10.1/doc/debug.html --- rsyslog-7.6.0/doc/debug.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/debug.html 2012-09-18 15:03:57.000000000 +0000 @@ -27,7 +27,7 @@

There are two environment variables that set several debug settings:

  • The "RSYSLOG_DEBUGLOG" (sample:  RSYSLOG_DEBUGLOG="/path/to/debuglog/") -writes (almost) +writes (allmost) all debug message to the specified log file in addition to stdout. Some system messages (e.g. segfault or abort message) are not written to the file as we can not capture them. @@ -49,14 +49,8 @@
  • Debug - if present, turns on the debug system and enables debug output
  • DebugOnDemand - if present, turns on the debug system but does not enable debug output itself. You need to send SIGUSR1 to turn it on when desired. -
  • OutputTidToStderr - if present, makes rsyslog output information about -the thread id (tid) of newly create processesto stderr. Note that not necessarily -all new threads are reported (depends on the code, e.g. of plugins). This is -only available under Linux. This usually does NOT work when privileges have -been dropped (that's not a bug, but the way it is).
  • help - display a very short list of commands - hopefully a life saver if you can't access the documentation...
-

Individual options are separated by spaces.

Why Environment Variables?

You may ask why we use environment variables for debug-system parameters and not @@ -76,26 +70,6 @@

For these reasons, we utilize environment variables to initialize and configure the debugging system. We understand this may be somewhat painful, but now you know there are at least some good reasons for doing so. -

HOWEVER, if you have a too hard time to set debug instructions using the environment -variables, there is a cure, described in the next paragraph. - -

Enabling Debug via rsyslog.conf

-

As described in the previous paragraph, enabling debug via rsyslog.conf -may not be perfect for some debugging needs, but basic debug output will work - and -that is what most often is requried. There are limited options available, but these -cover the most important use cases. -

Debug processing is done via legacy config statements. There currently -is no plan to move these over to the v6+ config system. Availabe settings are -

    -
  • $DebugFile <filename> - sets the debug file name -
  • $DebugLevel <0|1|2> - sets the respective debug level, where -0 means debug off, 1 is debug on demand activated (but debug mode off) -and 2 is full debug mode. -
-

Note that in theory it is forbidden to specify these parameters more -than once. However, we do not enforce that and if it happens results -are undefined. -

Getting debug information from a running Instance

It is possible to obtain debugging information from a running instance, but this requires some setup. We assume that the instance runs in the background, so debug output to @@ -133,7 +107,7 @@ threads and their calling stack by sending SIGUSR2. However, the usefulness of that information is very much depending on rsyslog compile-time settings, must importantly the --enable-rtinst configure flag. Note that activating this option causes additional overhead -and slows down rsyslogd considerable. So if you do that, you need to check if it is +and slows down rsyslgod considerable. So if you do that, you need to check if it is capable to handle the workload. Also, threading behavior is modified by the runtime instrumentation.

Sending SIGUSR2 writes new process state information to the log file each time @@ -143,13 +117,13 @@ on the mutex debugging options (see above) is probably useful.

Interpreting the Logs

Debug logs are primarily meant for rsyslog developers. But they may still provide valuable -information to users. Just be warned that logs sometimes contains information the looks like +information to users. Just be warned that logs sometimes contains informaton the looks like an error, but actually is none. We put a lot of extra information into the logs, and there are some cases where it is OK for an error to happen, we just wanted to record it inside the log. The code handles many cases automatically. So, in short, the log may not make sense to you, but it (hopefully) makes sense to a developer. Note that we developers often need many lines of the log file, it is relatively rare that a problem can be diagnosed by -looking at just a couple of (hundred) log records. +looking at just a couple of (hundered) log records.

Security Risks

The debug log will reveal potentially sensible information, including user accounts and passwords, to anyone able to read the log file. As such, it is recommended to properly @@ -159,17 +133,12 @@ enable DebugOnDemand mode only for a reason. Note that when no debug mode is enabled, SIGUSR1 and SIGUSR2 are completely ignored.

When running in any of the debug modes (including on demand mode), an interactive -instance of rsyslogd can be aborted by pressing ctrl-c. +instance of rsyslogd can be aborted by pressing ctl-c.

-

See Also

- -

[manual index] [rsyslog site]

This documentation is part of the rsyslog project.
-Copyright © 2008-2013 by Rainer Gerhards and +Copyright © 2008-2010 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

diff -Nru rsyslog-7.6.0/doc/dev_queue.html rsyslog-5.10.1/doc/dev_queue.html --- rsyslog-7.6.0/doc/dev_queue.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/dev_queue.html 2012-01-24 16:37:09.000000000 +0000 @@ -80,7 +80,7 @@ highly unlikely (but only for the main message queue) because rsyslog issues a startup message. HOWEVER, we can not rely on that, it would introduce a race. If the primary rsyslog thread (the one that issues the message) is scheduled very -late and there is a low inactivity timeout for queue workers, the queue worker +late and there is a low inactivty timeout for queue workers, the queue worker may terminate before the startup message is issued. And if the on-disk queue holds only a few messages, it may become empty before the DA worker is re-initiated again. So it is possible that the DA run mode termination criteria @@ -105,7 +105,7 @@

One might think that it would be more natural for the DA queue to detect being idle and shut down itself. However, there are some issues associated with that. Most importantly, all queue worker threads need to be shut down during -queue destruction. Only after that has happened, final destruction steps can +queue destruction. Only after that has happend, final destruction steps can happen (else we would have a myriad of races). However, it is the DA queues worker thread that detects it is empty (empty queue detection always happens at the consumer side and must so). That would lead to the DA queue worker thread to @@ -115,7 +115,7 @@ other issues - so let's forget about it). As such, the thread that enqueues messages must destruct the queue - and that is the primary queue's DA worker thread.

-

There are some subtleties due to thread synchronization and the fact that the +

There are some subleties due to thread synchronization and the fact that the DA consumer may not be running (in a case-2 startup). So it is not trivial to reliably change the queue back from DA run mode to regular run mode. The priority is a clean switch. We accept the fact that there may be situations @@ -132,7 +132,7 @@

Case 2 is unlikely, but may happen (see info above on a case 2 startup).

The DA worker may also not wait at all, because it is actively -executing and shuffling messages between the queues. In that case, however, the +executing and shuffeling messages between the queues. In that case, however, the program flow passes both of the two wait conditions but simply does not wait.

Finally, the DA worker may be inactive (again, with a case-2 startup). In that case no work(er) at all is executed. Most importantly, without the DA @@ -247,4 +247,4 @@ viewed at http://www.gnu.org/copyleft/fdl.html.

- + \ No newline at end of file diff -Nru rsyslog-7.6.0/doc/droppriv.html rsyslog-5.10.1/doc/droppriv.html --- rsyslog-7.6.0/doc/droppriv.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/droppriv.html 2012-01-24 16:37:09.000000000 +0000 @@ -18,7 +18,7 @@ user. That is probably the safest way of operations. However, if a startup as root is required, you can use the $PrivDropToGroup and $PrivDropToUser config directives to specify a group and/or user that rsyslogd should drop to after initialization. -Once this happens, the daemon runs without high privileges (depending, of +Once this happend, the daemon runs without high privileges (depending, of course, on the permissions of the user account you specified).

There is some additional information available in the rsyslog wiki. diff -Nru rsyslog-7.6.0/doc/features.html rsyslog-5.10.1/doc/features.html --- rsyslog-7.6.0/doc/features.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/features.html 2012-01-24 16:37:09.000000000 +0000 @@ -42,7 +42,7 @@

  • ability to configure backup syslog/database servers - if the primary fails, control is switched to a prioritized list of backups
  • support for receiving messages via reliable -RFC 3195 delivery (a bit clumsy to build right now...)
  • +RFC 3195 delivery (a bit clumpsy to build right now...)
  • ability to generate file names and directories (log targets) dynamically, based on many different properties
  • control of log output format, including ability to present @@ -95,7 +95,7 @@
  • an easy-to-write to plugin interface
  • ability to send SNMP trap messages
  • ability to filter out messages based on sequence of arrival
  • -
  • support for comma-separated-values (CSV) output generation +
  • support for comma-seperated-values (CSV) output generation (via the "csv" property replace option). The CSV format supported is that from RFC 4180.
  • support for arbitrary complex boolean, string and diff -Nru rsyslog-7.6.0/doc/gssapi.html rsyslog-5.10.1/doc/gssapi.html --- rsyslog-7.6.0/doc/gssapi.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/gssapi.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,118 @@ + +GSSAPI module support in rsyslog v3 + + + +

    GSSAPI module support in rsyslog v3

    +

    What is it good for.

    +
      +
    • +client-serverauthentication
    • +
    • +Log +messages encryption
    • +
    +

    +

    Requirements. +

    +
      +
    • Kerberos infrastructure
    • +
    • rsyslog, rsyslog-gssapi
    • +
    +

    +

    Configuration. +

    +

    Let's assume there are 3 machines in kerberos Realm:

    +
      +
    • the +first is running KDC (Kerberos Authentication Service and Key +Distribution Center),
    • +
    • the second is a client sending its logs to the server,
    • +
    • the third is receiver, gathering all logs.
    • +
    +

    +

    1. +KDC:

    +
      +
    • Kerberos +database must be properly set-up on KDC machine first. Use +kadmin/kadmin.local to do that. Two principals need to be add in our +case:
    • +
    +
      +
    1. +

      sender@REALM.ORG +

      +
    2. +
    +
      +
    • client must have ticket for pricipal sender
    • +
    • REALM.ORG is kerberos Realm
    • +
    +
      +
    1. host/receiver.mydomain.com@REALM.ORG - service principal
    2. +
    +
      +
    • Use ktadd to export service principal and transfer it to +/etc/krb5.keytab +on receiver
    • +
    +

    2. CLIENT: +

    +
      +
    • set-up rsyslog, in /etc/rsyslog.conf
    • +
    • $ModLoad omgssapi - load output gss module
    • +
    • $GSSForwardServiceName +otherThanHost - set the name of service principal, "host" is the +default one
    • +
    • *.* :omgssapi:receiver.mydomain.com - action line, forward +logs to receiver
    • +
    • kinit root - get the TGT ticket
    • +
    • service rsyslog start +

      +
    • +
    +

    3. SERVER: +

    +
      +
    • +

      set-up +rsyslog, in /etc/rsyslog.conf

      +
    • +
    • +

      $ModLoad +imgssapi - load input gss module

      +
    • +
    • +

      $InputGSSServerServiceName +otherThanHost - set the name of service principal, "host" is the +default one

      +
    • +
    • +

      $InputGSSServerPermitPlainTCP +on - accept GSS and TCP connections (not authenticated senders), off by +default

      +
    • +
    • +

      $InputGSSServerRun +514 - run server on port

      +
    • +
    • +

      service +rsyslog start

      +
    • +
    +The picture demonstrate +how things work. +

    +rsyslog gssapi support +

    [rsyslog.conf overview] +[manual index] [rsyslog site]

    +

    This documentation is part of the +rsyslog +project.
    +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

    + diff -Nru rsyslog-7.6.0/doc/history.html rsyslog-5.10.1/doc/history.html --- rsyslog-7.6.0/doc/history.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/history.html 2012-01-24 16:37:09.000000000 +0000 @@ -117,26 +117,8 @@ use case. On February, 28th rsyslog 3.12.0 was released, the first version to contain expression support. This also meant that rsyslog from that date on supported all syslog-ng major features, but had a -number of major features exclusive to it. With 3.12.0, I consider -rsyslog fully superior to syslog-ng (except for platform support).

    - -

    Following the Fedora Developer's conference in Brno 2012, rsyslog -got very serious on implementing structured logging in -project Lumberjack (CEE) style. Project Lumberjack was a much broader -effort and brought closer collaboration with the syslog-ng folks, which -helped to maintain and improve interoperability. In the -late winter/spring/summer 2012 timeframe numerous engine enhancements -were made and plugins written (among them the first "official" interfaces -to the Linux audit subsystem). At the end of the year, this culminated in the -rsyslog 7, which not only implemented Lumberjack but also was the first one -to support full condition nesting in rsyslog.conf (and a ton of other features as -well). - -

    In spring 2013 major new security features were engineered, -namely anonymization support, as well as log file signing and -encryption capabilities. - -

    Be sure to visit Rainer's syslog blog +number of major features exlusive to it. With 3.12.0, I consider +rsyslog fully superior to syslog-ng (except for platform support).

    Be sure to visit Rainer's syslog blog to get some more insight into the development and futures of rsyslog and syslog in general. Don't be shy to post to either the blog or the rsyslog forums.

    @@ -144,4 +126,4 @@ - + \ No newline at end of file diff -Nru rsyslog-7.6.0/doc/how2help.html rsyslog-5.10.1/doc/how2help.html --- rsyslog-7.6.0/doc/how2help.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/how2help.html 2012-10-17 14:41:20.000000000 +0000 @@ -14,9 +14,6 @@
  • spread word about rsyslog in forums and newsgroups
  • place a link to www.rsyslog.com from your home page
  • -
  • you may also want to tell others about the - log analyzer tool - created by the same folks as rsyslog - at least, if you like it ;)
  • let us know about rsyslog - we are eager for feedback
      @@ -57,4 +54,4 @@ might do!

      - + + +RFC3195 Input Module (im3195) + + + +back + +

      RFC3195 Input Module

      +

      Module Name:    im3195

      +

      Author: Rainer Gerhards +<rgerhards@adiscon.com>

      +

      Description:

      +

      Receives syslog messages via RFC 3195. The RAW profile is fully implemented and the +COOKED profile is provided in an experimental state. This module uses +liblogging for the actual protocol handling.

      +

      Configuration Directives:

      +
        +
      • $Input3195ListenPort <port>
        +The port on which imklog listens for RFC 3195 messages. The default port is 601 +(the IANA-assigned port)
      • +
      +Caveats/Known Bugs: +

      Due to no demand at all for RFC3195, we have converted rfc3195d +to this input module, but we have NOT conducted any testing. Also, +the module does not yet properly handle the recovery case. If someone +intends to put this module into production, good testing should be +cunducted. It also is a good idea to notify the rsyslog project that you intend to use +it in production. In this case, we'll probably give the module another +cleanup. We don't do this now because so far it looks just like a big +waste of time. +

      Currently only a single listener can be defined. That one binds to all interfaces.

      +

      Sample:

      +

      The following sample accepts syslog messages via RFC 3195 on port 1601. +
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog project.
      +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imfile.html rsyslog-5.10.1/doc/imfile.html --- rsyslog-7.6.0/doc/imfile.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imfile.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,161 @@ + + +Text File Input Monitor + +back + +

      Text File Input Module

      +

      Module Name:    imfile

      +

      Author: Rainer Gerhards +<rgerhards@adiscon.com>

      +

      Description:

      +

      Provides the ability to convert any standard text file into +a syslog message. A standard +text file is a file consisting of printable characters with lines +being delimited by LF.

      +

      The file is read line-by-line and any line read is passed to +rsyslog's rule engine. The rule engine applies filter conditons and +selects which actions needs to be carried out. Empty lines are not +processed, as they would result in empty syslog records. They are simply +ignored.

      +

      As new lines are written they are taken from the file and +processed. Please note that this happens based on a polling interval +and not immediately. The file monitor support file rotation. To fully +work, rsyslogd must run while the file is rotated. Then, any remaining +lines from the old file are read and processed and when done with that, +the new file is being processed from the beginning. If rsyslogd is +stopped during rotation, the new file is read, but any not-yet-reported +lines from the previous file can no longer be obtained.

      +

      When rsyslogd is stopped while monitoring a text file, it +records the last processed location and continues to work from there +upon restart. So no data is lost during a restart (except, as noted +above, if the file is rotated just in this very moment).

      +

      Currently, the file must have a fixed name and location +(directory). It is planned to add support for dynamically generating +file names in the future.

      +

      Multiple files may be monitored by specifying +$InputRunFileMonitor multiple times. +

      +

      Configuration Directives:

      +
        +
      • $InputFileName /path/to/file
        +The file being monitored. So far, this must be an absolute name (no +macros or templates)
      • +
      • $InputFileTag +tag:
        +The tag to be used for messages that originate from this file. If you +would like to see the colon after the tag, you need to specify it here +(as shown above).
      • +
      • $InputFileStateFile +<name-of-state-file>
        +Rsyslog must keep track of which parts of the to be monitored file it +already processed. This is done in the state file. This file always is +created in the rsyslog working directory (configurable via +$WorkDirectory). Be careful to use unique names for different files +being monitored. If there are duplicates, all sorts of "interesting" +things may happen. Rsyslog currently does not check if a name is +specified multiple times.
      • +
      • $InputFileFacility +facility
        +The syslog facility to be assigned to lines read. Can be specified in +textual form (e.g. "local0", "local1", ...) or as numbers (e.g. 128 for +"local0"). Textual form is suggested. Default  is +"local0".
      • +
      • $InputFileSeverity
        +The +syslog severity to be assigned to lines read. Can be specified in +textual form (e.g. "info", "warning", ...) or as numbers (e.g. 4 for +"info"). Textual form is suggested. Default +is "notice".
      • +
      • $InputRunFileMonitor
        +This activates +the current monitor. It has no parameters. If you forget this +directive, no file monitoring will take place.
      • +
      • $InputFilePollInterval +seconds
        +This is a global setting. It specifies how often files are to be polled +for new data. The time specified is in seconds. The default value is 10 +seconds. Please note that future +releases of imfile may support per-file polling intervals, but +currently this is not the case. If multiple $InputFilePollInterval +statements are present in rsyslog.conf, only the last one is used.
        +A short poll interval provides more rapid message forwarding, but +requires more system ressources. While it is possible, we stongly +recommend not to set the polling interval to 0 seconds. That will make +rsyslogd become a CPU hog, taking up considerable ressources. It is +supported, however, for the few very unusual situations where this +level may be needed. Even if you need quick response, 1 seconds should +be well enough. Please note that imfile keeps reading files as long as +there is any data in them. So a "polling sleep" will only happen when +nothing is left to be processed.
      • +
      • $InputFilePersistStateInterval [lines]
        +Available in 4.7.3+, 5.6.2+
        +Specifies how often the state file shall be written when processing the input +file. The default value is 0, which means a new state file is only written when +the monitored files is being closed (end of rsyslogd execution). Any other +value n means that the state file is written every time n file lines have +been processed. This setting can be used to guard against message duplication due +to fatal errors (like power fail). Note that this setting affects imfile +performance, especially when set to a low value. Frequently writing the state +file is very time consuming. +
      • $InputFileReadMode [mode]
        +Available in 5.7.5+ +
      • $InputFileMaxLinesAtOnce [number]
        +Available in 5.9.0+ +
        +This is useful if multiple files need to be monitored. If set to 0, each file +will be fully processed and then processing switches to the next file +(this was the default in previous versions). If it is set, a maximum of +[number] lines is processed in sequence for each file, and then the file is +switched. This provides a kind of mutiplexing the load of multiple files and +probably leads to a more natural distribution of events when multiple busy files +are monitored. The default is 10240. +
      • $InputFileBindRuleset <ruleset>
        +Available in 5.7.5+, 6.1.5+ +Binds the listener to a specific ruleset.
      • +
      +Caveats/Known Bugs: +

      So far, only 100 files can be monitored. If more are needed, +the source needs to be patched. See define MAX_INPUT_FILES in imfile.c

      Powertop +users may want to notice that imfile utilizes polling. Thus, it is no +good citizen when it comes to conserving system power consumption. We +are currently evaluating to move to inotify(). However, there are a +number of subtle issues, which needs to be worked out first. We will +make the change as soon as we can. If you can afford it, we recommend +using a long polling interval in the mean time. +

      +

      Sample:

      +

      The following sample monitors two files. If you need just one, +remove the second one. If you need more, add them according to the +sample ;). This code must be placed in /etc/rsyslog.conf (or wherever +your distro puts rsyslog's config files). Note that only commands +actually needed need to be specified. The second file uses less +commands and uses defaults instead.
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog project.
      +Copyright © 2008 by Rainer +Gerhards and Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imgssapi.html rsyslog-5.10.1/doc/imgssapi.html --- rsyslog-7.6.0/doc/imgssapi.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imgssapi.html 2012-09-23 10:29:49.000000000 +0000 @@ -0,0 +1,53 @@ + + +GSSAPI Syslog Input Module + + + +back + +

      GSSAPI Syslog Input Module

      +

      Module Name:    imgssapi

      +

      Author: varmojfekoj

      +

      Description:

      +

      Provides the ability to receive syslog messages from the +network protected via Kerberos 5 encryption and authentication. This +module also accept plain tcp syslog messages on the same port if configured to do so. If you need just plain tcp, use imtcp instead.

      +

      There is also an overview of gssapi support in rsyslog available. We recommend reading +it before digging into the configuration parameters.

      +

      Configuration Directives:

      +
        +
      • InputGSSServerRun <port>
        +Starts a GSSAPI server on selected port - note that this runs +independently from the TCP server.
      • +
      • InputGSSServerServiceName <name>
        +The service name to use for the GSS server.
      • +
      • $InputGSSServerPermitPlainTCP on|off
        +Permits the server to receive plain tcp syslog (without GSS) on the +same port
      • +
      • $InputGSSServerMaxSessions <number>
        +Sets the maximum number of sessions supported
      • +
      +Caveats/Known Bugs: +
        +
      • module always binds to all interfaces
      • +
      • only a single listener can be bound
      • + +
      +

      Sample:

      +

      This sets up a GSS server on port 1514 that also permits to +receive plain tcp syslog messages (on the same port):
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2008-2011 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imjournal.html rsyslog-5.10.1/doc/imjournal.html --- rsyslog-7.6.0/doc/imjournal.html 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/doc/imjournal.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ - - -Systemd Journal Input Module - -back - -

      Systemd Journal Input Module

      -

      Module Name:    imjournal

      -

      Author: Milan Bartos -<mbartos@redhat.com> (This module is not project-supported)

      -

      Description:

      -

      Provides the ability to import structured log messages from systemd journal -to syslog.

      -

      Note that this module reads the journal database, what is considered a -relativly performance-intense operation. As such, the performance of a -configuration utilizing this -module may be notably slower then when using -imuxsock. The journal provides imuxsock with a -copy of all "classical" syslog messages, however, it does not provide -structured data. If the latter is needed, imjournal must be used. Otherwise, -imjournal may be simply replaced by imuxsock. -

      We suggest to check out our short presentation on -rsyslog journal integration to -learn more details of anticipated use cases. - -

      Warning: Some versions of systemd journal have problems with database -corruption, which leads to the journal to return the same data endlessly -in a thight loop. This results in massive message duplication inside rsyslog -probably resulting in a denial-of-service when the system ressouces get -exhausted. This can be somewhat mitigated by using proper rate-limiters, but -even then there are spikes of old data which are endlessly repeated. By default, -ratelimiting is activated and permits to process 20,000 messages within 10 -minutes, what should be well enough for most use cases. If insufficient, use -the parameters described below to adjust the permitted volume. -It is strongly recommended to use this plugin only if there -is hard need to do so. - -

      Configuration Directives:

      -

      Module Directives

      -
        -
      • PersistStateInterval number-of-messages
        -This is a global setting. It specifies how often should the journal state be persisted. -The persists happens after each number-of-messages. -This option is useful for rsyslog to start reding from the last journal message it read. - -
      • StateFile /path/to/file
        -This is a global setting. It specifies where the state file for persisting -journal state is located. - -
      • ratelimit.interval seconds (default: 600)
        -Specifies the interval in seconds onto which rate-limiting is to be applied. -If more than ratelimit.burst messages are read during that interval, further -messages up to the end of the interval are discarded. The number of messages -discarded is emitted at the end of the interval (if there were any discards). -
        Setting this to value zero turns off ratelimiting. Note that it is -not recommended to turn of ratelimiting, except that you know for -sure journal database entries will never be corrupted. Without ratelimiting, -a corrupted systemd journal database may cause a kind of denial of service (we -are stressing this point as multiple users have reported us such problems -with the journal database - information current as of June 2013). - -
      • ratelimit.burst messages (default: 20000)
        -Specifies the maximum number of messages that can be emitted within the -ratelimit.interval interval. For futher information, see description there. - -
      • IgnorePreviousMessages [off/on]
        -This option specifies whether imjournal should ignore messages currently in -journal and read only new messages. This option is only used when there is -no StateFile to avoid message loss. -
      - -Caveats/Known Bugs: -

      -

        -
      • As stated above, a corrupted systemd journal database can cause major -problems, depending on what the corruption results in. This is beyond the -control of the rsyslog team. -
      -

      -

      Sample:

      -

      -The following example shows pulling structured imjournal messages and saving them into /var/log/ceelog. -

      - - -

      Legacy Configuration Directives:

      -
        -
      • $imjournalPersistStateInterval
        -Equivalent to: PersistStateInterval
      • -
      • $imjournalStateFile
        -Equivalent to: StateFile
      • -
      • $imjournalRatelimitInterval
        -Equivalent to: ratelimit.interval
      • -
      • $imjournalRatelimitBurst
        -Equivalent to: ratelimit.burst
      • -
      • $ImjournalIgnorePreviousMessages
        -Equivalent to: ignorePreviousMessages
      • -
      - - - diff -Nru rsyslog-7.6.0/doc/imklog.html rsyslog-5.10.1/doc/imklog.html --- rsyslog-7.6.0/doc/imklog.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imklog.html 2012-10-15 13:45:04.000000000 +0000 @@ -0,0 +1,92 @@ + + +Kernel Log Input Module (imklog) + + + +back + +

      Kernel Log Input Module

      +

      Module Name:    imklog

      +

      Author: Rainer Gerhards +<rgerhards@adiscon.com>

      +

      Description:

      +

      Reads messages from the kernel log and submits them to the +syslog engine.

      +

      Configuration Directives:

      +
        +
      • $KLogInternalMsgFacility +<facility>
        +The facility which messages internally generated by imklog will have. +imklog generates some messages of itself (e.g. on problems, startup and +shutdown) and these do not stem from the kernel. Historically, under +Linux, these too have "kern" facility. Thus, on Linux platforms the +default is "kern" while on others it is "syslogd". You usually do not +need to specify this configuratin directive - it is included primarily +for few limited cases where it is needed for good reason. Bottom line: +if you don't have a good idea why you should use this setting, do not +touch it.
      • +
      • $KLogPermitNonKernelFacility +[on/off]
        +
        At least under BSD the kernel log may contain entries +with non-kernel facilities. This setting controls how those are +handled. The default is "off", in which case these messages are +ignored. Switch it to on to submit non-kernel messages to rsyslog +processing.
      • +
      • $DebugPrintKernelSymbols +[on/off]
        +Linux only, ignored on other platforms (but may be specified)
      • +
      • $klogLocalIPIF [interface name] - (available since 5.9.6) - if provided, the IP of the specified +interface (e.g. "eth0") shall be used as fromhost-ip for imklog-originating messages. +If this directive is not given OR the interface cannot be found (or has no IP address), +the default of "127.0.0.1" is used. +
      • +
      • $klogSymbolLookup [on/off] -- +disables imklog kernel symbol translation (former klogd -x option). NOTE that +this option is counter-productive on recent kernels (>= 2.6) because the +kernel already does the symbol translation and this option breaks the information.
        +This option is scheduled for removal, probably with version 4.x. Do not use +it except if you have a very good reason. If you have one, let us know +because otherwise new versions will no longer support it.
        +Linux only, ignored on other platforms (but may be specified)
      • +
      • $klogConsoleLogLevel [number] +(former klogd -c option) -- sets the console log level. If specified, only messages with +up to the specified level are printed to the console. The default is -1, which means that +the current settings are not modified. To get this behavior, do not specify +$klogConsoleLogLevel in the configuration file. Note that this is a global parameter. Each time +it is changed, the previous definition is re-set. The one activate will be that one that is +active when imklog actually starts processing. In short words: do not specify this +directive more than once! +
        Linux only, ignored on other platforms (but may be specified)
      • +
      • $klogUseSyscallInterface [on/off] +-- former klogd -s option
        +Linux only, ignored on other platforms (but may be specified)
      • +
      • $klogSymbolsTwice [on/off] -- +former klogd -2 option
        +Linux only, ignored on other platforms (but may be specified)
        +
      • +
      +Caveats/Known Bugs: +

      This is obviously platform specific and requires platform +drivers. +Currently, imklog functionality is available on Linux and BSD.

      +

      This module is not supported on Solaris and not needed there. +For Solaris kernel input, use imsolaris.

      +

      Sample:

      +

      The following sample pulls messages from the kernel log. All +parameters are left by default, which is usually a good idea. Please +note that loading the plugin is sufficient to activate it. No directive +is needed to start pulling kernel messages.
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2008-2009 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/impstats.html rsyslog-5.10.1/doc/impstats.html --- rsyslog-7.6.0/doc/impstats.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/impstats.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,64 @@ + + +Periodic Statistics of Internal Counters (impstats) + + +back + +

      Input Module to Generate Periodic Statistics of Internal Counters

      +

      Module Name:    impstats

      +

      Available since: 5.7.0+, 6.1.1+ +

      Author: Rainer Gerhards <rgerhards@adiscon.com>

      +

      Description:

      +

      This module provides periodic output of rsyslog internal counters. +Note that the whole statistics system is currently under development. So +availabilty and format of counters may change and is not yet stable (so be +prepared to change your trending scripts when you upgrade to a newer rsyslog version). +

      The set of available counters will be output as a set of syslog messages. This +output is periodic, with the interval being configurable (default is 5 minutes). +Be sure that your configuration records the counter messages (default is syslog.info). +

      Note that loading this module has impact on rsyslog performance. Depending on +settings, this impact may be noticable (for high-load environments). +

      The rsyslog website has an updated overview of available +rsyslog statistic counters. +

      +

      Configuration Directives:

      +
        +
      • $PStatInterval <Seconds>
        +Sets the interval, in seconds at which messages are generated. Please note that the +actual interval may be a bit longer. We do not try to be precise and so the interval is +actually a sleep period which is entered after generating all messages. So the actual +interval is what is configured here plus the actual time required to generate messages. +In general, the difference should not really matter. +
      • $PStatFacility <numerical facility>
        +The numerical syslog facility code to be used for generated messages. Default +is 5 (syslog).This is useful for filtering messages.
      • +
      • $PStatSeverity <numerical severity>
        +The numerical syslog severity code to be used for generated messages. Default +is 6 (info).This is useful for filtering messages.
      • +
      +Caveats/Known Bugs: +
        +
      • This module MUST be loaded right at the top of rsyslog.conf, otherwise +stats may not get turned on in all places.
      • +
      • experimental code
      • +
      +

      Sample:

      +

      This activates the module and records messages to /var/log/rsyslog-stats in 10 minute intervals:
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2010 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imptcp.html rsyslog-5.10.1/doc/imptcp.html --- rsyslog-7.6.0/doc/imptcp.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imptcp.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,104 @@ + + + +Plain TCP Syslog Input Module (imptcp) + +back + +

      Plain TCP Syslog Input Module

      +

      Module Name:    imptcp

      +

      Available since: 4.7.3+, 5.5.8+ +

      Author: Rainer Gerhards +<rgerhards@adiscon.com>

      +

      Description:

      +

      Provides the ability to receive syslog messages via plain TCP syslog. +This is a specialised input plugin tailored for high performance on Linux. It will +probably not run on any other platform. Also, it does no provide TLS services. +Encryption can be provided by using stunnel. +

      This module has no limit on the number of listeners and sessions that can be used. +

      Multiple receivers may be configured by +specifying $InputPTCPServerRun multiple times. +

      +

      Configuration Directives:

      +

      This plugin has config directives similar named as imtcp, but they all have PTCP in +their name instead of just TCP. Note that only a subset of the parameters are supported. +

        +
      • $InputPTCPServerAddtlFrameDelimiter <Delimiter>
        +This directive permits to specify an additional frame delimiter for plain tcp syslog. +The industry-standard specifies using the LF character as frame delimiter. Some vendors, +notable Juniper in their NetScreen products, use an invalid frame delimiter, in Juniper's +case the NUL character. This directive permits to specify the ASCII value of the delimiter +in question. Please note that this does not guarantee that all wrong implementations can +be cured with this directive. It is not even a sure fix with all versions of NetScreen, +as I suggest the NUL character is the effect of a (common) coding error and thus will +probably go away at some time in the future. But for the time being, the value 0 can +probably be used to make rsyslog handle NetScreen's invalid syslog/tcp framing. +For additional information, see this +forum thread. +
        If this doesn't work for you, please do not blame the rsyslog team. Instead file +a bug report with Juniper! +
        Note that a similar, but worse, issue exists with Cisco's IOS implementation. They do +not use any framing at all. This is confirmed from Cisco's side, but there seems to be +very limited interest in fixing this issue. This directive can not fix the Cisco bug. +That would require much more code changes, which I was unable to do so far. Full details +can be found at the Cisco tcp syslog anomaly +page. +
      • $InputPTCPSupportOctetCountedFraming <on|off>
        +If set to "on", the legacy octed-counted framing (similar to RFC5425 framing) is +activated. This is the default and should be left unchanged until you know +very well what you do. It may be useful to turn it off, if you know this framing +is not used and some senders emit multi-line messages into the message stream. +
      • +
      • $InputPTCPServerNotifyOnConnectionClose [on/off]
        +instructs imptcp to emit a message if the remote peer closes a connection.
        +
      • $InputPTCPServerKeepAlive <on/off>
        +enable of disable keep-alive packets at the tcp socket layer. The default is +to disable them.
      • +
      • $InputPTCPServerKeepAlive_probes <number>
        +The number of unacknowledged probes to send before considering the connection dead and notifying the application layer. +The default, 0, means that the operating system defaults are used. This has only +effect if keep-alive is enabled. The functionality may not be available on +all platforms. +
      • $InputPTCPServerKeepAlive_intvl <number>
        +The interval between subsequential keepalive probes, regardless of what the connection has exchanged in the meantime. +The default, 0, means that the operating system defaults are used. This has only +effect if keep-alive is enabled. The functionality may not be available on +all platforms. +
      • $InputPTCPServerKeepAlive_time <number>
        +The interval between the last data packet sent (simple ACKs are not considered data) and the first keepalive probe; after the connection is marked to need keepalive, this counter is not used any further. +The default, 0, means that the operating system defaults are used. This has only +effect if keep-alive is enabled. The functionality may not be available on +all platforms. +
      • $InputPTCPServerRun <port>
        +Starts a TCP server on selected port
      • +
      • $InputPTCPServerInputName <name>
        +Sets a name for the inputname property. If no name is set "imptcp" is used by default. Setting a +name is not strictly necessary, but can be useful to apply filtering based on which input +the message was received from. +
      • $InputPTCPServerBindRuleset <name>
        +Binds specified ruleset to next server defined. +
      • $InputPTCPServerListenIP <name>
        +On multi-homed machines, specifies to which local address the next listerner should +be bound. +
      +Caveats/Known Bugs: +
        +
      • module always binds to all interfaces
      • +
      +

      Sample:

      +

      This sets up a TCP server on port 514:
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2010 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imrelp.html rsyslog-5.10.1/doc/imrelp.html --- rsyslog-7.6.0/doc/imrelp.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imrelp.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,57 @@ + + +RELP Input Module + + + +back + +

      RELP Input Module

      +

      Module Name:    imrelp

      +

      Author: Rainer Gerhards

      +

      Description:

      +

      Provides the ability to receive syslog messages via the +reliable RELP protocol. This module requires librelp to be +present on the system. From the user's point of view, imrelp works much +like imtcp or imgssapi, except that no message loss can occur. Please +note that with the currently supported relp protocol version, a minor +message duplication may occur if a network connection between the relp +client and relp server breaks after the client could successfully send +some messages but the server could not acknowledge them. The window of +opportunity is very slim, but in theory this is possible. Future +versions of RELP will prevent this. Please also note that rsyslogd may +lose a few messages if rsyslog is shutdown while a network conneciton +to the server is broken and could not yet be recovered. Future version +of RELP support in rsyslog will prevent that. Please note that both +scenarios also exists with plain tcp syslog. RELP, even with the small +nits outlined above, is a much more reliable solution than plain tcp +syslog and so it is highly suggested to use RELP instead of plain tcp. +Clients send messages to the RELP server via omrelp.

      +

      Configuration Directives:

      +
        +
      • InputRELPServerRun <port>
        +Starts a RELP server on selected port
      • +
      +Caveats/Known Bugs: +
        +
      • see description
      • +
      • To obtain the remote system's IP address, you need to have at least +librelp 1.0.0 installed. Versions below it return the hostname instead +of the IP address.
      • +
      +

      Sample:

      +

      This sets up a RELP server on port 20514.
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imsolaris.html rsyslog-5.10.1/doc/imsolaris.html --- rsyslog-7.6.0/doc/imsolaris.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imsolaris.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,47 @@ + + + +Solaris Input Module (imsolaris) + + + +back + +

      Solaris Input Module

      +

      Module Name:    imsolaris

      +

      Author: Rainer Gerhards +<rgerhards@adiscon.com>

      +

      Description:

      +

      Reads local Solaris log messages including the kernel log.

      +

      This module is specifically tailored for Solaris. Under Solaris, there +is no special kernel input device. Instead, both kernel messages as well as +messages emitted via syslog() are received from a single source. +

      This module obeys the Solaris door() mechanism to detect a running syslogd +instance. As such, only one can be active at one time. If it detects another +active intance at startup, the module disables itself, but rsyslog will +continue to run. +

      Configuration Directives:

      +
        +
      • $IMSolarisLogSocketName <name>
        +This is the name of the log socket (stream) to read. If not given, /dev/log +is read. +
      • +
      +Caveats/Known Bugs: +

      None currently known. For obvious reasons, works on Solaris, only (and compilation +will most probably fail on any other platform). +

      Sample:

      +

      The following sample pulls messages from the default log source +
      +

      + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2010 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/imtcp.html rsyslog-5.10.1/doc/imtcp.html --- rsyslog-7.6.0/doc/imtcp.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imtcp.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,120 @@ + + + + +TCP Syslog Input Module + + + +back to rsyslog module overview + +

      TCP Syslog Input Module

      +

      Module Name:    imtcp

      +

      Author: Rainer Gerhards <rgerhards@adiscon.com>

      +

      Multi-Ruleset Support: since 4.5.0 and 5.1.1 +

      Description:

      +

      Provides the ability to receive syslog messages via TCP. +Encryption is natively provided by selecting the approprioate network stream driver and +can also be provided by using stunnel +(an alternative is the use the imgssapi module).

      +

      Multiple receivers may be configured by specifying +$InputTCPServerRun multiple times. This is available since version 4.3.1, earlier +versions do NOT support it. +

      +

      Configuration Directives:

      +
        +
      • $InputTCPServerAddtlFrameDelimiter <Delimiter>
        +This directive permits to specify an additional frame delimiter for plain tcp syslog. +The industry-standard specifies using the LF character as frame delimiter. Some vendors, +notable Juniper in their NetScreen products, use an invalid frame delimiter, in Juniper's +case the NUL character. This directive permits to specify the ASCII value of the delimiter +in question. Please note that this does not guarantee that all wrong implementations can +be cured with this directive. It is not even a sure fix with all versions of NetScreen, +as I suggest the NUL character is the effect of a (common) coding error and thus will +probably go away at some time in the future. But for the time being, the value 0 can +probably be used to make rsyslog handle NetScreen's invalid syslog/tcp framing. +For additional information, see this +forum thread. +
        If this doesn't work for you, please do not blame the rsyslog team. Instead file +a bug report with Juniper! +
        Note that a similar, but worse, issue exists with Cisco's IOS implementation. They do +not use any framing at all. This is confirmed from Cisco's side, but there seems to be +very limited interest in fixing this issue. This directive can not fix the Cisco bug. +That would require much more code changes, which I was unable to do so far. Full details +can be found at the Cisco tcp syslog anomaly +page. +
      • $InputTCPServerDisableLFDelimiter <on/off> (available since 5.5.3)
        +Industry-strandard plain text tcp syslog uses the LF to delimit syslog frames. However, +some users brought up the case that it may be useful to define a different delimiter and +totally disable LF as a delimiter (the use case named were multi-line messages). This mode +is non-standard and will probably come with a lot of problems. However, as there is need +for it and it is relatively easy to support, we do so. Be sure to turn this setting to +"on" only if you exactly know what you are doing. You may run into all sorts of troubles, +so be prepared to wrangle with that! +
      • $InputTCPServerNotifyOnConnectionClose [on/off] (available since 4.5.5)
        +instructs imtcp to emit a message if the remote peer closes a connection.
        +Important: This directive is global to all listeners and must be given right +after loading imtcp, otherwise it may have no effect.
      • +
      • $InputTCPServerKeepAlive <on/off>
        +enable of disable keep-alive packets at the tcp socket layer. The default is +to disable them.
      • +
      • $InputTCPServerRun <port>
        +Starts a TCP server on selected port
      • +
      • $InputTCPFlowControl <on/off>
        +This setting specifies whether some message flow control shall be exercised on the +related TCP input. If set to on, messages are handled as "light delayable", which means +the sender is throttled a bit when the queue becomes near-full. This is done in order +to preserve some queue space for inputs that can not throttle (like UDP), but it +may have some undesired effect in some configurations. Still, we consider this as +a useful setting and thus it is the default. To turn the handling off, simply +configure that explicitely. +
      • +
      • $InputTCPMaxListeners <number>
        +Sets the maximum number of listeners (server ports) supported. Default is 20. This must be set before the first $InputTCPServerRun directive.
      • +
      • $InputTCPMaxSessions <number>
        Sets the maximum number of sessions supported. Default is 200. This must be set before the first $InputTCPServerRun directive
      • +
      • $InputTCPServerStreamDriverMode <number>
        +Sets the driver mode for the currently selected network stream driver. <number> is driver specifc.
      • +
      • $InputTCPServerInputName <name>
        +Sets a name for the inputname property. If no name is set "imtcp" is used by default. Setting a +name is not strictly necessary, but can be useful to apply filtering based on which input +the message was received from. +
      • $InputTCPServerStreamDriverAuthMode <mode-string>
        +Sets the authentication mode for the currently selected network stream driver. <mode-string> is driver specifc.
      • +
      • $InputTCPServerStreamDriverPermittedPeer <id-string>
        +Sets permitted peer IDs. Only these peers are able to connect to the +listener. <id-string> semantics depend on the currently selected +AuthMode and  network stream driver. PermittedPeers may not be set in anonymous modes.
      • +
      • $InputTCPServerBindRuleset <ruleset>
        +Binds the listener to a specific ruleset.
      • +
      • $InputTCPSupportOctetCountedFraming <on|off>
        +If set to "on", the legacy octed-counted framing (similar to RFC5425 framing) is +activated. This is the default and should be left unchanged until you know +very well what you do. It may be useful to turn it off, if you know this framing +is not used and some senders emit multi-line messages into the message stream. +
      • +
      +Caveats/Known Bugs: +
        +
      • module always binds to all interfaces
      • +
      • can not be loaded together with imgssapi +(which includes the functionality of imtcp)
      • +
      +

      Example:

      +

      This sets up a TCP server on port 514 and permits it to accept up to 500 connections:
      +

      + +

      Note that the parameters (here: max sessions) need to be set before the listener +is activated. Otherwise, the parameters will not apply. +

      +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the rsyslog +project.
      +Copyright © 2008,2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + + diff -Nru rsyslog-7.6.0/doc/imuxsock.html rsyslog-5.10.1/doc/imuxsock.html --- rsyslog-7.6.0/doc/imuxsock.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/imuxsock.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,195 @@ + + + +Unix Socket Input + + +back + +

      Unix Socket Input

      +

      Module Name:    imuxsock

      +

      Author: Rainer Gerhards +<rgerhards@adiscon.com>

      +

      Description:

      +

      Provides the ability to accept syslog messages via local Unix +sockets. Most importantly, this is the mechanism by which the syslog(3) +call delivers syslog messages to rsyslogd. So you need to have this +module loaded to read the system log socket and be able to process log +messages from applications running on the local system.

      +

      Application-provided +timestamps are ignored by default. This is needed, as some programs +(e.g. sshd) log with inconsistent timezone information, what +messes up the local logs (which by default don't even contain time zone +information). This seems to be consistent with what sysklogd did for +the past four years. Alternate behaviour may be desirable if +gateway-like processes send messages via the local log slot - in this +case, it can be enabled via the +$InputUnixListenSocketIgnoreMsgTimestamp and $SystemLogSocketIgnoreMsgTimestamp config directives

      +

      There is input rate limiting available, (since 5.7.1) to guard you against +the problems of a wild running logging process. +If more than $SystemLogRateLimitInterval * $SystemLogRateLimitBurst log messages are emitted +from the same process, those messages with $SystemLogRateLimitSeverity or lower will be +dropped. It is not possible to recover anything about these messages, but imuxsock will +tell you how many it has dropped one the interval has expired AND the next message +is logged. Rate-limiting depends on SCM_CREDENTIALS. If the platform does not support +this socket option, rate limiting is turned off. If multiple sockets are configured, +rate limiting works independently on each of them (that should be what you usually expect). +The same functionality is available for additional log sockets, in which case the +config statements just use +the prefix $IMUXSockRateLimit... but otherwise works exactly the same. +When working with severities, please keep in mind that higher severity numbers mean lower +severity and configure things accordingly. +To turn off rate limiting, set the interval to zero. +

      Unix log sockets can be flow-controlled. That is, if processing queues fill up, +the unix socket reader is blocked for a short while. This may be useful to prevent overruning +the queues (which may cause exessive disk-io where it actually would not be needed). However, +flow-controlling a log socket (and especially the system log socket) can lead to a very +unresponsive system. As such, flow control is disabled by default. That means any log records +are places as quickly as possible into the processing queues. If you would like to have +flow control, you need to enable it via the $SystemLogSocketFlowControl and +$InputUnixListenSocketFlowControl config directives. Just make sure you thought about +the implications. Note that for many systems, turning on flow control does not hurt. +

      Starting with rsyslog 5.9.4, +trusted syslog properties +are available. These require a recent enough Linux Kernel and access to the /proc file +system. In other words, this may not work on all platforms and may not work fully when +privileges are dropped (depending on how they are dropped). Note that trusted properties +can be very useful, but also typically cause the message to grow rather large. Also, the +format of log messages is obviously changed by adding the trusted properties at the end. +For these reasons, the feature is not enabled by default. If you want to use it, +you must turn it on (via $SystemLogSocketAnnotate and $InputUnixListenSocketAnnotate). +

      Configuration Directives:

      +
        +
      • $InputUnixListenSocketIgnoreMsgTimestamp [on/off] +
        Ignore timestamps included in the message. Applies to the next socket being added.
      • +
      • $InputUnixListenSocketFlowControl [on/off] - specifies if flow control should be applied +to the next socket.
      • +
      • $IMUXSockRateLimitInterval [number] - specifies the rate-limiting +interval in seconds. Default value is 0, which turns off rate limiting. Set it to a number +of seconds (5 recommended) to activate rate-limiting. The default of 0 has been choosen in 5.9.6+, +as people experienced problems with this feature activated by default. Now it needs an +explicit opt-in by setting this parameter. +
      • +
      • $IMUXSockRateLimitBurst [number] - specifies the rate-limiting +burst in number of messages. Default is 200. +
      • +
      • $IMUXSockRateLimitSeverity [numerical severity] - specifies the severity of +messages that shall be rate-limited. +
      • +
      • $IMUXSockLocalIPIF [interface name] - (available since 5.9.6) - if provided, the IP of the specified +interface (e.g. "eth0") shall be used as fromhost-ip for imuxsock-originating messages. +If this directive is not given OR the interface cannot be found (or has no IP address), +the default of "127.0.0.1" is used. +
      • +
      • $InputUnixListenSocketUsePIDFromSystem [on/off] - specifies if the pid being logged shall +be obtained from the log socket itself. If so, the TAG part of the message is rewritten. +It is recommended to turn this option on, but the default is "off" to keep compatible +with earlier versions of rsyslog. This option was introduced in 5.7.0.
      • +
      • $InputUnixListenSocketUseSysTimeStamp [on/off] instructs imuxsock +to obtain message time from the system (via control messages) insted of using time +recorded inside the message. This may be most useful in combination with systemd. Note: +this option was introduced with version 5.9.1. Due to the usefulness of it, we +decided to enable it by default. As such, 5.9.1 and above behave slightly different +than previous versions. However, we do not see how this could negatively affect +existing environments.
        +
      • $SystemLogSocketIgnoreMsgTimestamp [on/off]
        +Ignore timestamps included in the messages, applies to messages received via the system log socket.
      • +
      • $OmitLocalLogging (imuxsock) [on/off] -- former -o option; +do NOT listen for the local log socket. This is most useful if you run multiple +instances of rsyslogd where only one shall handle the system log socket.
      • +
      • $SystemLogSocketName <name-of-socket> -- former -p option
      • +
      • $SystemLogFlowControl [on/off] - specifies if flow control should be applied +to the system log socket.
      • +
      • $SystemLogUsePIDFromSystem [on/off] - specifies if the pid being logged shall +be obtained from the log socket itself. If so, the TAG part of the message is rewritten. +It is recommended to turn this option on, but the default is "off" to keep compatible +with earlier versions of rsyslog. This option was introduced in 5.7.0.
      • +
      • $SystemLogRateLimitInterval [number] - specifies the rate-limiting +interval in seconds. Default value is 5 seconds. Set it to 0 to turn rate limiting off. +
      • +
      • $SystemLogRateLimitBurst [number] - specifies the rate-limiting +burst in number of messages. Default is 200. +
      • +
      • $SystemLogRateLimitSeverity [numerical severity] - specifies the severity of +messages that shall be rate-limited. +
      • +
      • $SystemLogUseSysTimeStamp [on/off] the same as $InputUnixListenSocketUseSysTimeStamp, but for the system log socket. +
      • $InputUnixListenSocketCreatePath [on/off] - create directories in the socket path +if they do not already exist. They are created with 0755 permissions with the owner being the process under +which rsyslogd runs. The default is not to create directories. Keep in mind, though, that rsyslogd always +creates the socket itself if it does not exist (just not the directories by default). +
        Note that this statement affects the +next $AddUnixListenSocket directive that follows in sequence in the configuration file. It never works +on the system log socket (where it is deemed unnecessary). Also note that it is automatically +being reset to "off" after the $AddUnixListenSocket directive, so if you would have it active +for two additional listen sockets, you need to specify it in front of each one. This option is primarily considered +useful for defining additional sockets that reside on non-permanent file systems. As rsyslogd probably starts +up before the daemons that create these sockets, it is a vehicle to enable rsyslogd to listen to those +sockets even though their directories do not yet exist. [available since 4.7.0 and 5.3.0]
      • +
      • $AddUnixListenSocket <name-of-socket> adds additional unix socket, default none -- former -a option
      • +
      • $InputUnixListenSocketHostName <hostname> permits to override the hostname that +shall be used inside messages taken from the next $AddUnixListenSocket socket. Note that +the hostname must be specified before the $AddUnixListenSocket configuration directive, and it +will only affect the next one and then automatically be reset. This functionality is provided so +that the local hostname can be overridden in cases where that is desired.
      • +
      • $InputUnixListenSocketAnnotate <on/off> turn on annotation/trusted +properties for the non-system log socket in question.
      • +
      • $SystemLogSocketAnnotate <on/off> turn on annotation/trusted +properties for the system log socket.
      • +
      + +Caveats/Known Bugs:
      +
        +
      • There is a compile-time limit of 50 concurrent sockets. If you need more, you need to +change the array size in imuxsock.c. +
      • This documentation is sparse and incomplete. +
      +

      Sample:

      +

      The following sample is the minimum setup required to accept syslog messages from applications running +on the local system.
      +

      + +

      The following sample is a configuration where rsyslogd pulls logs from two +jails, and assigns different hostnames to each of the jails:

      + +

      The following sample is a configuration where rsyslogd reads the openssh log +messages via a separate socket, but this socket is created on a temporary file +system. As rsyslogd starts up before the sshd, it needs to create the socket +directories, because it otherwise can not open the socket and thus not listen +to openssh messages. Note that it is vital not to place any other socket between +the $InputUnixListenSocketCreatePath and the $InputUnixListenSocketHostName.

      + +

      The following sample is used to turn off input rate limiting on the system log +socket. + +

      The following sample is used activate message annotation and thus trusted properties +on the system log socket. + +

      [rsyslog.conf overview] +[manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2008-2012 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/licensing.html rsyslog-5.10.1/doc/licensing.html --- rsyslog-7.6.0/doc/licensing.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/licensing.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,72 @@ + + +rsyslog licensing + + + +

      rsyslog licensing

      +

      Most important things first: if you intend to use rsyslog inside a GPLv3 compatible project, you are free to do so. You don't even need to continue reading. +If you intend to use rsyslog inside a non-GPLv3 +compatible project, rsyslog offers you some liberties to do that, too. However, you then need +to study the licensing details in depth. +

      The project hopes this is a good compromise, which also gives a boost to fellow free +software developers who release under GPLv3. +

      And now on to the dirty and boring license details, still on a executive summary level. For the +real details, check source files and the files COPYING and COPYING.LESSER inside the distribution. +

      The rsyslog package contains several components: +

        +
      • the rsyslog core programs (like rsyslogd) +
      • plugins (like imklog, omrelp, ...) +
      • the rsyslog runtime library +
      +

      Each of these components can be thought of as individual projects. In fact, some of the +plugins have different main authors than the rest of the rsyslog package. All of these +components are currently put together into a single "rsyslog" package (tarball) for +convinience: this makes it easier to distribute a consistent version where everything +is included (and in the right versions) to build a full system. Platform package +maintainers in general take the overall package and split off the individual components, so that +users can install only what they need. In source installations, this can be done via the +proper ./configure switches. +

      However, while it is convenient to package all parts in a single tarball, it does not +imply all of them are necessarily covered by the same license. Traditionally, GPL licenses +are used for rsyslog, because the project would like to provide free software. GPLv3 has been +used since around 2008 to help fight for our freedom. All rsyslog core programs are +released under GPLv3. But, from the beginning on, plugins were separate projects and we did not +impose and license restrictions on them. So even though all plugins that currently ship with +the rsyslog package are also placed under GPLv3, this can not taken for granted. You need +to check each plugins license terms if in question - this is especially important for +plugins that do NOT ship as part of the rsyslog tarball. +

      In order to make rsyslog technology available to a broader range of applications, +the rsyslog runtime is, at least partly, licensed under LGPL. If in doubt, check the source file +licensing comments. As of now, the following files are licensed under LGPL: +

        +
      • queue.c/.h +
      • wti.c/.h +
      • wtp.c/.h +
      • vm.c/.h +
      • vmop.c/.h +
      • vmprg.c/.h +
      • vmstk.c/.h +
      • expr.c/.h +
      • sysvar.c/.h +
      • ctok.c/.h +
      • ctok_token.c/.h +
      • regexp.c/.h +
      • sync.c/.h +
      • stream.c/.h +
      • var.c/.h +
      +This list will change as time of the runtime modularization. At some point in the future, there will +be a well-designed set of files inside a runtime library branch and all of these will be LGPL. Some +select extras will probably still be covered by GPL. We are following a similar licensing +model in GnuTLS, which makes effort to reserve some functionality exclusively to open source +projects. +

      [manual index] [rsyslog site]

      +

      This documentation is part of the +rsyslog +project.
      +Copyright © 2008 by Rainer +Gerhards and +Adiscon. Last Update: 2008-04-15. +Released under the GNU GPL version 3 or higher.

      + diff -Nru rsyslog-7.6.0/doc/log_rotation_fix_size.html rsyslog-5.10.1/doc/log_rotation_fix_size.html --- rsyslog-7.6.0/doc/log_rotation_fix_size.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/log_rotation_fix_size.html 2012-09-23 10:28:22.000000000 +0000 @@ -31,7 +31,7 @@

       # start log rotation via outchannel
      -# outchannel definition
      +# outchannel definiation
       $outchannel log_rotation,/var/log/log_rotation.log, 52428800,/home/me/./log_rotation_script 
       #  activate the channel and log everything to it 
       *.* :omfile:$log_rotation
      @@ -49,13 +49,13 @@
       
       

      This moves the original log to a kind of backup log file. After the action was successfully performed rsyslog creates a new /var/log/log_rotation.log -file and fill it up with new logs. So the latest logs are always in log_rotation.log.

      +file and fill it up with new logs. So the latest logs are always in log_roatation.log.

      Conclusion

      With this approach two files for logging are used, each with a maximum size of 50 MB. So we can say we have successfully configured a log rotation which satisfies our requirement. -We keep the logs at a fixed-size level of 100 MB.

      +We keep the logs at a fixed-size level of100 MB.

      [manual index] [rsyslog.conf] [rsyslog site]

      diff -Nru rsyslog-7.6.0/doc/Makefile.am rsyslog-5.10.1/doc/Makefile.am --- rsyslog-7.6.0/doc/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -31,27 +31,10 @@ version_naming.html \ contributors.html \ dev_queue.html \ - ompipe.html \ - omfwd.html \ - omfile.html \ - omjournal.html \ - imjournal.html \ - mmanon.html \ - mmsequence.html \ - mmcount.html - mmfields.html \ - mmrfc5424addhmac.html \ - mmutf8fix.html \ - omelasticsearch.html \ - ommongodb.html \ - queue_parameters.html - mmpstrucdata.html \ - omusrmsg.html \ omstdout.html \ omudpspoof.html \ omruleset.html \ omsnmp.html \ - sigprov_gt.html \ ommysql.html \ omoracle.html \ omlibdbi.html \ @@ -74,9 +57,15 @@ tls_cert_ca.jpg \ tls_cert.jpg \ tls_cert_errmsgs.html \ + rsyslog_secure_tls.html \ + tls_cert_server.html \ + tls_cert_ca.html \ + tls_cert_summary.html \ + tls_cert_machine.html \ + tls_cert_udp_relay.html \ + tls_cert_client.html \ + tls_cert_scenario.html \ rainerscript.html \ - global.html \ - lookup_tables.html \ rscript_abnf.html \ rsconf1_actionexeconlywhenpreviousissuspended.html \ rsconf1_actionresumeinterval.html \ @@ -121,14 +110,13 @@ src/tls_cert.dia \ gssapi.html \ licensing.html \ - mmnormalize.html \ - mmjsonparse.html \ ommail.html \ omuxsock.html \ omrelp.html \ syslog_parsing.html \ troubleshoot.html \ rsyslog_conf_actions.html \ + rsyslog_conf_examples.html \ rsyslog_conf_filter.html \ rsyslog_conf_global.html \ rsyslog_conf_modules.html \ @@ -137,25 +125,6 @@ rsyslog_conf_nomatch.html \ queues_analogy.html \ multi_ruleset.html \ - multi_ruleset_legacy_format.html \ - dev_oplugins.html \ - free_support.html \ - imudp.html \ - messageparser.html \ - omhdfs.html \ - omprog.html \ - queue_msg_state.jpeg \ - rsconf1_abortonuncleanconfig.html \ - rsconf1_maxopenfiles.html \ - rsconf1_omfileforcechown.html \ - rsyslog_queue_pointers.jpeg \ - rsyslog_queue_pointers2.jpeg \ - v6compatibility.html \ - v7compatibility.html \ - rsyslog_conf_basic_structure.html \ - rsyslog_conf_sysklogd_compatibility.html \ - imkmsg.html \ - rainerscript_call.html \ src/classes.dia grfx_files = \ diff -Nru rsyslog-7.6.0/doc/Makefile.in rsyslog-5.10.1/doc/Makefile.in --- rsyslog-7.6.0/doc/Makefile.in 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/doc/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -47,11 +47,11 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ SOURCES = DIST_SOURCES = @@ -72,11 +72,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -90,56 +87,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -147,8 +118,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -168,16 +137,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -189,14 +153,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -230,6 +191,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -280,14 +242,101 @@ version_naming.html \ contributors.html \ dev_queue.html \ - ompipe.html \ - omfwd.html \ - omfile.html \ - omjournal.html \ - imjournal.html \ - mmanon.html \ - mmsequence.html \ - mmcount.html + omstdout.html \ + omudpspoof.html \ + omruleset.html \ + omsnmp.html \ + ommysql.html \ + omoracle.html \ + omlibdbi.html \ + imfile.html \ + imtcp.html \ + imptcp.html \ + impstats.html \ + imgssapi.html \ + imrelp.html \ + imsolaris.html \ + imuxsock.html \ + imklog.html \ + pmlastmsg.html \ + mmsnmptrapd.html \ + queues.html \ + src/queueWorkerLogic.dia \ + queueWorkerLogic.jpg \ + queueWorkerLogic_small.jpg \ + tls_cert_100.jpg \ + tls_cert_ca.jpg \ + tls_cert.jpg \ + tls_cert_errmsgs.html \ + rsyslog_secure_tls.html \ + tls_cert_server.html \ + tls_cert_ca.html \ + tls_cert_summary.html \ + tls_cert_machine.html \ + tls_cert_udp_relay.html \ + tls_cert_client.html \ + tls_cert_scenario.html \ + rainerscript.html \ + rscript_abnf.html \ + rsconf1_actionexeconlywhenpreviousissuspended.html \ + rsconf1_actionresumeinterval.html \ + rsconf1_allowedsender.html \ + rsconf1_controlcharacterescapeprefix.html \ + rsconf1_escape8bitcharsonreceive.html \ + rsconf1_debugprintcfsyslinehandlerlist.html \ + rsconf1_debugprintmodulelist.html \ + rsconf1_debugprinttemplatelist.html \ + rsconf1_dircreatemode.html \ + rsconf1_dirgroup.html \ + rsconf1_dirowner.html \ + rsconf1_dropmsgswithmaliciousdnsptrrecords.html \ + rsconf1_droptrailinglfonreception.html \ + rsconf1_dynafilecachesize.html \ + rsconf1_escapecontrolcharactersonreceive.html \ + rsconf1_failonchownfailure.html \ + rsconf1_filecreatemode.html \ + rsconf1_filegroup.html \ + rsconf1_fileowner.html \ + rsconf1_generateconfiggraph.html \ + rsconf1_gssforwardservicename.html \ + rsconf1_gsslistenservicename.html \ + rsconf1_gssmode.html \ + rsconf1_includeconfig.html \ + rsconf1_mainmsgqueuesize.html \ + rsconf1_markmessageperiod.html \ + rsconf1_modload.html \ + rsconf1_moddir.html \ + rsconf1_repeatedmsgreduction.html \ + rsconf1_resetconfigvariables.html \ + rsconf1_rulesetcreatemainqueue.html \ + rsconf1_umask.html \ + rsconf1_rulesetparser.html \ + v3compatibility.html \ + v4compatibility.html \ + v5compatibility.html \ + im3195.html \ + netstream.html \ + ns_gtls.html \ + ns_ptcp.html \ + src/tls_cert.dia \ + gssapi.html \ + licensing.html \ + ommail.html \ + omuxsock.html \ + omrelp.html \ + syslog_parsing.html \ + troubleshoot.html \ + rsyslog_conf_actions.html \ + rsyslog_conf_examples.html \ + rsyslog_conf_filter.html \ + rsyslog_conf_global.html \ + rsyslog_conf_modules.html \ + rsyslog_conf_output.html \ + rsyslog_conf_templates.html \ + rsyslog_conf_nomatch.html \ + queues_analogy.html \ + multi_ruleset.html \ + src/classes.dia grfx_files = \ rsyslog_confgraph_complex.png\ @@ -398,15 +447,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: @@ -497,124 +541,6 @@ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am - mmfields.html \ - mmrfc5424addhmac.html \ - mmutf8fix.html \ - omelasticsearch.html \ - ommongodb.html \ - queue_parameters.html - mmpstrucdata.html \ - omusrmsg.html \ - omstdout.html \ - omudpspoof.html \ - omruleset.html \ - omsnmp.html \ - sigprov_gt.html \ - ommysql.html \ - omoracle.html \ - omlibdbi.html \ - imfile.html \ - imtcp.html \ - imptcp.html \ - impstats.html \ - imgssapi.html \ - imrelp.html \ - imsolaris.html \ - imuxsock.html \ - imklog.html \ - pmlastmsg.html \ - mmsnmptrapd.html \ - queues.html \ - src/queueWorkerLogic.dia \ - queueWorkerLogic.jpg \ - queueWorkerLogic_small.jpg \ - tls_cert_100.jpg \ - tls_cert_ca.jpg \ - tls_cert.jpg \ - tls_cert_errmsgs.html \ - rainerscript.html \ - global.html \ - lookup_tables.html \ - rscript_abnf.html \ - rsconf1_actionexeconlywhenpreviousissuspended.html \ - rsconf1_actionresumeinterval.html \ - rsconf1_allowedsender.html \ - rsconf1_controlcharacterescapeprefix.html \ - rsconf1_escape8bitcharsonreceive.html \ - rsconf1_debugprintcfsyslinehandlerlist.html \ - rsconf1_debugprintmodulelist.html \ - rsconf1_debugprinttemplatelist.html \ - rsconf1_dircreatemode.html \ - rsconf1_dirgroup.html \ - rsconf1_dirowner.html \ - rsconf1_dropmsgswithmaliciousdnsptrrecords.html \ - rsconf1_droptrailinglfonreception.html \ - rsconf1_dynafilecachesize.html \ - rsconf1_escapecontrolcharactersonreceive.html \ - rsconf1_failonchownfailure.html \ - rsconf1_filecreatemode.html \ - rsconf1_filegroup.html \ - rsconf1_fileowner.html \ - rsconf1_generateconfiggraph.html \ - rsconf1_gssforwardservicename.html \ - rsconf1_gsslistenservicename.html \ - rsconf1_gssmode.html \ - rsconf1_includeconfig.html \ - rsconf1_mainmsgqueuesize.html \ - rsconf1_markmessageperiod.html \ - rsconf1_modload.html \ - rsconf1_moddir.html \ - rsconf1_repeatedmsgreduction.html \ - rsconf1_resetconfigvariables.html \ - rsconf1_rulesetcreatemainqueue.html \ - rsconf1_umask.html \ - rsconf1_rulesetparser.html \ - v3compatibility.html \ - v4compatibility.html \ - v5compatibility.html \ - im3195.html \ - netstream.html \ - ns_gtls.html \ - ns_ptcp.html \ - src/tls_cert.dia \ - gssapi.html \ - licensing.html \ - mmnormalize.html \ - mmjsonparse.html \ - ommail.html \ - omuxsock.html \ - omrelp.html \ - syslog_parsing.html \ - troubleshoot.html \ - rsyslog_conf_actions.html \ - rsyslog_conf_filter.html \ - rsyslog_conf_global.html \ - rsyslog_conf_modules.html \ - rsyslog_conf_output.html \ - rsyslog_conf_templates.html \ - rsyslog_conf_nomatch.html \ - queues_analogy.html \ - multi_ruleset.html \ - multi_ruleset_legacy_format.html \ - dev_oplugins.html \ - free_support.html \ - imudp.html \ - messageparser.html \ - omhdfs.html \ - omprog.html \ - queue_msg_state.jpeg \ - rsconf1_abortonuncleanconfig.html \ - rsconf1_maxopenfiles.html \ - rsconf1_omfileforcechown.html \ - rsyslog_queue_pointers.jpeg \ - rsyslog_queue_pointers2.jpeg \ - v6compatibility.html \ - v7compatibility.html \ - rsyslog_conf_basic_structure.html \ - rsyslog_conf_sysklogd_compatibility.html \ - imkmsg.html \ - rainerscript_call.html \ - src/classes.dia # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru rsyslog-7.6.0/doc/manual.html rsyslog-5.10.1/doc/manual.html --- rsyslog-7.6.0/doc/manual.html 2014-02-12 12:02:15.000000000 +0000 +++ rsyslog-5.10.1/doc/manual.html 2012-10-17 14:42:11.000000000 +0000 @@ -13,13 +13,13 @@ replacement. Its advanced features make it suitable for enterprise-class, encryption protected syslog relay chains while at the same time being very easy to setup for the -novice user. And as we know what enterprise users really need, there are -also rsyslog -professional services available directly from the source!

      +novice user. And as we know what enterprise users really need, there is +also professional +rsyslog support available directly from the source!

      Please visit the rsyslog sponsor's page to honor the project sponsors or become one yourself! We are very grateful for any help towards the project goals.

      -

      This documentation is for version 7.6.0 (v7.6-stable branch) of rsyslog. +

      This documentation is for version 5.10.1 (stable branch) of rsyslog. Visit the rsyslog status page to obtain current version information and project status.

      If you like rsyslog, you might @@ -30,19 +30,15 @@

      If you are upgrading from rsyslog v2 or stock sysklogd, be sure to read the rsyslog v3 compatibility notes, and if you are upgrading from v3, read the -rsyslog v4 compatibility notes, +rsyslog v4 compatibility notes and if you upgrade from v4, read the -rsyslog v5 compatibility notes, and -if you upgrade from v5, read the -rsyslog v6 compatibility notes. -if you upgrade from v6, read the -rsyslog v7 compatibility notes. +rsyslog v5 compatibility notes.

      Rsyslog will work even if you do not read the doc, but doing so will definitely improve your experience.

      Follow the links below for the

      • troubleshooting rsyslog problems
      • -
      • configuration file format (rsyslog.conf)
      • +
      • configuration file syntax (rsyslog.conf)
      • a regular expression checker/generator tool for rsyslog
      • property replacer, an important core component
      • rsyslog bug list
      • @@ -58,7 +54,7 @@
      • installing rsyslog
      • obtaining rsyslog from the source repository
      • rsyslog and IPv6 (which is fully supported)
      • -
      • native TLS encryption for syslog
      • +
      • native TLS encryption for syslog
      • using multiple rule sets in rsyslog
      • ssl-encrypting syslog with stunnel
      • writing syslog messages to MySQL (and other databases as well)
      • diff -Nru rsyslog-7.6.0/doc/mmanon.html rsyslog-5.10.1/doc/mmanon.html --- rsyslog-7.6.0/doc/mmanon.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/mmanon.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ - - - -IP Address Anonimization Module (mmanon) - - -back - -

        IP Address Anonimization Module (mmanon)

        -

        Module Name:    mmanon

        -

        Author: Rainer Gerhards <rgerhards@adiscon.com>

        -

        Available since: 7.3.7

        -

        Description:

        -

        The mmanon module permits to anonymize IP addresses. It is a message -modification module that actually changes the IP address inside the message, -so after calling mmanon, the original message can no longer be obtained. -Note that anonymization will break digital signatures on the message, if -they exist. -

        How are IP-Addresses defined? -

        We assume that an IP address consists of four octets in dotted notation, -where each of the octets has a value between 0 and 255, inclusively. -

         

        - -

        Module Configuration Parameters:

        -

        Currently none. -

         

        -

        Action Confguration Parameters:

        -
          -
        • mode - default "rewrite"
          -There exists the "simple" and "rewrite" mode. In simple mode, only octets -as whole can be anonymized and the length of the message is never changed. -This means that when the last three octets of the address 10.1.12.123 are -anonymized, the result will be 10.0.00.000. This means that the length of the -original octets is still visible and may be used to draw some privacy-evasive -conclusions. This mode is slightly faster than "overwrite" mode, and this -may matter in high throughput environments.
          -The default "rewrite" mode will do full anonymization of any number of bits -and it will also normlize the address, so that no information about the -original IP address is available. So in the above example, 10.1.12.123 would -be anonymized to 10.0.0.0. -
        • ipv4.bits - default 16
          -This set the number of bits that should be anonymized (bits are from the -right, so lower bits are anonymized first). This setting permits to save -network information while still anonymizing user-specific data. The more -bits you discard, the better the anonymization obviously is. The default -of 16 bits reflects what German data privacy rules consider as being -sufficinetly anonymized. We assume, this can also be used as a rough -but conservative guideline for other countries.
          -Note: when in simple mode, only bits on a byte boundary can be specified. -As such, any value other than 8, 16, 24 or 32 is invalid. If an invalid -value is given, it is rounded to the next byte boundary (so we favor stronger -anonymization in that case). For example, a bit value of 12 will become 16 in -simple mode (an error message is also emitted). -
        • replacementChar - default "x"
          -In simple mode, this sets the character -that the to-be-anonymized part of the IP address is to be overwritten -with. In rewrite mode, this parameter is not permitted, as in -this case we need not necessarily rewrite full octets. As such, the anonymized -part is always zero-filled and replacementChar is of no use. If it is -specified, an error message is emitted and the parameter ignored. -
        - -

        See Also -

        - - -

        Caveats/Known Bugs: -

          -
        • only IPv4 is supported -
        - -

        Samples:

        -

        In this snippet, we write one file without anonymization and another one -with the message anonymized. Note that once mmanon has run, access to the -original message is no longer possible (execept if stored in user -variables before anonymization). -

        - -

        This next snippet is almost identical to the first one, but -here we anonymize the full IPv4 address. Note that by -modifying the number of bits, you can anonymize different parts -of the address. Keep in mind that in simple mode (used here), the bit values -must match IP address bytes, so for IPv4 only the values 8, 16, 24 and -32 are valid. Also, in this example the replacement is done -via asterisks instead of lower-case "x"-letters. Also keep in mind that -"replacementChar" can only be set in simple mode. -

        - -

        The next snippet is also based on the first one, but anonimzes an -"odd" number of bits, 12. The value of 12 is used by some folks as a -compromise between keeping privacy and still permiting to gain some -more in-depth insight from log files. Note that anonymizing 12 bits -may be insufficient to fulfill legal requirements (if such exist). -

        - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/mmcount.html rsyslog-5.10.1/doc/mmcount.html --- rsyslog-7.6.0/doc/mmcount.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/mmcount.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ - - - -mmcount - - -back - -

        mmcount

        -

        Module Name:    mmcount

        -

        Author: Bala.FA <barumuga@redhat.com>

        -

        Status: Non project-supported module - contact author -or rsyslog mailing list for questions -

        Available since: 7.5.0

        -

        Description:

        -

        -

        -    mmcount: message modification plugin which counts messages
        -    
        -    This module provides the capability to count log messages by severity
        -    or json property of given app-name.  The count value is added into the
        -    log message as json property named 'mmcount'
        -    
        -    Example usage of the module in the configuration file
        -    
        -     module(load="mmcount")
        -    
        -     # count each severity of appname gluster
        -     action(type="mmcount" appname="gluster")
        -    
        -     # count each value of gf_code of appname gluster
        -     action(type="mmcount" appname="glusterd" key="!gf_code")
        -    
        -     # count value 9999 of gf_code of appname gluster
        -     action(type="mmcount" appname="glusterfsd" key="!gf_code" value="9999")
        -    
        -     # send email for every 50th mmcount
        -     if $app-name == 'glusterfsd' and $!mmcount <> 0 and $!mmcount % 50 == 0 then {
        -        $ActionMailSMTPServer smtp.example.com
        -        $ActionMailFrom rsyslog@example.com
        -        $ActionMailTo glusteradmin@example.com
        -        $template mailSubject,"50th message of gf_code=9999 on %hostname%"
        -        $template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"
        -        $ActionMailSubject mailSubject
        -        $ActionExecOnlyOnceEveryInterval 30
        -        :ommail:;RSYSLOG_SyslogProtocol23Format
        -     }
        -
        - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/mmsequence.html rsyslog-5.10.1/doc/mmsequence.html --- rsyslog-7.6.0/doc/mmsequence.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/mmsequence.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ - - - -mmsequence - - -back - -

        Number generator and counter module (mmsequence)

        -

        Module Name:    mmsequence

        -

        Author: Pavel Levshin <pavel@levshin.spb.ru>

        -

        Status: Non project-supported module - contact author -or rsyslog mailing list for questions

        -

        Available since: 7.5.6

        -

        Description:

        -

        This module generates numeric sequences of different kinds. It can be used -to count messages up to a limit and to number them. It can generate random -numbers in a given range.

        - -

        This module is implemented via the output module interface, so it is -called just as an action. The number generated is stored in a variable.

        -

         

        -

        Action Parameters:

        -
          -
        • mode "random" or "instance" or "key" -

          Specifies mode of the action. In "random" mode, the module - generates uniformly distributed integer numbers in a range defined - by "from" and "to".

          - -

          In "instance" mode, which is default, the action produces a counter - in range [from, to). This counter is specific to this action instance.

          - -

          In "key" mode, the counter can be shared between multiple instances. - This counter is identified by a name, which is defined with "key" - parameter.

          -
        • -
        • from [non-negative integer], default "0" -

          Starting value for counters and lower margin for random generator.

          -
        • -
        • to [positive integer], default "INT_MAX" -

          Upper margin for all sequences. Note that this margin is not - inclusive. When next value for a counter is equal or greater than - this parameter, the counter resets to the starting value.

          -
        • -
        • step [non-negative integer], default "1" -

          Increment for counters. If step is "0", it can be used to fetch - current value without modification. The latter not applies to - "random" mode. This is useful in "key" mode or to get constant - values in "instance" mode.

          -
        • -
        • key [word], default "" -

          Name of the global counter which is used in this action.

          -
        • -
        • var [word], default "$!mmsequence" -

          Name of the variable where the number will be stored. - Should start with "$".

          -
        • -
        - - -

        Sample:

        -
        -# load balance
        -Ruleset(
        -    name="logd"
        -    queue.workerthreads="5"
        -    ){
        -
        -    Action(
        -        type="mmsequence"
        -        mode="instance"
        -        from="0"
        -        to="2"
        -        var="$.seq"
        -    )
        -
        -    if $.seq == "0" then {
        -        Action(
        -            type="mmnormalize"
        -            userawmsg="on"
        -            rulebase="/etc/rsyslog.d/rules.rb"
        -        )
        -    } else {
        -        Action(
        -            type="mmnormalize"
        -            userawmsg="on"
        -            rulebase="/etc/rsyslog.d/rules.rb"
        -        )
        -    }
        -
        -    # output logic here
        -}
        -    # generate random numbers
        -    action(
        -        type="mmsequence"
        -        mode="random"
        -        to="100"
        -        var="$!rndz"
        -    )
        -    # count from 0 to 99
        -    action(
        -        type="mmsequence"
        -        mode="instance"
        -        to="100"
        -        var="$!cnt1"
        -    )
        -    # the same as before but the counter is global
        -    action(
        -        type="mmsequence"
        -        mode="key"
        -        key="key1"
        -        to="100"
        -        var="$!cnt2"
        -    )
        -    # count specific messages but place the counter in every message
        -    if $msg contains "txt" then
        -        action(
        -            type="mmsequence"
        -            mode="key"
        -            to="100"
        -            var="$!cnt3"
        -        )
        -    else
        -        action(
        -            type="mmsequence"
        -            mode="key"
        -            to="100"
        -            step="0"
        -            var="$!cnt3"
        -            key=""
        -        )
        -
        - - -

        Legacy Configuration Directives:

        - -

        Not supported.

        - - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/mmsnmptrapd.html rsyslog-5.10.1/doc/mmsnmptrapd.html --- rsyslog-7.6.0/doc/mmsnmptrapd.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/mmsnmptrapd.html 2012-10-15 13:45:04.000000000 +0000 @@ -0,0 +1,95 @@ + + + + +mmsnmptrapd message modification module + + + +back to rsyslog module overview + +

        mmsnmptrapd message modification module

        +

        Module Name:    imtcp

        +

        Author: Rainer Gerhards <rgerhards@adiscon.com> (custom-created)

        +

        Multi-Ruleset Support: since 5.8.1 +

        Description:

        +

        This module uses a specific configuration of snmptrapd's tag values to +obtain information of the original source system and the severity present inside the +original SNMP trap. It then replaces these fields inside the syslog message. +

        Let's look at an example. Essentially, SNMPTT will invoke something like this: +

        logger -t snmptrapd/warning/realhost Host 003c.abcd.ffff in vlan 17 is flapping between port Gi4/1 and port Gi3/2 
        +
        +

        +This message modification module will change the tag (removing the additional information), +hostname and severity (not shown in example), so the log entry will look as follows: +

        +2011-04-21T16:43:09.101633+02:00 realhost snmptrapd: Host 003c.abcd.ffff in vlan 122 is flapping between port Gi4/1 and port Gi3/2 
        +
        +The following logic is applied to all message being processed: +
          +
        1. The module checks incoming syslog entries. If their TAG field starts with "snmptrapd/" +(configurable), they are modified, otherwise not. If the are modified, this happens as follows: +
        2. It will derive the hostname from the tag field which has format snmptrapd/severity/hostname +
        3. It should derive the severity from the tag field which has format +snmptrapd/severity/hostname. A configurable mapping table will be used to drive a new +severity value from that severity string. If no mapping has been defined, the original +severity is not changed. +
        4. It replaces the "FromHost" value with the derived value from step2 +
        5. It replaces the "Severity" value with the derived value from step 3 +
        +

        Note that the placement of this module inside the configuration is important. All actions +before this modules is called will work on the unmodified message. All messages after it's call +will work on the modified message. Please also note that there is some extra power in case it +is required: as this module is implemented via the output module interface, a filter +can be used (actually must be used) in order to tell when it is called. Usually, the catch-all +filter (*.*) is used, but more specific filters are fully supported. So it is possible to define +different parameters for this module depending on different filters. It is also possible to +just run messages from one remote system through this module, with the help of filters or +multiple rulesets and ruleset bindings. In short words, all capabilities rsyslog offers +to control output modules are also available to mmsnmptrapd. +

        Configuration Directives:

        +
          +
        • $mmsnmptrapdTag [tagname]
          +tells the module which start string inside the tag to look for. The default is +"snmptrapd". Note that a slash is automatically added to this tag when it comes to +matching incoming messages. It MUST not be given, except if two slashes are required +for whatever reasons (so "tag/" results in a check for "tag//" at the start of +the tag field). +
        • $mmsnmptrapdSeverityMapping [severtiymap]
          +This specifies the severity mapping table. It needs to be specified as a list. Note that +due to the current config system no whitespace is supported inside the list, so be +sure not to use any whitespace inside it.
          +The list is constructed of Severtiy-Name/Severity-Value pairs, delimited by comma. +Severity-Name is a case-sensitive string, e.g. "warning" and an associated +numerical value (e.g. 4). +Possible values are in the rage 0..7 and are defined in RFC5424, table 2. The +given sample would be specified as "warning/4".
          +If multiple instances of mmsnmptrapd are used, each instance uses the most recently +defined $mmsnmptrapdSeverityMapping before itself. +
        +Caveats/Known Bugs: +
          +
        • currently none known
        • +
        +

        Example:

        +

        This enables to rewrite messages from snmptrapd and configures error and warning +severities. The default tag is used.
        +

        + +

        +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the rsyslog +project.
        +Copyright © 2011 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/modules.html rsyslog-5.10.1/doc/modules.html --- rsyslog-7.6.0/doc/modules.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/modules.html 2012-01-24 16:37:09.000000000 +0000 @@ -70,7 +70,7 @@ job of the output module developer.

        Action Selectors

        Modules (and rsyslog) need to know when they are called. For this, there must -be an action identification in selector lines. There are two syntaxes: the +a an action identification in selector lines. There are two syntaxes: the single-character syntax, where a single characters identifies a module (e.g. "*" for a wall message) and the modules designator syntax, where the module name is given between colons (e.g. ":ommysql:"). The single character syntax is diff -Nru rsyslog-7.6.0/doc/multi_ruleset.html rsyslog-5.10.1/doc/multi_ruleset.html --- rsyslog-7.6.0/doc/multi_ruleset.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/multi_ruleset.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,302 @@ + + +Multiple Rulesets in rsyslog + +

        Multiple Rulesets in rsyslog

        +

        Starting with version 4.5.0 and 5.1.1, rsyslog supports +multiple rulesets within a single configuration. +This is especially useful for routing the recpetion of remote messages to a set of specific rules. +Note that the input module must support binding to non-standard rulesets, so the functionality +may not be available with all inputs. +

        In this document, I am using imtcp, an input module +that supports binding to non-standard rulesets since rsyslog started to support them. +

        What is a Ruleset?

        +If you have worked with (r)syslog.conf, you know that it is made up of what I call rules (others +tend to call them selectors, a sysklogd term). Each rule consist of a filter and one or more +actions to be carried out when the filter evaluates to true. A filter may be as simple as a +traditional +syslog priority based filter (like "*.*" or "mail.info" or a as complex as a +script-like expression. Details on that are covered in the config file documentation. After the +filter come action specifiers, and an action is something that does something to a message, e.g. +write it to a file or forward it to a remote logging server. + +

        A traditional configuration file is made up of one or more of these rules. When a new +message arrives, its processing starts with the first rule (in order of appearance in +rsyslog.conf) and continues for each rule until either all rules have been processed or +a so-called "discard" action happens, in which case processing stops and the +message is thrown away (what also happens after the last rule has been processed). + +

        The multi-ruleset support now permits to specify more than one such rule sequence. +You can think of a traditional config file just as a single default rule set, which is +automatically bound to each of the inputs. This is even what actually happens. When +rsyslog.conf is processed, the config file parser looks for the directive + +

        $RuleSet <name>
        +
        + +

        Where name is any name the user likes (but must not start with "RSYSLOG_", which +is the name space reserved for rsyslog use). If it finds this directive, it begins a new +rule set (if the name was not yet know) or switches to an already-existing one (if the name +was known). All rules defined between this $RuleSet directive and the next one are appended +to the named ruleset. Note that the reserved name "RSYSLOG_DefaultRuleset" is used to +specify rsyslogd's default ruleset. You can use that name whereever you can use a ruleset name, +including when binding an input to it. + +

        Inside a ruleset, messages are processed as described above: they start with the first rule +and rules are processed in the order of appearance of the configuration file until either +there are no more rules or the discard action is executed. Note that with multiple rulesets +no longer all rsyslog.conf rules are executed but only those that are +contained within the specific ruleset. + +

        Inputs must explicitely bind to rulesets. If they don't do, the default ruleset is bound. + +

        This brings up the next question: + +

        What does "To bind to a Ruleset" mean?

        +

        This term is used in the same sense as "to bind an IP address to an interface": +it means that a specific input, or part of an input (like a tcp listener) will use a specific +ruleset to "pass its messages to". So when a new message arrives, it will be processed +via the bound ruleset. Rule from all other rulesets are irrelevant and will never be processed. +

        This makes multiple rulesets very handy to process local and remote message via +seperate means: bind the respective receivers to different rule sets, and you do not need +to seperate the messages by any other method. + +

        Binding to rulesets is input-specifc. For imtcp, this is done via the + +

        $InputTCPServerBindRuleset <name>
        +
        + +directive. Note that "name" must be the name of a ruleset that is already defined +at the time the bind directive is given. There are many ways to make sure this happens, but +I personally think that it is best to define all rule sets at the top of rsyslog.conf and +define the inputs at the bottom. This kind of reverses the traditional recommended ordering, but +seems to be a really useful and straightforward way of doing things. +

        Why are rulesets important for different parser configurations?

        +

        Custom message parsers, used to handle differnet (and potentially otherwise-invalid) +message formats, can be bound to rulesets. So multiple rulesets can be a very useful +way to handle devices sending messages in different malformed formats in a consistent +way. Unfortunately, this is not uncommon in the syslog world. An in-depth explanation +with configuration sample can be found at the +$RulesetParser configuration directive. +

        Can I use a different Ruleset as the default?

        +

        This is possible by using the + +

        $DefaultRuleset <name>
        +
        + +Directive. Please note, however, that this directive is actually global: that is, it does not +modify the ruleset to which the next input is bound but rather provides a system-wide +default rule set for those inputs that did not explicitly bind to one. As such, the directive +can not be used as a work-around to bind inputs to non-default rulesets that do not support +ruleset binding. +

        Examples

        +

        Split local and remote logging

        +

        Let's say you have a pretty standard system that logs its local messages to the usual +bunch of files that are specified in the default rsyslog.conf. As an example, your rsyslog.conf +might look like this: + +

        +# ... module loading ...
        +# The authpriv file has restricted access.
        +authpriv.*  /var/log/secure
        +# Log all the mail messages in one place.
        +mail.*      /var/log/maillog
        +# Log cron stuff
        +cron.*      /var/log/cron
        +# Everybody gets emergency messages
        +*.emerg     *
        +... more ...
        +
        + +

        Now, you want to add receive messages from a remote system and log these to +a special file, but you do not want to have these messages written to the files +specified above. The traditional approach is to add a rule in front of all others that +filters on the message, processes it and then discards it: + +

        +# ... module loading ...
        +# process remote messages
        +:fromhost-ip, isequal, "192.0.2.1"    /var/log/remotefile
        +& ~
        +# only messages not from 192.0.21 make it past this point
        +
        +# The authpriv file has restricted access.
        +authpriv.*                            /var/log/secure
        +# Log all the mail messages in one place.
        +mail.*                                /var/log/maillog
        +# Log cron stuff
        +cron.*                                /var/log/cron
        +# Everybody gets emergency messages
        +*.emerg                               *
        +... more ...
        +
        + +

        Note the tilde character, which is the discard action!. Also note that we assume that +192.0.2.1 is the sole remote sender (to keep it simple). + +

        With multiple rulesets, we can simply define a dedicated ruleset for the remote reception +case and bind it to the receiver. This may be written as follows: + +

        +# ... module loading ...
        +# process remote messages
        +# define new ruleset and add rules to it:
        +$RuleSet remote
        +*.*           /var/log/remotefile
        +# only messages not from 192.0.21 make it past this point
        +
        +# bind ruleset to tcp listener
        +$InputTCPServerBindRuleset remote
        +# and activate it:
        +$InputTCPServerRun 10514
        +
        +# switch back to the default ruleset:
        +$RuleSet RSYSLOG_DefaultRuleset
        +# The authpriv file has restricted access.
        +authpriv.*    /var/log/secure
        +# Log all the mail messages in one place.
        +mail.*        /var/log/maillog
        +# Log cron stuff
        +cron.*        /var/log/cron
        +# Everybody gets emergency messages
        +*.emerg       *
        +... more ...
        +
        + +

        Here, we need to switch back to the default ruleset after we have defined our custom +one. This is why I recommend a different ordering, which I find more intuitive. The sample +below has it, and it leads to the same results: + +

        +# ... module loading ...
        +# at first, this is a copy of the unmodified rsyslog.conf
        +# The authpriv file has restricted access.
        +authpriv.*    /var/log/secure
        +# Log all the mail messages in one place.
        +mail.*        /var/log/maillog
        +# Log cron stuff
        +cron.*        /var/log/cron
        +# Everybody gets emergency messages
        +*.emerg       *
        +... more ...
        +# end of the "regular" rsyslog.conf. Now come the new definitions:
        +
        +# process remote messages
        +# define new ruleset and add rules to it:
        +$RuleSet remote
        +*.*           /var/log/remotefile
        +
        +# bind ruleset to tcp listener
        +$InputTCPServerBindRuleset remote
        +# and activate it:
        +$InputTCPServerRun 10514
        +
        + +

        Here, we do not switch back to the default ruleset, because this is not needed as it is +completely defined when we begin the "remote" ruleset. + +

        Now look at the examples and compare them to the single-ruleset solution. You will notice +that we do not need a real filter in the multi-ruleset case: we can simply use +"*.*" as all messages now means all messages that are being processed by this +rule set and all of them come in via the TCP receiver! This is what makes using multiple +rulesets so much easier. + +

        Split local and remote logging for three different ports

        +

        This example is almost like the first one, but it extends it a little bit. While it is +very similar, I hope it is different enough to provide a useful example why you may want +to have more than two rulesets. + +

        Again, we would like to use the "regular" log files for local logging, only. But +this time we set up three syslog/tcp listeners, each one listening to a different +port (in this example 10514, 10515, and 10516). Logs received from these receivers shall go into +different files. Also, logs received from 10516 (and only from that port!) with +"mail.*" priority, shall be written into a specif file and not be +written to 10516's general log file. + +

        This is the config: + +

        +# ... module loading ...
        +# at first, this is a copy of the unmodified rsyslog.conf
        +# The authpriv file has restricted access.
        +authpriv.* /var/log/secure
        +# Log all the mail messages in one place.
        +mail.*  /var/log/maillog
        +# Log cron stuff
        +cron.*  /var/log/cron
        +# Everybody gets emergency messages
        +*.emerg       *
        +... more ...
        +# end of the "regular" rsyslog.conf. Now come the new definitions:
        +
        +# process remote messages
        +
        +#define rulesets first
        +$RuleSet remote10514
        +*.*     /var/log/remote10514
        +
        +$RuleSet remote10515
        +*.*     /var/log/remote10515
        +
        +$RuleSet remote10516
        +mail.*	/var/log/mail10516
        +&       ~
        +# note that the discard-action will prevent this messag from 
        +# being written to the remote10516 file - as usual...
        +*.*     /var/log/remote10516
        +
        +# and now define listners bound to the relevant ruleset
        +$InputTCPServerBindRuleset remote10514
        +$InputTCPServerRun 10514
        +
        +$InputTCPServerBindRuleset remote10515
        +$InputTCPServerRun 10515
        +
        +$InputTCPServerBindRuleset remote10516
        +$InputTCPServerRun 10516
        +
        + +

        Note that the "mail.*" rule inside the "remote10516" ruleset does +not affect processing inside any other rule set, including the default rule set. + + +

        Performance

        +

        Fewer Filters

        +

        No rule processing can be faster than not processing a rule at all. As such, it is useful +for a high performance system to identify disjunct actions and try to split these off to +different rule sets. In the example section, we had a case where three different tcp listeners +need to write to three different files. This is a perfect example of where multiple rule sets +are easier to use and offer more performance. The performance is better simply because there +is no need to check the reception service - instead messages are automatically pushed to the +right rule set and can be processed by very simple rules (maybe even with +"*.*"-filters, the fastest ones available). + +

        Partitioning of Input Data

        +

        Starting with rsyslog 5.3.4, rulesets permit higher concurrency. They offer the ability +to run on their own "main" queue. What that means is that a own queue is associated +with a specific rule set. That means that inputs bound to that ruleset do no longer need +to compete with each other when they enqueue a data element into the queue. Instead, enqueue +operations can be completed in parallel. +

        An example: let us assume we have three TCP listeners. Without rulesets, each of them +needs to insert messages into the main message queue. So if each of them wants to +submit a newly arrived message into the queue at the same time, only one can do so +while the others need to wait. With multiple rulesets, its own queue can be created for each +ruleset. If now each listener is bound to its own ruleset, concurrent message submission is +possible. On a machine with a sufficiently large number of corse, this can result in +dramatic performance improvement. +

        It is highly advised that high-performance systems define a dedicated ruleset, with a +dedicated queue for each of the inputs. +

        By default, rulesets do not have their own queue. It must be activated via the +$RulesetCreateMainQueue directive. + +

        Future Enhancements

        +

        In the long term, multiple rule sets will probably lay the foundation for even better +optimizations. So it is not a bad idea to get aquainted with them. + +

        [manual index] [rsyslog site]

        +

        This documentation is part of the rsyslog +project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/netstream.html rsyslog-5.10.1/doc/netstream.html --- rsyslog-7.6.0/doc/netstream.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/netstream.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,23 @@ + +Network Stream Drivers + + + +back + +

        Network Stream Drivers

        Network stream drivers are a layer +between various parts of rsyslogd (e.g. the imtcp module) and the +transport layer. They provide sequenced delivery, authentication and +confidentiality to the upper layers. Drivers implement different +capabilities.

        Users need to know about netstream drivers because +they need to configure the proper driver, and proper driver properties, +to achieve desired results (e.g. a TLS-protected syslog transmission).

        The following drivers exist:

        • ptcp - the plain tcp network transport (no security)
        • gtls - a secure TLS transport implemented via the GnuTLS library
        [rsyslog.conf overview] +[manual index] [rsyslog site] +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/ns_gtls.html rsyslog-5.10.1/doc/ns_gtls.html --- rsyslog-7.6.0/doc/ns_gtls.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/ns_gtls.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,59 @@ + +gtls Network Stream Driver + + + +

        gtls Network Stream Driver

        +

        This network stream +driver implements a TLS protected transport via the GnuTLS +library.

        +

        Available since: 3.19.0 (suggested minimum 3.19.8 and above)

        +

        Supported Driver Modes

        +
          +
        • 0 - unencrypted trasmission (just like ptcp driver)
        • +
        • 1 - TLS-protected operation
        • +
        +Note: mode 0 does not provide any benefit over the ptcp driver. This +mode exists for technical reasons, but should not be used. It may be +removed in the future.
        +Supported Authentication +Modes
        +
          +
        • anon +- anonymous authentication as +described in IETF's draft-ietf-syslog-transport-tls-12 Internet draft
        • +
        • x509/fingerprint +- certificate fingerprint authentication as +described in IETF's draft-ietf-syslog-transport-tls-12 Internet draft
        • +
        • x509/certvalid +- certificate validation only
        • +
        • x509/name +- certificate validation and subject name authentication as +described in IETF's draft-ietf-syslog-transport-tls-12 Internet draft +
        • +
        +Note: "anon" does not permit to authenticate the remote peer. As such, +this mode is vulnerable to man in the middle attacks as well as +unauthorized access. It is recommended NOT to use this mode.

        +

        x509/certvalid is a nonstandard mode. It validates the remote +peers certificate, but does not check the subject name. This is +weak authentication that may be useful in scenarios where multiple +devices are deployed and it is sufficient proof of authenticy when +their certificates are signed by the CA the server trusts. This is +better than anon authentication, but still not recommended. +Known Problems
        +

        Even in x509/fingerprint mode, both the client and sever +certificate currently must be signed by the same root CA. This is an +artifact of the underlying GnuTLS library and the way we use it. It is +expected that we can resolve this issue in the future.

        +

        [rsyslog.conf overview] +[manual index] [rsyslog site] +

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/ns_ptcp.html rsyslog-5.10.1/doc/ns_ptcp.html --- rsyslog-7.6.0/doc/ns_ptcp.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/ns_ptcp.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,16 @@ + +ptcp Network Stream Driver + + + +

        ptcp Network Stream Driver

        +

        This network stream driver implement a plain tcp transport without security properties.

        Supported Driver Modes

        • 0 - unencrypted trasmission
        Supported Authentication Modes
        • "anon" - no authentication
        [rsyslog.conf overview] +[manual index] [rsyslog site] +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + \ No newline at end of file diff -Nru rsyslog-7.6.0/doc/omfile.html rsyslog-5.10.1/doc/omfile.html --- rsyslog-7.6.0/doc/omfile.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/omfile.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,239 +0,0 @@ - - - -File Output Module - - -back - -

        File Output Module

        -

        Module Name:    omfile

        -

        Author: Rainer Gerhards <rgergards@adiscon.com>

        -

        Description:

        -

        The omfile plug-in provides the core functionality of writing messages to files residing inside the local file system (which may actually be remote if methods like NFS are used). Both files named with static names as well files with names based on message content are supported by this module. It is a built-in module that does not need to be loaded.

        - -

        Module Parameters:

        -
          -
        • Template [templateName]
          - Set the default template to be used if an action is not - configured to use a specific template.
        • - -
        • DirCreateMode [default 0700]
          - Sets the default DirCreateMode to be used for an action - if no explicit one is specified.
          - -
        • FileCreateMode [default 0644]
          - Sets the default DirCreateMode to be used for an action - if no explicit one is specified.
          -
        -

         

        -

        Action Parameters:

        -
          -
        • Template [templateName]
          - Sets the template to be used for this action. If not specified, the - default template is applied.

        • - -
        • DynaFileCacheSize (not mandatory, default 10)
          - Applies only if dynamic filenames are used.
          - Specifies the number of DynaFiles that will be kept open. The default is - 10. Note that this is a per-action value, so if you have multiple - dynafile actions, each of them have their individual caches (which means - the numbers sum up). Ideally, the cache size exactly matches the - need. You can use impstats to tune this - value. Note that a too-low cache size can be a very considerable - performance bottleneck.

        • - -
        • ZipLevel 0..9 [default 0]
          - if greater 0, turns on gzip compression of the output file. The higher the number, the better the compression, but also the more CPU is required for zipping.

        • - -
        • VeryRobustZip [on/off] (v7.3.0+) - if ZipLevel is greater 0, - then this setting controls if extra headers are written to make the resulting file - extra hardened against malfunction. If set to off, data appended to previously unclean - closed files may not be accessible without extra tools. - Note that this risk is usually expected to be bearable, and thus "off" is the default mode. - The extra headers considerably - degrade compression, files with this option set to "on" may be four to five times as - large as files processed in "off" mode. -

        • - -
        • FlushInterval (not mandatory, default will be used)
          - Defines, in seconds, the interval after which unwritten data is - flushed.

        • - -
        • ASyncWriting on/off [default off]
          - if turned on, the files will be written in asynchronous mode via a separate thread. In that case, double buffers will be used so that one buffer can be filled while the other buffer is being written. Note that in order to enable FlushInterval, AsyncWriting must be set to "on". Otherwise, the flush interval will be ignored. Also note that when FlushOnTXEnd is "on" but AsyncWriting is off, output will only be written when the buffer is full. This may take several hours, or even require a rsyslog shutdown. However, a buffer flush can be forced in that case by sending rsyslogd a HUP signal.

        • - -
        • FlushOnTXEnd on/off [default on]
          - Omfile has the capability to write output using a buffered writer. Disk writes are only done when the buffer is full. So if an error happens during that write, data is potentially lost. In cases where this is unacceptable, set FlushOnTXEnd to on. Then, data is written at the end of each transaction (for pre-v5 this means after each log message) and the usual error recovery thus can handle write errors without data loss. Note that this option severely reduces the effect of zip compression and should be switched to off for that use case. Note that the default -on- is primarily an aid to preserve the traditional syslogd behaviour.

        • - -
        • IOBufferSize <size_nbr>, default 4k
          - size of the buffer used to writing output data. The larger the buffer, the potentially better performance is. The default of 4k is quite conservative, it is useful to go up to 64k, and 128K if you used gzip compression (then, even higher sizes may make sense)

        • - -
        • DirOwner
          - Set the file owner for directories newly created. Please note that this setting does not affect the owner of directories already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        • - -
        • DirOwnerNum available in 7.5.8+ and 8.1.4+
          - Set the file owner for directories newly created. Please note that this setting does not affect the owner of directories already existing. The parameter is a numerical ID, which is used regardless of whether the user actually exists. This can be useful if the user mapping is not available to rsyslog during startup.

        • - -
        • DirGroup
          - Set the group for directories newly created. Please note that this setting does not affect the group of directories already existing. The parameter is a group name, for which the groupid is obtained by rsyslogd on during startup processing. Interim changes to the user mapping are not detected.

        • - -
        • DirGroupNum
          - Set the group for directories newly created. Please note that this setting does not affect the group of directories already existing. The parameter is a numerical ID, which is used regardless of whether the group actually exists. This can be useful if the group mapping is not available to rsyslog during startup.

        • - -
        • FileOwner
          - Set the file owner for files newly created. Please note that this setting does not affect the owner of files already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        • - -
        • FileOwnerNum available in 7.5.8+ and 8.1.4+
          - Set the file owner for files newly created. Please note that this setting does not affect the owner of files already existing. The parameter is a numerical ID, which which is used regardless of whether the user actually exists. This can be useful if the user mapping is not available to rsyslog during startup.

        • - -
        • FileGroup
          - Set the group for files newly created. Please note that this setting does not affect the group of files already existing. The parameter is a group name, for which the groupid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        • - -
        • FileGroupNum available in 7.5.8+ and 8.1.4+
          - Set the group for files newly created. Please note that this setting does not affect the group of files already existing. The parameter is a numerical ID, which is used regardless of whether the group actually exists. This can be useful if the group mapping is not available to rsyslog during startup.

        • - -
        • FileCreateMode [default equelly-named module parameter]
          - The FileCreateMode directive allows to specify the creation mode with which rsyslogd creates new files. If not specified, the value 0644 is used (which retains backward-compatibility with earlier releases). The value given must always be a 4-digit octal number, with the initial digit being zero.
          Please note that the actual permission depend on rsyslogd's process umask. If in doubt, use "$umask 0000" right at the beginning of the configuration file to remove any restrictions.
          FileCreateMode may be specified multiple times. If so, it specifies the creation mode for all selector lines that follow until the next $FileCreateMode directive. Order of lines is vitally important.

        • - -
        • DirCreateMode [default equelly-named module parameter]
          - This is the same as FileCreateMode, but for directories automatically generated.

        • - -
        • FailOnCHOwnFailure on/off [default on]
          - This option modifies behaviour of file creation. If different owners or groups are specified for new files or directories and rsyslogd fails to set these new owners or groups, it will log an error and NOT write to the file in question if that option is set to "on". If it is set to "off", the error will be ignored and processing continues. Keep in mind, that the files in this case may be (in)accessible by people who should not have permission. The default is "on".

        • - -
        • CreateDirs on/off [default on]
          - create directories on an as-needed basis

        • - -
        • Sync on/off [default off]
          - enables file syncing capability of omfile. Note that this causes - an enormous performance hit if enabled.

        • - -
        • File
          - If the file already exists, new data is appended to it. Existing data is not truncated. If the file does not already exist, it is created. Files are kept open as long as rsyslogd is active. This conflicts with external log file rotation. In order to close a file after rotation, send rsyslogd a HUP signal after the file has been rotated away.

        • - -
        • DynaFile
          - For each message, the file name is generated based on the given template. Then, this file is opened. As with the ``file'' property, data is appended if the file already exists. If the file does not exist, a new file is created. A cache of recent files is kept. Note that this cache can consume quite some memory (especially if large buffer sizes are used). Files are kept open as long as they stay inside the cache. Currently, files are only evicted from the cache when there is need to do so (due to insufficient cache size). To force-close (and evict) a dynafile from cache, send a HUP signal to rsyslogd.

        • - -
        • Sig.Provider [ProviderName]
          - Selects a signature provider for log signing. Currently, - there only is one provider called - "gt".

        • - -
        • Cry.Provider [ProviderName]
          - Selects a crypto provider for log encryption. Currently, - there only is one provider called - "gcry".

        • - -
        -

        See Also -

        -

        -

        Caveats/Known Bugs:

        -
          -
        • One needs to be careful with log rotation if signatures and/or encryption -are being used. These create side-files, which form a set and must be kept -together. -
          -For signatures, the ".sigstate" file must NOT be rotated away if -signature chains are to be build across multiple files. This is because -.sigstate contains just global information for the whole file set. However, -all other files need to be rotated together. The proper sequence is to -
            -
          1. move all files inside the file set -
          2. only AFTER this is completely done, HUP rsyslog -
          -This sequence will ensure that all files inside the set are atomically -closed and in sync. HUPing only after a subset of files have been moved -results in inconsistencies and will most probably render the file set -unusable. -
        • -
        -

        Sample:

        -

        The following command writes all syslog messages into a file.

        - - -

        - -

        Legacy Configuration Directives:

        -
          -
        • $DynaFileCacheSize
          - equivalent to the "dynaFileCacheSize" parameter

        • - -
        • $OMFileZipLevel
          - equivalent to the "zipLevel" parameter

        • - -
        • $OMFileFlushInterval
          - equivalent to the "flushInterval" parameter

        • - -
        • $OMFileASyncWriting
          - equivalent to the "asyncWriting" parameter

        • - -
        • $OMFileFlushOnTXEnd
          - equivalent to the "flushOnTXEnd" parameter

        • - -
        • $OMFileIOBufferSize
          - equivalent to the "IOBufferSize" parameter

        • - -
        • $DirOwner
          - equivalent to the "dirOwner" parameter

        • - -
        • $DirGroup
          - equivalent to the "dirGroup" parameter

        • - -
        • $FileOwner
          - equivalent to the "fileOwner" parameter

        • - -
        • $FileGroup
          - equivalent to the "fileGroup" parameter

        • - -
        • $DirCreateMode
          - equivalent to the "dirCreateMode" parameter

        • - -
        • $FileCreateMode
          - equivalent to the "fileCreateMode" parameter

        • - -
        • $FailOnCHOwnFailure
          - equivalent to the "failOnChOwnFailure" parameter

        • - -
        • $F$OMFileForceCHOwn
          - equivalent to the "ForceChOwn" parameter

        • - -
        • $CreateDirs
          - equivalent to the "createDirs" parameter

        • - -
        • $ActionFileEnableSync
          - equivalent to the "enableSync" parameter

        • - -
        • $ActionFileDefaultTemplate
          - equivalent to the "template" module parameter

        • - -
        • $ResetConfigVariables
          - Resets all configuration variables to their default value.

        • - -
        - -

        Legacy Sample:

        -

        The following command writes all syslog messages into a file.

        - - - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/omfwd.html rsyslog-5.10.1/doc/omfwd.html --- rsyslog-7.6.0/doc/omfwd.html 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/doc/omfwd.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ - - - -Forwarding Output Module - - -back - -

        Forwarding Output Module

        -

        Module Name:    omfwd

        -

        Author: Rainer Gerhards <rgergards@adiscon.com>

        -

        Description:

        -

        The omfwd plug-in provides the core functionality of traditional message forwarding via UDP and plain TCP. It is a built-in module that does not need to be loaded.

        -

         

        - -

        Note: this documentation describes features present in v7+ of -rsyslog. If you use an older version, scroll down to "legacy parameters". -If you prefer, you can also -obtain -a specific version of the rsyslog documentation. -

         

        - -

        Module Parameters:

        -
          -
        • Template [templateName]
          - sets a non-standard default template for this module.
        • - -
        -

         

        -

        Action Parameters:

        -
          -
        • Target string
          - Name or IP-Address of the system that shall receive messages. Any resolvable name is fine.

        • - -
        • Port [Default 514]
          - Name or numerical value of port to use when connecting to target.

        • - -
        • Protocol udp/tcp [default udp]
          - Type of protocol to use for forwarding. Note that ``tcp'' means both legacy plain tcp syslog as well as RFC5425-based TCL-encrypted syslog. Which one is selected depends on the protocol drivers set before the action commend. Note that as of 6.3.6, there is no way to specify this within the action itself.

        • - -
        • TCP_Framing ``traditional'' or ``octet-counted'' [default traditional]
          - Framing-Mode to be for forwarding. This affects only TCP-based protocols. It is ignored for UDP. In protocol engineering, ``framing'' means how multiple messages over the same connection are separated. Usually, this is transparent to users. Unfortunately, the early syslog protocol evolved, and so there are cases where users need to specify the framing. The traditional framing is nontransparent. With it, messages are end when a LF (aka ``line break'', ``return'') is encountered, and the next message starts immediately after the LF. If multi-line messages are received, these are essentially broken up into multiple message, usually with all but the first message segment being incorrectly formatted. The octet-counting framing solves this issue. With it, each message is prefixed with the actual message length, so that a receivers knows exactly where the message ends. Multi-line messages cause no problem here. This mode is very close to the method described in RFC5425 for TLS-enabled syslog. Unfortunately, only few syslogd implementations support octet-counted framing. As such, the traditional framing is set as default, even though it has defects. If it is known that the receiver supports octet-counted framing, it is suggested to use that framing mode.

        • - -
        • ZipLevel 0..9 [default 0]
          - Compression level for messages. -
          Up until rsyslog 7.5.1, this was the only compression setting that - rsyslog understood. Starting with 7.5.1, we have different compression - modes. All of them are affected by the ziplevel. If, however, no mode - is explicitely set, setting ziplevel also turns on "single" - compression mode, so pre 7.5.1 configuration will continue to work - as expected. -
          The compression level is specified via the usual factor of 0 to 9, with 9 being the strongest compression (taking up most processing time) and 0 being no compression at all (taking up no extra processing time).

        • - -
        • maxErrorMessages integer [default 5], available since 7.5.4
          - This sets the maximum number of error messages that omfwd - emits during regular operations. The reason for such an upper - limit is that error messages are conveyed back to rsyslog's - input message stream. So if there would be no limit, an endless - loop could be initiated if the failing action would need to - process its own error messages and the emit a new one. This is - also the reason why the default is very conservatively low. - Note that version prior to 7.5.4 did not report any error - messages for the same reason. Also note that with the initial - implementation only errors during UDP forwarding are logged.

        • - -
        • compression.mode mode
          - mode is one of "none", "single", or "stream:always". The - default is "none", in which no compression happens at all. -
          In "single" compression mode, Rsyslog implements a proprietary - capability to zip transmitted messages. That compression happens - on a message-per-message basis. As such, there is a performance gain - only for larger messages. Before compressing a message, rsyslog checks - if there is some gain by compression. If so, the message is sent - compressed. If not, it is sent uncompressed. As such, it is totally - valid that compressed and uncompressed messages are intermixed - within a conversation. -
          In "stream:always" compression mode the full stream is being - compressed. This also uses non-standard protocol and is compatible - only with receives that have the same abilities. This mode offers - potentially very high compression ratios. With typical syslog - messages, it can be as high as 95+% compression (so only one twentieth - of data is actually transmitted!). Note that this mode introduces - extra latency, as data is only sent when the compressor emits new - compressed data. For typical syslog messages, this can mean that - some hundered messages may be held in local buffers before they are - actually sent. This mode has been introduced in 7.5.1. -
          Note: currently only imptcp supports receiving stream-compressed - data. -

        • - -
        • compression.stream.flushOnTXEnd [on/off] (requires 7.5.3+)
          - This setting affects stream compression mode, only. If enabled (the default), the compression - buffer will by emptied at the end of a rsyslog batch. If set to "off", - end of batch will not affect compression at all.
          - While setting it to "off" can potentially greatly improve compression - ratio, it will also introduce severe delay between when a message is being processed - by rsyslog and actually sent out to the network. We have seen cases where for - several thousand message not a single byte was sent. This is good in the sense that - it can happen only if we have a great compression ratio. This is most probably - a very good mode for busy machines which will process several thousand messages - per second and te resulting short delay will not pose any problems. However, - the default is more conservative, while it works more "naturally" with even low - message traffic. Even in flush mode, notable compression should be achivable - (but we do not yet have practice reports on actual compression ratios). -

        • - -
        • RebindInterval integer
          - Permits to specify an interval at which the current connection is broken and re-established. This setting is primarily an aid to load balancers. After the configured number of messages has been transmitted, the current connection is terminated and a new one started. Note that this setting applies to both TCP and UDP traffic. For UDP, the new ``connection'' uses a different source port (ports are cycled and not reused too frequently). This usually is perceived as a ``new connection'' by load balancers, which in turn forward messages to another physical target system.

        • - -
        • StreamDriver string
          - Set the file owner for directories newly created. Please note that this setting does not affect the owner of directories already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        • - -
        • StreamDriverMode integer [default 0]
          - mode to use with the stream driver (driver-specific)

        • - -
        • StreamDriverAuthMode string
          - authentication mode to use with the stream driver. Note that this directive requires TLS netstream drivers. For all others, it will be ignored. (driver-specific).

        • - -
        • StreamDriverPermittedPeers string
          - accepted fingerprint (SHA1) or name of remote peer. Note that this directive requires TLS netstream drivers. For all others, it will be ignored. (driver-specific)

        • - -
        • ResendLastMSGOnReconnect on/off
          - Permits to resend the last message when a connection is reconnected. This setting affects TCP-based syslog, only. It is most useful for traditional, plain TCP syslog. Using this protocol, it is not always possible to know which messages were successfully transmitted to the receiver when a connection breaks. In many cases, the last message sent is lost. By switching this setting to "yes", rsyslog will always retransmit the last message when a connection is reestablished. This reduces potential message loss, but comes at the price that some messages may be duplicated (what usually is more acceptable).

        • - -
        -

        See Also -

        -

        -

        Caveats/Known Bugs:

        • None.
        -

        Sample:

        -

        The following command sends all syslog messages to a remote server via TCP port 10514.

        - - -

        - -

        Legacy Configuration Directives:

        -
          -
        • $ActionForwardDefaultTemplateName string [templatename]
          - sets a new default template for UDP and plain TCP forwarding action

        • - -
        • $ActionSendTCPRebindInterval integer
          - instructs the TCP send action to close and re-open the connection to the remote host every nbr of messages sent. Zero, the default, means that no such processing is done. This directive is useful for use with load-balancers. Note that there is some performance overhead associated with it, so it is advisable to not too often "rebind" the connection (what "too often" actually means depends on your configuration, a rule of thumb is that it should be not be much more often than once per second).

        • - -
        • $ActionSendUDPRebindInterval integer
          - instructs the UDP send action to rebind the send socket every nbr of messages sent. Zero, the default, means that no rebind is done. This directive is useful for use with load-balancers.

        • - -
        • $ActionSendStreamDriver <driver basename>
          - just like $DefaultNetstreamDriver, but for the specific action

        • - -
        • $ActionSendStreamDriverMode <mode> [default 0]
          - mode to use with the stream driver (driver-specific)

        • - -
        • $ActionSendStreamDriverAuthMode <mode>
          - authentication mode to use with the stream driver. Note that this directive requires TLS netstream drivers. For all others, it will be ignored. (driver-specific))

        • - -
        • $ActionSendStreamDriverPermittedPeers <ID>
          - accepted fingerprint (SHA1) or name of remote peer. Note that this directive requires TLS netstream drivers. For all others, it will be ignored. (driver-specific)

        • - -
        • $ActionSendResendLastMsgOnReconnect on/off [default off]
          - specifies if the last message is to be resend when a connecition breaks and has been reconnected. May increase reliability, but comes at the risk of message duplication.

        • - -
        • $ResetConfigVariables
          - Resets all configuration variables to their default value. Any settings made will not be applied to configuration lines following the $ResetConfigVariables. This is a good method to make sure no side-effects exists from previous directives. This directive has no parameters.

        • - -
        - -

        Legacy Sample:

        -

        The following command sends all syslog messages to a remote server via TCP port 10514.

        - - - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/omjournal.html rsyslog-5.10.1/doc/omjournal.html --- rsyslog-7.6.0/doc/omjournal.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/omjournal.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ - - - -Linux Journal Output Module (omjournal) - - -back - -

        Linux Journal Output Module (omjournal)

        -

        Module Name:    omjournal

        -

        Author: Rainer Gerhards <rgerhards@adiscon.com>

        -

        Available since: 7.3.7

        -

        Description:

        -

        The omjournal output module provides an interface to the Linux journal. -It is meant to be used in those cases where the Linux journal is being used -as the sole system log database. With omjournal, messages from various -sources (e.g. files and remote devices) can also be written to the journal -and processed by its tools. -

        A typical use case we had on our mind is a SOHO environment, where the -user wants to include syslog data obtained from the local router to be -part of the journal data. -

        We suggest to check out our short presentation on -rsyslog journal integration to -learn more details of anticipated use cases. -

         

        - -

        Module Configuration Parameters:

        -

        Currently none. -

         

        -

        Action Confguration Parameters:

        -

        Currently none. - -

        Caveats/Known Bugs: -

          -
        • One needs to be careful that no message routing loop is created. The -systemd journal forwards messages it receives to the traditional syslog -system (if present). That means rsyslog will receive the same message that -it just wrote as new input on imuxsock. If not handled specially and assuming -all messages be written to the journal, the message would be emitted to the -journal again and a deadly loop is started. -

          To prevent that, imuxsock by default does not accept messages originating -from its own process ID, aka it ignores messages from the current instance of -rsyslogd. However, this setting can be changed, and if so the problem may occur. -

        - -

        Sample:

        -

        We assume we have a DSL router inside the network and would like to -receive its syslog message into the journal. Note that this configuration can be -used without havoing any other syslog functionality at all (most importantly, there -is no need to write any file to /var/log!). We assume syslog over UDP, as this -is the most probable choice for the SOHO environment that this use case reflects. -To log to syslog data to the journal, add the following snippet to rsyslog.conf: - -

        Note that this can be your sole rsyslog.conf if you do not use rsyslog -for anything else than receving the router syslog messages. -

        If you do not receive messages, you probably need to enable inbound UDP -syslog traffic in your firewall. - - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/omlibdbi.html rsyslog-5.10.1/doc/omlibdbi.html --- rsyslog-7.6.0/doc/omlibdbi.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omlibdbi.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,128 @@ + + +Generic Database Output Module (omlibdbi) + + + +back + +

        Generic Database Output Module (omlibdbi)

        +

        Module Name:    omlibdbi

        +

        Author: Rainer Gerhards +<rgerhards@adiscon.com>

        +

        Description:

        +

        This modules supports a large number of database systems via libdbi. +Libdbi abstracts the database layer and provides drivers for many +systems. Drivers are available via the libdbi-drivers +project. As of this writing, the following drivers are available:

        + +

        The following drivers are in various stages of completion:

        + +

        These drivers seem to be quite usable, at +least from an rsyslog point of view.

        +

        Libdbi provides a slim layer between rsyslog and the actual +database engine. We have not yet done any performance testing (e.g. +omlibdbi vs. ommysql) but honestly believe that the performance impact +should be irrelevant, if at all measurable. Part of that assumption is +that rsyslog just does the "insert" and most of the time is spent +either in the database engine or rsyslog itself. It's hard to think of +any considerable time spent in the libdbi abstraction layer.

        +

        Setup

        +

        In order for this plugin to work, you need to have libdbi, the +libdbi driver for your database backend and the client software for +your database backend installed. There are libdbi packages for many +distributions. Please note that rsyslogd requires a quite recent +version (0.8.3) of libdbi. It may work with older versions, but these +need some special ./configure options to support being called from a +dlopen()ed plugin (as omlibdbi is). So in short, you probably save you +a lot of headache if you make sure you have at least libdbi version +0.8.3 on your system. +

        +

        Configuration Directives:

        +
          +
        • $ActionLibdbiDriverDirectory /path/to/dbd/drivers
          This +is a global setting. It points libdbi to its driver directory. Usually, +you do not need to set it. If you installed libdbi-driver's at a +non-standard location, you may need to specify the directory here. If +you are unsure, do not use this configuration directive. Usually, everything works just fine.
        • $ActionLibdbiDriver drivername
          +Name of the dbidriver to use, see libdbi-drivers documentation. As a +quick excerpt, at least those were available at the time of this +writiting "mysql" (suggest to use ommysql instead), "firebird" (Firbird +and InterBase), "ingres", "msql", "Oracle", "sqlite", "sqlite3", +"freetds" (for Microsoft SQL and Sybase) and "pgsql" (suggest to use +ompgsql instead).
        • +
        • $ActionLibdbiHost +hostname
          +The host to connect to.
        • +
        • $ActionLibdbiUserName +user
          +The user used to connect to the database.
        • +
        • $ActionlibdbiPassword
          +That user's password.
        • +
        • $ActionlibdbiDBName +db
          +The database that shall be written to.
        • +
        • selector +line: :omlibdbi:;template
          +executes the recently configured omlibdbi action. The ;template part is +optional. If no template is provided, a default template is used (which +is currently optimized for MySQL - sorry, folks...)
        • +
        +Caveats/Known Bugs: +

        You must make sure that any templates used for omlibdbi +properly escape strings. This is usually done by supplying the SQL (or +STDSQL) option to the template. Omlibdbi rejects templates without this +option for security reasons. However, omlibdbi does not detect if you +used the right option for your backend. Future versions of rsyslog +(with full expression  support) will provide advanced +ways of handling this situation. So far, you must be careful. The +default template provided by rsyslog is suitable for MySQL, but not +necessarily for your database backend. Be careful!

        +

        If you receive the rsyslog error message "libdbi or libdbi +drivers not present on this system" you may either not have libdbi and +its drivers installed or (very probably) the version is earlier than +0.8.3. In this case, you need to make sure you have at least 0.8.3 and +the libdbi driver for your database backend present on your system.

        I +do not have most of the database supported by omlibdbi in my lab. So it +received limited cross-platform tests. If you run into troubles, be +sure the let us know at http://www.rsyslog.com.

        +

        Sample:

        +

        The following sample writes all syslog messages to the +database "syslog_db" on mysqlsever.example.com. The server is MySQL and +being accessed under the account of "user" with password "pwd" (if you +have empty passwords, just remove the $ActionLibdbiPassword line).
        +

        + +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/ommail.html rsyslog-5.10.1/doc/ommail.html --- rsyslog-7.6.0/doc/ommail.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/ommail.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,146 @@ + +mail output module - sending syslog messages via mail +back + + +

        Mail Output Module (ommail)

        +

        Module Name:    ommail

        +

        Available since:    3.17.0

        +

        Author: Rainer Gerhards +<rgerhards@adiscon.com>

        +

        Description:

        +

        This module supports sending syslog messages via mail. Each +syslog message is sent via its own mail. Obviously, you will want to +apply rigorous filtering, otherwise your mailbox (and mail server) will +be heavily spammed. The ommail plugin is primarily meant for alerting +users. As such, it is assume that mails will only be sent in an +extremely limited number of cases.

        +

        Please note that ommail is especially well-suited to work in +tandem with imfile to +watch files for the occurence of specific things to be alerted on. So +its scope is far broader than forwarding syslog messages to mail +recipients.

        +Ommail uses two templates, one for the mail body and one for the +subject line. If neither is provided, a quite meaningless subject line +is used and the mail body will be a syslog message just as if it were +written to a file. It is expected that the users customizes both +messages. In an effort to support cell phones (including SMS gateways), +there is an option to turn off the body part at all. This is considered +to be useful to send a short alert to a pager-like device.
        +
        +It is highly recommended to use the  "$ActionExecOnlyOnceEveryInterval +<seconds>" directive to limit the amount of +mails that potentially be generated. With it, mails are sent at most in +a <seconds> interval. This may be your life safer. And +remember that an hour has 3,600 seconds, so if you would like to +receive mails at most once every two hours, include a +"$ActionExecOnlyOnceEveryInterval 7200" immediately before the ommail +action. Messages sent more frequently are simpy discarded. +

        Configuration Directives:

        +
          +
        • $ActionMailSMTPServer
          +Name or IP address of the SMTP server to be used. Must currently be +set. The default is 127.0.0.1, the SMTP server on the local machine. +Obviously it is not good to expect one to be present on each machine, +so this value should be specified.
          +
        • +
        • $ActionMailSMTPPort
          +Port number or name of the SMTP port to be used. The default is 25, the +standard SMTP port.
        • +
        • $ActionMailFrom
          +The email address used as the senders address. There is no default.
        • +
        • $ActionMailTo
          +The recipient email addresses. There is no default. To specify multiple +recpients, repeat this directive as often as needed. Note: This directive +must be specified for each new action and is automatically reset. +[Multiple recipients are supported for 3.21.2 and above.]
        • +
        • $ActionMailSubject
          +The name of the template +to be used as the mail subject. If this is not specified, a more or +less meaningless mail subject is generated (we don't tell you the exact +text because that can change - if you want to have something specific, +configure it!).
        • +
        • $ActionMailEnableBody
          +Setting this to "off" permits to exclude the actual message body. This +may be useful for pager-like devices or cell phone SMS messages. The +default is "on", which is appropriate for allmost all cases. Turn it +off only if you know exactly what you do!
        • +
        +Caveats/Known Bugs: +

        The current ommail implementation supports SMTP-direct mode +only. In that mode, the plugin talks to the mail server via SMTP +protocol. No other process is involved. This mode offers best +reliability as it is not depending on any external entity except the +mail server. Mail server downtime is acceptable if the action is put +onto its own action queue, so that it may wait for the SMTP server to +come back online. However, the module implements only the bare SMTP +essentials. Most importantly, it does not provide any authentication +capabilities. So your mail server must be configured to accept incoming +mail from ommail without any authentication needs (this may be change +in the future as need arises, but you may also be referred to +sendmail-mode).

        +

        In theory, ommail should also offer a mode where it uses the +sendmail utility to send its mail (sendmail-mode). +This is somewhat less reliable (because we depend on an entity we do +not have close control over - sendmail). It also requires dramatically +more system ressources, as we need to load the external process (but +that should be no problem given the expected infrequent number of calls +into this plugin). The big advantage of sendmail mode is that it +supports all the bells and whistles of a full-blown SMTP implementation +and may even work for local delivery without a SMTP server being +present. Sendmail mode will be implemented as need arises. So if you +need it, please drop us a line (I nobody does, sendmail mode will +probably never be implemented).

        +

        Sample:

        +

        The following sample alerts the operator if the string "hard +disk fatal failure" is present inside a syslog message. The mail server +at mail.example.net is used and the subject shall be "disk problem on +<hostname>". Note how \r\n is included inside the body +text +to create line breaks. A message is sent at most once every 6 hours, +any other messages are silently discarded (or, to be precise, not being +forwarded - they are still being processed by the rest of the +configuration file).
        +

        + +

        The sample below is the same, but sends mail to two recipients:

        + +

        A more advanced example plus a discussion on using the email feature +inside a reliable system can be found in Rainer's blogpost +"Why +is native email capability an advantage for a syslogd?" +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/ommysql.html rsyslog-5.10.1/doc/ommysql.html --- rsyslog-7.6.0/doc/ommysql.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/ommysql.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,71 @@ + + + +MySQL Database Output Module + + + +back + +

        MySQL Database Output Module

        +

        Module Name:    ommysql

        +

        Author: Michael Meckelein (Initial Author) / Rainer Gerhards +<rgerhards@adiscon.com>

        +

        Description:

        +

        This module provides native support for logging to MySQL databases. It offers +superior performance over the more generic omlibdbi module. +

        +

        Configuration Directives:

        +

        ommysql mostly uses the "old style" configuration, with almost everything on the +action line itself. A few newer features are being migrated to the new style-config +directive configuration system. +

          +
        • $ActionOmmysqlServerPort <port>
          Permits to select +a non-standard port for the MySQL server. The default is 0, which means the +system default port is used. There is no need to specify this directive unless +you know the server is running on a non-standard listen port. +
        • $OmMySQLConfigFile <file name>
          Permits the selection +of an optional MySQL Client Library configuration file (my.cnf) for extended +configuration functionality. The use of this configuration directive is necessary +only if you have a non-standard environment or if fine-grained control over the +database connection is desired.
        • +
        • $OmMySQLConfigSection <string>
          Permits the selection of the +section within the configuration file specified by the $OmMySQLConfigFile directive. +
          This will likely only be used where the database administrator provides a single +configuration file with multiple profiles. +
          This configuration directive is ignored unless $OmMySQLConfigFile is also used +in the rsyslog configration file. +
          If omitted, the MySQL Client Library default of "client" will be used.
        • +
        • Action parameters: +
          :ommysql:database-server,database-name,database-userid,database-password +
          All parameters should be filled in for a successful connect. +
        +

        Note rsyslog contains a canned default template to write to the MySQL +database. It works on the MonitorWare schema. This template is: +

        + +

        As you can see, the template is an actual SQL statement. Note the ",SQL" option: it tells the +template processor that the template is used for SQL processing, thus quote characters are quoted +to prevent security issues. You can not assign a template without ",SQL" to a MySQL output action. +

        If you would like to change fields contents or add or delete your own fields, you +can simply do so by modifying the schema (if required) and creating your own custom +template. +

        Sample:

        +

        The following sample writes all syslog messages to the +database "syslog_db" on mysqlsever.example.com. The server is +being accessed under the account of "user" with password "pwd". +

        + +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008, 2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/omoracle.html rsyslog-5.10.1/doc/omoracle.html --- rsyslog-7.6.0/doc/omoracle.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omoracle.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,201 @@ + + + +Oracle Database Output Module + + + +rsyslog module reference + +

        Oracle Database Output Module

        +

        Module Name:    omoracle

        +

        Author: Luis Fernando Muñoz Mejías <Luis.Fernando.Munoz.Mejias@cern.ch>

        +

        Available since: : 4.3.0 +

        Status: : contributed module, not maitained by rsyslog core authors +

        Description:

        +

        This module provides native support for logging to Oracle +databases. It offers superior performance over the more +generic omlibdbi module. It also includes +a number of enhancements, most importantly prepared statements and +batching, what provides a big performance improvement. +

        +

        Note that this module is maintained by its original author. If you need assistance with it, +it is suggested to post questions to the +rsyslog mailing list. +

        From the header comments of this module: +

        +
        +    This is an output module feeding directly to an Oracle
        +    database. It uses Oracle Call Interface, a propietary module
        +    provided by Oracle.
        +
        +    Selector lines to be used are of this form:
        +
        +    :omoracle:;TemplateName
        +
        +    The module gets its configuration via rsyslog $... directives,
        +    namely:
        +
        +    $OmoracleDBUser: user name to log in on the database.
        +
        +    $OmoracleDBPassword: password to log in on the database.
        +
        +    $OmoracleDB: connection string (an Oracle easy connect or a db
        +    name as specified by tnsnames.ora)
        +
        +    $OmoracleBatchSize: Number of elements to send to the DB on each
        +    transaction.
        +
        +    $OmoracleStatement: Statement to be prepared and executed in
        +    batches. Please note that Oracle's prepared statements have their
        +    placeholders as ':identifier', and this module uses the colon to
        +    guess how many placeholders there will be.
        +
        +    All these directives are mandatory. The dbstring can be an Oracle
        +    easystring or a DB name, as present in the tnsnames.ora file.
        +
        +    The form of the template is just a list of strings you want
        +    inserted to the DB, for instance:
        +
        +    $template TestStmt,"%hostname%%msg%"
        +
        +    Will provide the arguments to a statement like
        +
        +    $OmoracleStatement \
        +        insert into foo(hostname,message)values(:host,:message)
        +
        +    Also note that identifiers to placeholders are arbitrary. You
        +    need to define the properties on the template in the correct order
        +    you want them passed to the statement!
        +
        +

        Some additional documentation contributed by Ronny Egner: +

        +REQUIREMENTS:
        +--------------
        +
        +- Oracle Instantclient 10g (NOT 11g) Base + Devel
        +  (if you´re on 64-bit linux you should choose the 64-bit libs!) 
        +- JDK 1.6 (not neccessary for oracle plugin but "make" didd not finsished successfully without it)
        +
        +- "oracle-instantclient-config" script 
        +  (seems to shipped with instantclient 10g Release 1 but i was unable to find it for 10g Release 2 so here it is)
        +
        +  
        +======================  /usr/local/bin/oracle-instantclient-config =====================
        +#!/bin/sh
        +#
        +# Oracle InstantClient SDK config file
        +# Jean-Christophe Duberga - Bordeaux 2 University
        +#
        +
        +# just adapt it to your environment
        +incdirs="-I/usr/include/oracle/10.2.0.4/client64"
        +libdirs="-L/usr/lib/oracle/10.2.0.4/client64/lib"
        +
        +usage="\
        +Usage: oracle-instantclient-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
        +
        +if test $# -eq 0; then
        +      echo "${usage}" 1>&2
        +      exit 1
        +fi
        +
        +while test $# -gt 0; do
        +  case "$1" in
        +  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
        +  *) optarg= ;;
        +  esac
        +
        +  case $1 in
        +    --prefix=*)
        +      prefix=$optarg
        +      if test $exec_prefix_set = no ; then
        +        exec_prefix=$optarg
        +      fi
        +      ;;
        +    --prefix)
        +      echo $prefix
        +      ;;
        +    --exec-prefix=*)
        +      exec_prefix=$optarg
        +      exec_prefix_set=yes
        +      ;;
        +    --exec-prefix)
        +      echo ${exec_prefix}
        +      ;;
        +    --version)
        +      echo ${version}
        +      ;;
        +    --cflags)
        +      echo ${incdirs}
        +      ;;
        +    --libs)
        +      echo $libdirs -lclntsh -lnnz10 -locci -lociei -locijdbc10
        +      ;;
        +    --static-libs)
        +      echo "No static libs" 1>&2
        +      exit 1
        +      ;;
        +    *)
        +      echo "${usage}" 1>&2
        +      exit 1
        +      ;;
        +  esac
        +  shift
        +done
        +
        +===============   END ==============
        +
        +
        +
        +
        +COMPILING RSYSLOGD
        +-------------------
        +
        +
        +./configure --enable-oracle
        +
        +
        +
        +
        +RUNNING
        +-------
        +
        +- make sure rsyslogd is able to locate the oracle libs (either via LD_LIBRARY_PATH or /etc/ld.so.conf)
        +- set TNS_ADMIN to point to your tnsnames.ora
        +- create a tnsnames.ora and test you are able to connect to the database
        +
        +- create user in oracle as shown in the following example:
        +		create user syslog identified by syslog default tablespace users quota unlimited on users;
        +		grant create session to syslog;
        +		create role syslog_role;
        +		grant syslog_role to syslog;
        +		grant create table to syslog_role;
        +		grant create sequence to syslog_role;
        +		
        +- create tables as needed
        +
        +- configure rsyslog as shown in the following example
        +		$ModLoad omoracle
        +
        +		$OmoracleDBUser syslog
        +		$OmoracleDBPassword syslog
        +		$OmoracleDB syslog
        +		$OmoracleBatchSize 1
        +		$OmoracleBatchItemSize 4096
        +
        +		$OmoracleStatementTemplate OmoracleStatement
        +		$template OmoracleStatement,"insert into foo(hostname,message) values (:host,:message)"
        +		$template TestStmt,"%hostname%%msg%"
        +		*.*                     :omoracle:;TestStmt
        +	(you guess it: username = password = database = "syslog".... see $rsyslogd_source/plugins/omoracle/omoracle.c for me info)
        +
        +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008, 2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/ompipe.html rsyslog-5.10.1/doc/ompipe.html --- rsyslog-7.6.0/doc/ompipe.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/ompipe.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - - - -Pipe Output Module - - -back - -

        Pipe Output Module

        -

        Module Name:    omfwd

        -

        Author: Rainer Gerhards <rgergards@adiscon.com>

        -

        Description:

        -

        The ompipe plug-in provides the core functionality for logging output to named pipes (fifos). It is a built-in module that does not need to be loaded.

        -

         

        - -

        Global Configuration Directives:

        -
          -
        • Template [templateName]
          - sets a new default template for file actions.
        • - -
        -

         

        -

        Action specific Configuration Directives:

        -
          -
        • Pipe string
          - A fifo or named pipe can be used as a destination for log messages.

        • - - - -
        -

        Caveats/Known Bugs:

        • None.
        -

        Sample:

        -

        The following command sends all syslog messages to a remote server via TCP port 10514.

        - - -

        - -

        Legacy Configuration Directives:

        -

        rsyslog has support for logging output to named pipes (fifos). A fifo or named pipe can be used as a destination for log messages by prepending a pipe symbol ("|'') to the name of the file. This is handy for debugging. Note that the fifo must be created with the mkfifo(1) command before rsyslogd is started. - -

        - -

        Legacy Sample:

        -

        The following command sends all syslog messages to a remote server via TCP port 10514.

        - - - -

        [rsyslog.conf overview] [manual -index] [rsyslog site]

        -

        This documentation is part of the -rsyslog project.
        -Copyright © 2008 by Rainer Gerhards and -Adiscon. Released under the GNU GPL -version 3 or higher.

        - - diff -Nru rsyslog-7.6.0/doc/omrelp.html rsyslog-5.10.1/doc/omrelp.html --- rsyslog-7.6.0/doc/omrelp.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omrelp.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,57 @@ + + +RELP Output Module (omrelp) + + + +back to rsyslog module documentation + +

        RELP Output Module (omrelp)

        +

        Module Name:    omrelp

        +

        Author: Rainer Gerhards +<rgerhards@adiscon.com>

        +

        Description:

        +

        This module supports sending syslog messages over the reliable +RELP protocol. For RELP's advantages over plain tcp syslog, please see +the documentation for imrelp +(the server counterpart). 

        +Setup +

        Please note the librelp +is required for imrelp (it provides the core relp protocol +implementation).

        +

        Configuration Directives:

        +

        This module uses old-style action configuration to keep +consistent with the forwarding rule. So far, no additional +configuration directives can be specified. To send a message via RELP, +use

        +

        *.* + :omrelp:<sever>:<port>;<template>

        +

        just as you use 

        +

        *.* + @@<sever>:<port>;<template>

        +

        to forward a message via plain tcp syslog.

        +Caveats/Known Bugs: +

        See imrelp, +which documents them. 

        +

        Sample:

        +

        The following sample sends all messages to the central server +"centralserv" at port 2514 (note that that server must run imrelp on +port 2514). Rsyslog's high-precision timestamp format is used, thus the +special "RSYSLOG_ForwardFormat" (case sensitive!) template is used.
        +

        + +Note: to use IPv6 addresses, encode them in [::1] format. +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/omruleset.html rsyslog-5.10.1/doc/omruleset.html --- rsyslog-7.6.0/doc/omruleset.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omruleset.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,140 @@ + + + +ruleset output module (omruleset) + + +rsyslog module reference + +

        ruleset output/including module (omruleset)

        +

        Module Name:    omruleset

        +

        Author: Rainer Gerhards <rgerhards@adiscon.com>

        +

        Available Since: 5.3.4

        +

        Description:

        +

        This is a very special "output" module. It permits to pass a message object +to another rule set. While this is a very simple action, it enables very +complex configurations, e.g. it supports high-speed "and" conditions, sending +data to the same file in a non-racy way, include-ruleset functionality as well as +some high-performance optimizations (in case the rule sets have the necessary +queue definitions). +

        While it leads to a lot of power, this output module offers seamingly easy functionaltiy. +The complexity (and capablities) arise from how everthing can be combined. +

        With this module, a message can be sent to processing to another ruleset. This is somewhat +similar to a "#include" in the C programming language. However, one needs to keep +on the mind that a ruleset can contain its own queue and that a queue can run in various modes. +

        Note that if no queue is defined in the ruleset, the message is enqueued into the main message +queue. This most often is not optimal and means that message processing may be severely defered. +Also note that when the ruleset's target queue is full and no free space can be aquired +within the usual timeout, the message object may actually be lost. This is an extreme scenario, +but users building an audit-grade system need to know this restriction. For regular installations, +it should not really be relevant. +

        At minimum, be sure you understand the +$RulesetCreateMainQueue +directive as well as the importance of statement order in rsyslog.conf before using omruleset! +

        Recommended Use: +

          +
        • create rulesets specifically for omruleset +
        • create these rulesets with their own main queue +
        • decent queueing parameters (sizes, threads, etc) should be used +for the ruleset main queue. If in doubt, use the same parameters as for the +overall main queue. +
        • if you use multiple levels of ruleset nesting, double check for endless loops - the rsyslog +engine does not detect these +
        + +

        Configuration Directives:

        +
          +
        • $ActionOmrulesetRulesetName ruleset-to-submit-to
          +This directive specifies the name of the ruleset that the message +provided to omruleset should be submitted to. This ruleset must already have +been defined. Note that the directive is automatically reset after each +:omruleset: action and there is no default. This is done to prevent accidential +loops in ruleset definition, what can happen very quickly. +The :omruleset: action will NOT be honored if no ruleset name has been defined. As usual, +the ruleset name must be specified in front of the action that it modifies. +
        +

        Examples:

        +

        This example creates a ruleset for a write-to-file action. The idea here +is that the same file is written based on multiple filters, problems occur if the file is used +together with a buffer. That is because file buffers are action-specific, and so some partial +buffers would be written. With omruleset, we create a single action inside its own ruleset and +then pass all messages to it whenever we need to do so. Of course, such a simple situation could +also be solved by a more complex filter, but the method used here can also be utilized in +more complex scenarios (e.g. with multiple listeners). The example tries to keep it simple. +Note that we create a ruleset-specific main queue (for simplicity with the default main queue +parameters) in order to avoid re-queueing messages back into the main queue. +

        + +

        The next example is used to creat a high-performance nested and filter condition. Here, +it is first checked if the message contains a string "error". If so, the message is forwarded +to another ruleset which then applies some filters. The advantage of this is that we can use +high-performance filters where we otherwise would need to use the (much slower) expression-based +filters. Also, this enables pipeline processing, in that second ruleset is executed in +parallel to the first one.

        + +

        Caveats/Known Bugs: +

        The current configuration file language is not really adequate for a complex construct +like omruleset. Unfortunately, more important work is currently preventing me from redoing the +config language. So use extreme care when nesting rulesets and be sure to test-run your +config before putting it into production, ensuring you have a suffciently large probe +of the traffic run over it. If problems arise, the +rsyslog debug log is your friend. +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/omsnmp.html rsyslog-5.10.1/doc/omsnmp.html --- rsyslog-7.6.0/doc/omsnmp.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omsnmp.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,175 @@ + + + +SNMP Output Module + + +back + +

        SNMP Output Module

        +

        Module Name:    omsnmp

        +

        Author: Andre Lorbach <alorbach@adiscon.com>

        +

        Description:

        +

        Provides the ability to send syslog messages as an SNMPv1 & v2c traps. By +default, SNMPv2c is preferred. The syslog message is wrapped into a OCTED +STRING variable. This module uses the +NET-SNMP library. In order to compile this module, you will need to have the +NET-SNMP +developer (headers) package installed.

        +

         

        +

        Action Line:

        +

        %omsnmp% without any further parameters.

        +

         

        +

        Configuration Directives:

        +
          +
        • $actionsnmptransport (This parameter is optional, the + default value is "udp")
          +
          + Defines the transport type you wish to use. Technically we can support all + transport types which are supported by NET-SNMP.
          + To name a few possible values:
          +
          + udp, tcp, udp6, tcp6, icmp, icmp6 ...
          +
          + Example: $actionsnmptransport udp
          +
        • +
        • $actionsnmptarget
          +
          + This can be a hostname or ip address, and is our snmp target host. This + parameter is required, if the snmptarget is not defined, nothing will be + send.
          +
          + Example: $actionsnmptarget server.domain.xxx
          +
        • +
        • $actionsnmptargetport (This parameter is optional, the + default value is "162")
          +
          + The port which will be used, common values are port 162 or 161.
          +
          + Example: $actionsnmptargetport 162
          +
        • +
        • $actionsnmpversion (This parameter is optional, the + default value is "1")
          +
          + There can only be two choices for this parameter for now.
          + 0 means SNMPv1 will be used.
          + 1 means SNMPv2c will be used.
          + Any other value will default to 1.
          +
          + Example: $actionsnmpversion 1
          +
        • +
        • $actionsnmpcommunity (This parameter is optional, the + default value is "public")
          +
          + This sets the used SNMP Community.
          +
          + Example: $actionsnmpcommunity public
          +

          +
        • +
        • $actionsnmptrapoid (This parameter is + optional, the default value is "1.3.6.1.4.1.19406.1.2.1" which means + "ADISCON-MONITORWARE-MIB::syslogtrap")
          + This configuration parameter is used for SNMPv2 only.
          +
          + This is the OID which defines the trap-type, or notifcation-type rsyslog + uses to send the trap.
          + In order to decode this OID, you will need to have the + ADISCON-MONITORWARE-MIB and ADISCON-MIB mibs installed on the receiver side. Downloads of these mib files + can be found here:
          + + http://www.adiscon.org/download/ADISCON-MIB.txt
          + + http://www.adiscon.org/download/ADISCON-MONITORWARE-MIB.txt
          +
          + Thanks to the net-snmp + mailinglist for the help and the recommendations ;).
          +
          + Example: $actionsnmptrapoid 1.3.6.1.4.1.19406.1.2.1
          +
          If you have this MIBS installed, you can also configured with the + OID Name: $actionsnmptrapoid ADISCON-MONITORWARE-MIB::syslogtrap
          +
          +
        • +
        • $actionsnmpsyslogmessageoid (This parameter is + optional, the default value is "1.3.6.1.4.1.19406.1.1.2.1" which means + "ADISCON-MONITORWARE-MIB::syslogMsg")
          +
          + This OID will be used as a variable, type "OCTET STRING". This variable will + contain up to 255 characters of the original syslog message including syslog header. It is recommend to + use the default OID.
          + In order to decode this OID, you will need to have the + ADISCON-MONITORWARE-MIB and ADISCON-MIB mibs installed on the receiver side. + To download these custom mibs, see the description of $actionsnmptrapoid. +
          +
          + Example: $actionsnmpsyslogmessageoid 1.3.6.1.4.1.19406.1.1.2.1
          +
          If you have this MIBS installed, you can also configured with the + OID Name: $actionsnmpsyslogmessageoid + ADISCON-MONITORWARE-MIB::syslogMsg
          +

          +
        • +
        • $actionsnmpenterpriseoid (This parameter is optional, + the default value is "1.3.6.1.4.1.3.1.1" which means "enterprises.cmu.1.1")
          +
          + Customize this value if needed. I recommend to use the default value unless + you require to use a different OID.
          + This configuration parameter is used for SNMPv1 only. It + has no effect if SNMPv2 is used.
          +
          + Example: $actionsnmpenterpriseoid 1.3.6.1.4.1.3.1.1
          +

          +
        • +
        • $actionsnmpspecifictype (This parameter is optional, + the default value is "0")
          +
          + This is the specific trap number. This configuration parameter is used for + SNMPv1 only. It has no effect if SNMPv2 is + used.
          +
          + Example: $actionsnmpspecifictype 0
          +

          +
        • +
        • $actionsnmptraptype (This parameter is optional, the + default value is "6" which means SNMP_TRAP_ENTERPRISESPECIFIC)
          +
          + There are only 7 Possible trap types defined which can be used here. These + trap types are:
          + 0 = SNMP_TRAP_COLDSTART
          + 1 = SNMP_TRAP_WARMSTART
          + 2 = SNMP_TRAP_LINKDOWN
          + 3 = SNMP_TRAP_LINKUP
          + 4 = SNMP_TRAP_AUTHFAIL
          + 5 = SNMP_TRAP_EGPNEIGHBORLOSS
          + 6 = SNMP_TRAP_ENTERPRISESPECIFIC
          +
          + Any other value will default to 6 automatically. This configuration + parameter is used for SNMPv1 only. It has no effect if + SNMPv2 is used.
          +
          + Example: $actionsnmptraptype 6
          +
        • +
        +

         

        +

        Caveats/Known Bugs:

        • In order to decode the custom OIDs, you + will need to have the adiscon mibs installed.
        +

        Sample:

        +

        The following commands send every message as a snmp trap.

        + + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/omstdout.html rsyslog-5.10.1/doc/omstdout.html --- rsyslog-7.6.0/doc/omstdout.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omstdout.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,42 @@ + + + +stdout output module (omstdout) + + +rsyslog module reference + +

        stdout output module (stdout)

        +

        Module Name:    omstdout

        +

        Author: Rainer Gerhards +<rgerhards@adiscon.com>

        +

        Available Since: 4.1.6

        +

        Description:

        +

        This module writes any messages that are passed to it to stdout. +It was developed for the rsyslog test suite. However, there may +(limited) other uses exists. Please not that we do not put too much +effort into the quality of this module as we do not expect it to +be used in real deployments. If you do, please drop us a note so +that we can enhance its priority! +

        Configuration Directives:

        +
          +
        • $ActionOMStdoutArrayInterface [on|off
          +This setting instructs omstdout to use the alternate +array based method of parameter passing. If used, the values +will be output with commas between the values but no other padding bytes. +This is a test aid for the alternate calling interface. +
        • $ActionOMStdoutEnsureLFEnding [on|off
          +Makes sure that each message is written with a terminating LF. This is needed for +the automatted tests. If the message contains a trailing LF, none is added. +
        +Caveats/Known Bugs: +

        Currently none known. +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/omudpspoof.html rsyslog-5.10.1/doc/omudpspoof.html --- rsyslog-7.6.0/doc/omudpspoof.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omudpspoof.html 2012-10-15 13:45:04.000000000 +0000 @@ -0,0 +1,92 @@ + + +UDP spoofing output module (omudpspoof) + + +rsyslog module reference + +

        UDP spoofing output module (omudpspoof)

        +

        Module Name:    omstdout

        +

        Author: David Lang <david@lang.hm> and Rainer Gerhards +<rgerhards@adiscon.com>

        +

        Available Since: 5.1.3

        +

        Description:

        +

        This module is similar to the regular UDP forwarder, but permits to +spoof the sender address. Also, it enables to circle through a number of +source ports. +

        Configuration Directives:

        +
          +
        • $ActionOMOMUDPSpoofSourceNameTemplate <templatename>
          +This is the name of the template that contains a +numerical IP address that is to be used as the source system IP address. +While it may often be a constant value, it can be generated as usual via the +property replacer, as long as it is a valid IPv4 address. If not specified, the +build-in default template RSYSLOG_omudpspoofDfltSourceTpl is used. This template is defined +as follows:
          +$template RSYSLOG_omudpspoofDfltSourceTpl,"%fromhost-ip%"
          +So in essence, the default template spoofs the address of the system the message +was received from. This is considered the most important use case. +
        • $ActionOMUDPSpoofTargetHost <hostname>
          +Host that the messages shall be sent to. +
        • $ActionOMUDPSpoofTargetPort <port>
          +Remote port that the messages shall be sent to. +
        • $ActionOMUDPSpoofDefaultTemplate <templatename>
          +This setting instructs omudpspoof to use a template different from the +default template for all of its actions that do not have a template specified +explicitely. +
        • $ActionOMUDPSpoofSourcePortStart <number>
          +Specifies the start value for circeling the source ports. Must be less than or +equal to the end value. Default is 32000. +
        • $ActionOMUDPSpoofSourcePortEnd <number>
          +Specifies the ending value for circeling the source ports. Must be less than or +equal to the start value. Default is 42000. +
        +Caveats/Known Bugs: +
          +
        • IPv6 is currently not supported. If you need this capability, please let us +know via the rsyslog mailing list. +
        +

        Sample:

        +

        The following sample forwards all syslog messages in standard form to the +remote server server.example.com. The original sender's address is used. We do not +care about the source port. This example is considered the typical use case for +omudpspoof. +

        + + +

        The following sample forwards all syslog messages in unmodified form to the +remote server server.example.com. The sender address 192.0.2.1 with fixed +source port 514 is used. +

        + +

        The following sample is similar to the previous, but uses as many defaults as possible. +In that sample, a source port in the range 32000..42000 is used. The message is formatted +according to rsyslog's canned default forwarding format. Note that if any parameters +have been changed, the previously set defaults will be used! +

        + +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2009-2012 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/omuxsock.html rsyslog-5.10.1/doc/omuxsock.html --- rsyslog-7.6.0/doc/omuxsock.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/omuxsock.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,43 @@ + +Unix sockets output module (omuxsock) - sending syslog messages to local socket +back + + +

        Unix sockets Output Module (omuxsock)

        +

        Module Name:    omuxsock

        +

        Available since:    4.7.3, 5.5.7

        +

        Author: Rainer Gerhards <rgerhards@adiscon.com>

        +

        Description:

        +

        This module supports sending syslog messages to local Unix sockets. +Thus it provided a fast message-passing interface between different rsyslog +instances. The counterpart to omuxsock is imuxsock. +Note that the template used together with omuxsock must be suitable to be +processed by the receiver. +

        Configuration Directives:

        +
          +
        • $OMUxSockSocket
          +Name of the socket to send data to. This has no default and must +be set. +
        • +
        • $OMUxSockDefaultTemplate
          +This can be used to override the default template to be used together +with omuxsock. This is primarily useful if there are many forwarding +actions and each of them should use the same template.
        • +
        +Caveats/Known Bugs: +

        Currently, only datagram sockets are supported. +

        Sample:

        +

        The following sample writes all messages to the "/tmp/socksample" socket. +

        + +[manual index] [rsyslog site]

        +

        This documentation is part of the rsyslog +project.
        +Copyright © 2010 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/pmlastmsg.html rsyslog-5.10.1/doc/pmlastmsg.html --- rsyslog-7.6.0/doc/pmlastmsg.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/pmlastmsg.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,62 @@ + + + +parser module for "last message repeated n times" (pmlastmsg) + + +rsyslog module reference + +

        parser module for "last message repeated n times" (pmlastmsg)

        +

        Module Name:    pmlastmsg

        +

        Module Type:    parser module

        +

        Author: Rainer Gerhards <rgerhards@adiscon.com>

        +

        Available Since: 5.5.6

        +

        Description:

        +

        Some syslogds are known to emit severily malformed messages with content +"last message repeated n times". These messages can mess up message reception, as +they lead to wrong interpretation with the standard RFC3164 parser. Rather than +trying to fix this issue in pmrfc3164, we have created a new parser module +specifically for these messages. The reason is that some processing overhead is +involved in processing these messages (they must be recognized) and we would +not like to place this toll on every user but only on those actually in need +of the feature. Note that the performance toll is not large -- but if you expect +a very high message rate with tenthousands of messages per second, you will notice +a difference. +

        This module should be loaded first inside rsyslog's +parser chain. It processes all those messages that contain a PRI, then none or +some spaces and then the exact text (case-insensitive) "last message repeated n times" +where n must be an integer. All other messages are left untouched. + +

        Configuration Directives:

        +

        There do not currently exist any configuration directives for this module. +

        Examples:

        +

        This example is the typical use case, where some systems emit malformed +"repeated msg" messages. Other than that, the default RFC5424 and RFC3164 parsers +should be used. Note that when a parser is specified, the default parser chain +is removed, so we need to specify all three parsers. We use this together with the +default ruleset. +

        + +

        Caveats/Known Bugs: +

        currently none +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2010 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/property_replacer.html rsyslog-5.10.1/doc/property_replacer.html --- rsyslog-7.6.0/doc/property_replacer.html 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/doc/property_replacer.html 2012-10-17 14:41:20.000000000 +0000 @@ -13,7 +13,7 @@

        Syslog message properties are used inside templates. They are accessed by putting them between percent signs. Properties can be modified by the property replacer. The full syntax is as follows:

        -
        %propname:fromChar:toChar:options:fieldname%
        +
        %propname:fromChar:toChar:options%

        Available Properties

        propname is the name of the property to access. It is case-insensitive (prior to 3.17.0, they were case-senstive). @@ -65,7 +65,8 @@ pri-text -the PRI part of the message in textual form (e.g. "syslog.info") +the PRI part of the message in a textual form with the numerical PRI appended in +brackes (e.g. "local0.err<133>") iut @@ -138,25 +139,6 @@ The contents of the MSGID field from IETF draft draft-ietf-syslog-protocol - -parsesuccess -This returns the status of the last called higher level parser, -like mmjsonparse. A higher level parser parses the actual message for additional -structured data and maintains an extra property table while doing so (this is -often referred to as "cee data" because the idea was originally rooted in the -cee effort, only (but has been extended since then). Note that higher level -parsers must explicitely support (and set) this property. So, depending on the -parser, it may not be set correctly. -
        If the parser properly supports it, the value "OK" means that parsing was -successfull, while "FAIL" means the parser could not successfully obtain any data. -Failure state is not necessarily an error. For example, it may simple indicate -that the cee-enhanced syslog parser (mmjsonparse) did not detect cee-enhanced format, -what can be totally valid. Using this property, further processing of the message -can be directed based on this parsing outcome. If no parser has been called at the -time this property is accessed, it will contain "FAIL". -
        This property is available since version 6.3.8. - - inputname The name of the input module that generated the message (e.g. "imuxsock", "imudp"). Note that not all modules @@ -179,10 +161,6 @@ in templates for RFC5424 support, when the character set is know to be Unicode. -$uptime -system-uptime in seconds (as reported by operating system). - - $now The current date stamp in the format YYYY-MM-DD @@ -223,28 +201,12 @@ The name of the current host as it knows itself (probably useful for filtering in a generic way) - -$!<name> -This is the "bridge" to syslog message normalization (via -mmnormalize): name is a name defined -inside the normalization rule. It has the value selected by the rule -or none if no rule with this field did match. You can also use these -properties to specify JSON fields from the CEE-enhanced syslog -message, once you parse it with mmjsonparse - - - -$!all-json -This is the JSON part of the CEE-enhanced syslog message, which -can be parsed with mmjsonparse - -

        Properties starting with a $-sign are so-called system properties. These do NOT stem from the message but are rather internally-generated.

        -

        Legacy Character Positions

        +

        Character Positions

        FromChar and toChar are used to build substrings. They specify the offset within the string that should be copied. Offset counting starts at 1, so if you need to @@ -312,6 +274,15 @@ the "ToChar" parameter. An example where the 3rd field (delimited by TAB) from the msg property is extracted is as follows: "%msg:F:3%". The same example with semicolon as delimiter is "%msg:F,59:3%".

        +

        The use of fields does not permit to select substrings, what is rather +unfortunate. To solve this issue, starting with 6.3.9, fromPos and toPos +can be specified for strings as well. However, the syntax is quite ugly, but +it was the only way to integrate this functonality into the already-existing +system. To do so, use ",fromPos" and ",toPos" during field extraction. +Let's assume you want to extract the substring from position 5 to 9 in the previous +example. Then, the syntax is as follows: "%msg:F,59,5:3,9%". As you can see, +"F,59" means field-mode, with semicolon delimiter and ",5" means starting +at position 5. Then "3,9" means field 3 and string extraction to position 9.

        Please note that the special characters "F" and "R" are case-sensitive. Only upper case works, lower case will return an error. There are no white spaces permitted inside the sequence (that will lead @@ -341,249 +312,6 @@

        Property Options

        property options are -case-insensitive. They are available as of version 6.5.0. -Currently, the following options are defined: -

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        This feature was introduced in rsyslog 4.6.2 and v4 versions above and -5.5.3 and all versions above. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        NameNew format. Name of the template / property / constant.
        OutnameThis field permits to specify a field name for structured-data emitting property replacer options. -It is most useful to set, for example, the name for JSON-based fields (like used in ommngodb). For -text-based modules, it is simply ignored. -If not specified, the original property name is used, with the exception of properties starting with -"$!", where that prefix is removed. Note that unnamaned constants are NOT forwarded to output modules -that expect structure (like ommnogodb). To pass constants, an outname must be set. -
        CaseConversionNew format. Additional values below.
        upperconvert property to lowercase only
        lowerconvert property text to uppercase only
        DateFormatNew format, additional parameter is needed. See below.
        mysqlformat as mysql date
        pgsqlformat as pgsql date
        rfc3164format as RFC 3164 date
        rfc3164-buggydaysimilar to date-rfc3164, but emulates a common coding error: RFC 3164 demands -that a space is written for single-digit days. With this option, a zero is -written instead. This format seems to be used by syslog-ng and the -date-rfc3164-buggyday option can be used in migration scenarios where otherwise -lots of scripts would need to be adjusted. It is recommended not to use this -option when forwarding to remote hosts - they may treat the date as invalid -(especially when parsing strictly according to RFC 3164).
        rfc3339format as RFC 3339 date
        unixtimestampformat as unix timestamp (seconds since epoch)
        subsecondsjust the subseconds of a timestamp (always 0 for a low precision timestamp)
        pos-end-relativethe from and to position is relative to the end of the string - instead of the usual start of string. (available since rsyslog v7.3.10) -
        ControlCharactersOption values for how to process control characters
        escapereplace control characters (ASCII value 127 and values -less then 32) with an escape sequence. The sequnce is -"#<charval>" where charval is the 3-digit decimal value -of the control character. For example, a tabulator would be replaced by -"#009".
        -Note: using this option requires that $EscapeControlCharactersOnReceive -is set to off.
        spacereplace control characters by spaces
        -Note: using this option requires that $EscapeControlCharactersOnReceive -is set to off.
        dropdrop control characters - the resulting string will -neither contain control characters, escape sequences nor any other -replacement character like space.
        -Note: using this option requires that $EscapeControlCharactersOnReceive -is set to off.
        SecurePathOption values for securing path templates.
        dropDrops slashes inside the field (e.g. "a/b" becomes "ab"). -Useful for secure pathname generation (with dynafiles). -
        replaceReplace slashes inside the field by an underscore. (e.g. "a/b" becomes "a_b"). -Useful for secure pathname generation (with dynafiles). -
        FormatOption values for the general output format.
        jsonencode the value so that it can be used inside a JSON field. This means -that several characters (according to the JSON spec) are being escaped, for -example US-ASCII LF is replaced by "\n". -The json option cannot be used together with either jsonf or csv options. -
        jsonf(available in 6.3.9+) -This signifies that the property should be expressed as a json field. -That means not only the property is written, but rather a complete json field in -the format
        -"fieldname"="value" -where "filedname" is the assigend field name (or the property name if none was assigned) -and value is the end result of property replacer operation. Note that value supports -all property replacer options, like substrings, case converson and the like. -Values are properly json-escaped. However, field names are (currently) not. It is -expected that proper field names are configured. -The jsonf option cannot be used together with either json or csv options. -
        csvformats the resulting field (after all modifications) in CSV format -as specified in RFC 4180. -Rsyslog will always use double quotes. Note that in order to have full CSV-formatted -text, you need to define a proper template. An example is this one: -
        $template csvline,"%syslogtag:::csv%,%msg:::csv%" -
        Most importantly, you need to provide the commas between the fields -inside the template. -The csv option cannot be used together with either json or jsonf options. -
        This feature was introduced in rsyslog 4.1.6. -
        droplastlfThe last LF in the message (if any), is dropped. -Especially useful for PIX.
        spifno1stspThis option looks scary and should probably not be used by a user. For any field -given, it returns either a single space character or no character at all. Field content -is never returned. A space is returned if (and only if) the first character of the -field's content is NOT a space. This option is kind of a hack to solve a problem rooted -in RFC 3164: 3164 specifies no delimiter between the syslog tag sequence and the actual -message text. Almost all implementation in fact delemit the two by a space. As of -RFC 3164, this space is part of the message text itself. This leads to a problem when -building the message (e.g. when writing to disk or forwarding). Should a delimiting -space be included if the message does not start with one? If not, the tag is immediately -followed by another non-space character, which can lead some log parsers to misinterpret -what is the tag and what the message. The problem finally surfaced when the klog module -was restructured and the tag correctly written. It exists with other message sources, -too. The solution was the introduction of this special property replacer option. Now, -the default template can contain a conditional space, which exists only if the -message does not start with one. While this does not solve all issues, it should -work good enough in the far majority of all cases. If you read this text and have -no idea of what it is talking about - relax: this is a good indication you will never -need this option. Simply forget about it ;) -
        New character positionIn addition to the above mentioned Character Positions in the legacy format, -positions can be determined by specifying the correct options for the properties. -Again, this is mostly for using the list format.
        position.FromCharacter position in the property to start from.
        position.ToCharacter position that determines the end for extraction. If the value is "$" -then the end of the string will be used.
        field.NumberThe number of the field, which should be used for the search operation with Regex.
        field.DelimiterThe Character that should delimit a field. Example: ",". Everything in a -property until this character is considered a field.
        regex.ExpressionValue to be compared to property.
        regex.TypeValues BRE or ERE
        regex.NoMatchModeDFLT, BLANK, ZERO, FIELD
        regex.MatchMatch to use.
        regex.SubmatchSubmatch to use. Values 0-9 whereas 0 = All
        - - - -

        Legacy Property Options

        -property options are case-insensitive. Currently, the following options are defined:

        @@ -597,29 +325,6 @@ - - - - - - - - @@ -663,10 +367,6 @@ - - - - @@ -728,33 +428,19 @@ Useful for secure pathname generation (with dynafiles). - - -
        convert property text to uppercase only
        jsonencode the value so that it can be used inside a JSON field. This means -that several characters (according to the JSON spec) are being escaped, for -example US-ASCII LF is replaced by "\n". -The json option cannot be used together with either jsonf or csv options. -
        jsonf(available in 6.3.9+) -This signifies that the property should be expressed as a json field. -That means not only the property is written, but rather a complete json field in -the format
        -"fieldname"="value" -where "filedname" is the assigend field name (or the property name if none was assigned) -and value is the end result of property replacer operation. Note that value supports -all property replacer options, like substrings, case converson and the like. -Values are properly json-escaped. However, field names are (currently) not. It is -expected that proper field names are configured. -The jsonf option cannot be used together with either json or csv options. -
        csv formats the resulting field (after all modifications) in CSV format as specified in RFC 4180. @@ -628,7 +333,6 @@
        $template csvline,"%syslogtag:::csv%,%msg:::csv%"
        Most importantly, you need to provide the commas between the fields inside the template. -The csv option cannot be used together with either json or jsonf options.
        This feature was introduced in rsyslog 4.1.6.
        format as RFC 3339 date
        date-unixtimestampformat as unix timestamp (seconds since epoch)
        date-subseconds just the subseconds of a timestamp (always 0 for a low precision timestamp)
        mandatory-fieldIn templates that are used for building field lists (in particular, ommongodb), include -this field, even if it is empty (or NULL). If not set, the field will be removed from -the output field set if empty. The latter is the default case. -

        To use multiple options, simply place them one after each other with a comma delmimiting them. For example "escape-cc,sp-if-no-1st-sp". If you use conflicting options together, the last one will override the previous one. For example, using "escape-cc,drop-cc" will use drop-cc and "drop-cc,escape-cc" will use escape-cc mode. -

        Fieldname

        -

        (available in 6.3.9+) -

        This field permits to specify a field name for structured-data emitting property replacer -options. It was initially introduced to support the "jsonf" option, for which it provides -the capability to set an alternative field name. If it is not specified, it defaults to -the property name. -See also +

        Further Links

        [manual index] [rsyslog.conf] diff -Nru rsyslog-7.6.0/doc/queues_analogy.html rsyslog-5.10.1/doc/queues_analogy.html --- rsyslog-7.6.0/doc/queues_analogy.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/queues_analogy.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,259 @@ + + +turning lanes and rsyslog queues - an analogy + +back + +

        Turning Lanes and Rsyslog Queues - an Analogy

        +

        If there is a single object absolutely vital to understanding the way +rsyslog works, this object is queues. Queues offer a variety of services, +including support for multithreading. While there is elaborate in-depth +documentation on the ins and outs of rsyslog queues, +some of the concepts are hard to grasp even for experienced people. I think this +is because rsyslog uses a very high layer of abstraction which includes things +that look quite unnatural, like queues that do not actually queue... +

        With this document, I take a different approach: I will not describe every specific +detail of queue operation but hope to be able to provide the core idea of how +queues are used in rsyslog by using an analogy. I will compare the rsyslog data flow +with real-life traffic flowing at an intersection. +

        But first let's set the stage for the rsyslog part. The graphic below describes +the data flow inside rsyslog: +

        rsyslog data flow +

        Note that there is a video tutorial +available on the data flow. It is not perfect, but may aid in understanding this picture. +

        For our needs, the important fact to know is that messages enter rsyslog on "the +left side" (for example, via UDP), are being preprocessed, put into the +so-called main queue, taken off that queue, be filtered and be placed into one or +several action queues (depending on filter results). They leave rsyslog on "the +right side" where output modules (like the file or database writer) consume them. +

        So there are always two stages where a message (conceptually) is queued - first +in the main queue and later on in n action specific queues (with n being the number of +actions that the message in question needs to be processed by, what is being decided +by the "Filter Engine"). As such, a message will be in at least two queues +during its lifetime (with the exception of messages being discarded by the queue itself, +but for the purpose of this document, we will ignore that possibility). +

        Also, it is vitally +important to understand that each action has a queue sitting in front of it. +If you have dug into the details of rsyslog configuration, you have probably seen that +a queue mode can be set for each action. And the default queue mode is the so-called +"direct mode", in which "the queue does not actually enqueue data". +That sounds silly, but is not. It is an important abstraction that helps keep the code clean. +

        To understand this, we first need to look at who is the active component. In our data flow, +the active part always sits to the left of the object. For example, the "Preprocessor" +is being called by the inputs and calls itself into the main message queue. That is, the queue +receiver is called, it is passive. One might think that the "Parser & Filter Engine" +is an active component that actively pulls messages from the queue. This is wrong! Actually, +it is the queue that has a pool of worker threads, and these workers pull data from the queue +and then call the passively waiting Parser and Filter Engine with those messages. So the +main message queue is the active part, the Parser and Filter Engine is passive. +

        Let's now try an analogy analogy for this part: Think about a TV show. The show is produced +in some TV studio, from there sent (actively) to a radio tower. The radio tower passively +receives from the studio and then actively sends out a signal, which is passively received +by your TV set. In our simplified view, we have the following picture: +

        rsyslog queues and TV analogy +

        The lower part of the picture lists the equivalent rsyslog entities, in an abstracted way. +Every queue has a producer (in the above sample the input) and a consumer (in the above sample the Parser +and Filter Engine). Their active and passive functions are equivalent to the TV entities +that are listed on top of the rsyslog entity. For example, a rsyslog consumer can never +actively initiate reception of a message in the same way a TV set cannot actively +"initiate" a TV show - both can only "handle" (display or process) +what is sent to them. +

        Now let's look at the action queues: here, the active part, the producer, is the +Parser and Filter Engine. The passive part is the Action Processor. The later does any +processing that is necessary to call the output plugin, in particular it processes the template +to create the plugin calling parameters (either a string or vector of arguments). From the +action queue's point of view, Action Processor and Output form a single entity. Again, the +TV set analogy holds. The Output does not actively ask the queue for data, but +rather passively waits until the queue itself pushes some data to it. + +

        Armed with this knowledge, we can now look at the way action queue modes work. My analogy here +is a junction, as shown below (note that the colors in the pictures below are not related to +the colors in the pictures above!): +

        +

        This is a very simple real-life traffic case: one road joins another. We look at +traffic on the straight road, here shown by blue and green arrows. Traffic in the +opposing direction is shown in blue. Traffic flows without +any delays as long as nobody takes turns. To be more precise, if the opposing traffic takes +a (right) turn, traffic still continues to flow without delay. However, if a car in the red traffic +flow intends to do a (left, then) turn, the situation changes: +

        +

        The turning car is represented by the green arrow. It cannot turn unless there is a gap +in the "blue traffic stream". And as this car blocks the roadway, the remaining +traffic (now shown in red, which should indicate the block condition), +must wait until the "green" car has made its turn. So +a queue will build up on that lane, waiting for the turn to be completed. +Note that in the examples below I do not care that much about the properties of the +opposing traffic. That is, because its structure is not really important for what I intend to +show. Think about the blue arrow as being a traffic stream that most of the time blocks +left-turners, but from time to time has a gap that is sufficiently large for a left-turn +to complete. +

        Our road network designers know that this may be unfortunate, and for more important roads +and junctions, they came up with the concept of turning lanes: +

        +

        Now, the car taking the turn can wait in a special area, the turning lane. As such, +the "straight" traffic is no longer blocked and can flow in parallel to the +turning lane (indicated by a now-green-again arrow). + +

        However, the turning lane offers only finite space. So if too many cars intend to +take a left turn, and there is no gap in the "blue" traffic, we end up with +this well-known situation: +

        +

        The turning lane is now filled up, resulting in a tailback of cars intending to +left turn on the main driving lane. The end result is that "straight" traffic +is again being blocked, just as in our initial problem case without the turning lane. +In essence, the turning lane has provided some relief, but only for a limited amount of +cars. Street system designers now try to weight cost vs. benefit and create (costly) +turning lanes that are sufficiently large to prevent traffic jams in most, but not all +cases. +

        Now let's dig a bit into the mathematical properties of turning lanes. We assume that +cars all have the same length. So, units of cars, the length is alsways one (which is nice, +as we don't need to care about that factor any longer ;)). A turning lane has finite capacity of +n cars. As long as the number of cars wanting to take a turn is less than or eqal +to n, "straigth traffic" is not blocked (or the other way round, traffic +is blocked if at least n + 1 cars want to take a turn!). We can now find an optimal +value for n: it is a function of the probability that a car wants to turn +and the cost of the turning lane +(as well as the probability there is a gap in the "blue" traffic, but we ignore this +in our simple sample). +If we start from some finite upper bound of n, we can decrease +n to a point where it reaches zero. But let's first look at n = 1, in which case exactly +one car can wait on the turning lane. More than one car, and the rest of the traffic is blocked. +Our everyday logic indicates that this is actually the lowest boundary for n. +

        In an abstract view, however, n can be zero and that works nicely. There still can be +n cars at any given time on the turning lane, it just happens that this means there can +be no car at all on it. And, as usual, if we have at least n + 1 cars wanting to turn, +the main traffic flow is blocked. True, but n + 1 = 0 + 1 = 1 so as soon as there is any +car wanting to take a turn, the main traffic flow is blocked (remember, in all cases, I assume +no sufficiently large gaps in the opposing traffic). +

        This is the situation our everyday perception calls "road without turning lane". +In my math model, it is a "road with turning lane of size 0". The subtle difference +is important: my math model guarantees that, in an abstract sense, there always is a turning +lane, it may just be too short. But it exists, even though we don't see it. And now I can +claim that even in my small home village, all roads have turning lanes, which is rather +impressive, isn't it? ;) +

        And now we finally have arrived at rsyslog's queues! Rsyslog action queues exists for +all actions just like all roads in my village have turning lanes! And as in this real-life sample, +it may be hard to see the action queues for that reason. In rsyslog, the "direct" queue +mode is the equivalent to the 0-sized turning lane. And actions queues are the equivalent to turning +lanes in general, with our real-life n being the maximum queue size. +The main traffic line (which sometimes is blocked) is the equivalent to the +main message queue. And the periods without gaps in the opposing traffic are equivalent to +execution time of an action. In a rough sketch, the rsyslog main and action queues look like in the +following picture. +

        +

        We need to read this picture from right to left (otherwise I would need to redo all +the graphics ;)). In action 3, you see a 0-sized turning lane, aka an action queue in "direct" +mode. All other queues are run in non-direct modes, but with different sizes greater than 0. +

        Let us first use our car analogy: +Assume we are in a car on the main lane that wants to take turn into the "action 4" +road. We pass action 1, where a number of cars wait in the turning lane and we pass +action 2, which has a slightly smaller, but still not filled up turning lane. So we pass that +without delay, too. Then we come to "action 3", which has no turning lane. Unfortunately, +the car in front of us wants to turn left into that road, so it blocks the main lane. So, this time +we need to wait. An observer standing on the sidewalk may see that while we need to wait, there are +still some cars in the "action 4" turning lane. As such, even though no new cars can +arrive on the main lane, cars still turn into the "action 4" lane. In other words, +an observer standing in "action 4" road is unable to see that traffic on the main lane +is blocked. +

        Now on to rsyslog: Other than in the real-world traffic example, messages in rsyslog +can - at more or less the +same time - "take turns" into several roads at once. This is done by duplicating the message +if the road has a non-zero-sized "turning lane" - or in rsyslog terms a queue that is +running in any non-direct mode. If so, a deep copy of the message object is made, that placed into +the action queue and then the initial message proceeds on the "main lane". The action +queue then pushes the duplicates through action processing. This is also the reason why a +discard action inside a non-direct queue does not seem to have an effect. Actually, it discards the +copy that was just created, but the original message object continues to flow. +

        +In action 1, we have some entries in the action queue, as we have in action 2 (where the queue is +slightly shorter). As we have seen, new messages pass action one and two almost instantaneously. +However, when a messages reaches action 3, its flow is blocked. Now, message processing must wait +for the action to complete. Processing flow in a direct mode queue is something like a U-turn: + +

        message processing in an rsyslog action queue in direct mode +

        The message starts to execute the action and once this is done, processing flow continues. +In a real-life analogy, this may be the route of a delivery man who needs to drop a parcel +in a side street before he continues driving on the main route. As a side-note, think of what happens +with the rest of the delivery route, at least for today, if the delivery truck has a serious accident +in the side street. The rest of the parcels won't be delivered today, will they? This is exactly how the +discard action works. It drops the message object inside the action and thus the message will no +longer be available for further delivery - but as I said, only if the discard is done in a +direct mode queue (I am stressing this example because it often causes a lot of confusion). +

        Back to the overall scenario. We have seen that messages need to wait for action 3 to +complete. Does this necessarily mean that at the same time no messages can be processed +in action 4? Well, it depends. As in the real-life scenario, action 4 will continue to +receive traffic as long as its action queue ("turn lane") is not drained. In +our drawing, it is not. So action 4 will be executed while messages still wait for action 3 +to be completed. +

        Now look at the overall picture from a slightly different angle: +

        message processing in an rsyslog action queue in direct mode +

        The number of all connected green and red arrows is four - one each for action 1, 2 and 3 +(this one is dotted as action 4 was a special case) and one for the "main lane" as +well as action 3 (this one contains the sole red arrow). This number is the lower bound for +the number of threads in rsyslog's output system ("right-hand part" of the main message +queue)! Each of the connected arrows is a continuous thread and each "turn lane" is +a place where processing is forked onto a new thread. Also, note that in action 3 the processing +is carried out on the main thread, but not in the non-direct queue modes. +

        I have said this is "the lower bound for the number of threads...". This is with +good reason: the main queue may have more than one worker thread (individual action queues +currently do not support this, but could do in the future - there are good reasons for that, too +but exploring why would finally take us away from what we intend to see). Note that you +configure an upper bound for the number of main message queue worker threads. The actual number +varies depending on a lot of operational variables, most importantly the number of messages +inside the queue. The number t_m of actually running threads is within the integer-interval +[0,confLimit] (with confLimit being the operator configured limit, which defaults to 5). +Output plugins may have more than one thread created by themselves. It is quite unusual for an +output plugin to create such threads and so I assume we do not have any of these. +Then, the overall number of threads in rsyslog's filtering and output system is +t_total = t_m + number of actions in non-direct modes. Add the number of +inputs configured to that and you have the total number of threads running in rsyslog at +a given time (assuming again that inputs utilize only one thread per plugin, a not-so-safe +assumption). +

        A quick side-note: I gave the lower bound for t_m as zero, which is somewhat in contrast +to what I wrote at the begin of the last paragraph. Zero is actually correct, because rsyslog +stops all worker threads when there is no work to do. This is also true for the action queues. +So the ultimate lower bound for a rsyslog output system without any work to carry out actually is zero. +But this bound will never be reached when there is continuous flow of activity. And, if you are +curios: if the number of workers is zero, the worker wakeup process is actually handled within the +threading context of the "left-hand-side" (or producer) of the queue. After being +started, the worker begins to play the active queue component again. All of this, of course, +can be overridden with configuration directives. +

        When looking at the threading model, one can simply add n lanes to the main lane but otherwise +retain the traffic analogy. This is a very good description of the actual process (think what this +means to the "turning lanes"; hint: there still is only one per action!). +

        Let's try to do a warp-up: I have hopefully been able to show that in rsyslog, an action +queue "sits in front of" each output plugin. Messages are received and flow, from input +to output, over various stages and two level of queues to the outputs. Actions queues are always +present, but may not easily be visible when in direct mode (where no actual queuing takes place). +The "road junction with turning lane" analogy well describes the way - and intent - of the various +queue levels in rsyslog. +

        On the output side, the queue is the active component, not the consumer. As such, the consumer +cannot ask the queue for anything (like n number of messages) but rather is activated by the queue +itself. As such, a queue somewhat resembles a "living thing" whereas the outputs are +just tools that this "living thing" uses. +

        Note that I left out a couple of subtleties, especially when it comes +to error handling and terminating +a queue (you hopefully have now at least a rough idea why I say "terminating a queue" +and not "terminating an action" - who is the "living thing"?). An action returns +a status to the queue, but it is the queue that ultimately decides which messages can finally be +considered processed and which not. Please note that the queue may even cancel an output right in +the middle of its action. This happens, if configured, if an output needs more than a configured +maximum processing time and is a guard condition to prevent slow outputs from deferring a rsyslog +restart for too long. Especially in this case re-queuing and cleanup is not trivial. Also, note that +I did not discuss disk-assisted queue modes. The basic rules apply, but there are some additional +constraints, especially in regard to the threading model. Transitioning between actual +disk-assisted mode and pure-in-memory-mode (which is done automatically when needed) is also far from +trivial and a real joy for an implementer to work on ;). +

        If you have not done so before, it may be worth reading the +rsyslog queue user's guide, which most importantly lists all +the knobs you can turn to tweak queue operation. +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/queues.html rsyslog-5.10.1/doc/queues.html --- rsyslog-7.6.0/doc/queues.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/queues.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,398 @@ + + +Understanding rsyslog queues + +back + +

        Understanding rsyslog Queues

        +

        Rsyslog uses queues whenever two activities need to be loosely coupled. With a +queue, one part of the system "produces" something while another part "consumes" +this something. The "something" is most often syslog messages, but queues may +also be used for other purposes.

        +

        This document provides a good insight into technical details, operation modes +and implications. In addition to it, an +rsyslog queue concepts overview document +exists which tries to explain queues with the help of some analogies. This may +probably be a better place to start reading about queues. I assume that once you +have understood that document, the material here will be much easier to grasp +and look much more natural. +

        The most prominent example is the main message queue. Whenever rsyslog +receives a message (e.g. locally, via UDP, TCP or in whatever else way), it +places these messages into the main message queue. Later, it is dequeued by the +rule processor, which then evaluates which actions are to be carried out. In +front of each action, there is also a queue, which potentially de-couples the +filter processing from the actual action (e.g. writing to file, database or +forwarding to another host).

        +

        Where are Queues Used?

        +

        Currently, queues are used for the main message queue and for the +actions.

        +

        There is a single main message queue inside rsyslog. Each input module +delivers messages to it. The main message queue worker filters messages based on +rules specified in rsyslog.conf and dispatches them to the individual action +queues. Once a message is in an action queue, it is deleted from the main +message queue.

        +

        There are multiple action queues, one for each configured action. By default, +these queues operate in direct (non-queueing) mode. Action queues are fully +configurable and thus can be changed to whatever is best for the given use case.

        +

        Future versions of rsyslog will most probably utilize queues at other places, +too.

        +

        Wherever "<object>"  is used in the config file +statements, substitute "<object>" with either "MainMsg" or "Action". The +former will set main message queue +parameters, the later parameters for the next action that will be +created. Action queue parameters can not be modified once the action has been +specified. For example, to tell the main message queue to save its content on +shutdown, use $MainMsgQueueSaveOnShutdown on".

        +

        If the same parameter is specified multiple times before a queue is created, +the last one specified takes precedence. The main message queue is created after +parsing the config file and all of its potential includes. An action queue is +created each time an action selector is specified. Action queue parameters are +reset to default after an action queue has been created (to provide a clean +environment for the next action).

        +

        Not all queues necessarily support the full set of queue configuration +parameters, because not all are applicable. For example, in current output +module design, actions do not support multi-threading. Consequently, the number +of worker threads is fixed to one for action queues and can not be changed.

        +

        Queue Modes

        +

        Rsyslog supports different queue modes, some with submodes. Each of them has +specific advantages and disadvantages. Selecting the right queue mode is quite +important when tuning rsyslogd. The queue mode (aka "type") is set via the "$<object>QueueType" +config directive.

        +

        Direct Queues

        +

        Direct queues are non-queuing queues. A queue in direct mode does +neither queue nor buffer any of the queue elements but rather passes the element +directly (and immediately) from the producer to the consumer. This sounds strange, +but there is a good reason for this queue type.

        +

        Direct mode queues allow to use queues generically, even in places where +queuing is not always desired. A good example is the queue in front of output +actions. While it makes perfect sense to buffer forwarding actions or database +writes, it makes only limited sense to build up a queue in front of simple local +file writes. Yet, rsyslog still has a queue in front of every action. So for +file writes, the queue mode can simply be set to "direct", in which case no +queuing happens.

        +

        Please note that a direct queue also is the only queue type that passes back +the execution return code (success/failure) from the consumer to the producer. +This, for example, is needed for the backup action logic. Consequently, backup +actions require the to-be-checked action to use a "direct" mode queue.

        +

        To create a direct queue, use the "$<object>QueueType Direct" config +directive.

        +

        Disk Queues

        +

        Disk queues use disk drives for buffering. The important fact is that the +always use the disk and do not buffer anything in memory. Thus, the queue is +ultra-reliable, but by far the slowest mode. For regular use cases, this queue +mode is not recommended. It is useful if log data is so important that it must +not be lost, even in extreme cases.

        +

        When a disk queue is written, it is done in chunks. Each chunk receives its +individual file. Files are named with a prefix (set via the "$<object>QueueFilename" +config directive) and followed by a 7-digit number (starting at one and +incremented for each file). Chunks are 10mb by default, a different size can be +set via the"$<object>QueueMaxFileSize" config directive. Note that +the size limit is not a sharp one: rsyslog always writes one complete queue +entry, even if it violates the size limit. So chunks are actually a little but +(usually less than 1k) larger then the configured size. Each chunk also has a +different size for the same reason. If you observe different chunk sizes, you +can relax: this is not a problem.

        +

        Writing in chunks is used so that processed data can quickly be deleted and +is free for other uses - while at the same time keeping no artificial upper +limit on disk space used. If a disk quota is set (instructions further below), +be sure that the quota/chunk size allows at least two chunks to be written. +Rsyslog currently does not check that and will fail miserably if a single chunk +is over the quota.

        +

        Creating new chunks costs performance but provides quicker ability to free +disk space. The 10mb default is considered a good compromise between these two. +However, it may make sense to adapt these settings to local policies. For +example, if a disk queue is written on a dedicated 200gb disk, it may make sense +to use a 2gb (or even larger) chunk size.

        +

        Please note, however, that the disk queue by default does not update its +housekeeping structures every time it writes to disk. This is for performance +reasons. In the event of failure, data will still be lost (except when manually +is mangled with the file structures). However, disk queues can be set to write +bookkeeping information on checkpoints (every n records), so that this can be +made ultra-reliable, too. If the checkpoint interval is set to one, no data can +be lost, but the queue is exceptionally slow.

        +

        Each queue can be placed on a different disk for best performance and/or +isolation. This is currently selected by specifying different $WorkDirectory +config directives before the queue creation statement.

        +

        To create a disk queue, use the "$<object>QueueType Disk" config +directive. Checkpoint intervals can be specified via "$<object>QueueCheckpointInterval", +with 0 meaning no checkpoints. Note that disk-based queues can be made very reliable +by issuing a (f)sync after each write operation. Starting with version 4.3.2, this can +be requested via "<object>QueueSyncQueueFiles on/off with the +default being off. Activating this option has a performance penalty, so it should +not be turned on without reason.

        +

        In-Memory Queues

        +

        In-memory queue mode is what most people have on their mind when they think +about computing queues. Here, the enqueued data elements are held in memory. +Consequently, in-memory queues are very fast. But of course, they do not survive +any program or operating system abort (what usually is tolerable and unlikely). +Be sure to use an UPS if you use in-memory mode and your log data is important +to you. Note that even in-memory queues may hold data for an infinite amount of +time when e.g. an output destination system is down and there is no reason to move +the data out of memory (lying around in memory for an extended period of time is +NOT a reason). Pure in-memory queues can't even store queue elements anywhere +else than in core memory.

        +

        There exist two different in-memory queue modes: LinkedList and FixedArray. +Both are quite similar from the user's point of view, but utilize different +algorithms.

        +

        A FixedArray queue uses a fixed, pre-allocated array that holds pointers to +queue elements. The majority of space is taken up by the actual user data +elements, to which the pointers in the array point. The pointer array itself is +comparatively small. However, it has a certain memory footprint even if the +queue is empty. As there is no need to dynamically allocate any housekeeping +structures, FixedArray offers the best run time performance (uses the least CPU +cycle). FixedArray is best if there is a relatively low number of queue elements +expected and performance is desired. It is the default mode for the main message +queue (with a limit of 10,000 elements).

        +

        A LinkedList queue is quite the opposite. All housekeeping structures are +dynamically allocated (in a linked list, as its name implies). This requires +somewhat more runtime processing overhead, but ensures that memory is only +allocated in cases where it is needed. LinkedList queues are especially +well-suited for queues where only occasionally a than-high number of elements +need to be queued. A use case may be occasional message burst. Memory +permitting, it could be limited to e.g. 200,000 elements which would take up +only memory if in use. A FixedArray queue may have a too large static memory +footprint in such cases.

        +

        In general, it is advised to use LinkedList mode if in doubt. The +processing overhead compared to FixedArray is low and may be +outweigh by the reduction in memory use. Paging in most-often-unused +pointer array pages can be much slower than dynamically allocating them.

        +

        To create an in-memory queue, use the "$<object>QueueType LinkedList" +or  "$<object>QueueType FixedArray" config directive.

        +

        Disk-Assisted Memory Queues

        +

        If a disk queue name is defined for in-memory queues (via +$<object>QueueFileName), they automatically +become "disk-assisted" (DA). In that mode, data is written to disk (and read +back) on an as-needed basis.

        +

        Actually, the regular memory queue (called the +"primary queue") and a disk queue (called the "DA queue") work in tandem in this +mode. Most importantly, the disk queue is activated if the primary queue is full +or needs to be persisted on shutdown. Disk-assisted queues combine the +advantages of pure memory queues with those of  pure disk queues. Under normal +operations, they are very fast and messages will never touch the disk. But if +there is need to, an unlimited amount of messages can be buffered (actually +limited by free disk space only) and data can be persisted between rsyslogd runs.

        +

        With a DA-queue, both disk-specific and in-memory specific configuration +parameters can be set. From the user's point of view, think of a DA queue like a +"super-queue" which does all within a single queue [from the code perspective, +there is some specific handling for this case, so it is actually much like a +single object].

        +

        DA queues are typically used to de-couple potentially long-running and +unreliable actions (to make them reliable). For example, it is recommended to +use a disk-assisted linked list in-memory queue in front of each database and +"send via tcp" action. Doing so makes these actions reliable and de-couples +their potential low execution speed from the rest of your rules (e.g. the local +file writes). There is a howto on +massive database inserts which nicely describes this use case. It may even +be a good read if you do not intend to use databases.

        +

        With DA queues, we do not simply write out everything to disk and then run as +a disk queue once the in-memory queue is full. A much smarter algorithm is used, +which involves a "high watermark" and a "low watermark". Both specify numbers of +queued items. If the queue size reaches high watermark elements, the queue +begins to write data elements to disk. It does so until it reaches the low water +mark elements. At this point, it stops writing until either high water mark is +reached again or the on-disk queue becomes empty, in which case the queue +reverts back to in-memory mode, only. While holding at the low watermark, new +elements are actually enqueued in memory. They are eventually written to disk, +but only if the high water mark is ever reached again. If it isn't, these items +never touch the disk. So even when a queue runs disk-assisted, there is +in-memory data present (this is a big difference to pure disk queues!).

        +

        This algorithm prevents unnecessary disk writes, but also leaves some +additional buffer space for message bursts. Remember that creating disk files +and writing to them is a lengthy operation. It is too lengthy to e.g. block +receiving UDP messages. Doing so would result in message loss. Thus, the queue +initiates DA mode, but still is able to receive messages and enqueue them - as +long as the maximum queue size is not reached. The number of elements between +the high water mark and the maximum queue size serves as this "emergency +buffer". Size it according to your needs, if traffic is very bursty you will +probably need a large buffer here. Keep in mind, though, that under normal +operations these queue elements will probably never be used. Setting the high +water mark too low will cause disk-assistance to be turned on more often than +actually needed.

        +

        The water marks can be set via the "$<object>QueueHighWatermark" and  +"$<object>QueueHighWatermark" configuration file directives. Note that +these are actual numbers, not precentages. Be sure they make sense (also in +respect to "$<object>QueueSize"), as rsyslodg does currently not perform +any checks on the numbers provided. It is easy to screw up the system here (yes, +a feature enhancement request is filed ;)).

        +

        Limiting the Queue Size

        +

        All queues, including disk queues, have a limit of the number of elements +they can enqueue. This is set via the "$<object>QueueSize" config +parameter. Note that the size is specified in number of enqueued elements, not +their actual memory size. Memory size limits can not be set. A conservative +assumption is that a single syslog messages takes up 512 bytes on average +(in-memory, NOT on the wire, this *is* a difference).

        +

        Disk assisted queues are special in that they do not have any size +limit. The enqueue an unlimited amount of elements. To prevent running out of +space, disk and disk-assisted queues can be size-limited via the "$<object>QueueMaxDiskSpace" +configuration parameter. If it is not set, the limit is only available free +space (and reaching this limit is currently not very gracefully handled, so +avoid running into it!). If a limit is set, the queue can not grow larger than +it. Note, however, that the limit is approximate. The engine always writes +complete records. As such, it is possible that slightly more than the set limit +is used (usually less than 1k, given the average message size). Keeping strictly +on the limit would be a performance hurt, and thus the design decision was to +favour performance. If you don't like that policy, simply specify a slightly +lower limit (e.g. 999,999K instead of 1G).

        +

        In general, it is a good idea to limit the pysical disk space even if you +dedicate a whole disk to rsyslog. That way, you prevent it from running out of +space (future version will have an auto-size-limit logic, that then kicks in in +such situations).

        +

        Worker Thread Pools

        +

        Each queue (except in "direct" mode) has an associated pool of worker +threads. Worker threads carry out the action to be performed on the data +elements enqueued. As an actual sample, the main message queue's worker task is +to apply filter logic to each incoming message and enqueue them to the relevant +output queues (actions).

        +

        Worker threads are started and stopped on an as-needed basis. On a system +without activity, there may be no worker at all running. One is automatically +started when a message comes in. Similarily, additional workers are started if +the queue grows above a specific size. The "$<object>QueueWorkerThreadMinimumMessages"  +config parameter controls worker startup. If it is set to the minimum number of +elements that must be enqueued in order to justify a new worker startup. For +example, let's assume it is set to 100. As long as no more than 100 messages are +in the queue, a single worker will be used. When more than 100 messages arrive, +a new worker thread is automatically started. Similarily, a third worker will be +started when there are at least 300 messages, a forth when reaching 400 and so +on.

        +

        It, however, does not make sense to have too many worker threads running in +parall. Thus, the upper limit ca be set via "$<object>QueueWorkerThreads". +If it, for example, is set to four, no more than four workers will ever be +started, no matter how many elements are enqueued.

        +

        Worker threads that have been started are kept running until an inactivity +timeout happens. The timeout can be set via "$<object>QueueWorkerTimeoutThreadShutdown" +and is specified in milliseconds. If you do not like to keep the workers +running, simply set it to 0, which means immediate timeout and thus immediate +shutdown. But consider that creating threads involves some overhead, and this is +why we keep them running. If you would like to never shutdown any worker +threads, specify -1 for this parameter.

        +

        Discarding Messages

        +

        If the queue reaches the so called "discard watermark" (a number of queued +elements), less important messages can automatically be discarded. This is in an +effort to save queue space for more important messages, which you even less like +to loose. Please note that whenever there are more than "discard watermark" +messages, both newly incoming as well as already enqueued low-priority messages +are discarded. The algorithm discards messages newly coming in and those at the +front of the queue.

        +

        The discard watermark is a last resort setting. It should be set sufficiently +high, but low enough to allow for large message burst. Please note that it take +effect immediately and thus shows effect promptly - but that doesn't help if the +burst mainly consist of high-priority messages...

        +

        The discard watermark is set via the "$<object>QueueDiscardMark" +directive. The priority of messages to be discarded is set via "$<object>QueueDiscardSeverity". +This directive accepts both the usual textual severity as well as a +numerical one. To understand it, you must be aware of the numerical +severity values. They are defined in RFC 3164:

        +
                Numerical         Severity
        Code

        0 Emergency: system is unusable
        1 Alert: action must be taken immediately
        2 Critical: critical conditions
        3 Error: error conditions
        4 Warning: warning conditions
        5 Notice: normal but significant condition
        6 Informational: informational messages
        7 Debug: debug-level messages
        +

        Anything of the specified severity and (numerically) above it is +discarded. To turn message discarding off, simply specify the discard +watermark to be higher than the queue size. An alternative is to +specify the numerical value 8 as DiscardSeverity. This is also the +default setting to prevent unintentional message loss. So if you would +like to use message discarding, you need to set" $<object>QueueDiscardSeverity" to an actual value.

        +

        An interesting application is with disk-assisted queues: if the discard +watermark is set lower than the high watermark, message discarding will start +before the queue becomes disk-assisted. This may be a good thing if you would +like to switch to disk-assisted mode only in cases where it is absolutely +unavoidable and you prefer to discard less important messages first.

        +

        Filled-Up Queues

        +

        If the queue has either reached its configured maximum number of entries or +disk space, it is finally full. If so, rsyslogd throttles the data element +submitter. If that, for example, is a reliable input (TCP, local log socket), +that will slow down the message originator which is a good +resolution for this scenario.

        +

        During throtteling, a disk-assisted queue continues to write to disk and +messages are also discarded based on severity as well as regular dequeuing and +processing continues. So chances are good the situation will be resolved by +simply throttling. Note, though, that throtteling is highly undesirable for +unreliable sources, like UDP message reception. So it is not a good thing to run +into throtteling mode at all.

        +

        We can not hold processing +infinitely, not even when throtteling. For example, throtteling the local +log socket too long would cause the system at whole come to a standstill. To +prevent this, rsyslogd times out after a configured period ("$<object>QueueTimeoutEnqueue", +specified in milliseconds) if no space becomes available. As a last resort, it +then discards the newly arrived message.

        +

        If you do not like throtteling, set the timeout to 0 - the message will then +immediately be discarded. If you use a high timeout, be sure you know what you +do. If a high main message queue enqueue timeout is set, it can lead to +something like a complete hang of the system. The same problem does not apply to +action queues.

        +

        Rate Limiting

        +

        Rate limiting provides a way to prevent rsyslogd from processing things too +fast. It can, for example, prevent overruning a receiver system.

        +

        Currently, there are only limited rate-limiting features available. The "$<object>QueueDequeueSlowdown"  +directive allows to specify how long (in microseconds) dequeueing should be +delayed. While simple, it still is powerful. For example, using a +DequeueSlowdown delay of 1,000 microseconds on a UDP send action ensures that no +more than 1,000 messages can be sent within a second (actually less, as there is +also some time needed for the processing itself).

        Processing Timeframes

        Queues +can be set to dequeue (process) messages only during certain +timeframes. This is useful if you, for example, would like to transfer +the bulk of messages only during off-peak hours, e.g. when you have +only limited bandwidth on the network path the the central server.

        Currently, +only a single timeframe is supported and, even worse, it can only be +specified by the hour. It is not hard to extend rsyslog's capabilities +in this regard - it was just not requested so far. So if you need more +fine-grained control, let us know and we'll probably implement it. +There are two configuration directives, both should be used together or +results are unpredictable:" $<object>QueueDequeueTimeBegin <hour>" and "$<object>QueueDequeueTimeEnd <hour>". The hour parameter must be specified in 24-hour format (so 10pm is 22). A use case for this parameter can be found in the rsyslog wiki.

        +

        Performance

        +

        The locking involved with maintaining the queue has a potentially large +performance impact. How large this is, and if it exists at all, depends much on +the configuration and actual use case. However, the queue is able to work on +so-called "batches" when dequeueing data elements. With batches, +multiple data elements are dequeued at once (with a single locking call). +The queue dequeues all available elements up to a configured upper +limit (<object>DequeueBatchSize <number>). It is important +to note that the actual upper limit is dictated by availability. The queue engine +will never wait for a batch to fill. So even if a high upper limit is configured, +batches may consist of fewer elements, even just one, if there are no more elements +waiting in the queue. +

        Batching +can improve performance considerably. Note, however, that it affects the +order in which messages are passed to the queue worker threads, as each worker +now receive as batch of messages. Also, the larger the batch size and the higher +the maximum number of permitted worker threads, the more main memory is needed. +For a busy server, large batch sizes (around 1,000 or even more elements) may be useful. +Please note that with batching, the main memory must hold BatchSize * NumOfWorkers +objects in memory (worst-case scenario), even if running in disk-only mode. So if you +use the default 5 workers at the main message queue and set the batch size to 1,000, you need +to be prepared that the main message queue holds up to 5,000 messages in main memory +in addition to the configured queue size limits! +

        The queue object's default maximum batch size +is eight, but there exists different defaults for the actual parts of +rsyslog processing that utilize queues. So you need to check these object's +defaults. +

        Terminating Queues

        +

        Terminating a process sounds easy, but can be complex. +Terminating a running queue is in fact the most complex operation a queue +object can perform. You don't see that from a user's point of view, but its +quite hard work for the developer to do everything in the right order.

        +

        The complexity arises when the queue has still data enqueued when it +finishes. Rsyslog tries to preserve as much of it as possible. As a first +measure, there is a regular queue time out ("$<object>QueueTimeoutShutdown", +specified in milliseconds): the queue workers are given that time period to +finish processing the queue.

        +

        If after that period there is still data in the queue, workers are instructed +to finish the current data element and then terminate. This essentially means +any other data is lost. There is another timeout ("$<object>QueueTimeoutActionCompletion", +also specified in milliseconds) that specifies how long the workers have to +finish the current element. If that timeout expires, any remaining workers are +cancelled and the queue is brought down.

        +

        If you do not like to lose data on shutdown, the "$<object>QueueSaveOnShutdown" +parameter can be set to "on". This requires either a disk or disk-assisted +queue. If set, rsyslogd ensures that any queue elements are saved to disk before +it terminates. This includes data elements there were begun being processed by +workers that needed to be cancelled due to too-long processing. For a large +queue, this operation may be lengthy. No timeout applies to a required shutdown +save.

        +[manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008, 2009 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/queueWorkerLogic.jpg and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/queueWorkerLogic.jpg differ Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/queueWorkerLogic_small.jpg and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/queueWorkerLogic_small.jpg differ diff -Nru rsyslog-7.6.0/doc/rainerscript.html rsyslog-5.10.1/doc/rainerscript.html --- rsyslog-7.6.0/doc/rainerscript.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rainerscript.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,75 @@ + + +RainerScript + + + +

        RainerScript

        +

        RainerScript is a scripting language specifically +designed and well-suited +for processing network events and configuring event processors +(with the most prominent sample being syslog). While RainerScript is +theoritically usable with various softwares, it currently is being +used, and developed for, rsyslog. Please note that RainerScript may not +be abreviated as rscript, because that's somebody elses trademark.

        +

        RainerScript is currently under development. It has its first +appearance in rsyslog 3.12.0, where it provides complex expression +support. However, this is only a very partial implementatio of the +scripting language. Due to technical restrictions, the final +implementation will have a slightly different syntax. So while you are +invited to use the full power of expresssions, you unfortunatley need +to be prepared to change your configuration files at some later points. +Maintaining backwards-compatibility at this point would cause us to +make too much compromise. Defering the release until everything is +perfect is also not a good option. So use your own judgement.

        +

        A formal definition of the language can be found in RainerScript ABNF. The +rest of this document describes the language from the user's point of +view. Please note that this doc is also currently under development and +can (and will) probably improve as time progresses. If you have +questions, use the rsyslog forum. Feedback is also always welcome.

        +

        Data Types

        +RainerScript is a typeless language. That doesn't imply you don't need +to care about types. Of course, expressions like "A" + "B" will not +return a valid result, as you can't really add two letters (to +concatenate them, use the concatenation operator &). + However, all type conversions are automatically done by the +script interpreter when there is need to do so.
        +

        Expressions

        +The language supports arbitrary complex expressions. All usual +operators are supported. The precedence of operations is as follows +(with operations being higher in the list being carried out before +those lower in the list, e.g. multiplications are done before additions.
        +
          +
        • expressions in parenthesis
        • not, unary minus
        • *, /, % (modulus, as in C)
        • +, -, & (string concatenation)
        • ==, !=, <>, <, >, <=, >=, contains (strings!), startswith (strings!)
        • and
        • or
        • +
        For example, "not a == b" probably returns not what you intended. +The script processor will first evaluate "not a" and then compare the +resulting boolean to the value of b. What you probably intended to do +is "not (a == b)". And if you just want to test for inequality, we +highly suggest to use "!=" or "<>". Both are exactly the same and +are provided so that you can pick whichever you like best. So inquality +of a and b should be tested as "a <> b". The "not" operator +should be reserved to cases where it actually is needed to form a +complex boolean expression. In those cases, parenthesis are highly +recommended. +

        Functions

        +

        RainerScript supports a currently quite limited set of functions: +

          +
        • getenv(str) - like the OS call, returns the value of the environment +variable, if it exists. Returns an empty string if it does not exist. +
        • strlen(str) - returns the length of the provided string +
        • tolower(str) - converts the provided string into lowercase +
        +

        The following example can be used to build a dynamic filter based on some environment +variable: +

        +if $msg contains getenv('TRIGGERVAR') then /path/to/errfile
        +
        +

        [rsyslog.conf overview] +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008, 2009 by Rainer Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/rsconf1_actionexeconlywhenpreviousissuspended.html rsyslog-5.10.1/doc/rsconf1_actionexeconlywhenpreviousissuspended.html --- rsyslog-7.6.0/doc/rsconf1_actionexeconlywhenpreviousissuspended.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_actionexeconlywhenpreviousissuspended.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,31 @@ + + +rsyslog.conf file + + +back + +

        $ActionExecOnlyWhenPreviousIsSuspended

        +

        Type: global configuration directive

        +

        Default: off

        +

        Description:

        +

        This directive allows to specify if actions should always be executed ("off," the default) or only if the previous action is suspended ("on"). This directive works hand-in-hand with the multiple actions per selector feature. It can be used, for example, to create rules that automatically switch destination servers or databases to a (set of) backup(s), if the primary server fails. Note that this feature depends on proper implementation of the suspend feature in the output module. All built-in output modules properly support it (most importantly the database write and the syslog message forwarder).

        +

        This selector processes all messages it receives (*.*). It tries to forward every message to primary-syslog.example.com (via tcp). If it can not reach that server, it tries secondary-1-syslog.example.com, if that fails too, it tries secondary-2-syslog.example.com. If neither of these servers can be connected, the data is stored in /var/log/localbuffer. Please note that the secondaries and the local log buffer are only used if the one before them does not work. So ideally, /var/log/localbuffer will never receive a message. If one of the servers resumes operation, it automatically takes over processing again.

        +

        We strongly advise not to use repeated line reduction together with ActionExecOnlyWhenPreviousIsSuspended. It may lead to "interesting" and undesired results (but you can try it if you like).

        +

        Sample:

        +

        *.* @@primary-syslog.example.com +
        $ActionExecOnlyWhenPreviousIsSuspended on +
        & @@secondary-1-syslog.example.com # & is used to have more than one action for +
        & @@secondary-2-syslog.example.com # the same selector - the mult-action feature +
        & /var/log/localbuffer +
        $ActionExecOnlyWhenPreviousIsSuspended off # to re-set it for the next selector

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_actionresumeinterval.html rsyslog-5.10.1/doc/rsconf1_actionresumeinterval.html --- rsyslog-7.6.0/doc/rsconf1_actionresumeinterval.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_actionresumeinterval.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,32 @@ + + +rsyslog.conf file + + +back + +

        $ActionResumeInterval

        +

        Type: global configuration directive

        +

        Default: 30

        +

        Description:

        +

        Sets the ActionResumeInterval for all following actions. The interval +provided is always in seconds. Thus, multiply by 60 if you need minutes and +3,600 if you need hours (not recommended).

        +

        When an action is suspended (e.g. destination can not be connected), the +action is resumed for the configured interval. Thereafter, it is retried. If +multiple retires fail, the interval is automatically extended. This is to +prevent excessive ressource use for retires. After each 10 retries, the interval +is extended by itself. To be precise, the actual interval is (numRetries / 10 + +1) * $ActionResumeInterval. so after the 10th try, it by default is 60 and after +the 100th try it is 330.

        +

        Sample:

        +

        $ActionResumeInterval 30

        +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_allowedsender.html rsyslog-5.10.1/doc/rsconf1_allowedsender.html --- rsyslog-7.6.0/doc/rsconf1_allowedsender.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_allowedsender.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,30 @@ + + +rsyslog.conf file + + +back + +

        $AllowedSender

        +

        Type: global configuration directive

        +

        Default: all allowed

        +

        Description:

        +

        Allowed sender lists can be used to specify which remote systems are allowed to send syslog messages to rsyslogd. With them, further hurdles can be placed between an attacker and rsyslogd. If a message from a system not in the allowed sender list is received, that message is discarded. A diagnostic message is logged, so that the fact is recorded (this message can be turned off with the "-w" rsyslogd command line option).

        +

        Allowed sender lists can be defined for UDP and TCP senders separately. There can be as many allowed senders as needed. The syntax to specify them is:

        +

        $AllowedSender , ip[/bits], ip[/bits]

        +

        "$AllowedSender" is the directive - it must be written exactly as shown and the $ must start at the first column of the line. "" is either "UDP" or "TCP". It must immediately be followed by the comma, else you will receive an error message. "ip[/bits]" is a machine or network ip address as in "192.0.2.0/24" or "127.0.0.1". If the "/bits" part is omitted, a single host is assumed (32 bits or mask 255.255.255.255). "/0" is not allowed, because that would match any sending system. If you intend to do that, just remove all $AllowedSender directives. If more than 32 bits are requested with IPv4, they are adjusted to 32. For IPv6, the limit is 128 for obvious reasons. Hostnames, with and without wildcards, may also be provided. If so, the result of revers DNS resolution is used for filtering. Multiple allowed senders can be specified in a comma-delimited list. Also, multiple $AllowedSender lines can be given. They are all combined into one UDP and one TCP list. Performance-wise, it is good to specify those allowed senders with high traffic volume before those with lower volume. As soon as a match is found, no further evaluation is necessary and so you can save CPU cycles.

        +

        Rsyslogd handles allowed sender detection very early in the code, nearly as the first action after receiving a message. This keeps the access to potential vulnerable code in rsyslog at a minimum. However, it is still a good idea to impose allowed sender limitations via firewalling.

        +

        WARNING: by UDP design, rsyslogd can not identify a spoofed sender address in UDP syslog packets. As such, a malicious person could spoof the address of an allowed sender, send such packets to rsyslogd and rsyslogd would accept them as being from the faked sender. To prevent this, use syslog via TCP exclusively. If you need to use UDP-based syslog, make sure that you do proper egress and ingress filtering at the firewall and router level.

        +

        Rsyslog also detects some kind of malicious reverse DNS entries. In any case, using DNS names adds an extra layer of vulnerability. We recommend to stick with hard-coded IP addresses wherever possible.

        +

        Sample:

        +

        $AllowedSender UDP, 127.0.0.1, 192.0.2.0/24, [::1]/128, *.example.net, somehost.example.com

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_controlcharacterescapeprefix.html rsyslog-5.10.1/doc/rsconf1_controlcharacterescapeprefix.html --- rsyslog-7.6.0/doc/rsconf1_controlcharacterescapeprefix.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_controlcharacterescapeprefix.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,25 @@ + + +rsyslog.conf file + + +back + +

        $ControlCharacterEscapePrefix

        +

        Type: global configuration directive

        +

        Default: \

        +

        Description:

        +

        This option specifies the prefix character to be used for control character escaping (see option $EscapeControlCharactersOnReceive). By default, it is '\', which is backwards-compatible with sysklogd. Change it to '#' in order to be compliant to the value that is somewhat suggested by Internet-Draft syslog-protocol.

        +

        IMPORTANT: do not use the ' character. This is reserved and will most probably be used in the future as a character delimiter. For the same reason, the syntax of this directive will probably change in future releases.

        +

        Sample:

        +

        $EscapeControlCharactersOnReceive #  # as of syslog-protocol

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_debugprintcfsyslinehandlerlist.html rsyslog-5.10.1/doc/rsconf1_debugprintcfsyslinehandlerlist.html --- rsyslog-7.6.0/doc/rsconf1_debugprintcfsyslinehandlerlist.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_debugprintcfsyslinehandlerlist.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $DebugPrintCFSyslineHandlerList

        +

        Type: global configuration directive

        +

        Default: on

        +

        Description:

        +

        Specifies whether or not the configuration file sysline handler list should be written to the debug log. Possible values: on/off. Default is on. Does not affect operation if debugging is disabled.

        +

        Sample:

        +

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_debugprintmodulelist.html rsyslog-5.10.1/doc/rsconf1_debugprintmodulelist.html --- rsyslog-7.6.0/doc/rsconf1_debugprintmodulelist.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_debugprintmodulelist.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,23 @@ + + +rsyslog.conf file + + +back +

        $DebugPrintModuleList

        +

        Type: global configuration directive

        +

        Default: on

        +

        Description:

        +

        Specifies whether or not the module list should be written to the debug log. Possible values: on/off. Default is on. Does not affect operation if debugging is disabled.

        +

        Sample:

        +

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_debugprinttemplatelist.html rsyslog-5.10.1/doc/rsconf1_debugprinttemplatelist.html --- rsyslog-7.6.0/doc/rsconf1_debugprinttemplatelist.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_debugprinttemplatelist.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $DebugPrintTemplateList

        +

        Type: global configuration directive

        +

        Default: on

        +

        Description:

        +

        Specifies whether or not the template list should be written to the debug log. Possible values: on/off. Default is on. Does not affect operation if debugging is disabled..

        +

        Sample:

        +

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_dircreatemode.html rsyslog-5.10.1/doc/rsconf1_dircreatemode.html --- rsyslog-7.6.0/doc/rsconf1_dircreatemode.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_dircreatemode.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,28 @@ + + +rsyslog.conf file + + +back + +

        $DirCreateMode

        +

        Type: global configuration directive

        +

        Default: 0700

        +

        Description:

        +

        This is the same as $FileCreateMode, but for directories automatically generated.

        +

        Please visit the +rsyslog mailing list +archive +to understand why the default is so restrictive.

        +

        Sample:

        +

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007-2009 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_dirgroup.html rsyslog-5.10.1/doc/rsconf1_dirgroup.html --- rsyslog-7.6.0/doc/rsconf1_dirgroup.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_dirgroup.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $DirGroup

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        Set the group for directories newly created. Please note that this setting does not affect the group of directories already existing. The parameter is a group name, for which the groupid is obtained by rsyslogd on during startup processing. Interim changes to the user mapping are not detected.

        +

        Sample:

        +

        $DirGroup loggroup

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_dirowner.html rsyslog-5.10.1/doc/rsconf1_dirowner.html --- rsyslog-7.6.0/doc/rsconf1_dirowner.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_dirowner.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $DirOwner

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        Set the file owner for directories newly created. Please note that this setting does not affect the owner of directories already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        +

        Sample:

        +

        $DirOwner loguser

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_dropmsgswithmaliciousdnsptrrecords.html rsyslog-5.10.1/doc/rsconf1_dropmsgswithmaliciousdnsptrrecords.html --- rsyslog-7.6.0/doc/rsconf1_dropmsgswithmaliciousdnsptrrecords.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_dropmsgswithmaliciousdnsptrrecords.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $DropMsgsWithMaliciousDnsPTRRecords

        +

        Type: global configuration directive

        +

        Default: off

        +

        Description:

        +

        Rsyslog contains code to detect malicious DNS PTR records (reverse name resolution). An attacker might use specially-crafted DNS entries to make you think that a message might have originated on another IP address. Rsyslog can detect those cases. It will log an error message in any case. If this option here is set to "on", the malicious message will be completely dropped from your logs. If the option is set to "off", the message will be logged, but the original IP will be used instead of the DNS name.

        +

        Sample:

        +

        $DropMsgsWithMaliciousDnsPTRRecords on

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_droptrailinglfonreception.html rsyslog-5.10.1/doc/rsconf1_droptrailinglfonreception.html --- rsyslog-7.6.0/doc/rsconf1_droptrailinglfonreception.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_droptrailinglfonreception.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $DropTrailingLFOnReception

        +

        Type: global configuration directive

        +

        Default: on

        +

        Description:

        +

        Syslog messages frequently have the line feed character (LF) as the last character of the message. In almost all cases, this LF should not really become part of the message. However, recent IETF syslog standardization recommends against modifying syslog messages (e.g. to keep digital signatures valid). This option allows to specify if trailing LFs should be dropped or not. The default is to drop them, which is consistent with what sysklogd does.

        +

        Sample:

        +

        $DropTrailingLFOnRecption on

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_dynafilecachesize.html rsyslog-5.10.1/doc/rsconf1_dynafilecachesize.html --- rsyslog-7.6.0/doc/rsconf1_dynafilecachesize.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_dynafilecachesize.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,25 @@ + + +rsyslog.conf file + + +back + +

        $DynaFileCacheSize

        +

        Type: global configuration directive

        +

        Default: 10

        +

        Description:

        +

        This directive specifies the maximum size of the cache for dynamically-generated file names. Selector lines with dynamic files names ('?' indicator) support writing to multiple files with a single selector line. This setting specifies how many open file handles should be cached. If, for example, the file name is generated with the hostname in it and you have 100 different hosts, a cache size of 100 would ensure that files are opened once and then stay open. This can be a great way to increase performance. If the cache size is lower than the number of different files, the least recently used one is discarded (and the file closed). The hardcoded maximum is 10,000 - a value that we assume should already be very extreme. Please note that if you expect to run with a very large number of files, you probably need to reconfigure the kernel to support such a large number. In practice, we do NOT recommend to use a cache of more than 1,000 entries. The cache lookup would probably require more time than the open and close operations. The minimum value is 1.

        +

        Numbers are always in decimal. Leading zeros should be avoided (in some later version, they may be mis-interpreted as being octal). Multiple directives may be given. They are applied to selector lines based on order of appearance.

        +

        Sample:

        +

        $DynaFileCacheSize 100    # a cache of 100 files at most

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_escape8bitcharsonreceive.html rsyslog-5.10.1/doc/rsconf1_escape8bitcharsonreceive.html --- rsyslog-7.6.0/doc/rsconf1_escape8bitcharsonreceive.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_escape8bitcharsonreceive.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,44 @@ + + +rsyslog.conf file + + +back + +

        $Escape8BitCharactersOnReceive

        +

        Type: global configuration directive

        +

        Default: off

        +

        Available Since: 5.5.2

        +

        Description:

        +

        This directive instructs rsyslogd to replace non US-ASCII characters (those that +have the 8th bit set) during reception of the message. +This may be useful for some systems. +Please note that this escaping breaks Unicode and many other encodings. Most importantly, +it can be assumed that Asian and European characters will be rendered hardly readable by +this settings. However, it may still be useful when the logs themself are primarily +in English and only occasionally contain local script. +If this option is turned on, all control-characters are converted to a 3-digit octal number and be prefixed with the $ControlCharacterEscapePrefix character (being '#' by default). +

        Warning:

        +
          +
        • turning on this option most probably destroys non-western character sets + (like Japanese, Chinese and Korean) as well as European character sets.
        • +
        • turning on this option destroys digital signatures if such exists inside + the message
        • +
        • if turned on, the drop-cc, space-cc and escape-cc + property replacer options do not work + as expected because control characters are already removed upon message + reception. If you intend to use these property replacer options, you must + turn off $Escape8BitCharactersOnReceive.
        • +
        +

        Sample:

        +

        $Escape8BitCharactersOnReceive on

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2010 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_escapecontrolcharactersonreceive.html rsyslog-5.10.1/doc/rsconf1_escapecontrolcharactersonreceive.html --- rsyslog-7.6.0/doc/rsconf1_escapecontrolcharactersonreceive.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_escapecontrolcharactersonreceive.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,36 @@ + + +rsyslog.conf file + + +back + +

        $EscapeControlCharactersOnReceive

        +

        Type: global configuration directive

        +

        Default: on

        +

        Description:

        +

        This directive instructs rsyslogd to replace control characters during reception of the message. The intent is to provide a way to stop non-printable messages from entering the syslog system as whole. If this option is turned on, all control-characters are converted to a 3-digit octal number and be prefixed with the $ControlCharacterEscapePrefix character (being '\' by default). For example, if the BEL character (ctrl-g) is included in the message, it would be converted to "\007". To be compatible to sysklogd, this option must be turned on.

        +

        Warning:

        +
          +
        • turning on this option most probably destroys non-western character sets + (like Japanese, Chinese and Korean)
        • +
        • turning on this option destroys digital signatures if such exists inside + the message
        • +
        • if turned on, the drop-cc, space-cc and escape-cc + property replacer options do not work + as expected because control characters are already removed upon message + reception. If you intend to use these property replacer options, you must + turn off $EscapeControlCharactersOnReceive.
        • +
        +

        Sample:

        +

        $EscapeControlCharactersOnReceive on

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_failonchownfailure.html rsyslog-5.10.1/doc/rsconf1_failonchownfailure.html --- rsyslog-7.6.0/doc/rsconf1_failonchownfailure.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_failonchownfailure.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $FailOnChownFailure

        +

        Type: global configuration directive

        +

        Default: on

        +

        Description:

        +

        This option modifies behaviour of dynaFile creation. If different owners or groups are specified for new files or directories and rsyslogd fails to set these new owners or groups, it will log an error and NOT write to the file in question if that option is set to "on". If it is set to "off", the error will be ignored and processing continues. Keep in mind, that the files in this case may be (in)accessible by people who should not have permission. The default is "on".

        +

        Sample:

        +

        $FailOnChownFailure off

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_filecreatemode.html rsyslog-5.10.1/doc/rsconf1_filecreatemode.html --- rsyslog-7.6.0/doc/rsconf1_filecreatemode.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_filecreatemode.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,37 @@ + + +rsyslog.conf file + + +back + +

        $FileCreateMode

        +

        Type: global configuration directive

        +

        Default: 0644

        +

        Description:

        +

        The $FileCreateMode directive allows to specify the creation mode with which rsyslogd creates new files. If not specified, the value 0644 is used (which retains backward-compatibility with earlier releases). The value given must always be a 4-digit octal number, with the initial digit being zero.

        +

        Please note that the actual permission depend on rsyslogd's process umask. If in doubt, use "$umask 0000" right at the beginning of the configuration file to remove any restrictions.

        +

        $FileCreateMode may be specified multiple times. If so, it specifies the creation mode for all selector lines that follow until the next $FileCreateMode directive. Order of lines is vitally important.

        +

        Sample:

        +

        $FileCreateMode 0600

        +

        This sample lets rsyslog create files with read and write access only for the users it runs under.

        +

        The following sample is deemed to be a complete rsyslog.conf: +

        $umask 0000 # make sure nothing interferes with the following +definitions
        +*.* /var/log/file-with-0644-default
        +$FileCreateMode 0600
        +*.* /var/log/file-with-0600
        +$FileCreateMode 0644
        +*.* /var/log/file-with-0644

        +

        As you can see, open modes depend on position in the config file. Note the +first line, which is created with the hardcoded default creation mode.

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_filegroup.html rsyslog-5.10.1/doc/rsconf1_filegroup.html --- rsyslog-7.6.0/doc/rsconf1_filegroup.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_filegroup.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $FileGroup

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        Set the group for dynaFiles newly created. Please note that this setting does not affect the group of files already existing. The parameter is a group name, for which the groupid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        +

        Sample:

        +

        $FileGroup loggroup

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_fileowner.html rsyslog-5.10.1/doc/rsconf1_fileowner.html --- rsyslog-7.6.0/doc/rsconf1_fileowner.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_fileowner.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $FileOwner

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        Set the file owner for dynaFiles newly created. Please note that this setting does not affect the owner of files already existing. The parameter is a user name, for which the userid is obtained by rsyslogd during startup processing. Interim changes to the user mapping are not detected.

        +

        Sample:

        +

        $FileOwner loguser

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_generateconfiggraph.html rsyslog-5.10.1/doc/rsconf1_generateconfiggraph.html --- rsyslog-7.6.0/doc/rsconf1_generateconfiggraph.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_generateconfiggraph.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,127 @@ + + +rsyslog.conf file + + +back + +

        $GenerateConfigGraph

        +

        Type: global configuration directive

        +

        Default:

        +

        Available Since: 4.3.1 CURRENTLY NOT AVAILABLE

        +

        Description:

        +This directive is currently not supported. We had to disable it when we improved the +rule engine. It is considerable effort to re-enable it. On the other hand, we are about +to add a new config system, which will make yet another config graph method necessary. +As such we have decided to currently disable this functionality and re-introduce it when +the new config system has been instantiated. +

        +

        This directive permits to create (hopefully) good-looking visualizations of rsyslogd's +configuration. It does not affect rsyslog operation. If the directive is specified multiple +times, all but the last are ignored. If it is specified, a graph is created. This happens +both during a regular startup as well a config check run. It is recommended to include +this directive only for documentation purposes and remove it from a production +configuraton. +

        The graph is not drawn by rsyslog itself. Instead, it uses the great open source tool +Graphviz to do the actual drawing. This has at least +two advantages: +

          +
        • the graph drawing support code in rsyslog is extremly slim and without overhead +
        • the user may change or further annotate the generated file, thus potentially +improving his documentation +
        +The drawback, of course, is that you need to run Graphviz once you have generated +the control file with rsyslog. Fortunately, the process to do so is rather easy: +
          +
        1. add "$GenerateConfigGraph /path/to/file.dot" to rsyslog.conf (from now on, I +will call the file just file.dot). Optionally, add "$ActionName" statement +in front of those actions that you like to use friendly names with. If you do +this, keep the names short. +
        2. run rsyslog at least once (either in regular or configuration check mode) +
        3. remember to remove the $GenerateConfigGraph directive when you no longer need it (or +comment it out) +
        4. change your working directory to where you place the dot file +
        5. if you would like to edit the rsyslog-generated file, now is the time to do so +
        6. do "dot -Tpng file.dot > file.png" +
        7. remember that you can use "convert -resize 50% file.png resized.png" if +dot's output is too large (likely) or too small. Resizing can be especially useful if +you intend to get a rough overview over your configuration. +
        +After completing these steps, you should have a nice graph of your configuration. Details +are missing, but that is exactly the point. At the start of the graph is always (at least +in this version, could be improved) a node called "inputs" in a tripple hexagon +shape. This represents all inputs active in the system (assuming you have defined some, +what the current version does not check). Next comes the main queue. It is given in a +hexagon shape. That shape indicates that a queue is peresent and used to de-couple +the inbound from the outbound part of the graph. In technical terms, here is a +threading boundary. Action with "real" queues (other than in direct mode) +also utilize this shape. For actions, notice that a "hexagon action" creates +a deep copy of the message. As such, a "discard hexagon action" actually does +nothing, because it duplicates the message and then discards the duplicate. +At the end of the diagram, you always see a "discard" action. This indicates +that rsyslog discards messages which have been run through all available rules. +

        Edges are labeled with information about when they are taken. For filters, the type of +filter, but not any specifics, are given. It is also indicated if no filter is +applied in the configuration file (by using a "*.*" selector). Edges without +labels are unconditionally taken. The actions themselfs are labeled with the name of +the output module that handles them. If provided, the name given via +"ActionName" is used instead. No further details are provided. +

        If there is anything in red, this should draw your attention. In this case, rsyslogd +has detected something that does not look quite right. A typical example is a discard +action which is followed by some other actions in an action unit. Even though something +may be red, it can be valid - rsyslogd's graph generator does not yet check each and +every speciality, so the configuration may just cover a very uncommon case. +

        Now let's look at some examples. The graph below was generated on a fairly standard +Fedora rsyslog.conf file. It had only the usually commented-out last forwarding action +activated: +

        +rsyslog configuration graph for a default fedora rsyslog.conf +

        This is the typical structure for a simple rsyslog configuration. There are a couple of +actions, each guarded by a filter. Messages run from top to bottom and control branches +whenever a filter evaluates to true. As there is no discard action, all messages will +run through all filters and discarded in the system default discard action right after +all configured actions. +

        +

        A more complex example can be seen in the next graph. This is a configuration I +created for testing the graph-creation features, so it contains a little bit of +everything. However, real-world configurations can look quite complex, too (and I +wouldn't say this one is very complex): +

        + +

        +

        Here, we have a user-defined discard action. You can immediately see this because +processing branches after the first "builtin-file" action. Those messages +where the filter evaluates to true for will never run through the left-hand action +branch. However, there is also a configuration error present: there are two more +actions (now shown red) after the discard action. As the message is discarded, these will +never be executed. Note that the discard branch contains no further filters. This is +because these actions are all part of the same action unit, which is guarded only by +an entry filter. The same is present a bit further down at the node labeled +"write_system_log_2". This note has one more special feature, that is label +was set via "ActionName", thus is does not have standard form (the same +happened to the node named "Forward" right at the top of the diagram. +Inside this diagram, the "Forward" node is executed asynchonously on its own +queue. All others are executed synchronously. +

        Configuration graphs are useful for documenting a setup, but are also a great +troubleshooting resource. It is important to +remember that these graphs are generated +from rsyslogd's in-memory action processing structures. You can not get closer +to understanding on how rsyslog interpreted its configuration files. +So if the graph does not look +what you intended to do, there is probably something worng in rsyslog.conf. +

        If something is not working as expected, but you do not spot the error immediately, +I recommend to generate a graph and zoom it so that you see all of it in one great picture. +You may not be able to read anything, but the structure should look good to you and +so you can zoom into those areas that draw your attention. +

        Sample:

        +

        $DirOwner /path/to/graphfile-file.dot

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_gssforwardservicename.html rsyslog-5.10.1/doc/rsconf1_gssforwardservicename.html --- rsyslog-7.6.0/doc/rsconf1_gssforwardservicename.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_gssforwardservicename.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,26 @@ + + +rsyslog.conf file + + +back + +

        $GssForwardServiceName

        +

        Type: global configuration directive

        +

        Default: host

        +

        Provided by: omgssapi

        +

        Description:

        +

        Specifies the service name used by the client when forwarding GSS-API wrapped messages.

        +

        The GSS-API service names are constructed by appending '@' and a hostname following "@@" in each selector.

        +

        Sample:

        +

        $GssForwardServiceName rsyslog

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_gsslistenservicename.html rsyslog-5.10.1/doc/rsconf1_gsslistenservicename.html --- rsyslog-7.6.0/doc/rsconf1_gsslistenservicename.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_gsslistenservicename.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $GssListenServiceName

        +

        Type: global configuration directive

        +

        Default: host

        +

        Description:

        +

        Specifies the service name used by the server when listening for GSS-API wrapped messages.

        +

        Sample:

        +

        $GssForwardServiceName rsyslog

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_gssmode.html rsyslog-5.10.1/doc/rsconf1_gssmode.html --- rsyslog-7.6.0/doc/rsconf1_gssmode.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_gssmode.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,26 @@ + + +rsyslog.conf file + + +back + +

        $GssMode

        +

        Type: global configuration directive

        +

        Default: encryption

        +

        Provided by: omgssapi

        +

        Description:

        +

        Specifies GSS-API mode to use, which can be "integrity" - clients are authenticated and + messages are checked for integrity, "encryption" - same as + "integrity", but messages are also encrypted if both sides support it.

        Sample:

        +

        $GssMode Encryption

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_includeconfig.html rsyslog-5.10.1/doc/rsconf1_includeconfig.html --- rsyslog-7.6.0/doc/rsconf1_includeconfig.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_includeconfig.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,48 @@ + + +rsyslog.conf file + + +back + +

        $IncludeConfig

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        This directive allows to include other files into the main configuration file. As soon as an IncludeConfig directive is found, the contents of the new file is processed. IncludeConfigs can be nested. Please note that from a logical point of view the files are merged. Thus, if the include modifies some parameters (e.g. $DynaFileChacheSize), these new parameters are in place for the "calling" configuration file when the include is completed. To avoid any side effects, do a $ResetConfigVariables after the $IncludeConfig. It may also be a good idea to do a $ResetConfigVariables right at the start of the include, so that the module knows exactly what it does. Of course, one might specifically NOT do this to inherit parameters from the main file. As always, use it as it best fits...

        +

        If all regular files in the /etc/rsyslog.d directory are included, then files starting with "." are ignored - so you can use them to place comments into the dir (e.g. "/etc/rsyslog.d/.mycomment" will be ignored). Michael Biebl had the idea to this functionality. Let me quote hím:

        +
        +

        Say you can add an option
        +$IncludeConfig /etc/rsyslog.d/
        +(which probably would make a good default)
        +to /etc/rsyslog.conf, which would then merge and include all *.conf files
        +in /etc/rsyslog.d/.
        +
        +This way, a distribution can modify its packages easily to drop a simple
        +config file into this directory upon installation.
        +
        +As an example, the network-manager package could install a simple config
        +file /etc/rsyslog.d/network-manager.conf which would contain.
        +:programname, contains, "NetworkManager" -/var/log/NetworkManager.log
        +
        +Upon uninstallation, the file could be easily removed again. This approach
        +would be much cleaner and less error prone, than having to munge around
        +with the /etc/rsyslog.conf file directly.

        +
        +

        Sample:

        +

        $IncludeConfig /etc/some-included-file.conf

        +

        Directories can also be included. To do so, the name must end on a slash:

        +

        $IncludeConfig /etc/rsyslog.d/

        +

        And finally, only specific files matching a wildcard my be included +from a directory:

        +

        $IncludeConfig /etc/rsyslog.d/*.conf

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_mainmsgqueuesize.html rsyslog-5.10.1/doc/rsconf1_mainmsgqueuesize.html --- rsyslog-7.6.0/doc/rsconf1_mainmsgqueuesize.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_mainmsgqueuesize.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $MainMsgQueueSize

        +

        Type: global configuration directive

        +

        Default: 10000

        +

        Description:

        +

        This allows to specify the maximum size of the message queue. This directive is only available when rsyslogd has been compiled with multithreading support. In this mode, receiver and output modules are de-coupled via an in-memory queue. This queue buffers messages when the output modules are not capable to process them as fast as they are received. Once the queue size is exhausted, messages will be dropped. The slower the output (e.g. MySQL), the larger the queue should be. Buffer space for the actual queue entries is allocated on an as-needed basis. Please keep in mind that a very large queue may exhaust available system memory and swap space. Keep this in mind when configuring the max size. The actual size of a message depends largely on its content and the originator. As a rule of thumb, typically messages should not take up more then roughly 1k (this is the memory structure, not what you see in a network dump!). For typical linux messages, 512 bytes should be a good bet. Please also note that there is a minimal amount of memory taken for each queue entry, no matter if it is used or not. This is one pointer value, so on 32bit systems, it should typically be 4 bytes and on 64bit systems it should typically be 8 bytes. For example, the default queue size of 10,000 entries needs roughly 40k fixed overhead on a 32 bit system.

        +

        Sample:

        +

        $MainMsgQueueSize 100000 # 100,000 may be a value to handle burst traffic

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_markmessageperiod.html rsyslog-5.10.1/doc/rsconf1_markmessageperiod.html --- rsyslog-7.6.0/doc/rsconf1_markmessageperiod.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_markmessageperiod.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,32 @@ + + +rsyslog.conf file + + +back + +

        $MarkMessagePeriod

        +

        Type: specific to immark input module

        +

        Default: 1200 (20 minutes)

        +

        Description:

        +

        This specifies when mark messages are to be written to output modules. The +time specified is in seconds. Specifying 0 is possible and disables mark +messages. In that case, however, it is more efficient to NOT load the immark +input module.

        +

        So far, there is only one mark message process and any subsequent +$MarkMessagePeriod overwrites the previous.

        +

        This directive is only available after the immark input module has been +loaded.

        +

        Sample:

        +

        $MarkMessagePeriod  600 # mark messages appear every 10 Minutes

        +

        Available since: rsyslog 3.0.0

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_moddir.html rsyslog-5.10.1/doc/rsconf1_moddir.html --- rsyslog-7.6.0/doc/rsconf1_moddir.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_moddir.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,29 @@ + + +rsyslog.conf file + + +back + +

        $ModDir

        +

        Type: global configuration directive

        +

        Default: system default for user libraries, e.g. +/usr/local/lib/rsyslog/

        +

        Description:

        +

        Provides the default directory in which loadable modules reside. This may be +used to specify an alternate location that is not based on the system default. +If the system default is used, there is no need to specify this directive. Please +note that it is vitally important to end the path name with a slash, else module +loads will fail.

        +

        Sample:

        +

        $ModDir /usr/rsyslog/libs/  # note the trailing slash!

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_modload.html rsyslog-5.10.1/doc/rsconf1_modload.html --- rsyslog-7.6.0/doc/rsconf1_modload.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_modload.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,34 @@ + + +rsyslog.conf file + + +back + +

        $ModLoad

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        Dynamically loads a plug-in into rsyslog's address space and activates it. +The plug-in must obey the rsyslog module API. Currently, only MySQL and Postgres +output modules are available +as a plugins, but users may create their own. A plug-in must be loaded BEFORE +any configuration file lines that reference it.

        +

        Modules must be present in the system default destination for rsyslog +modules. You can also set the directory via the +$ModDir directive.

        +

        If a full path name is specified, the module is loaded from that path. The +default module directory is ignored in that case.

        +

        Sample:

        +

        $ModLoad ommysql # load MySQL functionality
        +$ModLoad /rsyslog/modules/ompgsql.so # load the postgres module via absolute path

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_repeatedmsgreduction.html rsyslog-5.10.1/doc/rsconf1_repeatedmsgreduction.html --- rsyslog-7.6.0/doc/rsconf1_repeatedmsgreduction.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_repeatedmsgreduction.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,25 @@ + + +rsyslog.conf file + + +back + +

        $RepeatedMsgReduction

        +

        Type: global configuration directive

        +

        Default: depending on -e

        +

        Description:

        +

        This directive specifies whether or not repeated messages should be reduced (this is the "Last line repeated n times" feature). If set to on, repeated messages are reduced. If set to off, every message is logged. Please note that this directive overrides the -e command line option. In case -e is given, it is just the default value until the first RepeatedMsgReduction directive is encountered.

        +

        This directives affects selector lines until a new directive is specified.

        +

        Sample:

        +

        $RepeatedMsgReduction off    # log every message

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_resetconfigvariables.html rsyslog-5.10.1/doc/rsconf1_resetconfigvariables.html --- rsyslog-7.6.0/doc/rsconf1_resetconfigvariables.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_resetconfigvariables.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,24 @@ + + +rsyslog.conf file + + +back + +

        $ResetConfigVariables

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        Resets all configuration variables to their default value. Any settings made will not be applied to configuration lines following the $ResetConfigVariables. This is a good method to make sure no side-effects exists from previous directives. This directive has no parameters.

        +

        Sample:

        +

        $ResetConfigVariables

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_rulesetcreatemainqueue.html rsyslog-5.10.1/doc/rsconf1_rulesetcreatemainqueue.html --- rsyslog-7.6.0/doc/rsconf1_rulesetcreatemainqueue.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_rulesetcreatemainqueue.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,83 @@ + + +RulesetCreateMainQueue - rsyslog.conf file + + +rsyslog.conf configuration directive + +

        $RulesetCreateMainQueue

        +

        Type: ruleset-specific configuration directive

        +

        Parameter Values: boolean (on/off, yes/no)

        +

        Available since: 5.3.5+

        +

        Default: off

        +

        Description:

        +

        +Rulesets may use their own "main" message queue for message submission. Specifying +this directive, inside a ruleset definition, turns this on. This is both a performance +enhancement and also permits different rulesets (and thus different inputs within the same +rsyslogd instance) to use different types of main message queues. +

        The ruleset queue is created with the parameters that are specified for the main message +queue at the time the directive is given. If different queue configurations are desired, +different main message queue directives must be used in front of the $RulesetCreateMainQueue +directive. Note that this directive may only be given once per ruleset. If multiple statements +are specified, only the first is used and for the others error messages are emitted. +

        Note that the final set of ruleset configuration directives specifies the parameters for +the default main message queue. +

        To learn more about this feature, please be sure to read about +multi-ruleset support in rsyslog. +

        Caveats:

        +The configuration statement "$RulesetCreateMainQueue off" has no effect at all. +The capability to specify this is an artifact of the current (ugly!) configuration +language. + +

        Example:

        +

        This example sets up a tcp server with three listeners. Each of these +three listener is bound to a specific ruleset. As a performance optimization, +the rulesets all receive their own private queue. The result is that received messages +can be independently processed. With only a single main message queue, we would have +some lock contention between the messages. This does not happen here. Note that in this +example, we use different processing. Of course, all messages could also have been +processed in the same way ($IncludeConfig may be useful in that case!). +

        + +

        Note the positions of the directives. With the current config language, +position is very important. This is ugly, but unfortunately the way it currently +works. +

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. Released under the GNU GPL version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_rulesetparser.html rsyslog-5.10.1/doc/rsconf1_rulesetparser.html --- rsyslog-7.6.0/doc/rsconf1_rulesetparser.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_rulesetparser.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,123 @@ + + +RulesetParser - rsyslog.conf file + + +rsyslog.conf configuration directive + +

        $RulesetParser

        +

        Type: ruleset-specific configuration directive

        +

        Parameter Values: string

        +

        Available since: 5.3.4+

        +

        Default: rsyslog.rfc5424 followed by rsyslog.rfc5425

        +

        Description:

        +

        +This directive permits to specify which +message parsers should be used for the ruleset +in question. It no ruleset is explicitely specified, the default ruleset is used. Message +parsers are contained in (loadable) parser modules with the most common cases +(RFC3164 and RFC5424) being build-in into rsyslogd. +

        When this directive is specified the first time for a ruleset, it will not only add the +parser to the ruleset's parser chain, it will also wipe out the default parser chain. +So if you need to have +them in addition to the custom parser, you need to specify those as well. +

        Order of directives is important. Parsers are tried one after another, in the order +they are specified inside the config. As soon as a parser is able to parse the message, +it will do so and no other parsers will be executed. If no matching parser can be found, +the message will be discarded and a warning message be issued (but only for the first +1,000 instances of this problem, to prevent message generation loops). +

        Note that the rfc3164 parser will always be able to parse a message - it may +just not be the format that you like. This has two important implications: 1) always place +that parser at the END of the parser list, or the other parsers after it will never +be tried and 2) if you would like to make sure no message is lost, placing the rfc3164 +parser at the end of the parser list ensures that. +

        Multiple parser modules are very useful if you have various devices that emit +messages that are malformed in various ways. The route to take then is +

          +
        • make sure you find a custom parser for that device; if there is no one, you +may consider writing one yourself (it is not that hard) or getting one written +as part of +Adiscon's professional services +for rsyslog. +
        • load your custom parsers via $ModLoad +
        • create a ruleset for each malformed format; assign the custom parser to it +
        • create a specific listening port for all devices that emit the same +malformed format +
        • bind the listener to the ruleset with the required parser +
        +

        Note that it may be cumbersome to add all rules to all rulesets. To avoid this, +you can either use $Include or omruleset +(what probably provides the best solution). +

        More information about rulesets in general can be found in +multi-ruleset support in rsyslog. +

        Caveats:

        +

        currently none known

        + +

        Example:

        +

        This example assumes there are two devices emiting malformed messages via UDP. +We have two custom parsers for them, named "device1.parser" and +"device2.parser". In addition to that, we have a number of other +devices sending wellformed messages, also via UDP. +

        The solution is to listen for data from the two devices on two special +ports (10514 and 10515 in this example), create a ruleset for each and +assign the custom parsers to them. The rest of the messages are received via +port 514 using the regular parsers. Processing shall be equal for all messages. +So we simply forward the malformed messages to the regular queue once they are parsed (keep +in mind that a message is never again parsed once any parser properly processed it). +

        + + +

        For an example of how multiple parser can be chained (and an actual use case), please see +the example section on the pmlastmsg parser +module. +

        Note the positions of the directives. With the current config language, +sequence of statements is very important. This is ugly, but unfortunately +the way it currently works. +

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2009 by Rainer Gerhards and +Adiscon. Released under the GNU GPL version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rsconf1_umask.html rsyslog-5.10.1/doc/rsconf1_umask.html --- rsyslog-7.6.0/doc/rsconf1_umask.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsconf1_umask.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,26 @@ + + +rsyslog.conf file + + +back + +

        $UMASK

        +

        Type: global configuration directive

        +

        Default:

        +

        Description:

        +

        The $umask directive allows to specify the rsyslogd processes' umask. If not specified, the system-provided default is used. The value given must always be a 4-digit octal number, with the initial digit being zero.

        +

        If $umask is specified multiple times in the configuration file, results may be somewhat unpredictable. It is recommended to specify it only once.

        +

        Sample:

        +

        $umask 0000

        +

        This sample removes all restrictions.

        + +

        [rsyslog.conf overview] [manual +index] [rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2007 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + diff -Nru rsyslog-7.6.0/doc/rscript_abnf.html rsyslog-5.10.1/doc/rscript_abnf.html --- rsyslog-7.6.0/doc/rscript_abnf.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rscript_abnf.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,43 @@ + + +RainerScript ABNF + +

        RainerScript ABNF

        +

        This is the formal definition of RainerScript, as supported by +rsyslog configuration. Please note that this currently is working +document and the actual implementation may be quite different.

        +

        The +first glimpse of RainerScript will be available as part of rsyslog +3.12.0 expression support. However, the 3.12. series of rsyslog will +have a partial script implementaiton, which will not necessariy be +compatible with the later full implementation. So if you use it, be +prepared for some config file changes as RainerScript evolves.

        +

        C-like comments (/* some comment */) are supported in all pure +RainerScript lines. However, legacy-mapped lines do not support them. +All lines support the hash mark "#" as a comment initiator. Everything +between the hash and the end of line is a comment (just like // in C++ +and many other languages).

        +

        Formal Definition

        +

        Below is the formal language definitionin ABNF (RFC 2234) +format:
        +

        +
        ; all of this is a working document and may change! -- rgerhards, 2008-02-24

        script := *stmt
        stmt := (if_stmt / block / vardef / run_s / load_s)
        vardef := "var" ["scope" = ("global" / "event")]
        block := "begin" stmt "end"
        load_s := "load" constraint ("module") modpath params ; load mod only if expr is true
        run_s := "run" constraint ("input") name
        constraint:= "if" expr ; constrains some one-time commands
        modpath := expr
        params := ["params" *1param *("," param) "endparams"]
        param := paramname) "=" expr
        paramname := [*(obqualifier ".") name]
        modpath:= ; path to module
        ?line? := cfsysline / cfli
        cfsysline:= BOL "$" *char EOL ; how to handle the first line? (no EOL in front!)
        BOL := ; Begin of Line - implicitely set on file beginning and after each EOL
        EOL := 0x0a ;LF
        if_stmt := "if" expr "then"
        old_filter:= BOL facility "." severity ; no whitespace allowed between BOL and facility!
        facility := "*" / "auth" / "authpriv" / "cron" / "daemon" / "kern" / "lpr" /
        "mail" / "mark" / "news" / "security" / "syslog" / "user" / "uucp" /
        "local0" .. "local7" / "mark"
        ; The keyword security should not be used anymore
        ; mark is just internal
        severity := TBD ; not really relevant in this context

        ; and now the actual expression
        expr := e_and *("or" e_and)
        e_and := e_cmp *("and" e_cmp)
        e_cmp := val 0*1(cmp_op val)
        val := term *(("+" / "-" / "&") term)
        term := factor *(("*" / "/" / "%") factor)
        factor := ["not"] ["-"] terminal
        terminal := var / constant / function / ( "(" expr ")" )
        function := name "(" *("," expr) ")"
        var := "$" varname
        varname := msgvar / sysvar
        msgvar := name
        sysvar := "$" name
        name := alpha *(alnum)
        constant := string / number
        string := simpstr / tplstr ; tplstr will be implemented in next phase
        simpstr := "'" *char "'" ; use your imagination for char ;)
        tplstr := '"' template '"' ; not initially implemented
        number := ["-"] 1*digit ; 0nn = octal, 0xnn = hex, nn = decimal
        cmp_op := "==" / "!=" / "<>" / "<" / ">" / "<=" / ">=" / "contains" / "contains_i" / "startswith" / "startswith_i"
        digit := %x30-39
        alpha := "a" ... "z" # all letters
        alnum :* alpha / digit / "_" /"-" # "-" necessary to cover currently-existing message properties
        +

        Samples

        +

        Some samples of RainerScript:

        define function IsLinux
        begin
            if $environ contains "linux" then return true else return false
        end

        load if IsLinux() 'imklog.so' params name='klog' endparams /* load klog under linux only */
        run if IsLinux() input 'klog'
        load 'ommysql.so'

        if $message contains "error" then
          action
            type='ommysql.so', queue.mode='disk', queue.highwatermark = 300,
            action.dbname='events', action.dbuser='uid',
          +  [?action.template='templatename'?] or [?action.sql='insert into +table... values('&$facility&','&$severity&...?]
          endaction

        ... or ...

        define action writeMySQL
            type='ommysql.so', queue.mode='disk', queue.highwatermark = 300,
            action.dbname='events', action.dbuser='uid',
            [?action.template='templatename'?] or [?action.sql='insert into table... values(' & $facility & ','  & $severity &...?]
           endaction

        if $message contains "error" then action writeMySQL

        ALTERNATE APPROACH

        define function IsLinux(
            if $environ contains "linux" then return true else return false
        )

        load if IsLinux() 'imklog.so' params name='klog' endparams /* load klog under linux only */
        run if IsLinux() input 'klog'
        load 'ommysql.so'

        if $message contains "error" then
          action(
            type='ommysql.so', queue.mode='disk', queue.highwatermark = 300,
            action.dbname='events', action.dbuser='uid',
          +  [?action.template='templatename'?] or [?action.sql='insert into +table... values('&$facility&','&$severity&...?]
          )

        ... or ...

        define action writeMySQL(
            type='ommysql.so', queue.mode='disk', queue.highwatermark = 300,
            action.dbname='events', action.dbuser='uid',
          +  [?action.template='templatename'?] or [?action.sql='insert into +table... values('&$facility&','&$severity&...?]
           )

        if $message contains "error" then action writeMySQL(action.dbname='differentDB')

        [rsyslog.conf overview] +

        Implementation

        +RainerScript will be implemented via a hand-crafted LL(1) parser. I was tempted to use yacc, but it turned out the resulting code was not thread-safe and as such did not fit within the context of rsyslog. Also, limited error handling is not a real problem for us: if there is a problem in parsing the configuration file, we stop processing. Guessing what was meant and trying to recover would IMHO not be good choices for something like a syslogd. +[manual index] [rsyslog site]

        +

        This documentation is part of the +rsyslog +project.
        +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

        + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_actions.html rsyslog-5.10.1/doc/rsyslog_conf_actions.html --- rsyslog-7.6.0/doc/rsyslog_conf_actions.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_actions.html 2012-09-23 10:29:49.000000000 +0000 @@ -0,0 +1,345 @@ + +Actions - rsyslog.conf + +

        This is a part of the rsyslog.conf documentation.

        +back +

        Actions

        +

        The action field of a rule describes what to do with the +message. In general, message content is written to a kind of "logfile". +But also other actions might be done, like writing to a database table +or forwarding to another host.
        +
        +Templates can be used with all actions. If used, the specified template +is used to generate the message content (instead of the default +template). To specify a template, write a semicolon after the action +value immediately followed by the template name.
        +
        +Beware: templates MUST be defined BEFORE they are used. It is OK to +define some templates, then use them in selector lines, define more +templates and use use them in the following selector lines. But it is +NOT permitted to use a template in a selector line that is above its +definition. If you do this, the action will be ignored.

        +

        You can have multiple actions for a single selector  (or +more precisely a single filter of such a selector line). Each action +must be on its own line and the line must start with an ampersand +('&') character and have no filters. An example would be

        +

        *.=crit :omusrmsg:rger
        +& root
        +& /var/log/critmsgs

        +

        These three lines send critical messages to the user rger and +root and also store them in /var/log/critmsgs. Using multiple +actions per selector is convenient and also offers +a performance benefit. As the filter needs to be evaluated +only once, there is less computation required to process the directive +compared to the otherwise-equal config directives below:

        +

        *.=crit :omusrmsg:rger
        +*.=crit root
        +*.=crit /var/log/critmsgs

        +

         

        +

        Regular File

        +

        Typically messages are logged to real files. The file usually is +specified by full pathname, beginning with a slash "/". +Starting with version 4.6.2 and 5.4.1 (previous v5 version do NOT support this) +relative file names can also be specified. To do so, these must begin with a +dot. For example, use "./file-in-current-dir.log" to specify a file in the +current directory. Please note that rsyslogd usually changes its working +directory to the root, so relative file names must be tested with care (they +were introduced primarily as a debugging vehicle, but may have useful other applications +as well).
        +
        +
        +You may prefix each entry with the minus "-'' sign to omit syncing the +file after every logging. Note that you might lose information if the +system crashes right behind a write attempt. Nevertheless this might +give you back some performance, especially if you run programs that use +logging in a very verbose manner.

        +

        If your system is connected to a reliable UPS and you receive +lots of log data (e.g. firewall logs), it might be a very good idea to +turn of +syncing by specifying the "-" in front of the file name.

        +

        The filename can be either static (always +the same) or dynamic (different based on message +received). The later is useful if you would automatically split +messages into different files based on some message criteria. For +example, dynamic file name selectors allow you to split messages into +different files based on the host that sent them. With dynamic file +names, everything is automatic and you do not need any filters.

        +

        It works via the template system. First, you define a template +for the file name. An example can be seen above in the description of +template. We will use the "DynFile" template defined there. Dynamic +filenames are indicated by specifying a questions mark "?" instead of a +slash, followed by the template name. Thus, the selector line for our +dynamic file name would look as follows:

        +
        +*.* ?DynFile +
        +

        That's all you need to do. Rsyslog will now automatically +generate file names for you and store the right messages into the right +files. Please note that the minus sign also works with dynamic file +name selectors. Thus, to avoid syncing, you may use

        +
        +*.* -?DynFile
        +

        And of course you can use templates to specify the output +format:

        +
        +*.* ?DynFile;MyTemplate
        +

        A word of caution: rsyslog creates files as +needed. So if a new host is using your syslog server, rsyslog will +automatically create a new file for it.

        +

        Creating directories is also supported. For +example you can use the hostname as directory and the program name as +file name:

        +
        +$template DynFile,"/var/log/%HOSTNAME%/%programname%.log"
        +

        Named Pipes

        +

        This version of rsyslogd(8) has support for logging output to +named pipes (fifos). A fifo or named pipe can be used as a destination +for log messages by prepending a pipe symbol ("|'') to the name of the +file. This is handy for debugging. Note that the fifo must be created +with the mkfifo(1) command before rsyslogd(8) is started.

        +

        Terminal and Console

        +

        If the file you specified is a tty, special tty-handling is +done, same with /dev/console.

        +

        Remote Machine

        +

        Rsyslogd provides full remote logging, i.e. is able to send +messages to a remote host running rsyslogd(8) and to receive messages +from remote hosts. Using this feature you're able to control all syslog +messages on one host, if all other machines will log remotely to that. +This tears down administration needs.

        +

        To forward messages to another host, prepend the hostname with +the at sign ("@"). A single at sign means that messages will +be forwarded via UDP protocol (the standard for syslog). If you prepend +two at signs ("@@"), the messages will be transmitted via TCP. Please +note that plain TCP based syslog is not officially standardized, but +most major syslogds support it (e.g. syslog-ng or +WinSyslog). The +forwarding action indicator (at-sign) can be followed by one or more +options. If they are given, they must be immediately (without a space) +following the final at sign and be enclosed in parenthesis. The +individual options must be separated by commas. The following options +are right now defined:

        + + + + + + + + + + + +
        +

        z<number>

        +
        Enable zlib-compression for the message. The +<number> is the compression level. It can be 1 (lowest +gain, lowest CPU overhead) to 9 (maximum compression, highest CPU +overhead). The level can also be 0, which means "no compression". If +given, the "z" option is ignored. So this does not make an awful lot of +sense. There is hardly a difference between level 1 and 9 for typical +syslog messages. You can expect a compression gain between 0% and 30% +for typical messages. Very chatty messages may compress up to 50%, but +this is seldom seen with typically traffic. Please note that rsyslogd +checks the compression gain. Messages with 60 bytes or less will never +be compressed. This is because compression gain is pretty unlikely and +we prefer to save CPU cycles. Messages over that size are always +compressed. However, it is checked if there is a gain in compression +and only if there is, the compressed message is transmitted. Otherwise, +the uncompressed messages is transmitted. This saves the receiver CPU +cycles for decompression. It also prevents small message to actually +become larger in compressed form. +

        Please note that when a TCP transport is used, +compression will also turn on syslog-transport-tls framing. See the "o" +option for important information on the implications.

        +

        Compressed messages are automatically detected and +decompressed by the receiver. There is nothing that needs to be +configured on the receiver side.

        +
        +

        o

        +
        This option is experimental. Use at your own +risk and only if you know why you need it! If in doubt, do NOT turn it +on. +

        This option is only valid for plain TCP based +transports. It selects a different framing based on IETF internet draft +syslog-transport-tls-06. This framing offers some benefits over +traditional LF-based framing. However, the standardization effort is +not yet complete. There may be changes in upcoming versions of this +standard. Rsyslog will be kept in line with the standard. There is some +chance that upcoming changes will be incompatible to the current +specification. In this case, all systems using -transport-tls framing +must be upgraded. There will be no effort made to retain compatibility +between different versions of rsyslog. The primary reason for that is +that it seems technically impossible to provide compatibility between +some of those changes. So you should take this note very serious. It is +not something we do not *like* to do (and may change our mind if enough +people beg...), it is something we most probably *can not* do for +technical reasons (aka: you can beg as much as you like, it won't +change anything...).

        +

        The most important implication is that compressed syslog +messages via TCP must be considered with care. Unfortunately, it is +technically impossible to transfer compressed records over traditional +syslog plain tcp transports, so you are left with two evil choices...

        +
        +


        +The hostname may be followed by a colon and the destination port.

        +

        The following is an example selector line with forwarding:

        +

        *.*    @@(o,z9)192.168.0.1:1470

        +

        In this example, messages are forwarded via plain TCP with +experimental framing and maximum compression to the host 192.168.0.1 at +port 1470.

        +

        *.* @192.168.0.1

        +

        In the example above, messages are forwarded via UDP to the +machine 192.168.0.1, the destination port defaults to 514. Messages +will not be compressed.

        +

        Note that IPv6 addresses contain colons. So if an IPv6 address is specified +in the hostname part, rsyslogd could not detect where the IP address ends +and where the port starts. There is a syntax extension to support this: +put squary brackets around the address (e.g. "[2001::1]"). Square +brackets also work with real host names and IPv4 addresses, too. +

        A valid sample to send messages to the IPv6 host 2001::1 at port 515 +is as follows: +

        *.* @[2001::1]:515 +

        This works with TCP, too. +

        Note to sysklogd users: sysklogd does not +support RFC 3164 format, which is the default forwarding template in +rsyslog. As such, you will experience duplicate hostnames if rsyslog is +the sender and sysklogd is the receiver. The fix is simple: you need to +use a different template. Use that one:

        +

        $template +sysklogd,"<%PRI%>%TIMESTAMP% %syslogtag%%msg%\""
        +*.* @192.168.0.1;sysklogd

        +

        List of Users

        +

        Usually critical messages are also directed to "root'' on +that machine. You can specify a list of users that shall get the +message by simply writing ":omusrmsg: followed by the login name. For example, +the send messages to root, use ":omusrmsg:root". +You may specify more than one user +by separating them with commas (",''). Do not repeat the ":omusrmsg:" prefix in +this case. For example, to send data to users root and rger, use +":omusrmsg:root,rger" (do not use ":omusrmsg:root,:omusrmsg:rger", this is invalid). +If they're logged in they get +the message.

        +

        Everyone logged on

        +

        Emergency messages often go to all users currently online to +notify them that something strange is happening with the system. To +specify this wall(1)-feature use an asterisk as the user message +destination(":omusrmsg:*'').

        +

        Call Plugin

        +

        This is a generic way to call an output plugin. The plugin +must support this functionality. Actual parameters depend on the +module, so see the module's doc on what to supply. The general syntax +is as follows:

        +

        :modname:params;template

        +

        Currently, the ommysql database output module supports this +syntax (in addtion to the ">" syntax it traditionally +supported). For ommysql, the module name is "ommysql" and the params +are the traditional ones. The ;template part is not module specific, it +is generic rsyslog functionality available to all modules.

        +

        As an example, the ommysql module may be called as follows:

        +

        :ommysql:dbhost,dbname,dbuser,dbpassword;dbtemplate

        +

        For details, please see the "Database Table" section of this +documentation.

        +

        Note: as of this writing, the ":modname:" part is hardcoded +into the module. So the name to use is not necessarily the name the +module's plugin file is called.

        +

        Database Table

        +

        This allows logging of the message to a database table. +Currently, only MySQL databases are supported. However, other database +drivers will most probably be developed as plugins. By default, a MonitorWare-compatible +schema is required for this to work. You can create that schema with +the createDB.SQL file that came with the rsyslog package. You can also
        +use any other schema of your liking - you just need to define a proper +template and assign this template to the action.
        +
        +The database writer is called by specifying a greater-then sign +(">") in front of the database connect information. Immediately +after that
        +sign the database host name must be given, a comma, the database name, +another comma, the database user, a comma and then the user's password. +If a specific template is to be used, a semicolon followed by the +template name can follow the connect information. This is as follows:
        +
        +>dbhost,dbname,dbuser,dbpassword;dbtemplate

        +

        Important: to use the database functionality, the +MySQL output module must be loaded in the config file BEFORE +the first database table action is used. This is done by placing the

        +

        $ModLoad ommysql

        +

        directive some place above the first use of the database write +(we recommend doing at the the beginning of the config file).

        +

        Discard

        +

        If the discard action is carried out, the received message is +immediately discarded. No further processing of it occurs. Discard has +primarily been added to filter out messages before carrying on any +further processing. For obvious reasons, the results of "discard" are +depending on where in the configuration file it is being used. Please +note that once a message has been discarded there is no way to retrieve +it in later configuration file lines.

        +

        Discard can be highly effective if you want to filter out some +annoying messages that otherwise would fill your log files. To do that, +place the discard actions early in your log files. This often plays +well with property-based filters, giving you great freedom in +specifying what you do not want.

        +

        Discard is just the single tilde character with no further +parameters:

        +

        ~

        +

        For example,

        +

        *.*   ~

        +

        discards everything (ok, you can achive the same by not +running rsyslogd at all...).

        +

        Output Channel

        +

        Binds an output channel definition (see there for details) to +this action. Output channel actions must start with a $-sign, e.g. if +you would like to bind your output channel definition "mychannel" to +the action, use "$mychannel". Output channels support template +definitions like all all other actions.

        +

        Shell Execute

        +

        This executes a program in a subshell. The program is passed +the template-generated message as the only command line parameter. +Rsyslog waits until the program terminates and only then continues to +run.

        +

        ^program-to-execute;template

        +

        The program-to-execute can be any valid executable. It +receives the template string as a single parameter (argv[1]).

        +

        WARNING: The Shell Execute action was added +to serve an urgent need. While it is considered reasonable save when +used with some thinking, its implications must be considered. The +current implementation uses a system() call to execute the command. +This is not the best way to do it (and will hopefully changed in +further releases). Also, proper escaping of special characters is done +to prevent command injection. However, attackers always find smart ways +to circumvent escaping, so we can not say if the escaping applied will +really safe you from all hassles. Lastly, rsyslog will wait until the +shell command terminates. Thus, a program error in it (e.g. an infinite +loop) can actually disable rsyslog. Even without that, during the +programs run-time no messages are processed by rsyslog. As the IP +stacks buffers are quickly overflowed, this bears an increased risk of +message loss. You must be aware of these implications. Even though they +are severe, there are several cases where the "shell execute" action is +very useful. This is the reason why we have included it in its current +form. To mitigate its risks, always a) test your program thoroughly, b) +make sure its runtime is as short as possible (if it requires a longer +run-time, you might want to spawn your own sub-shell asynchronously), +c) apply proper firewalling so that only known senders can send syslog +messages to rsyslog. Point c) is especially important: if rsyslog is +accepting message from any hosts, chances are much higher that an +attacker might try to exploit the "shell execute" action.

        +

        Template Name

        +

        Every ACTION can be followed by a template name. If so, that +template is used for message formatting. If no name is given, a +hard-coded default template is used for the action. There can only be +one template name for each given action. The default template is +specific to each action. For a description of what a template is and +what you can do with it, see "TEMPLATES" at the top of this document.

        + + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008-2011 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_examples.html rsyslog-5.10.1/doc/rsyslog_conf_examples.html --- rsyslog-7.6.0/doc/rsyslog_conf_examples.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_examples.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,209 @@ + +Examples - rsyslog.conf + +

        This is a part of the rsyslog.conf documentation.

        +back +

        Examples

        +

        Below are example for templates and selector lines. I hope +they are self-explanatory. If not, please see +www.monitorware.com/rsyslog/ for advise.

        +

        TEMPLATES

        +

        Please note that the samples are split across multiple lines. +A template MUST NOT actually be split across multiple lines.
        +
        +A template that resembles traditional syslogd file output:
        +$template TraditionalFormat,"%timegenerated% %HOSTNAME%
        +%syslogtag%%msg:::drop-last-lf%\n"
        +
        +A template that tells you a little more about the message:
        +$template +precise,"%syslogpriority%,%syslogfacility%,%timegenerated%,%HOSTNAME%,
        +%syslogtag%,%msg%\n"
        +
        +A template for RFC 3164 format:
        +$template RFC3164fmt,"<%PRI%>%TIMESTAMP% %HOSTNAME% +%syslogtag%%msg%"
        +
        +A template for the format traditonally used for user messages:
        +$template usermsg," XXXX%syslogtag%%msg%\n\r"
        +
        +And a template with the traditonal wall-message format:
        +$template wallmsg,"\r\n\7Message from syslogd@%HOSTNAME% at +%timegenerated%
        +
        +A template that can be used for the database write (please note the SQL
        +template option)
        +$template MySQLInsert,"insert iut, message, receivedat values
        +('%iut%', '%msg:::UPPERCASE%', '%timegenerated:::date-mysql%')
        +into systemevents\r\n", SQL
        +
        +The following template emulates WinSyslog +format (it's an Adiscon +format, you do not feel bad if you don't know it ;)). It's interesting +to see how it takes different parts out of the date stamps. What +happens is that the date stamp is split into the actual date and time +and the these two are combined with just a comma in between them.
        +
        +$template WinSyslogFmt,"%HOSTNAME%,%timegenerated:1:10:date-rfc3339%,
        +%timegenerated:12:19:date-rfc3339%,%timegenerated:1:10:date-rfc3339%,
        +%timegenerated:12:19:date-rfc3339%,%syslogfacility%,%syslogpriority%,
        +%syslogtag%%msg%\n"

        +

        SELECTOR LINES

        +

        # Store critical stuff in critical
        +#
        +*.=crit;kern.none /var/adm/critical
        +
        +This will store all messages with the priority crit in the file +/var/adm/critical, except for any kernel message.
        +
        +
        +# Kernel messages are first, stored in the kernel
        +# file, critical messages and higher ones also go
        +# to another host and to the console. Messages to
        +# the host finlandia are forwarded in RFC 3164
        +# format (using the template defined above).
        +#
        +kern.* /var/adm/kernel
        +kern.crit @finlandia;RFC3164fmt
        +kern.crit /dev/console
        +kern.info;kern.!err /var/adm/kernel-info
        +
        +The first rule direct any message that has the kernel facility to the +file /var/adm/kernel.
        +
        +The second statement directs all kernel messages of the priority crit +and higher to the remote host finlandia. This is useful, because if the +host crashes and the disks get irreparable errors you might not be able +to read the stored messages. If they're on a remote host, too, you +still can try to find out the reason for the crash.
        +
        +The third rule directs these messages to the actual console, so the +person who works on the machine will get them, too.
        +
        +The fourth line tells rsyslogd to save all kernel messages that come +with priorities from info up to warning in the file +/var/adm/kernel-info. Everything from err and higher is excluded.
        +
        +
        +# The tcp wrapper loggs with mail.info, we display
        +# all the connections on tty12
        +#
        +mail.=info /dev/tty12
        +
        +This directs all messages that uses mail.info (in source LOG_MAIL | +LOG_INFO) to /dev/tty12, the 12th console. For example the tcpwrapper +tcpd(8) uses this as it's default.
        +
        +
        +# Store all mail concerning stuff in a file
        +#
        +mail.*;mail.!=info /var/adm/mail
        +
        +This pattern matches all messages that come with the mail facility, +except for the info priority. These will be stored in the file +/var/adm/mail.
        +
        +
        +# Log all mail.info and news.info messages to info
        +#
        +mail,news.=info /var/adm/info
        +
        +This will extract all messages that come either with mail.info or with +news.info and store them in the file /var/adm/info.
        +
        +
        +# Log info and notice messages to messages file
        +#
        +*.=info;*.=notice;\
        +mail.none /var/log/messages
        +
        +This lets rsyslogd log all messages that come with either the info or +the notice facility into the file /var/log/messages, except for all
        +messages that use the mail facility.
        +
        +
        +# Log info messages to messages file
        +#
        +*.=info;\
        +mail,news.none /var/log/messages
        +
        +This statement causes rsyslogd to log all messages that come with the +info priority to the file /var/log/messages. But any message coming +either with the mail or the news facility will not be stored.
        +
        +
        +# Emergency messages will be displayed using wall
        +#
        +*.=emerg *
        +
        +This rule tells rsyslogd to write all emergency messages to all +currently logged in users. This is the wall action.
        +
        +
        +# Messages of the priority alert will be directed
        +# to the operator
        +#
        +*.alert root,rgerhards
        +
        +This rule directs all messages with a priority of alert or higher to +the terminals of the operator, i.e. of the users "root'' and +"rgerhards'' if they're logged in.
        +
        +
        +*.* @finlandia
        +
        +This rule would redirect all messages to a remote host called +finlandia. This is useful especially in a cluster of machines where all +syslog messages will be stored on only one machine.
        +
        +In the format shown above, UDP is used for transmitting the message. +The destination port is set to the default auf 514. Rsyslog is also +capable of using much more secure and reliable TCP sessions for message +forwarding. Also, the destination port can be specified. To select TCP, +simply add one additional @ in front of the host name (that is, @host +is UPD, @@host is TCP). For example:
        +
        +
        +*.* @@finlandia
        +
        +To specify the destination port on the remote machine, use a colon +followed by the port number after the machine name. The following +forwards to port 1514 on finlandia:
        +
        +
        +*.* @@finlandia:1514
        +
        +This syntax works both with TCP and UDP based syslog. However, you will +probably primarily need it for TCP, as there is no well-accepted port +for this transport (it is non-standard). For UDP, you can usually stick +with the default auf 514, but might want to modify it for security rea-
        +sons. If you would like to do that, it's quite easy:
        +
        +
        +*.* @finlandia:1514
        +
        +
        +
        +*.* >dbhost,dbname,dbuser,dbpassword;dbtemplate
        +
        +This rule writes all message to the database "dbname" hosted on +"dbhost". The login is done with user "dbuser" and password +"dbpassword". The actual table that is updated is specified within the +template (which contains the insert statement). The template is called +"dbtemplate" in this case.

        +

        :msg,contains,"error" @errorServer

        +

        This rule forwards all messages that contain the word "error" +in the msg part to the server "errorServer". Forwarding is via UDP. +Please note the colon in fron

        + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_filter.html rsyslog-5.10.1/doc/rsyslog_conf_filter.html --- rsyslog-7.6.0/doc/rsyslog_conf_filter.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_filter.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,284 @@ + +Filter Conditions - rsyslog.conf + +

        This is a part of the rsyslog.conf documentation.

        +back +

        Filter Conditions

        +

        Rsyslog offers four different types "filter conditions":

        +
          +
        • BSD-style blocks
        • +
        • "traditional" severity and facility based selectors
        • +
        • property-based filters
        • +
        • expression-based filters
        • +
        +

        Blocks

        +

        Rsyslogd supports BSD-style blocks inside rsyslog.conf. Each +block of lines is separated from the previous block by a program or +hostname specification. A block will only log messages corresponding to +the most recent program and hostname specifications given. Thus, a +block which selects ‘ppp’ as the program, directly followed by a block +that selects messages from the hostname ‘dialhost’, then the second +block will only log messages from the ppp program on dialhost. +

        +

        A program specification is a line beginning with ‘!prog’ and +the following blocks will be associated with calls to syslog from that +specific program. A program specification for ‘foo’ will also match any +message logged by the kernel with the prefix ‘foo: ’. Alternatively, a +program specification ‘-foo’ causes the following blocks to be applied +to messages from any program but the one specified. A hostname +specification of the form ‘+hostname’ and the following blocks will be +applied to messages received from the specified hostname. +Alternatively, a hostname specification ‘-hostname’ causes the +following blocks to be applied to messages from any host but the one +specified. If the hostname is given as ‘@’, the local hostname will be +used. (NOT YET IMPLEMENTED) A program or hostname specification may be +reset by giving the program or hostname as ‘*’.

        +

        Please note that the "#!prog", "#+hostname" and "#-hostname" +syntax available in BSD syslogd is not supported by rsyslogd. By +default, no hostname or program is set.

        +

        Selectors

        +

        Selectors are the traditional way of filtering syslog +messages. They have been kept in rsyslog with their original +syntax, because it is well-known, highly effective and also needed for +compatibility with stock syslogd configuration files. If you just need +to filter based on priority and facility, you should do this with +selector lines. They are not second-class citizens +in rsyslog and offer the best performance for this job.

        +

        The selector field itself again consists of two parts, a +facility and a priority, separated by a period (".''). Both parts are +case insensitive and can also be specified as decimal numbers, but +don't do that, you have been warned. Both facilities and priorities are +described in syslog(3). The names mentioned below correspond to the +similar LOG_-values in /usr/include/syslog.h.
        +
        +The facility is one of the following keywords: auth, authpriv, cron, +daemon, kern, lpr, mail, mark, news, security (same as auth), syslog, +user, uucp and local0 through local7. The keyword security should not +be used anymore and mark is only for internal use and therefore should +not be used in applications. Anyway, you may want to specify and +redirect these messages here. The facility specifies the subsystem that +produced the message, i.e. all mail programs log with the mail facility +(LOG_MAIL) if they log using syslog.
        +
        +The priority is one of the following keywords, in ascending order: +debug, info, notice, warning, warn (same as warning), err, error (same +as err), crit, alert, emerg, panic (same as emerg). The keywords error, +warn and panic are deprecated and should not be used anymore. The +priority defines the severity of the message.
        +
        +The behavior of the original BSD syslogd is that all messages of the +specified priority and higher are logged according to the given action. +Rsyslogd behaves the same, but has some extensions.
        +
        +In addition to the above mentioned names the rsyslogd(8) understands +the following extensions: An asterisk ("*'') stands for all facilities +or all priorities, depending on where it is used (before or after the +period). The keyword none stands for no priority of the given facility.
        +
        +You can specify multiple facilities with the same priority pattern in +one statement using the comma (",'') operator. You may specify as much +facilities as you want. Remember that only the facility part from such +a statement is taken, a priority part would be skipped.

        +

        Multiple selectors may be specified for a single action using +the semicolon (";'') separator. Remember that each selector in the +selector field is capable to overwrite the preceding ones. Using this +behavior you can exclude some priorities from the pattern.

        +

        Rsyslogd has a syntax extension to the original BSD source, +that makes its use more intuitively. You may precede every priority +with an equals sign ("='') to specify only this single priority and +not any of the above. You may also (both is valid, too) precede the +priority with an exclamation mark ("!'') to ignore all that +priorities, either exact this one or this and any higher priority. If +you use both extensions than the exclamation mark must occur before the +equals sign, just use it intuitively.

        +

        Property-Based Filters

        +

        Property-based filters are unique to rsyslogd. They allow to +filter on any property, like HOSTNAME, syslogtag and msg. A list of all +currently-supported properties can be found in the property replacer documentation +(but keep in mind that only the properties, not the replacer is +supported). With this filter, each properties can be checked against a +specified value, using a specified compare operation.

        +

        A property-based filter must start with a colon in column 0. +This tells rsyslogd that it is the new filter type. The colon must be +followed by the property name, a comma, the name of the compare +operation to carry out, another comma and then the value to compare +against. This value must be quoted. There can be spaces and tabs +between the commas. Property names and compare operations are +case-sensitive, so "msg" works, while "MSG" is an invalid property +name. In brief, the syntax is as follows:

        +

        :property, [!]compare-operation, "value"

        +

        The following compare-operations are +currently supported:

        + + + + + + + + + + + + + + + + + + + + + + + +
        containsChecks if the string provided in value is contained in +the property. There must be an exact match, wildcards are not supported.
        isequalCompares the "value" string provided and the property +contents. These two values must be exactly equal to match. The +difference to contains is that contains searches for the value anywhere +inside the property value, whereas all characters must be identical for +isequal. As such, isequal is most useful for fields like syslogtag or +FROMHOST, where you probably know the exact contents.
        startswithChecks if the value is found exactly at the beginning +of the property value. For example, if you search for "val" with +

        :msg, startswith, "val"

        +

        it will be a match if msg contains "values are in this +message" but it won't match if the msg contains "There are values in +this message" (in the later case, contains would match). Please note +that "startswith" is by far faster than regular expressions. So even +once they are implemented, it can make very much sense +(performance-wise) to use "startswith".

        +
        regexCompares the property against the provided POSIX +BRE regular +expression.
        ereregexCompares the property against the provided POSIX +ERE regular +expression.
        +

        You can use the bang-character (!) immediately in front of a +compare-operation, the outcome of this operation is negated. For +example, if msg contains "This is an informative message", the +following sample would not match:

        +

        :msg, contains, "error"

        +

        but this one matches:

        +

        :msg, !contains, "error"

        +

        Using negation can be useful if you would like to do some +generic processing but exclude some specific events. You can use the +discard action in conjunction with that. A sample would be:

        +

        *.* +/var/log/allmsgs-including-informational.log
        +:msg, contains, "informational"  ~ +
        +*.* /var/log/allmsgs-but-informational.log

        +

        Do not overlook the red tilde in line 2! In this sample, all +messages are written to the file allmsgs-including-informational.log. +Then, all messages containing the string "informational" are discarded. +That means the config file lines below the "discard line" (number 2 in +our sample) will not be applied to this message. Then, all remaining +lines will also be written to the file allmsgs-but-informational.log.

        +

        Value is a quoted string. It supports some +escape sequences:

        +

        \" - the quote character (e.g. "String with \"Quotes\"")
        +\\ - the backslash character (e.g. "C:\\tmp")

        +

        Escape sequences always start with a backslash. Additional +escape sequences might be added in the future. Backslash characters must +be escaped. Any other sequence then those outlined above is invalid and +may lead to unpredictable results.

        +

        Probably, "msg" is the most prominent use case of property +based filters. It is the actual message text. If you would like to +filter based on some message content (e.g. the presence of a specific +code), this can be done easily by:

        +

        :msg, contains, "ID-4711"

        +

        This filter will match when the message contains the string +"ID-4711". Please note that the comparison is case-sensitive, so it +would not match if "id-4711" would be contained in the message.

        +

        :msg, regex, "fatal .* error"

        +

        This filter uses a POSIX regular expression. It matches when +the +string contains the words "fatal" and "error" with anything in between +(e.g. "fatal net error" and "fatal lib error" but not "fatal error" as +two spaces are required by the regular expression!).

        +

        Getting property-based filters right can sometimes be +challenging. In order to help you do it with as minimal effort as +possible, rsyslogd spits out debug information for all property-based +filters during their evaluation. To enable this, run rsyslogd in +foreground and specify the "-d" option.

        +

        Boolean operations inside property based filters (like +'message contains "ID17" or message contains "ID18"') are currently not +supported (except for "not" as outlined above). Please note that while +it is possible to query facility and severity via property-based +filters, it is far more advisable to use classic selectors (see above) +for those cases.

        +

        Expression-Based Filters

        +Expression based filters allow +filtering on arbitrary complex expressions, which can include boolean, +arithmetic and string operations. Expression filters will evolve into a +full configuration scripting language. Unfortunately, their syntax will +slightly change during that process. So if you use them now, you need +to be prepared to change your configuration files some time later. +However, we try to implement the scripting facility as soon as possible +(also in respect to stage work needed). So the window of exposure is +probably not too long.
        +
        +Expression based filters are indicated by the keyword "if" in column 1 +of a new line. They have this format:
        +
        +if expr then action-part-of-selector-line
        +
        +"If" and "then" are fixed keywords that mus be present. "expr" is a +(potentially quite complex) expression. So the expression documentation for +details. "action-part-of-selector-line" is an action, just as you know +it (e.g. "/var/log/logfile" to write to that file).
        +
        +A few quick samples:
        +
        + +*.* /var/log/file1 # the traditional way
        +if $msg contains 'error' then /var/log/errlog # the expression-based way
        +
        +
        +Right now, you need to specify numerical values if you would like to +check for facilities and severity. These can be found in RFC 3164. +If you don't like that, you can of course also use the textual property +- just be sure to use the right one. As expression support is enhanced, +this will change. For example, if you would like to filter on message +that have facility local0, start with "DEVNAME" and have either +"error1" or "error0" in their message content, you could use the +following filter:
        +
        + +if $syslogfacility-text == 'local0' and $msg +startswith 'DEVNAME' and ($msg contains 'error1' or $msg contains +'error0') then /var/log/somelog
        +
        +
        +Please note that the above must +all be on one line! And if you would like to store all +messages except those that contain "error1" or "error0", you just need +to add a "not":
        +
        + +if $syslogfacility-text == 'local0' and $msg +startswith 'DEVNAME' and not +($msg contains 'error1' or $msg contains +'error0') then /var/log/somelog
        +
        +
        +If you would like to do case-insensitive comparisons, use +"contains_i" instead of "contains" and "startswith_i" instead of +"startswith".
        +
        +Note that regular expressions are currently NOT +supported in expression-based filters. These will be added later when +function support is added to the expression engine (the reason is that +regular expressions will be a separate loadable module, which requires +some more prequisites before it can be implemented).
        + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_global.html rsyslog-5.10.1/doc/rsyslog_conf_global.html --- rsyslog-7.6.0/doc/rsyslog_conf_global.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_global.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,333 @@ + +Configuration Directives - rsyslog.conf + +

        This is a part of the rsyslog.conf documentation.

        +back +

        Configuration Directives

        +

        All configuration directives need to be specified on a line by their +own and must start with a dollar-sign. Note that those starting with +the word "Action" modify the next action and should be specified +in front of it. +

        Here is a list in alphabetical order. Follow links for a description.

        +

        Not all directives have an in-depth description right now. +Default values for them are in bold. A more in-depth description will +appear as implementation progresses. +

        +

        Be sure to read information about queues in rsyslog - +many parameter settings modify queue parameters. If in doubt, use the +default, it is usually well-chosen and applicable in most cases.

        +
          +
        • $AbortOnUncleanConfig - abort startup if there is +any issue with the config file
        • +
        • $ActionExecOnlyWhenPreviousIsSuspended
        • +
        • $ActionName <a_single_word> - used primarily for documentation, e.g. when +generating a configuration graph. Available sice 4.3.1. +
        • $ActionExecOnlyOnceEveryInterval <seconds> - +execute action only if the last execute is at last +<seconds> seconds in the past (more info in ommail, +but may be used with any action)
        • +
        • $ActionExecOnlyEveryNthTime <number> - If configured, the next action will +only be executed every n-th time. For example, if configured to 3, the first two messages +that go into the action will be dropped, the 3rd will actually cause the action to execute, +the 4th and 5th will be dropped, the 6th executed under the action, ... and so on. Note: +this setting is automatically re-set when the actual action is defined.
        • +
        • $ActionExecOnlyEveryNthTimeTimeout <number-of-seconds> - has a meaning only if +$ActionExecOnlyEveryNthTime is also configured for the same action. If so, the timeout +setting specifies after which period the counting of "previous actions" expires and +a new action count is begun. Specify 0 (the default) to disable timeouts. +
          +Why is this option needed? Consider this case: a message comes in at, eg., 10am. That's +count 1. Then, nothing happens for the next 10 hours. At 8pm, the next +one occurs. That's count 2. Another 5 hours later, the next message +occurs, bringing the total count to 3. Thus, this message now triggers +the rule. +
          +The question is if this is desired behavior? Or should the rule only be +triggered if the messages occur within an e.g. 20 minute window? If the +later is the case, you need a +
          +$ActionExecOnlyEveryNthTimeTimeout 1200 +
          +This directive will timeout previous messages seen if they are older +than 20 minutes. In the example above, the count would now be always 1 +and consequently no rule would ever be triggered. + +
        • $ActionFileDefaultTemplate [templateName] - sets a new default template for file actions
        • +
        • $ActionFileEnableSync [on/off] - enables file +syncing capability of omfile
        • +
        • $ActionForwardDefaultTemplate [templateName] - sets a new +default template for UDP and plain TCP forwarding action
        • +
        • $ActionGSSForwardDefaultTemplate [templateName] - sets a +new default template for GSS-API forwarding action
        • +
        • $ActionQueueCheckpointInterval <number>
        • +
        • $ActionQueueDequeueBatchSize <number> [default 16]
        • +
        • $ActionQueueDequeueSlowdown <number> [number +is timeout in microseconds (1000000us is 1sec!), +default 0 (no delay). Simple rate-limiting!]
        • +
        • $ActionQueueDiscardMark <number> [default +9750]
        • +
        • $ActionQueueDiscardSeverity <number> +[*numerical* severity! default 4 (warning)]
        • +
        • $ActionQueueFileName <name>
        • +
        • $ActionQueueHighWaterMark <number> [default +8000]
        • +
        • $ActionQueueImmediateShutdown [on/off]
        • +
        • $ActionQueueSize <number>
        • +
        • $ActionQueueLowWaterMark <number> [default +2000]
        • +
        • $ActionQueueMaxFileSize <size_nbr>, default 1m
        • +
        • $ActionQueueTimeoutActionCompletion <number> +[number is timeout in ms (1000ms is 1sec!), default 1000, 0 means +immediate!]
        • +
        • $ActionQueueTimeoutEnqueue <number> [number +is timeout in ms (1000ms is 1sec!), default 2000, 0 means indefinite]
        • +
        • $ActionQueueTimeoutShutdown <number> [number +is timeout in ms (1000ms is 1sec!), default 0 (indefinite)]
        • +
        • $ActionQueueWorkerTimeoutThreadShutdown +<number> [number is timeout in ms (1000ms is 1sec!), +default 60000 (1 minute)]
        • +
        • $ActionQueueType [FixedArray/LinkedList/Direct/Disk]
        • +
        • $ActionQueueSaveOnShutdown  [on/off] +
        • +
        • $ActionQueueWorkerThreads <number>, num worker threads, default 1, recommended 1
        • +
        • $ActionQueueWorkerThreadMinumumMessages <number>, default 100
        • +
        • $ActionResumeInterval
        • +
        • $ActionResumeRetryCount <number> [default 0, -1 means eternal]
        • +
        • $ActionSendResendLastMsgOnReconnect <[on/off]> specifies if the last message is to be resend when a connecition breaks and has been reconnected. May increase reliability, but comes at the risk of message duplication. +
        • $ActionSendStreamDriver <driver basename> just like $DefaultNetstreamDriver, but for the specific action
        • +
        • $ActionSendStreamDriverMode <mode>, default 0, mode to use with the stream driver (driver-specific)
        • +
        • $ActionSendStreamDriverAuthMode <mode>,  authentication mode to use with the stream driver. Note that this directive requires TLS +netstream drivers. For all others, it will be ignored. +(driver-specific)
        • +
        • $ActionSendStreamDriverPermittedPeer <ID>,  accepted fingerprint (SHA1) or name of remote peer. Note that this directive requires TLS +netstream drivers. For all others, it will be ignored. +(driver-specific) - directive may go away!
        • +
        • $ActionSendTCPRebindInterval nbr- [available since 4.5.1] - instructs the TCP send +action to close and re-open the connection to the remote host every nbr of messages sent. +Zero, the default, means that no such processing is done. This directive is useful for +use with load-balancers. Note that there is some performance overhead associated with it, +so it is advisable to not too often "rebind" the connection (what +"too often" actually means depends on your configuration, a rule of thumb is +that it should be not be much more often than once per second).
        • +
        • $ActionSendUDPRebindInterval nbr- [available since 4.3.2] - instructs the UDP send +action to rebind the send socket every nbr of messages sent. Zero, the default, means +that no rebind is done. This directive is useful for use with load-balancers.
        • +
        • $ActionWriteAllMarkMessages [on/off]- [available since 5.1.5] - normally, mark messages +are written to actions only if the action was not recently executed (by default, recently means within the +past 20 minutes). If this setting is switched to "on", mark messages are always sent to actions, +no matter how recently they have been executed. In this mode, mark messages can be used as a kind of +heartbeat. Note that this option auto-resets to "off", so if you intend to use it with multiple +actions, it must be specified in front off all selector lines that should provide this +functionality. +
        • +
        • $AllowedSender
        • +
        • $ControlCharacterEscapePrefix
        • +
        • $DebugPrintCFSyslineHandlerList
        • + +
        • $DebugPrintModuleList
        • +
        • $DebugPrintTemplateList
        • +
        • $DefaultNetstreamDriver <drivername>, the default network stream driver to use. Defaults to ptcp.$DefaultNetstreamDriverCAFile </path/to/cafile.pem>
        • +
        • $DefaultNetstreamDriverCertFile </path/to/certfile.pem>
        • +
        • $DefaultNetstreamDriverKeyFile </path/to/keyfile.pem>
        • +
        • $DefaultRuleset name - changes the default ruleset for unbound inputs to +the provided name (the default default ruleset is named +"RSYSLOG_DefaultRuleset"). It is advised to also read +our paper on using multiple rule sets in rsyslog.
        • +
        • $CreateDirs [on/off] - create directories on an as-needed basis
        • +
        • $DirCreateMode
        • +
        • $DirGroup
        • +
        • $DirOwner
        • +
        • $DropMsgsWithMaliciousDnsPTRRecords
        • +
        • $DropTrailingLFOnReception
        • +
        • $DynaFileCacheSize
        • +
        • $Escape8BitCharactersOnReceive
        • +
        • $EscapeControlCharactersOnReceive
        • +
        • $EscapeControlCharactersOnReceive [on|off] - escape USASCII HT character
        • +
        • $SpaceLFOnReceive [on/off] - instructs rsyslogd to replace LF with spaces during message reception (sysklogd compatibility aid)
        • +
        • $ErrorMessagesToStderr [on|off] - direct rsyslogd error message to stderr (in addition to other targets)
        • +
        • $FailOnChownFailure
        • +
        • $FileCreateMode
        • +
        • $FileGroup
        • +
        • $FileOwner
        • +
        • $GenerateConfigGraph
        • +
        • $GssForwardServiceName
        • +
        • $GssListenServiceName
        • +
        • $GssMode
        • +
        • $IncludeConfig
        • MainMsgQueueCheckpointInterval <number>
        • +
        • $LocalHostName [name] - this directive permits to overwrite the system +hostname with the one specified in the directive. If the directive is given +multiple times, all but the last one will be ignored. Please note that startup +error messages may be issued with the real hostname. This is by design and not +a bug (but one may argue if the design should be changed ;)). Available since +4.7.4+, 5.7.3+, 6.1.3+. +
        • $LogRSyslogStatusMessages [on/off] - If set to on (the default), +rsyslog emits message on startup and shutdown as well as when it is HUPed. +This information might be needed by some log analyzers. If set to off, no such +status messages are logged, what may be useful for other scenarios. +[available since 4.7.0 and 5.3.0] +
        • $MainMsgQueueDequeueBatchSize <number> [default 32]
        • +
        • $MainMsgQueueDequeueSlowdown <number> [number +is timeout in microseconds (1000000us is 1sec!), +default 0 (no delay). Simple rate-limiting!]
        • +
        • $MainMsgQueueDiscardMark <number> [default 9750]
        • +
        • $MainMsgQueueDiscardSeverity <severity> +[either a textual or numerical severity! default 4 (warning)]
        • +
        • $MainMsgQueueFileName <name>
        • +
        • $MainMsgQueueHighWaterMark <number> [default +8000]
        • +
        • $MainMsgQueueImmediateShutdown [on/off]
        • +
        • $MainMsgQueueSize
        • +
        • $MainMsgQueueLowWaterMark <number> [default +2000]
        • +
        • $MainMsgQueueMaxFileSize <size_nbr>, default +1m
        • +
        • $MainMsgQueueTimeoutActionCompletion +<number> [number is timeout in ms (1000ms is 1sec!), +default +1000, 0 means immediate!]
        • +
        • $MainMsgQueueTimeoutEnqueue <number> [number +is timeout in ms (1000ms is 1sec!), default 2000, 0 means indefinite]
        • +
        • $MainMsgQueueTimeoutShutdown <number> [number +is timeout in ms (1000ms is 1sec!), default 0 (indefinite)]
        • +
        • $MainMsgQueueWorkerTimeoutThreadShutdown +<number> [number is timeout in ms (1000ms is 1sec!), +default 60000 (1 minute)]
        • +
        • $MainMsgQueueType [FixedArray/LinkedList/Direct/Disk]
        • +
        • $MainMsgQueueSaveOnShutdown  [on/off] +
        • +
        • $MainMsgQueueWorkerThreads <number>, num +worker threads, default 1, recommended 1
        • +
        • $MainMsgQueueWorkerThreadMinumumMessages <number>, default 100
        • +
        • $MarkMessagePeriod (immark)
        • +
        • $MaxMessageSize <size_nbr>, default 2k - allows to specify maximum supported message size +(both for sending and receiving). The default +should be sufficient for almost all cases. Do not set this below 1k, as it would cause +interoperability problems with other syslog implementations.
          +Change the setting to e.g. 32768 if you would like to +support large message sizes for IHE (32k is the current maximum +needed for IHE). I was initially tempted to set the default to 32k, +but there is a some memory footprint with the current +implementation in rsyslog. +
          If you intend to receive Windows Event Log data (e.g. via +EventReporter), you might want to +increase this number to an even higher value, as event +log messages can be very lengthy ("$MaxMessageSize 64k" is not a bad idea). +Note: testing showed that 4k seems to be +the typical maximum for UDP based syslog. This is an IP stack +restriction. Not always ... but very often. If you go beyond +that value, be sure to test that rsyslogd actually does what +you think it should do ;) It is highly suggested to use a TCP based transport +instead of UDP (plain TCP syslog, RELP). This resolves the UDP stack size restrictions. +
          Note that 2k, the current default, is the smallest size that must be +supported in order to be compliant to the upcoming new syslog RFC series. +
        • +
        • $MaxOpenFiles
        • +
        • $ModDir
        • +
        • $ModLoad
        • +
        • $OMFileAsyncWriting [on/off], if turned on, the files will be written +in asynchronous mode via a separate thread. In that case, double buffers will be used so +that one buffer can be filled while the other buffer is being written. Note that in order +to enable $OMFileFlushInterval, $OMFileAsyncWriting must be set to "on". Otherwise, the flush +interval will be ignored. Also note that when $OMFileFlushOnTXEnd is "on" but +$OMFileAsyncWriting is off, output will only be written when the buffer is full. This may take +several hours, or even require a rsyslog shutdown. However, a buffer flush can be forced +in that case by sending rsyslogd a HUP signal. +
        • $OMFileZipLevel 0..9 [default 0] - if greater 0, turns on gzip compression +of the output file. The higher the number, the better the compression, but also the +more CPU is required for zipping.
        • +
        • $OMFileIOBufferSize <size_nbr>, default 4k, size of the buffer used to writing output data. The larger the buffer, the potentially better performance is. The default of 4k is quite conservative, it is useful to go up to 64k, and 128K if you used gzip compression (then, even higher sizes may make sense)
        • +
        • $OMFileFlushOnTXEnd <[on/off]>, default on. Omfile has the +capability to +write output using a buffered writer. Disk writes are only done when the buffer is +full. So if an error happens during that write, data is potentially lost. In cases where +this is unacceptable, set $OMFileFlushOnTXEnd to on. Then, data is written at the end +of each transaction (for pre-v5 this means after each log message) and the usual +error recovery thus can handle write errors without data loss. Note that this option +severely reduces the effect of zip compression and should be switched to off +for that use case. Note that the default -on- is primarily an aid to preserve +the traditional syslogd behaviour.
        • +
        • $omfileForceChown - force ownership change for all files
        • +
        • $RepeatedMsgContainsOriginalMsg [on/off] - "last message repeated n times" messages, if generated, +have a different format that contains the message that is being repeated. +Note that only the first "n" characters are included, with n to be at least 80 characters, most +probably more (this may change from version to version, thus no specific limit is given). The bottom +line is that n is large enough to get a good idea which message was repeated but it is not necessarily +large enough for the whole message. (Introduced with 4.1.5). Once set, it affects all following actions.
        • +
        • $RepeatedMsgReduction
        • +
        • $ResetConfigVariables
        • +
        • $Ruleset name - starts a new ruleset or switches back to one already defined. +All following actions belong to that new rule set. +the name does not yet exist, it is created. To switch back to rsyslog's +default ruleset, specify "RSYSLOG_DefaultRuleset") as the name. +All following actions belong to that new rule set. It is advised to also read +our paper on using multiple rule sets in rsyslog.
        • +
        • $RulesetCreateMainQueue on - creates +a ruleset-specific main queue. +
        • $RulesetParser - enables to set +a specific (list of) message parsers to be used with the ruleset. +
        • $OptimizeForUniprocessor [on/off] - turns on optimizatons which lead to better +performance on uniprocessors. If you run on multicore-machiens, turning this off lessens CPU load. The +default may change as uniprocessor systems become less common. [available since 4.1.0]
        • +
        • $PreserveFQDN [on/off) - if set to off (legacy default to remain compatible +to sysklogd), the domain part from a name that is within the same domain as the receiving +system is stripped. If set to on, full names are always used.
        • +
        • $WorkDirectory <name> (directory for spool and other work files. +Do not use trailing slashes)
        • +
        • $UDPServerAddress <IP> (imudp) -- local IP +address (or name) the UDP listens should bind to
        • +
        • $UDPServerRun <port> (imudp) -- former +-r<port> option, default 514, start UDP server on this +port, "*" means all addresses
        • +
        • $UDPServerTimeRequery <nbr-of-times> (imudp) -- this is a performance +optimization. Getting the system time is very costly. With this setting, imudp can +be instructed to obtain the precise time only once every n-times. This logic is +only activated if messages come in at a very fast rate, so doing less frequent +time calls should usually be acceptable. The default value is two, because we have +seen that even without optimization the kernel often returns twice the identical time. +You can set this value as high as you like, but do so at your own risk. The higher +the value, the less precise the timestamp. +
        • $PrivDropToGroup
        • +
        • $PrivDropToGroupID
        • +
        • $PrivDropToUser
        • +
        • $PrivDropToUserID
        • +
        • $Sleep <seconds> - puts the rsyslog main thread to sleep for the specified +number of seconds immediately when the directive is encountered. You should have a +good reason for using this directive!
        • +
        • $LocalHostIPIF <interface name> - (available since 5.9.6) - if provided, the IP of the specified +interface (e.g. "eth0") shall be used as fromhost-ip for locall-originating messages. +If this directive is not given OR the interface cannot be found (or has no IP address), +the default of "127.0.0.1" is used. Note that this directive can be given only +once. Trying to reset will result in an error message and the new value will +be ignored. Please note that modules must have support for obtaining the local +IP address set via this directive. While this is the case for rsyslog-provided +modules, it may not always be the case for contributed plugins. +
          Important: This directive shall be placed right at the top of +rsyslog.conf. Otherwise, if error messages are triggered before this directive +is processed, rsyslog will fix the local host IP to "127.0.0.1", what than can +not be reset. +
        • +
        • $UMASK
        • +
        +

        Where <size_nbr> or integers are specified above, +modifiers can be used after the number part. For example, 1k means +1024. Supported are k(ilo), m(ega), g(iga), t(era), p(eta) and e(xa). +Lower case letters refer to the traditional binary defintion (e.g. 1m +equals 1,048,576) whereas upper case letters refer to their new +1000-based definition (e.g 1M equals 1,000,000).

        +

        Numbers may include '.' and ',' for readability. So you can +for example specify either "1000" or "1,000" with the same result. +Please note that rsyslogd simply ignores the punctuation. From it's +point of view, "1,,0.0.,.,0" also has the value 1000.

        + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008-2010 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf.html rsyslog-5.10.1/doc/rsyslog_conf.html --- rsyslog-7.6.0/doc/rsyslog_conf.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf.html 2012-10-17 14:41:20.000000000 +0000 @@ -1,10 +1,10 @@ -rsyslog.conf configuration file +rsyslog.conf file

        rsyslog.conf configuration file

        -

        Rsyslog is configured via the rsyslog.conf file, +

        Rsyslogd is configured via the rsyslog.conf file, typically found in /etc. By default, rsyslogd reads the file -/etc/rsyslog.conf. This may be changed by command line option "-f".

        +/etc/rsyslog.conf. This may be changed by a command line option.

        Configuration file examples can be found in the rsyslog wiki. Also keep the @@ -12,34 +12,74 @@ on your mind. These are ready-to-use real building blocks for rsyslog configuration.

        +

        There is also one sample file provided together with the +documentation set. If you do not like to read, be sure to have at least +a quick look at +rsyslog-example.conf. +

        While rsyslogd contains enhancements over standard syslogd, efforts have been made to keep the configuration file as compatible as possible. While, for obvious reasons, enhanced features require a different config file syntax, rsyslogd should be able to work with a standard syslog.conf file. This is especially useful while you are migrating from syslogd to rsyslogd.

        - -

        Follow the links below to learn more about specific topics:

        - +

        Modules

        +

        Lines

        +Lines can be continued by specifying a backslash ("\") as the last +character of the line. There is a hard-coded maximum line length of 4K. +If you need lines larger than that, you need to change compile-time +settings inside rsyslog and recompile. +

        Configuration Directives

        +

        Basic Structure

        +

        Rsyslog supports standard sysklogd's configuration file format +and extends it. So in general, you can take a "normal" syslog.conf and +use it together with rsyslogd. It will understand everything. However, +to use most of rsyslogd's unique features, you need to add extended +configuration directives.

        +

        Rsyslogd supports the classical, selector-based rule lines. +They are still at the heart of it and all actions are initiated via +rule lines. A rule lines is any line not starting with a $ or the +comment sign (#). Lines starting with $ carry rsyslog-specific +directives.

        +

        Every rule line consists of two fields, a selector field and +an action field. These two fields are separated by one or more spaces +or tabs. The selector field specifies a pattern of facilities and +priorities belonging to the specified action.
        +
        +Lines starting with a hash mark ("#'') and empty lines are ignored. +

        +

        Templates

        +

        Output Channels

        +

        Filter Conditions

        +

        Actions

        +

        Examples

        +

        Here you will find examples for templates and selector lines. I hope +they are self-explanatory. If not, please see +www.monitorware.com/rsyslog/ for advise.

        +

        Configuration File Syntax Differences

        +

        Rsyslogd uses a slightly different syntax for its +configuration file than the original BSD sources. Originally all +messages of a specific priority and above were forwarded to the log +file. The modifiers "='', "!'' and "!-'' were added to make rsyslogd +more flexible and to use it in a more intuitive manner.
        +
        +The original BSD syslogd doesn't understand spaces as separators +between the selector and the action field.
        +
        +When compared to syslogd from sysklogd package, rsyslogd offers +additional +features (like template +and database support). For obvious reasons, the syntax for defining +such features is available in rsyslogd, only.

        [back to top] [manual index] [rsyslog site]

        This documentation is part of the rsyslog project.
        -Copyright © 2008-2013 by Rainer Gerhards and +Copyright © 2008-2011 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

        - +> diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_modules.html rsyslog-5.10.1/doc/rsyslog_conf_modules.html --- rsyslog-7.6.0/doc/rsyslog_conf_modules.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_modules.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,181 @@ + +Modules - rsyslog.conf + +

        This is a part of the rsyslog.conf documentation.

        +Back to rsyslog.conf manual +

        Modules

        +

        Rsyslog has a modular design. This enables functionality to be +dynamically loaded from modules, which may also be written by any +third party. Rsyslog itself offers all non-core functionality as +modules. Consequently, there is a growing +number of modules. Here is the entry point to their documentation and +what they do (list is currently not complete)

        +

        Please note that each module provides configuration +directives, which are NOT necessarily being listed below. Also +remember, that a modules configuration directive (and functionality) is +only available if it has been loaded (using $ModLoad).

        +

        It is relatively easy to write a rsyslog module. If none of the provided +modules solve your need, you may consider writing one or have one written +for you by +Adiscon's professional services for rsyslog +(this often is a very cost-effective and efficient way of getting what you need). +

        There exist different classes of loadable modules: +

        + +

        Input Modules

        +

        Input modules are used to gather messages from various sources. They interface +to message generators. +

          +
        • imfile -  input module for text files
        • +
        • imrelp - RELP input module
        • +
        • imudp - udp syslog message input
        • +
        • imtcp - input plugin for tcp syslog
        • +
        • imptcp - input plugin for plain tcp syslog (no TLS but faster)
        • +
        • imgssapi - input plugin for plain tcp and GSS-enabled syslog
        • +
        • immark - support for mark messages
        • +
        • imklog - kernel logging
        • +
        • imuxsock - unix sockets, including the system log socket
        • +
        • imsolaris - input for the Sun Solaris system log source
        • +
        • im3195 - accepts syslog messages via RFC 3195
        • +
        • impstats - provides periodic statistics of rsyslog internal counters
        • +
        + +

        Output Modules

        +

        Output modules process messages. With them, message formats can be transformed +and messages be transmitted to various different targets. +

          +
        • omsnmp - SNMP trap output module
        • +
        • omtdout - stdout output module (mainly a test tool)
        • +
        • omrelp - RELP output module
        • +
        • omruleset - forward message to another ruleset
        • +
        • omgssapi - output module for GSS-enabled syslog
        • +
        • ommysql - output module for MySQL
        • +
        • ompgsql - output module for PostgreSQL
        • +
        • omlibdbi - +generic database output module (Firebird/Interbase, MS SQL, Sybase, +SQLLite, Ingres, Oracle, mSQL)
        • +
        • ommail - +permits rsyslog to alert folks by mail if something important happens
        • +
        • omprog - permits sending messages to a program for custom processing
        • +
        • omoracle - output module for Oracle (native OCI interface)
        • +
        • omudpspoof - output module sending UDP syslog messages with a spoofed address
        • +
        • omuxsock - output module Unix domain sockets
        • +
        • omhdfs - output module for Hadoop's HDFS file system
        • +
        + +

        Parser Modules

        +

        Parser modules are used to parse message content, once the message has been +received. They can be used to process custom message formats or invalidly formatted +messages. For details, please see the rsyslog +message parser documentation. +

        The current modules are currently provided as part of rsyslog: +

          +
        • pmrfc5424[builtin] - rsyslog.rfc5424 - +parses RFC5424-formatted messages (the new syslog standard) +
        • pmrfc3164[builtin] - rsyslog.rfc3164 - +the traditional/legacy syslog parser +
        • pmrfc3164sd - rsyslog.rfc3164sd - +a contributed module supporting RFC5424 structured data inside +RFC3164 messages (not supported by the rsyslog team) +
        • pmlastmsg - rsyslog.lastmsg - +a parser module that handles the typically malformed "last messages +repated n times" messages emitted by some syslogds. +
        + +

        Message Modification Modules

        +

        Message modification modules are used to change the content of messages being processed. +They can be implemented using either the output module or the parser module interface. +From the rsyslog core's point of view, they actually are output or parser modules, it is their +implementation that makes them special. +

        Currently, there do not exist any such modules, but could be written with +the methods the engine provides. They could be used, for example, to: +

          +
        • anonymize message content +
        • add dynamically computed content to message (fields) +
        +

        Message modification modules are usually written for one specific task and thus +usually are not generic enough to be reused. However, existing module's code is +probably an excellent starting base for writing a new module. Currently, the following +modules existin inside the source tree +

          +
        • mmsnmptrapd - uses information provided by snmptrapd inside +the tag to correct the original sender system and priority of messages. Implemented via +the output module interface. +
        + +

        String Generator Modules

        +

        String generator modules are used, as the name implies, to generate strings based +on the message content. They are currently tightly coupled with the template system. +Their primary use is to speed up template processing by providing a native C +interface to template generation. These modules exist since 5.5.6. To get an idea +of the potential speedup, the default file format, when generated by a string generator, +provides a roughly 5% speedup. For more complex strings, especially those that include +multiple regular expressions, the speedup may be considerably higher. +

        String generator modules are written to a quite simple interface. However, a word of +caution is due: they access the rsyslog message object via a low-level interface. +That interface is not guaranteed yet to stay stable. So it may be necessary to +modify string generator modules if the interface changes. Obviously, we will not do that +without good reason, but it may happen. +

        Rsyslog comes with a set of core, build-in string generators, which are used +to provide those default templates that we consider to be time-critical: +

          +
        • smfile - the default rsyslog file format +
        • smfwd - the default rsyslog (network) forwarding format +
        • smtradfile - the traditional syslog file format +
        • smfwd - the traditional syslog (network) forwarding format +
        +

        Note that when you replace these defaults be some custom strings, you will +loose some performance (around 5%). For typical systems, this is not really relevant. +But for a high-performance systems, it may be very relevant. To solve that issue, create +a new string generator module for your custom format, starting out from one of the +default generators provided. If you can not do this yourself, you may want to +contact Adiscon as we offer custom development +of string generators at a very low price. +

        Note that string generator modules can be dynamically loaded. However, the default +ones provided are so important that they are build right into the executable. But this +does not need to be done that way (and it is straightforward to do it dynamic). + + +

        Library Modules

        +

        Library modules provide dynamically loadable functionality for parts of rsyslog, +most often for other loadable modules. They can not be user-configured and are loaded +automatically by some components. They are just mentioned so that error messages that +point to library moduls can be understood. No module list is provided. + +

        Where are the modules integrated into the Message Flow?

        +

        Depending on their module type, modules may access and/or modify messages at +various stages during rsyslog's processing. Note that only the "core type" (e.g. input, +output) but not any type derived from it (message modification module) specifies when +a module is called. +

        The simplified workflow is as follows: +

        + +

        As can be seen, messages are received by input modules, then passed to one or many +parser modules, which generate the in-memory representation of the message and may +also modify the message itself. The, the internal representation is passed to +output modules, which may output a message and (with the interfaces newly introduced +in v5) may also modify messageo object content. +

        String generator modules are not included inside this picture, because they are +not a required part of the workflow. If used, they operate "in front of" the +output modules, because they are called during template generation. +

        Note that the actual flow is much more complex and depends a lot on queue and +filter settings. This graphic above is a high-level message flow diagram. + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008-2010 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

        + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_nomatch.html rsyslog-5.10.1/doc/rsyslog_conf_nomatch.html --- rsyslog-7.6.0/doc/rsyslog_conf_nomatch.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_nomatch.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,48 @@ + +nomatch mode - property replacer - rsyslog.conf + +

        nomatch mode - property replacer - rsyslog.con

        +

        This is a part of the rsyslog.conf documentation +of the property replacer.

        +

        The "nomatch-Mode" specifies which string the property replacer +shall return if a regular expression did not find the search string.. Traditionally, +the string "**NO MATCH**" was returned, but many people complained this was almost never useful. +Still, this mode is support as "DFLT" for legacy configurations. +

        Three additional and potentially useful modes exist: in one (BLANK) a blank string +is returned. This is probably useful for inserting values into databases where no +value shall be inserted if the expression could not be found. +

        A similar mode is "ZERO" where the string "0" is returned. This is suitable +for numerical values. A use case may be +that you record a traffic log based on firewall rules and the "bytes transmitted" counter +is extracted via a regular expression. If no "bytes transmitted" counter is available +in the current message, it is probably a good idea to return an empty string, which the +database layer can turn into a zero. +

        The other mode is "FIELD", in which the complete field is returned. This may be useful +in cases where absense of a match is considered a failure and the message that triggered +it shall be logged. +

        If in doubt, it is highly suggested to use the +rsyslog online regular expression +checker and generator to see these options in action. With that online tool, +you can craft regular expressions based on samples and try out the different modes. + +

        Summary of nomatch Modes

        + + + + + + + +
        ModeReturned
        DFLT"**NO MATCH**"
        BLANK"" (empty string)
        ZERO"0"
        FIELDfull content of original field
         Interactive Tool
        +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_output.html rsyslog-5.10.1/doc/rsyslog_conf_output.html --- rsyslog-7.6.0/doc/rsyslog_conf_output.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_output.html 2012-09-23 10:28:22.000000000 +0000 @@ -0,0 +1,81 @@ + +Output Channels - rsyslog.conf + +

        This is a part of the rsyslog.conf documentation.

        +back +

        Output Channels

        +

        Output Channels are a new concept first introduced in rsyslog +0.9.0. As of this writing, it is most likely that they will +be replaced by something different in the future. So if you +use them, be prepared to change you configuration file syntax when you +upgrade to a later release.
        +
        +The idea behind output channel definitions is that it shall provide an +umbrella for any type of output that the user might want. In essence,
        +this is the "file" part of selector lines (and this is why we are not +sure output channel syntax will stay after the next review). There is a
        +difference, though: selector channels both have filter conditions +(currently facility and severity) as well as the output destination. +they can only be used to write to files - not pipes, ttys or whatever +Output channels define the output definition, only. As of this build, +else. If we stick with output channels, this will change over time.

        +

        In concept, an output channel includes everything needed to +know about an output actions. In practice, the current implementation +only carries
        +a filename, a maximum file size and a command to be issued when this +file size is reached. More things might be present in future version, +which might also change the syntax of the directive.

        +

        Output channels are defined via an $outchannel directive. It's +syntax is as follows:
        +
        +$outchannel name,file-name,max-size,action-on-max-size
        +
        +name is the name of the output channel (not the file), file-name is the +file name to be written to, max-size the maximum allowed size and +action-on-max-size a command to be issued when the max size is reached. +This command always has exactly one parameter. The binary is that part +of action-on-max-size before the first space, its parameter is +everything behind that space.
        +
        +Please note that max-size is queried BEFORE writing the log message to +the file. So be sure to set this limit reasonably low so that any +message might fit. For the current release, setting it 1k lower than +you expected is helpful. The max-size must always be specified in bytes +- there are no special symbols (like 1k, 1m,...) at this point of +development.
        +
        +Keep in mind that $outchannel just defines a channel with "name". It +does not activate it. To do so, you must use a selector line (see +below). That selector line includes the channel name plus an $ sign in +front of it. A sample might be:
        +
        +*.* :omfile:$mychannel
        +
        +In its current form, output channels primarily provide the ability to +size-limit an output file. To do so, specify a maximum size. When this +size is reached, rsyslogd will execute the action-on-max-size command +and then reopen the file and retry. The command should be something +like a log rotation +script or a similar thing.

        +

        If there is no action-on-max-size command or the command did +not resolve the situation, the file is closed and never reopened by +rsyslogd (except, of course, by huping it). This logic was integrated +when we first experienced severe issues with files larger 2gb, which +could lead to rsyslogd dumping core. In such cases, it is more +appropriate to stop writing to a single file. Meanwhile, rsyslogd has +been fixed to support files larger 2gb, but obviously only on file +systems and operating system versions that do so. So it can still make +sense to enforce a 2gb file size limit.

        + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_conf_templates.html rsyslog-5.10.1/doc/rsyslog_conf_templates.html --- rsyslog-7.6.0/doc/rsyslog_conf_templates.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_conf_templates.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,200 @@ + +Templates - rsyslog.conf + +

        This is a part of the rsyslog.conf - documentation.

        +back +

        Templates

        +

        Templates are a key feature of rsyslog. They allow to specify +any +format a user might want. They are also used for dynamic file name +generation. Every output in rsyslog uses templates - this holds true +for files, user messages and so on. The database writer expects its +template to be a proper SQL statement - so this is highly customizable +too. You might ask how does all of this work when no templates at all +are specified. Good question ;) The answer is simple, though. Templates +compatible with the stock syslogd formats are hardcoded into rsyslogd. +So if no template is specified, we use one of these hardcoded +templates. Search for "template_" in syslogd.c and you will find the +hardcoded ones.

        +

        Starting with 5.5.6, there are actually two differnt types of template: +

          +
        • string based +
        • string-generator module based +
        +

        String-generator module based templates +have been introduced in 5.5.6. They permit a string generator, actually a C "program", +the generate a format. Obviously, it is more work required to code such a generator, +but the reward is speed improvement. If you do not need the ultimate throughput, you +can forget about string generators (so most people never need to know what they are). +You may just be interested in learning that for the most important default formats, +rsyslog already contains highly optimized string generators and these are called +without any need to configure anything. But if you have written (or purchased) a +string generator module, you need to know how to call it. Each such module has a name, +which you need to know (look it up in the module doc or ask the developer). Let's assume +that "mystrgen" is the module name. Then you can define a template for that strgen +in the following way: +

        $template MyTemplateName,=mystrgen
        +(Of course, you must have first loaded the module via $ModLoad). +

        The important part is the equal sign: it tells the rsyslog config parser that +no string follows but a strgen module name. +

        There are no additional parameters but the module name supported. This is because +there is no way to customize anything inside such a "template" other than by +modifying the code of the string generator. + +

        So for most use cases, string-generator module based templates are not +the route to take. Usually, us use string based templates instead. +This is what the rest of the documentation now talks about. + +

        A template consists of a template directive, a name, the +actual template text and optional options. A sample is:

        +
        $template MyTemplateName,"\7Text +%property% some more text\n",<options>
        +

        The "$template" is the template directive. It tells rsyslog +that this line contains a template. "MyTemplateName" is the template +name. All +other config lines refer to this name. The text within quotes is the +actual template text. The backslash is an escape character, much as it +is in C. It does all these "cool" things. For example, \7 rings the +bell (this is an ASCII value), \n is a new line. C programmers and perl +coders have the advantage of knowing this, but the set in rsyslog is a +bit restricted currently. +

        +

        All text in the template is used literally, except for things +within percent signs. These are properties and allow you access to the +contents of the syslog message. Properties are accessed via the +property replacer +(nice name, huh) and it can do cool things, too. For +example, it can pick a substring or do date-specific formatting. More +on this is below, on some lines of the property replacer.
        +
        +The <options> part is optional. It carries options +influencing the template as whole. See details below. Be sure NOT to +mistake template options with property options - the later ones are +processed by the property replacer and apply to a SINGLE property, only +(and not the whole template).
        +
        +Template options are case-insensitive. Currently defined are:

        +

        sql - format the string suitable for a SQL +statement in MySQL format. This will replace single quotes ("'") and +the backslash character by their backslash-escaped counterpart ("\'" +and "\\") inside each field. Please note that in MySQL configuration, +the NO_BACKSLASH_ESCAPES +mode must be turned off for this format to work (this is the default).

        +

        stdsql - format the string suitable for a +SQL statement that is to be sent to a standards-compliant sql server. +This will replace single quotes ("'") by two single quotes ("''") +inside each field. You must use stdsql together with MySQL if in MySQL +configuration the +NO_BACKSLASH_ESCAPES is +turned on.

        +

        Either the sql or stdsql  +option must be specified when a template is used +for writing to a database, otherwise injection might occur. Please note +that due to the unfortunate fact that several vendors have violated the +sql standard and introduced their own escape methods, it is impossible +to have a single option doing all the work.  So you yourself +must make sure you are using the right format. If you choose +the wrong one, you are still vulnerable to sql injection.
        +
        +Please note that the database writer *checks* that the sql option is +present in the template. If it is not present, the write database +action is disabled. This is to guard you against accidental forgetting +it and then becoming vulnerable to SQL injection. The sql option can +also be useful with files - especially if you want to import them into +a database on another machine for performance reasons. However, do NOT +use it if you do not have a real need for it - among others, it takes +some toll on the processing time. Not much, but on a really busy system +you might notice it ;)

        +

        The default template for the write to database action has the +sql option set. As we currently support only MySQL and the sql option +matches the default MySQL configuration, this is a good choice. +However, if you have turned on +NO_BACKSLASH_ESCAPES in +your MySQL config, you need to supply a template with the stdsql +option. Otherwise you will become vulnerable to SQL injection.
        +
        +To escape:
        +% = \%
        +\ = \\ --> '\' is used to escape (as in C)
        +$template TraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg%\n"
        +
        +Properties can be accessed by the property +replacer (see there for details).

        +

        Please note that templates can also by +used to generate selector lines with dynamic file names. For +example, if you would like to split syslog messages from different +hosts to different files (one per host), you can define the following +template:

        +
        $template +DynFile,"/var/log/system-%HOSTNAME%.log"
        +

        This template can then be used when defining an output +selector line. It will result in something like +"/var/log/system-localhost.log"

        +

        Template +names beginning with "RSYSLOG_" are reserved for rsyslog use. Do NOT +use them if, otherwise you may receive a conflict in the future (and +quite unpredictable behaviour). There is a small set of pre-defined +templates that you can use without the need to define it:

        +
          +
        • RSYSLOG_TraditionalFileFormat +- the "old style" default log file format with low-precision timestamps
        • +
        • RSYSLOG_FileFormat +- a modern-style logfile format similar to TraditionalFileFormat, buth +with high-precision timestamps and timezone information
        • +
        • RSYSLOG_TraditionalForwardFormat +- the traditional forwarding format with low-precision timestamps. Most +useful if you send messages to other syslogd's or rsyslogd +below +version 3.12.5.
        • +
        • RSYSLOG_SysklogdFileFormat +- sysklogd compatible log file format. If used with options: $SpaceLFOnReceive on; +$EscapeControlCharactersOnReceive off; $DropTrailingLFOnReception off, +the log format will conform to sysklogd log format.
        • +
        • RSYSLOG_ForwardFormat +- a new high-precision forwarding format very similar to the +traditional one, but with high-precision timestamps and timezone +information. Recommended to be used when sending messages to rsyslog +3.12.5 or above.
        • +
        • RSYSLOG_SyslogProtocol23Format +- the format specified in IETF's internet-draft +ietf-syslog-protocol-23, which is assumed to be come the new syslog +standard RFC. This format includes several improvements. The rsyslog +message parser understands this format, so you can use it together with +all relatively recent versions of rsyslog. Other syslogd's may get +hopelessly confused if receiving that format, so check before you use +it. Note that the format is unlikely to change when the final RFC comes +out, but this may happen.
        • +
        • RSYSLOG_DebugFormat +- a special format used for troubleshooting property problems. This format +is meant to be written to a log file. Do not use for production or remote +forwarding.
        • +
        +

        String-based Template Samples

        +

        This section provides some sample of what the default formats would +look as a text-based template. Hopefully, their description is self-explanatory. +Note that each $Template statement is on a single line, but probably broken +accross several lines for display purposes by your browsers. Lines are separated by +empty lines. +

        +$template FileFormat,"%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +

        +$template TraditionalFileFormat,"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +

        +$template ForwardFormat,"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%" +

        +$template TraditionalForwardFormat,"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%" +

        +$template StdSQLFormat,"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",SQL +

        + +

        [manual index] +[rsyslog.conf] +[rsyslog site]

        +

        This documentation is part of the +rsyslog project.
        +Copyright © 2008 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 2 or higher.

        + + + diff -Nru rsyslog-7.6.0/doc/rsyslog_ng_comparison.html rsyslog-5.10.1/doc/rsyslog_ng_comparison.html --- rsyslog-7.6.0/doc/rsyslog_ng_comparison.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_ng_comparison.html 2012-10-17 14:41:20.000000000 +0000 @@ -4,45 +4,24 @@ back

        rsyslog vs. syslog-ng

        Written by Rainer Gerhards -(2008-05-06), slightly updated 2012-01-09

        -

        This comparison page is rooted nearly 5 years in the past and has become severely -outdated since then. It was unmaintained for several years and contained false -information on both syslog-ng and rsyslog as technology had advanced so much. -

        This page was initially written because so many people asked about a comparison when -rsyslog was in its infancy. So I tried to create one, but it was hard to maintain as both -projects grew and added feature after feature. I have to admit we did not try hard to keep -it current -- there were many other priorities. I even had forgetten about this page, when I -saw that Peter Czanik blogged about its -incorrectness (it must be noted -that Peter is wrong on RELP -- it is well alive). I now remember -that he asked me some time ago about this page, what I somehow lost... I guess he must have been -rather grumpy about that :-( -

        Visiting this page after so many years is interesting, because it shows how much has changed since then. -Obviously, one of my main goals in regard to syslog-ng is reached: in 2007, I blogged that -the -world needs another syslogd in order to have healthy competition and a greate feature -set in the free editions. In my opinion, the timeline clearly tells that rsyslog's competition -has driven more syslog-ng features from the commercial to the free edition. Also, I found -it interesting to see that syslog-ng has adapted rsyslog's licensing scheme, modular design and -multi-threadedness. On the other hand, the Balabit folks have obviously done a quicker and -better move on log normalization with what they call patterndb (it is very roughly equivalent -to what rsyslog has just recently introduced with the help of liblognorm). - -

        To that account, I think the projects are closer together than 5 years ago. I should now -go ahead and create a new feature comparison. Given previous experience, I think this does not -work out. In the future, we will probably focus on some top features, as Balabit does. However, -that requires some time and I have to admit I do not like to drop this page that has a lot of -inbound links. So I think I do the useful thing by providing these notes and removing the -syslog-ng information. So it can't be wrong on syslog-ng any more. Note that it still contains -some incorrect information about rsyslog (it's the state it had 5 years ago!). The core idea is -to start with updating the rsyslog feature sheet and from there -on work to a complete comparision. Of course, feel free to read on if you like to get some sense -of history (and inspiration on what you can still do -- but more ;)). -

        -Thanks,
        -Rainer Gerhards -

        - +(2008-05-06)

        +

        Warning: this comparison is a little outdated, take it with a grain +of salt and be sure to check the links at the bottom (both syslog-ng as well as +rsyslog features are missing, but our priority is on creating great software not +continously updating this comparison ;)). +

        We have often been asked about a comparison sheet between +rsyslog and syslog-ng. Unfortunately, I do not know much about +syslog-ng, I did not even use it once. Also, there seems to be no +comprehensive feature sheet available for syslog-ng (that recently +changed, see below). So I started this +comparison, but it probably is not complete. For sure, I miss some +syslog-ng features. This is not an attempt to let rsyslog shine more +than it should. I just used the rsyslog +feature sheet as a starting point, simply because it was +available. If you would like to add anything to the chart, or correct +it, please simply drop +me a line. I would love to see a real honest and up-to-date +comparison sheet, so please don't be shy ;)

        @@ -58,50 +37,50 @@ - + - + - + - + - + - + - + - + @@ -110,7 +89,8 @@ EventReporter or MonitorWare Agent (both commercial software, both fund rsyslog development) - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -296,47 +277,47 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -436,7 +417,7 @@ - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + @@ -528,23 +510,24 @@ - + - + - + - + - + - + - + - + - + - + - - + +
        UNIX domain socket yesyes
        UDP yesyes
        TCP yesyes
        RELP yesno
        RFC 3195/BEEP yes (via im3195)no
        kernel log yesyes
        file yesyes
        mark message generator as an optional input yesno (?)
        via separate Windows agent, paid +edition only

        @@ -120,82 +100,83 @@
        support for (plain) tcp based syslog yesyes
        support for GSS-API yesno
        ability to limit the allowed network senders (syslog ACLs) yesyes (?)
        support for syslog-transport-tls based framing on syslog/tcp connections yesno (?)
        udp syslog yesyes
        syslog over RELP
        truly reliable message delivery (Why is plain tcp syslog not reliable?)
        yesno
        on the wire (zlib) message compression yesno (?)
        support for receiving messages via reliable RFC 3195 delivery yesno
        support for TLS/SSL-protected syslog natively (since 3.19.0)
        via stunnel
        via stunnel
        +paid edition natively
        support for IETF's new syslog-protocol draft yesno
        support for IETF's new syslog-transport-tls draft yes
        (since 3.19.0 - world's first implementation)
        no
        support for IPv6 yesyes
        native ability to send SNMP traps yesno
        ability to preserve the original hostname in NAT environments and relay chains yesyes

        @@ -206,81 +187,81 @@
        Filtering for syslog facility and priority yesyes
        Filtering for hostname yesyes
        Filtering for application yesyes
        Filtering for message contents yesyes
        Filtering for sending IP address yesyes
        ability to filter on any other message field not mentioned above (including substrings and the like) yesno
        support for complex filters, using full boolean algebra with and/or/not operators and parenthesis yesyes
        Support for reusable filters: specify a filter once and use it in multiple selector lines noyes
        support for arbritrary complex arithmetic and string expressions inside filters yesno
        ability to use regular expressions in filters yesyes
        support for discarding messages based on filters yesyes
        ability to filter out messages based on sequence of appearing yes (starting with 3.21.3)no
        powerful BSD-style hostname and program name blocks for easy multi-host support yesno
        MySQL yes (native ommysql, omlibdbi)yes (via libdibi)
        PostgreSQL yes (native ompgsql, omlibdbi)yes (via libdibi)
        Oracle yes (omlibdbi)yes (via libdibi)
        SQLite yes (omlibdbi)yes (via libdibi)
        Microsoft SQL (Open TDS) yes (omlibdbi)no (?)
        Sybase (Open TDS) yes (omlibdbi)no (?)
        Firebird/Interbase yes (omlibdbi)no (?)
        Ingres yes (omlibdbi)no (?)
        mSQL yes (omlibdbi)no (?)

        @@ -347,26 +328,26 @@
        support for on-demand on-disk spooling of messages yespaid edition only
        ability to limit disk space used by spool files yesyes
        each action can use its own, independant set of spool files yesno
        different sets of spool files can be placed on different disk yesno
        ability to process spooled @@ -375,18 +356,18 @@ yes
        (can independently be configured for the main queue and each action queue)
        no
        ability to configure backup syslog/database servers yesno
        Professional Support yesyes

        @@ -397,20 +378,20 @@
        config file format compatible to legacy syslogd but uglyclean but not backwards compatible
        ability to include config file from within other config files yesno
        ability to include all config files existing in a specific directory yesno

        @@ -422,13 +403,13 @@ loadable modules
        yesno
        Support for third-party input plugins yesno
        Support for third-party output plugins yesno

        @@ -449,78 +430,79 @@
        ability to generate file names and directories (log targets) dynamically yesyes
        control of log output format, including ability to present channel and priority as visible log data yesyes
        native ability to send mail messages yes (ommail, introduced in 3.17.0)no (only via piped external process)
        good timestamp format control; at a minimum, ISO 8601/RFC 3339 second-resolution UTC zone yesyes
        ability to reformat message contents and work with substrings yesI think yes
        support for log files larger than 2gb yesyes
        support for log file size limitation and automatic rollover command execution yesyes
        support for running multiple syslogd instances on a single machine yes? (but I think yes)
        ability to execute shell scripts on received messagesyes yes
        ability to pipe messages to a continously running programnoyes
        massively multi-threaded for tomorrow's multi-core machines yesno (only multithreaded with +database destinations)
        ability to control repeated line reduction ("last message repeated n times") on a per selector-line basis yesyes (?)
        supports multiple actions per selector/filter condition yesyes
        phpLogCon
        [also works with php-syslog-ng]
        +php-syslog-ng
        using text files as input source yesyes
        rate-limiting output actions yesyes
        discard low-priority messages under system stress yesno (?)
        flow control @@ -552,39 +535,40 @@ yes (advanced, with multiple ways to slow down inputs depending on individual input capabilities, based on watermarks)yes (limited? +"stops accepting messages")
        rewriting messages yesyes (at least I think so...)
        output data into various formats yesyes (looks somewhat limited to me)
        ability to control "message repeated n times" generation yesno (?)
        license GPLv3 (GPLv2 for v2 branch)GPL (paid edition is closed source)
        supported platforms Linux, BSD, anecdotical seen on Solaris; compilation and basic testing done on HP UXmany popular *nixes
        DNS cachenoyes
        @@ -601,6 +585,11 @@ argument why it is good to have another strong syslogd besides syslog-ng
        . You may want to read it at my blog at "Why does the world need another syslogd?".

        +

        Balabit, the vendor of syslog-ng, has just recently done a +feature sheet. I have not yet been able to fully work through it. In +the mean time, you may want to read it in parallel. It is available at +Balabit's +site.

        [manual index] [rsyslog.conf] [rsyslog site]

        diff -Nru rsyslog-7.6.0/doc/rsyslog_packages.html rsyslog-5.10.1/doc/rsyslog_packages.html --- rsyslog-7.6.0/doc/rsyslog_packages.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_packages.html 2012-01-24 16:37:09.000000000 +0000 @@ -12,29 +12,20 @@ appreciated. While I create the core daemon, the package maintainers are really filling it with life, making it available to the average user. I am very grateful for that!

        -

        This list has last been updated on 2013-07-25 by +

        This list has last been updated on 2008-07-11 by Rainer Gerhards. New packages may appear at any time, so be sure to check this page whenever you need a new one.

          -
        • Ubuntu (maintained by Adiscon) - - -
        • RHEL/CentOS (maintained by Adiscon) - -
        • BSD (maintained by infofarmer)
        • CentOS 4.3 (maintained by James Bergamin)
        • Debian (maintained by Michael Biebl) @@ -81,10 +72,5 @@

          If you do not find a suitable package for your distribution, there is no reason to panic. It is quite simple to install rsyslog from the source tarball, so you should consider that. -

          See Also -

          -

          diff -Nru rsyslog-7.6.0/doc/rsyslog_recording_pri.html rsyslog-5.10.1/doc/rsyslog_recording_pri.html --- rsyslog-7.6.0/doc/rsyslog_recording_pri.html 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_recording_pri.html 2012-10-17 14:41:20.000000000 +0000 @@ -45,7 +45,7 @@

          Thankfully, rsyslog provides message properties for the priority. These are called "PRI", "syslogfacility" and "syslogpriority" (case is important!). They are numerical values. Starting with rsyslog 1.13.4, there is also a property "pri-text", which -contains the priority in friendly text format (e.g. "syslog.info"). For the rest +contains the priority in friendly text format (e.g. "local0.err<133>"). For the rest of this article, I assume that you run version 1.13.4 or higher.

          Recording the priority is now a simple matter of adding the respective field to the template. It now looks like this:

          @@ -83,29 +83,29 @@

          Below is some sample data created with the template specified above. Note the priority recording at the start of each line.

          -kern.info: Jun 15 18:10:38 host kernel: PCI: Sharing IRQ 11 with 00:04.0
          -kern.info: Jun 15 18:10:38 host kernel: PCI: Sharing IRQ 11 with 01:00.0
          -kern.warn: Jun 15 18:10:38 host kernel: Yenta IRQ list 06b8, PCI irq11
          -kern.warn: Jun 15 18:10:38 host kernel: Socket status: 30000006
          -kern.warn: Jun 15 18:10:38 host kernel: Yenta IRQ list 06b8, PCI irq11
          -kern.warn: Jun 15 18:10:38 host kernel: Socket status: 30000010
          -kern.info: Jun 15 18:10:38 host kernel: cs: IO port probe 0x0c00-0x0cff: clean.
          -kern.info: Jun 15 18:10:38 host kernel: cs: IO port probe 0x0100-0x04ff: excluding 0x100-0x107 0x378-0x37f 0x4d0-0x4d7
          -kern.info: Jun 15 18:10:38 host kernel: cs: IO port probe 0x0a00-0x0aff: clean.
          -local7.notice: Jun 15 18:17:24 host dd: 1+0 records out
          -local7.notice: Jun 15 18:17:24 host random: Saving random seed: succeeded
          -local7.notice: Jun 15 18:17:25 host portmap: portmap shutdown succeeded
          -local7.notice: Jun 15 18:17:25 host network: Shutting down interface eth1: succeeded
          -local7.notice: Jun 15 18:17:25 host network: Shutting down loopback interface: succeeded
          -local7.notice: Jun 15 18:17:25 host pcmcia: Shutting down PCMCIA services: cardmgr
          -user.notice: Jun 15 18:17:25 host /etc/hotplug/net.agent: NET unregister event not supported
          -local7.notice: Jun 15 18:17:27 host pcmcia: modules.
          -local7.notice: Jun 15 18:17:29 host rc: Stopping pcmcia: succeeded
          -local7.notice: Jun 15 18:17:30 host rc: Starting killall: succeeded
          -syslog.info: Jun 15 18:17:33 host [origin software="rsyslogd" swVersion="1.13.3" x-pid="2464"] exiting on signal 15.
          -syslog.info: Jun 18 10:55:47 host [origin software="rsyslogd" swVersion="1.13.3" x-pid="2367"][x-configInfo udpReception="Yes" udpPort="514" tcpReception="Yes" tcpPort="1470"] restart
          -user.notice: Jun 18 10:55:50 host rger: test
          -syslog.info: Jun 18 10:55:52 host [origin software="rsyslogd" swVersion="1.13.3" x-pid="2367"] exiting on signal 2.

          +kern.info<6>: Jun 15 18:10:38 host kernel: PCI: Sharing IRQ 11 with 00:04.0
          +kern.info<6>: Jun 15 18:10:38 host kernel: PCI: Sharing IRQ 11 with 01:00.0
          +kern.warn<4>: Jun 15 18:10:38 host kernel: Yenta IRQ list 06b8, PCI irq11
          +kern.warn<4>: Jun 15 18:10:38 host kernel: Socket status: 30000006
          +kern.warn<4>: Jun 15 18:10:38 host kernel: Yenta IRQ list 06b8, PCI irq11
          +kern.warn<4>: Jun 15 18:10:38 host kernel: Socket status: 30000010
          +kern.info<6>: Jun 15 18:10:38 host kernel: cs: IO port probe 0x0c00-0x0cff: clean.
          +kern.info<6>: Jun 15 18:10:38 host kernel: cs: IO port probe 0x0100-0x04ff: excluding 0x100-0x107 0x378-0x37f 0x4d0-0x4d7
          +kern.info<6>: Jun 15 18:10:38 host kernel: cs: IO port probe 0x0a00-0x0aff: clean.
          +local7.notice<189>: Jun 15 18:17:24 host dd: 1+0 records out
          +local7.notice<189>: Jun 15 18:17:24 host random: Saving random seed: succeeded
          +local7.notice<189>: Jun 15 18:17:25 host portmap: portmap shutdown succeeded
          +local7.notice<189>: Jun 15 18:17:25 host network: Shutting down interface eth1: succeeded
          +local7.notice<189>: Jun 15 18:17:25 host network: Shutting down loopback interface: succeeded
          +local7.notice<189>: Jun 15 18:17:25 host pcmcia: Shutting down PCMCIA services: cardmgr
          +user.notice<13>: Jun 15 18:17:25 host /etc/hotplug/net.agent: NET unregister event not supported
          +local7.notice<189>: Jun 15 18:17:27 host pcmcia: modules.
          +local7.notice<189>: Jun 15 18:17:29 host rc: Stopping pcmcia: succeeded
          +local7.notice<189>: Jun 15 18:17:30 host rc: Starting killall: succeeded
          +syslog.info<46>: Jun 15 18:17:33 host [origin software="rsyslogd" swVersion="1.13.3" x-pid="2464"] exiting on signal 15.
          +syslog.info<46>: Jun 18 10:55:47 host [origin software="rsyslogd" swVersion="1.13.3" x-pid="2367"][x-configInfo udpReception="Yes" udpPort="514" tcpReception="Yes" tcpPort="1470"] restart
          +user.notice<13>: Jun 18 10:55:50 host rger: test
          +syslog.info<46>: Jun 18 10:55:52 host [origin software="rsyslogd" swVersion="1.13.3" x-pid="2367"] exiting on signal 2.

          Feedback Requested

          I would appreciate feedback on this paper. If you have additional ideas, comments or find bugs, please diff -Nru rsyslog-7.6.0/doc/rsyslog_secure_tls.html rsyslog-5.10.1/doc/rsyslog_secure_tls.html --- rsyslog-7.6.0/doc/rsyslog_secure_tls.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_secure_tls.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,127 @@ + +TLS-protected syslog: recommended scenario + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-06-17)

          + + +

          Overview

          +

          This document describes a secure way to set up rsyslog TLS. A secure logging +environment requires more than just encrypting the transmission channel. This document +provides one possible way to create such a secure system. +

          Rsyslog's TLS authentication can be used very flexible and thus supports a +wide range of security policies. This section tries to give some advise on a +scenario that works well for many environments. However, it may not be suitable +for you - please assess you security needs before using the recommendations +below. Do not blame us if it doesn't provide what you need ;)

          +

          Our policy offers these security benefits:

          +
            +
          • syslog messages are encrypted while traveling on the wire
          • +
          • the syslog sender authenticates to the syslog receiver; thus, the + receiver knows who is talking to it
          • +
          • the syslog receiver authenticates to the syslog sender; thus, the sender + can check if it indeed is sending to the expected receiver
          • +
          • the mutual authentication prevents man-in-the-middle attacks
          • +
          +

          Our secrity goals are achived via public/private key security. As such, it is +vital that private keys are well protected and not accessible to third parties. + + + + +If private keys have become known to third parties, the system does not provide +any security at all. Also, our solution bases on X.509 certificates and a (very +limited) chain of trust. We have one instance (the CA) that issues all machine +certificates. The machine certificate indentifies a particular machine. hile in +theory (and practice), there could be several "sub-CA" that issues machine +certificates for a specific adminitrative domain, we do not include this in our +"simple yet secure" setup. If you intend to use this, rsyslog supports it, but +then you need to dig a bit more into the documentation (or use the forum to ask). +In general, if you depart from our simple model, you should have good reasons +for doing so and know quite well what you are doing - otherwise you may +compromise your system security.

          +

          Please note that security never comes without effort. In the scenario +described here, we have limited the effort as much as possible. What remains is +some setup work for the central CA, the certificate setup for each machine as +well as a few configuration commands that need to be applied to all of them. +Proably the most important limiting factor in our setup is that all senders and +receivers must support IETF's syslog-transport-tls standard (which is not +finalized yet). We use mandatory-to-implement technology, yet you may have +trouble finding all required features in some implementations. More often, +unfortunately, you will find that an implementation does not support the +upcoming IETF standard at all - especially in the "early days" (starting May +2008) when rsyslog is the only implementation of said standard.

          +

          Fortunately, rsyslog supports allmost every protocol that is out there in the +syslog world. So in cases where transport-tls is not available on a sender, we +recommend to use rsyslog as the initial relay. In that mode, the not-capabe +sender sends to rsyslog via another protocol, which then relays the message via +transport-tls to either another interim relay or the final destination (which, +of course, must by transport-tls capable). In such a scenario, it is best to try +see what the sender support. Maybe it is possible to use industry-standard plain +tcp syslog with it. Often you can even combine it with stunnel, which then, too, +enables a secure delivery to the first rsyslog relay. If all of that is not +possible, you can (and often must...) resort to UDP. Even though this is now +lossy and insecure, this is better than not having the ability to listen to that +device at all. It may even be reasonale secure if the uncapable sender and the +first rsyslog relay communicate via a private channel, e.g. a dedicated network +link.

          +

          One final word of caution: transport-tls protects the connection between the +sender and the receiver. It does not necessarily protect against attacks that +are present in the message itself. Especially in a relay environment, the +message may have been originated from a malicious system, which placed invalid +hostnames and/or other content into it. If there is no provisioning against such +things, these records may show up in the receivers' repository. -transport-tls +does not protect against this (but it may help, properly used). Keep in mind +that syslog-transport-tls provides hop-by-hop security. It does not provide +end-to-end security and it does not authenticate the message itself (just the +last sender).

          +

          A very quick Intro

          +

          If you'd like to get all information very rapidly, the graphic below contains +everything you need to know (from the certificate perspective) in a very condensed +manner. It is no surprise if the graphic puzzles you. In this case, simply read on +for full instructions. +

          +TLS/SSL protected syslog +

          Feedback requested

          +

          I would appreciate feedback on this tutorial. If you have +additional ideas, comments or find bugs (I *do* bugs - no way... ;)), +please +let me know.

          +

          Revision History

          + +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/rsyslog_tls.html rsyslog-5.10.1/doc/rsyslog_tls.html --- rsyslog-7.6.0/doc/rsyslog_tls.html 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/doc/rsyslog_tls.html 2012-09-18 15:03:57.000000000 +0000 @@ -23,7 +23,7 @@

          This is a quick guide. There is a more elaborate guide currently under construction which provides a much more secure environment. It is highly recommended to -at least have a look at it. +at least have a look at it.

          Background

          Traditional syslog is a clear-text protocol. That means anyone with a sniffer can have a peek at your data. In Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/src/classes.dia and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/src/classes.dia differ Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/src/queueWorkerLogic.dia and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/src/queueWorkerLogic.dia differ Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/src/tls_cert.dia and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/src/tls_cert.dia differ diff -Nru rsyslog-7.6.0/doc/syslog_parsing.html rsyslog-5.10.1/doc/syslog_parsing.html --- rsyslog-7.6.0/doc/syslog_parsing.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/syslog_parsing.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,210 @@ + +syslog parsing in rsyslog + + +

          syslog parsing in rsyslog

          +

          Written by Rainer Gerhards +(2008-09-23)

          +

          We regularly receive messages asking why rsyslog +parses this or that message incorrectly. Of course, it turns out that rsyslog does +the right thing, but the message sender does not. And also of course, this is not even +of the slightest help to the end user experiencing the problem ;). So I thought I write this +paper. It describes the problem source and shows potential solutions (aha!). +

          Syslog Standardization

          +The syslog protocol has not been standardized until relatively recently.The first document "smelling" a bit +like a standard is RFC 3164, which dates back +to August 2001. The problem is that this document is no real standard. It has assigned "informational" +status by the IETF which means it provides some hopefully +useful information but does not demand anything. It is impossible to "comply" to an informational +document. This, of course, doesn't stop marketing guys from telling they comply to RFC3164 and +it also does not stop some techs to tell you "this and that does not comply to RFC3164, so it is +<anybody else but them>'s fault". +

          Then, there is RFC3195, which is +a real standard. In it's section 3 it makes (a somewhat questionable) reference to (informational) +RFC 3164 which may be interpreted in a way that RFC3195 standardizes the format layed out +in RFC 3164 by virtue of referencing them. So RFC3195 seems to extend its standardization +domain to the concepts layed out in RFC 3164 (which is why I tend to find that refrence +questionable). In that sense, RFC3195 standardizes the format informationally described in +RFC3164, Section 4. But it demands it only for the scope of RFC3195, which is syslog over +BEEP - and NOT syslog over UDP. So one may argue whether or not the RFC3164 format could +be considered a standard for any non-BEEP (including UDP) syslog, too. In the strict view +I tend to have, it does not. Refering to the RFC3195 context usually does not help, +because there are virtually no RFC3195 implementations available (at this time, +I would consider this RFC a failure). +

          Now let's for a short moment assume that RFC3195 would somehow be able to demand +RFC3164 format for non-BEEP syslog. So we could use RFC3164 format as a standard. But does +that really help? Let's cite RFC 3164, right at the begining of section 4 (actually, this +is the first sentence): +

          +
          +   The payload of any IP packet that has a UDP destination port of 514
          +   MUST be treated as a syslog message. 
          +
          +
          +

          Think a bit about it: this means that whatever is send to port 514 must be considered +a valid syslog message. No format at all is demanded. So if "this is junk" is sent to +UDP port 514 - voila, we have a valid message (interestingly, it is no longer a syslog +message if it is sent to port 515 ;)). You may now argue that I am overdoing. So let's +cite RFC 3164, Section 5.4, Example 2: +

          +
          +  Example 2
          +
          +        Use the BFG!
          +
          +   While this is a valid message, it has extraordinarily little useful
          +   information.
          +
          +
          +

          As you can see, RFC3164 explicitely states that no format at all is required. +

          Now a side-note is due: all of this does not mean that the RFC3164 authors +did not know what they were doing. No, right the contrary is true: RFC3164 mission +is to describe what has been seen in practice as syslog messages and the +conclusion is quite right that there is no common understanding on the +message format. This is also the reason why RFC3164 is an informational document: +it provides useful information, but does not precisely specify anything. +

          After all of this bashing, I now have to admit that RFC3164 has some format +recommendations layed out in section 4. The format described has quite some +value in it and implementors recently try to follow it. This format is usually meant +when someone tells you that a software is "RFC3164 compliant" or expects "RFC3164 compliant messages". +I also have to admit that rsyslog also uses this format and, in the sense outlined here, +expects messages received to be "RFC3164 compliant" (knowingly that such a beast does not +exist - I am simply lying here ;)). +

          Please note that there is some relief of the situation in reach. There is a new normative +syslog RFC series upcoming, and it specifies a standard message format. At the time of +this writing, the main documents are sitting in the RFC editor queue waiting for a transport +mapping to be completed. I personally expect them to be assigned RFC numbers in 2009. +

          Practical Format Requirements

          +

          From a practical point of view, the message format expected (and generated by +default in legacy mode) is: +

          
          +<PRI>TIMESTAMP SP HOST SP TAG MSG(Freetext)
          +
          +

          SP is the ASCII "space" character and the definition of the rest of the fields +can be taken from RFC3164. Please note that there also is a lot of confusion on what +syntax and semantics the TAG actually has. This format is called "legacy syslog" because +it is not well specified (as you know by now) and has been "inherited from the real world". +

          Rsyslog offers two parsers: one for the upcoming RFC series and one for legacy format. We +concentrate on the later. That parser applies some logic to detect missing hostnames, +is able to handle various ways the TIMESTAMP is typically malformed. In short it applies +a lot of guesswork in trying to figure out what a message really means. I am sure the +guessing algorithm can be improved, and I am always trying that when I see new malformed +messages (and there is an ample set of them...). However, this finds its limits where +it is not possible to differentiate between two entities which could be either. +For example, look at this message: +

          
          +<144>Tue Sep 23 11:40:01 taghost sample message
          +
          +

          Does it contain a hostname? Mabye. The value "taghost" is a valid hostname. Of course, it is +also a valid tag. If it is a hostname, the tag's value is "sample" and the msg value is "message". +Or is the hostname missing, the tag is "taghost" and msg is "sample message"? As a human, I tend +to say the later interpretation is correct. But that's hard to tell the message parser (and, no, I do +not intend to apply artificial intelligence just to guess what the hostname value is...). +

          One approach is to configure the parser so that it never expects hostnames. This becomes problematic +if you receive messages from multiple devices. Over time, I may implement parser conditionals, +but this is not yet available and I am not really sure if it is needed comlexity... +

          Things like this, happen. Even more scary formats happen in practice. Even from mainstream +vendors. For example, I was just asked about this message (which, btw, finally made me +write this article here): +

          
          +"<130> [ERROR] iapp_socket_task.c 399: iappSocketTask: iappRecvPkt returned error"
          +
          +

          If you compare it with the format RFC3164 "suggests", you'll quickly notice that +the message is "a bit" malformed. Actually, even my human intelligence is not sufficient +to guess if there is a TAG or not (is "[ERROR]" a tag or part of the message). I may not be +the smartest guy, but don't expect me to program a parser that is smarter than me. +

          To the best of my konwledge, these vendor's device's syslog format can be configured, so it +would proabably be a good idea to include a (sufficiently well-formed) timestamp, +the sending hostname and (maybe?) a tag to make this message well parseable. +I will also once again take this sample and see if we can apply some guesswork. +For example, "[" can not be part of a well-formed TIMESTAMP, so logic can conclude +there is not TIMESTAMP. Also, "[" can not be used inside a valid hostname, so +logic can conclude that the message contains no hostname. Even if I implement this +logic (which I will probably do), this is a partial solution: it is impossible to +guess if there is a tag or not (honestly!). And, even worse, it is a solution only for +those set of messages that can be handled by the logic described. Now consider this +hypothetical message: +

          
          +"<130> [ERROR] host.example.net 2008-09-23 11-40-22 PST iapp_socket_task.c 399: iappSocketTask: iappRecvPkt returned error"
          +
          +

          Obviously, it requires additional guesswork. If we iterate over all the cases, we +can very quickly see that it is impossible to guess everything correct. In the example above +we can not even surely tell if PST should be a timezone or some other message property. +

          A potential solution is to generate a parser-table based parser, but this requires +considerable effort and also has quite some runtime overhead. I try to avoid this for +now (but I may do it, especially if someone sponsors this work ;)). Side-note: if you want +to be a bit scared about potential formats, you may want to have a look at my paper +"On the Nature of Syslog Data". +

          Work-Around

          +

          The number one work-around is to configure your devices so that they emit +(sufficiently) well-formed messages. You should by now know what these look +like. +

          If that cure is not available, there are some things you can do in rsyslog to +handle the situation. First of all, be sure to read about +rsyslog.conf format +and the property replacer and properties specifically. +You need to understand that everything is configured in rsyslog. And that the message is parsed +into properties. There are also properties available which do not stem back directly to parsing. +Most importantly, %fromhost% property holds the name of the system rsyslog received +the message from. In non-relay cases, this can be used instead of hostname. In relay cases, +there is no cure other than to either fix the orginal sender or at least one of the +relays in front of the rsyslog instance in question. Similarly, you can use %timegenerated% +instead of %timereported%. Timegenerated is the time the message hit rsyslog for the first +time. For non-relayed, locally connected peers, Timegenerated should be a very close approximation +of the actual time a message was formed at the sender (depending, of course, on potential +internal queueing inside the sender). +Also, you may use the +%rawmsg% property together with the several extraction modes the property replacer supports. +Rawmsg contains the message as it is received from the remote peer. In a sense, you can +implement a post-parser with this method. +

          To use these properties, you need to define your own templates and assign them. Details +can be found in the above-quoted documentation. Just let's do a quick example. Let's say +you have the horrible message shown above and can not fix the sending device for +some good reason. In rsyslog.conf, you used to say: +

          
          +*.* /var/log/somefile
          +
          +

          Of course, things do not work out well with that ill-formed message. So you decide +to dump the rawmsg to the file and pull the remote host and time of message generation +from rsyslog's internal properties (which, btw, is clever, because otherwise there is no +indication of these two properties...). So you need to define a template for that and +make sure the template is used with your file logging action. This is how it may look: +

          
          +$template, MalfromedMsgFormater,"%timegenerated% %fromhost% %rawmsg:::drop-last-lf%\n"
          +*.* /var/log/somefile;MalformedMsgFormatter
          +
          +

          This will make your log much nicer, but not look perfect. Experiment a bit +with the available properties and replacer extraction options to fine-tune it +to your needs. +

          The Ultimate Solution...

          +

          Is available with rsyslog 5.3.4 and above. Here, we can define so-called custom +parsers. These are plugin modules, written in C and adapted to a specific message format +need. The big plus of custom parsers is that they offer excellent performance and unlimited +possibilities - far better than any work-around could do. Custom parsers can be +bound to specific rule sets +(and thus listening) ports with relative ease. The only con is that they must be written. +However, if you are lucky, a parser for your device may already exist. If not, you can +opt to write it yourself, what is not too hard if you know some C. Alternatively, +Adiscon can program one for you as part of the +rsyslog professional services offering. +In any case, you should seriously consider custom parsers as an alternative if you can not +reconfigure your device to send decent message format. +

          Wrap-Up

          +

          Syslog message format is not sufficiently standardized. There exists a weak +"standard" format, which is used by a good number of implementations. However, there +exist many others, including mainstream vendor implementations, which have a +(sometimes horribly) different format. Rsyslog tries to deal with anomalies but +can not guess right in all instances. If possible, the sender should be configured +to submit well-formed messages. If that is not possible, you can work around these +issues with rsyslog's property replacer and template system. Or you can use a suitable +message parser or write one for your needs. +

          I hope this is a useful guide. You may also have a look at the +rsyslog troubleshooting guide for further help and places where +to ask questions. +

          [manual index] [rsyslog site]

          +

          This documentation is part of the +rsyslog project.
          +Copyright © 2009 by Rainer +Gerhards and Adiscon. +Released under the GNU GPL version 3 or higher.

          + Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/tls_cert_100.jpg and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/tls_cert_100.jpg differ diff -Nru rsyslog-7.6.0/doc/tls_cert_ca.html rsyslog-5.10.1/doc/tls_cert_ca.html --- rsyslog-7.6.0/doc/tls_cert_ca.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_ca.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,168 @@ + +TLS-protected syslog: scenario + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-06-17)

          + + + +

          Setting up the CA

          +

          The first step is to set up a certificate authority (CA). It must be +maintained by a trustworthy person (or group) and approves the indentities of +all machines. It does so by issuing their certificates. In a small setup, the +administrator can provide the CA function. What is important is the the CA's + + + + +private key is well-protocted and machine certificates are only issued if it is +know they are valid (in a single-admin case that means the admin should not +issue certificates to anyone else except himself).

          +

          The CA creates a so-called self-signed certificate. That is, it approves its +own authenticy. This sounds useless, but the key point to understand is that +every machine will be provided a copy of the CA's certificate. Accepting this +certificate is a matter of trust. So by configuring the CA certificate, the +administrator tells rsyslog which certificates to trust. This is the root of all +trust under this model. That is why the CA's private key is so important - +everyone getting hold of it is trusted by our rsyslog instances.

          +
          +

          To create a self-signed certificate, use the following commands with GnuTLS (which +is currently the only supported TLS library, what may change in the future). +Please note that GnuTLS' tools are not installed by default on many platforms. Also, +the tools do not necessarily come with the GnuTLS core package. If you do not +have certtool on your system, check if there is package for the GnuTLS tools available +(under Fedora, for example, this is named gnutls-utils-<version> and +it is NOT installed by default).

          +
            +
          1. generate the private key: +
            certtool --generate-privkey --outfile ca-key.pem
            +
            +This takes a short while. Be sure to do some work on your workstation, +it waits for radom input. Switching between windows is sufficient ;) +
          2. +
          3. now create the (self-signed) CA certificate itself:
            +
            certtool --generate-self-signed --load-privkey ca-key.pem --outfile ca.pem
            +This generates the CA certificate. This command queries you for a +number of things. Use appropriate responses. When it comes to +certificate validity, keep in mind that you need to recreate all +certificates when this one expires. So it may be a good idea to use a +long period, eg. 3650 days (roughly 10 years). You need to specify that +the certificates belongs to an authority. The certificate is used to +sign other certificates.
            +
          4. +
          +

          Sample Screen Session

          +

          Text in red is user input. Please note that for some questions, there is no +user input given. This means the default was accepted by simply pressing the +enter key. +

          +[root@rgf9dev sample]# certtool --generate-privkey --outfile ca-key.pem --bits 2048
          +Generating a 2048 bit RSA private key...
          +[root@rgf9dev sample]# certtool --generate-self-signed --load-privkey ca-key.pem --outfile ca.pem
          +Generating a self signed certificate...
          +Please enter the details of the certificate's distinguished name. Just press enter to ignore a field.
          +Country name (2 chars): US
          +Organization name: SomeOrg
          +Organizational unit name: SomeOU
          +Locality name: Somewhere
          +State or province name: CA
          +Common name: someName (not necessarily DNS!)
          +UID: 
          +This field should not be used in new certificates.
          +E-mail: 
          +Enter the certificate's serial number (decimal): 
          +
          +
          +Activation/Expiration time.
          +The certificate will expire in (days): 3650
          +
          +
          +Extensions.
          +Does the certificate belong to an authority? (Y/N): y
          +Path length constraint (decimal, -1 for no constraint): 
          +Is this a TLS web client certificate? (Y/N): 
          +Is this also a TLS web server certificate? (Y/N): 
          +Enter the e-mail of the subject of the certificate: someone@example.net
          +Will the certificate be used to sign other certificates? (Y/N): y
          +Will the certificate be used to sign CRLs? (Y/N): 
          +Will the certificate be used to sign code? (Y/N): 
          +Will the certificate be used to sign OCSP requests? (Y/N): 
          +Will the certificate be used for time stamping? (Y/N): 
          +Enter the URI of the CRL distribution point:        
          +X.509 Certificate Information:
          +	Version: 3
          +	Serial Number (hex): 485a365e
          +	Validity:
          +		Not Before: Thu Jun 19 10:35:12 UTC 2008
          +		Not After: Sun Jun 17 10:35:25 UTC 2018
          +	Subject: C=US,O=SomeOrg,OU=SomeOU,L=Somewhere,ST=CA,CN=someName (not necessarily DNS!)
          +	Subject Public Key Algorithm: RSA
          +		Modulus (bits 2048):
          +			d9:9c:82:46:24:7f:34:8f:60:cf:05:77:71:82:61:66
          +			05:13:28:06:7a:70:41:bf:32:85:12:5c:25:a7:1a:5a
          +			28:11:02:1a:78:c1:da:34:ee:b4:7e:12:9b:81:24:70
          +			ff:e4:89:88:ca:05:30:0a:3f:d7:58:0b:38:24:a9:b7
          +			2e:a2:b6:8a:1d:60:53:2f:ec:e9:38:36:3b:9b:77:93
          +			5d:64:76:31:07:30:a5:31:0c:e2:ec:e3:8d:5d:13:01
          +			11:3d:0b:5e:3c:4a:32:d8:f3:b3:56:22:32:cb:de:7d
          +			64:9a:2b:91:d9:f0:0b:82:c1:29:d4:15:2c:41:0b:97
          +		Exponent:
          +			01:00:01
          +	Extensions:
          +		Basic Constraints (critical):
          +			Certificate Authority (CA): TRUE
          +		Subject Alternative Name (not critical):
          +			RFC822name: someone@example.net
          +		Key Usage (critical):
          +			Certificate signing.
          +		Subject Key Identifier (not critical):
          +			fbfe968d10a73ae5b70d7b434886c8f872997b89
          +Other Information:
          +	Public Key Id:
          +		fbfe968d10a73ae5b70d7b434886c8f872997b89
          +
          +Is the above information ok? (Y/N): y
          +
          +
          +Signing certificate...
          +[root@rgf9dev sample]# chmod 400 ca-key.pem
          +[root@rgf9dev sample]# ls -l
          +total 8
          +-r-------- 1 root root  887 2008-06-19 12:33 ca-key.pem
          +-rw-r--r-- 1 root root 1029 2008-06-19 12:36 ca.pem
          +[root@rgf9dev sample]# 
          +
          +

          Be sure to safeguard ca-key.pem! Nobody except the CA itself +needs to have it. If some third party obtains it, you security is broken! +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/tls_cert_ca.jpg and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/tls_cert_ca.jpg differ diff -Nru rsyslog-7.6.0/doc/tls_cert_client.html rsyslog-5.10.1/doc/tls_cert_client.html --- rsyslog-7.6.0/doc/tls_cert_client.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_client.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,91 @@ + +TLS-protected syslog: client setup + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-07-03)

          + + + +

          Setting up a client

          +

          In this step, we configure a client machine. We from our scenario, we use +zuse.example.net. You need to do the same steps for all other clients, too (in the +example, that meanst turng.example.net). The client check's the server's identity and +talks to it only if it is the expected server. This is a very important step. +Without it, you would not detect man-in-the-middle attacks or simple malicious servers +who try to get hold of your valuable log data. + + + + +

          +

          Steps to do: +

            +
          • make sure you have a functional CA (Setting up the CA) +
          • generate a machine certificate for zuse.example.net (follow instructions in + Generating Machine Certificates) +
          • make sure you copy over ca.pem, machine-key.pem ad machine-cert.pem to the client. +Ensure that no user except root can access them (even read permissions are really bad). +
          • configure the client so that it checks the server identity and sends messages only +if the server identity is known. Please note that you have the same options as when +configuring a server. However, we now use a single name only, because there is only one +central server. No using wildcards make sure that we will exclusively talk to that server +(otherwise, a compromised client may take over its role). If you load-balance to different +server identies, you obviously need to allow all of them. It still is suggested to use +explcit names. +
          +

          At this point, please be reminded once again that your security needs may be quite different from +what we assume in this tutorial. Evaluate your options based on your security needs. +

          Sample syslog.conf

          +

          Keep in mind that this rsyslog.conf sends messages via TCP, only. Also, we do not +show any rules to write local files. Feel free to add them. +

          +# make gtls driver the default
          +$DefaultNetstreamDriver gtls
          +
          +# certificate files
          +$DefaultNetstreamDriverCAFile /rsyslog/protected/ca.pem
          +$DefaultNetstreamDriverCertFile /rsyslog/protected/machine-cert.pem
          +$DefaultNetstreamDriverKeyFile /rsyslog/protected/machine-key.pem
          +
          +$ActionSendStreamDriverAuthMode x509/name
          +$ActionSendStreamDriverPermittedPeer central.example.net
          +$ActionSendStreamDriverMode 1 # run driver in TLS-only mode
          +*.* @@central.example.net:10514 # forward everything to remote server
          +
          +

          Note: the example above forwards every message to the remote server. Of course, +you can use the normal filters to restrict the set of information that is sent. +Depending on your message volume and needs, this may be a smart thing to do. +

          Be sure to safeguard at least the private key (machine-key.pem)! +If some third party obtains it, you security is broken! +

          Copyright

          +

          Copyright © 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/tls_cert_errmsgs.html rsyslog-5.10.1/doc/tls_cert_errmsgs.html --- rsyslog-7.6.0/doc/tls_cert_errmsgs.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_errmsgs.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,103 @@ + +TLS-protected syslog: error messages + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-06-17)

          + + + +

          Error Messages

          +

          This page covers error message you may see when setting up + + + + +rsyslog with TLS. Please note that many +of the message stem back to the TLS library being used. In those cases, there is +not always a good explanation available in rsyslog alone. +

          A single error typically results in two or more message being emitted: (at +least) one is the actual error cause, followed by usually one message with additional +information (like certificate contents). In a typical system, these message should +immediately follow each other in your log. Kepp in mind that they are reported +as syslog.err, so you need to capture these to actually see errors (the default +rsyslog.conf's shipped by many systems will do that, recording them e.g. in +/etc/messages). +

          certificate invalid

          +

          Sample: + +not permitted to talk to peer, certificate invalid: insecure algorithm + +

          This message may occur during connection setup. It indicates that the remote peer's +certificate can not be accepted. The reason for this is given in the message part that +is shown in red. Please note that this red part directly stems back to the TLS library, +so rsyslog does acutally not have any more information about the reason. +

          With GnuTLS, the following reasons have been seen in practice: +

          insecure algorith

          +

          The certificate contains information on which encryption algorithms are to be used. +This information is entered when the certificate is created. +Some older alogrithms are no longer secure and the TLS library does not accept +them. Thus the connection request failed. The cure is to use a certificate with sufficiently secure +alogorithms. +

          Please note that noi encryption algorithm is totally secure. It only is secure based +on our current knowledge AND on computing power available. As computers get more and more +powerful, previously secure algorithms become insecure over time. As such, algorithms +considered secure today may not be accepted by the TLS library in the future. +

          So in theory, after a system upgrade, a connection request may fail with the "insecure +algorithm" failure without any change in rsyslog configuration or certificates. This could be +caused by a new perception of the TLS library of what is secure and what not. +

          GnuTLS error -64

          +

          Sample: unexpected GnuTLS error -64 in nsd_gtls.c:517: Error while reading file. +

          This error points to an encoding error witht the pem file in question. It means "base 64 encoding error". +From my experience, it can be caused by a couple of things, some of them not obvious: +

            +
          • You specified a wrong file, which is not actually in .pem format +
          • The file was incorrectly generated +
          • I think I have also seen this when I accidently swapped private key files and +certificate files. So double-check the type of file you are using. +
          • It may even be a result of an access (permission) problem. In theory, that +should lead to another error, but in practice it sometimes seems to lead to +this -64 error. +
          +

          info on invalid cert

          +

          Sample: + +info on invalid cert: peer provided 1 certificate(s). Certificate 1 info: certificate valid from Wed Jun 18 11:45:44 2008 to Sat Jun 16 11:45:53 2018; Certificate public key: RSA; DN: C=US,O=Sample Corp,OU=Certs,L=Somehwere,ST=CA,CN=somename; Issuer DN: C=US,O=Sample Corp,OU=Certs,L=Somewhere,ST=CA,CN=somename,EMAIL=xxx@example.com; SAN:DNSname: machine.example.net; + +

          This is not an error message in itself. It always follows the actual error message and +tells you what is seen in the peer's certificate. This is done to give you a chance to evaluate +the certificate and better understand why the initial error message was issued. +

          Please note that you can NOT diagnose problems based on this message alone. It follows +in a number of error cases and does not pinpoint any problems by itself. +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + Binary files /tmp/z2meHKWPeK/rsyslog-7.6.0/doc/tls_cert.jpg and /tmp/fJ6_yZqB50/rsyslog-5.10.1/doc/tls_cert.jpg differ diff -Nru rsyslog-7.6.0/doc/tls_cert_machine.html rsyslog-5.10.1/doc/tls_cert_machine.html --- rsyslog-7.6.0/doc/tls_cert_machine.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_machine.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,182 @@ + +TLS-protected syslog: generating the machine certificate + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-06-18)

          + + + +

          generating the machine certificate

          +

          In this step, we generate certificates for each of the machines. Please note +that both clients and servers need certificates. The certificate identifies each +machine to the remote peer. The DNSName specified inside the certificate can + + + + +be specified inside the $<object>PermittedPeer config statements. +

          For now, we assume that a single person (or group) is responsible for the whole +rsyslog system and thus it is OK if that single person is in posession of all +machine's private keys. This simplification permits us to use a somewhat less +complicated way of generating the machine certificates. So, we generate both the private +and public key on the CA (which is NOT a server!) and then copy them over to the +respective machines. +

          If the roles of machine and CA administrators are split, the private key must +be generated by the machine administrator. This is done via a certificate request. +This request is then sent to the CA admin, which in turn generates the certificate +(containing the public key). The CA admin then sends back the certificate to the +machine admin, who installs it. That way, the CA admin never get's hold of the +machine's private key. Instructions for this mode will be given in a later revision +of this document. +

          In any case, it is vital that the machine's private key is protected. Anybody +able to obtain that private key can imporsonate as the machine to which it belongs, thus +breaching your security. +

          Sample Screen Session

          +

          Text in red is user input. Please note that for some questions, there is no +user input given. This means the default was accepted by simply pressing the +enter key. +

          Please note: you need to substitute the names specified below with values +that match your environment. Most importantly, machine.example.net must be replaced +by the actual name of the machine that will be using this certificate. For example, +if you generate a certificate for a machine named "server.example.com", you need +to use that name. If you generate a certificate for "client.example.com", you need +to use this name. Make sure that each machine certificate has a unique name. If not, +you can not apply proper access control. +

          +[root@rgf9dev sample]# certtool --generate-privkey --outfile key.pem --bits 2048
          +Generating a 2048 bit RSA private key...
          +[root@rgf9dev sample]# certtool --generate-request --load-privkey key.pem --outfile request.pem
          +Generating a PKCS #10 certificate request...
          +Country name (2 chars): US
          +Organization name: SomeOrg
          +Organizational unit name: SomeOU
          +Locality name: Somewhere
          +State or province name: CA
          +Common name: machine.example.net
          +UID: 
          +Enter a dnsName of the subject of the certificate:
          +Enter the IP address of the subject of the certificate:
          +Enter the e-mail of the subject of the certificate:
          +Enter a challange password:
          +Does the certificate belong to an authority? (y/N): n
          +Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y/N): 
          +Will the certificate be used for encryption (RSA ciphersuites)? (y/N):
          +Is this a TLS web client certificate? (y/N): y
          +Is this also a TLS web server certificate? (y/N): y
          +[root@rgf9dev sample]# certtool --generate-certificate --load-request request.pem --outfile cert.pem --load-ca-certificate ca.pem --load-ca-privkey ca-key.pem
          +Generating a signed certificate...
          +Enter the certificate's serial number (decimal): 
          +
          +
          +Activation/Expiration time.
          +The certificate will expire in (days): 1000
          +
          +
          +Extensions.
          +Do you want to honour the extensions from the request? (y/N):
          +Does the certificate belong to an authority? (Y/N): n
          +Is this a TLS web client certificate? (Y/N): y
          +Is this also a TLS web server certificate? (Y/N): y
          +Enter the dnsName of the subject of the certificate: machine.example.net {This is the name of the machine that will use the certificate}
          +Enter the IP address of the subject of certificate:
          +Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (Y/N): 
          +Will the certificate be used for encryption (RSA ciphersuites)? (Y/N): 
          +X.509 Certificate Information:
          +	Version: 3
          +	Serial Number (hex): 485a3819
          +	Validity:
          +		Not Before: Thu Jun 19 10:42:54 UTC 2008
          +		Not After: Wed Mar 16 10:42:57 UTC 2011
          +	Subject: C=US,O=SomeOrg,OU=SomeOU,L=Somewhere,ST=CA,CN=machine.example.net
          +	Subject Public Key Algorithm: RSA
          +		Modulus (bits 2048):
          +			b2:4e:5b:a9:48:1e:ff:2e:73:a1:33:ee:d8:a2:af:ae
          +			2f:23:76:91:b8:39:94:00:23:f2:6f:25:ad:c9:6a:ab
          +			2d:e6:f3:62:d8:3e:6e:8a:d6:1e:3f:72:e5:d8:b9:e0
          +			d0:79:c2:94:21:65:0b:10:53:66:b0:36:a6:a7:cd:46
          +			1e:2c:6a:9b:79:c6:ee:c6:e2:ed:b0:a9:59:e2:49:da
          +			c7:e3:f0:1c:e0:53:98:87:0d:d5:28:db:a4:82:36:ed
          +			3a:1e:d1:5c:07:13:95:5d:b3:28:05:17:2a:2b:b6:8e
          +			8e:78:d2:cf:ac:87:13:15:fc:17:43:6b:15:c3:7d:b9
          +		Exponent:
          +			01:00:01
          +	Extensions:
          +		Basic Constraints (critical):
          +			Certificate Authority (CA): FALSE
          +		Key Purpose (not critical):
          +			TLS WWW Client.
          +			TLS WWW Server.
          +		Subject Alternative Name (not critical):
          +			DNSname: machine.example.net
          +		Subject Key Identifier (not critical):
          +			0ce1c3dbd19d31fa035b07afe2e0ef22d90b28ac
          +		Authority Key Identifier (not critical):
          +			fbfe968d10a73ae5b70d7b434886c8f872997b89
          +Other Information:
          +	Public Key Id:
          +		0ce1c3dbd19d31fa035b07afe2e0ef22d90b28ac
          +
          +Is the above information ok? (Y/N): y
          +
          +
          +Signing certificate...
          +[root@rgf9dev sample]# rm -f request.pem
          +[root@rgf9dev sample]# ls -l
          +total 16
          +-r-------- 1 root root  887 2008-06-19 12:33 ca-key.pem
          +-rw-r--r-- 1 root root 1029 2008-06-19 12:36 ca.pem
          +-rw-r--r-- 1 root root 1074 2008-06-19 12:43 cert.pem
          +-rw-r--r-- 1 root root  887 2008-06-19 12:40 key.pem
          +[root@rgf9dev sample]# # it may be a good idea to rename the files to indicate where they belong to
          +[root@rgf9dev sample]# mv cert.pem machine-cert.pem
          +[root@rgf9dev sample]# mv key.pem machine-key.pem
          +[root@rgf9dev sample]# 
          +
          +

          Distributing Files

          +

          Provide the machine with: +

            +
          • a copy of ca.pem +
          • cert.pem +
          • key.pem +
          +

          This is how the relevant part of rsyslog.conf looks on the target machine: +

          +

          +$DefaultNetstreamDriverCAFile /home/rger/proj/rsyslog/sample/ca.pem
          +$DefaultNetstreamDriverCertFile /home/rger/proj/rsyslog/sample/machine-cert.pem
          +$DefaultNetstreamDriverKeyFile /home/rger/proj/rsyslog/sample/machine-key.pem
          +
          +

          Never provide anyone with ca-key.pem! Also, make sure +nobody but the machine in question gets hold of key.pem. +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/tls_cert_scenario.html rsyslog-5.10.1/doc/tls_cert_scenario.html --- rsyslog-7.6.0/doc/tls_cert_scenario.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_scenario.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,63 @@ + +TLS-protected syslog: scenario + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-06-17)

          + + + +

          Sample Scenario

          +

          We have a quite simple scenario. There is one central syslog server, + + + + +named central.example.net. These server is being reported to by two Linux +machines with name zuse.example.net and turing.example.net. Also, there is a +third client - ada.example.net - which send both its own messages to the central +server but also forwards messages receive from an UDP-only capable router. We +hav decided to use ada.example.net because it is in the same local network +segment as the router and so we enjoy TLS' security benefits for forwarding the +router messages inside the corporate network. All systems (except the router) use +rsyslog as the syslog software.

          +

          +

          Please note that the CA must not necessarily be connected to the rest of the +network. Actually, it may be considered a security plus if it is not. If the CA +is reachable via the regular network, it should be sufficiently secured (firewal +rules et al). Keep in mind that if the CA's security is breached, your overall +system security is breached. +

          In case the CA is compromised, you need to regenerate the CA's certificate as well +as all individual machines certificates. +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/tls_cert_server.html rsyslog-5.10.1/doc/tls_cert_server.html --- rsyslog-7.6.0/doc/tls_cert_server.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_server.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,127 @@ + +TLS-protected syslog: central server setup + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-06-18)

          + + + +

          Setting up the Central Server

          +

          In this step, we configure the central server. We assume it accepts messages only +via TLS protected plain tcp based syslog from those peers that are explicitely permitted +to send to it. The picture below show our configuration. This step configures +the server central.example.net. + + + + +

          +

          Important: Keep in mind that the order of configuration directives +is very important in rsyslog. As such, the samples given below do only work if the given +order is preserved. Re-ordering the directives can break configurations and has broken them +in practice. If you intend to re-order them, please be sure that you fully understand how +the configuration language works and, most importantly, which statements form a block together. +Please also note that we understand the the current configuration file format is +ugly. However, there has been more important work in the way of enhancing it. If you would like +to contribute some time to improve the config file language, please let us know. Any help +is appreciated (be it doc or coding work!). +

          Steps to do: +

            +
          • make sure you have a functional CA (Setting up the CA) +
          • generate a machine certificate for central.example.net (follow instructions in + Generating Machine Certificates) +
          • make sure you copy over ca.pem, machine-key.pem ad machine-cert.pem to the central server. +Ensure that no user except root can access them (even read permissions are really bad). +
          • configure the server so that it accepts messages from all machines in the +example.net domain that have certificates from your CA. Alternatively, you may also +precisely define from which machine names messages are accepted. See sample rsyslog.conf +below. +
          +In this setup, we use wildcards to ease adding new systems. We permit the server to accept +messages from systems whos names match *.example.net. +
          
          +$InputTCPServerStreamDriverPermittedPeer *.example.net
          +
          +This will match zuse.example.net and +turing.example.net, but NOT pascal.otherdepartment.example.net. If the later would be desired, +you can (and need) to include additional permitted peer config statments: +
          
          +$InputTCPServerStreamDriverPermittedPeer *.example.net
          +$InputTCPServerStreamDriverPermittedPeer *.otherdepartment.example.net
          +$InputTCPServerStreamDriverPermittedPeer *.example.com
          +
          +

          As can be seen with example.com, the different permitted peers need NOT to be in a single +domain tree. Also, individual machines can be configured. For example, if only zuse, turing +and ada should be able to talk to the server, you can achive this by: +

          
          +$InputTCPServerStreamDriverPermittedPeer zuse.example.net
          +$InputTCPServerStreamDriverPermittedPeer turing.example.net
          +$InputTCPServerStreamDriverPermittedPeer ada.example.net
          +
          +

          As an extension to the (upcoming) IETF syslog/tls standard, you can specify some text +together with a domain component wildcard. So "*server.example.net", "server*.example.net" +are valid permitted peers. However "server*Fix.example.net" is NOT a valid wildcard. The +IETF standard permits no text along the wildcards. +

          The reason we use wildcards in the default setup is that it makes it easy to add systems +without the need to change the central server's configuration. It is important to understand that +the central server will accept names only (no exception) if the client certificate was +signed by the CA we set up. So if someone tries to create a malicious certificate with +a name "zuse.example.net", the server will not accept it. So a wildcard is safe +as long as you ensure CA security is not breached. Actually, you authorize a client by issuing +the certificate to it. +

          At this point, please be reminded once again that your security needs may be quite different from +what we assume in this tutorial. Evaluate your options based on your security needs. +

          Sample syslog.conf

          +

          Keep in mind that this rsyslog.conf accepts messages via TCP, only. The only other +source accepted is messages from the server itself. +

          +$ModLoad imuxsock # local messages
          +$ModLoad imtcp # TCP listener
          +
          +# make gtls driver the default
          +$DefaultNetstreamDriver gtls
          +
          +# certificate files
          +$DefaultNetstreamDriverCAFile /rsyslog/protected/ca.pem
          +$DefaultNetstreamDriverCertFile /rsyslog/protected/machine-cert.pem
          +$DefaultNetstreamDriverKeyFile /rsyslog/protected/machine-key.pem
          +
          +$InputTCPServerStreamDriverAuthMode x509/name
          +$InputTCPServerStreamDriverPermittedPeer *.example.net
          +$InputTCPServerStreamDriverMode 1 # run driver in TLS-only mode
          +$InputTCPServerRun 10514 # start up listener at port 10514
          +
          +

          Be sure to safeguard at least the private key (machine-key.pem)! +If some third party obtains it, you security is broken! +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/tls_cert_summary.html rsyslog-5.10.1/doc/tls_cert_summary.html --- rsyslog-7.6.0/doc/tls_cert_summary.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_summary.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,66 @@ + +TLS-protected syslog: Summary + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-07-03)

          + + + +

          Summary

          +

          If you followed the steps outlined in this documentation set, you now have + + + + +a reasonable (for most needs) secure setup for the following environment: +

          +

          You have learned about the security decisions involved and which we +made in this example. Be once again reminded that you must make sure yourself +that whatever you do matches your security needs! There is no guarantee that +what we generally find useful actually is. It may even be totally unsuitable for +your environment. +

          In the example, we created a rsyslog certificate authority (CA). Guard the CA's +files. You need them whenever you need to create a new machine certificate. We also saw how +to generate the machine certificates themselfs and distribute them to the individual +machines. Also, you have found some configuration samples for a sever, a client and +a syslog relay. Hopefully, this will enable you to set up a similar system in many +environments. +

          Please be warned that you defined some expiration dates for the certificates. +After they are reached, the certificates are no longer valid and rsyslog will NOT +accept them. At that point, syslog messages will no longer be transmitted (and rsyslogd +will heavily begin to complain). So it is a good idea to make sure that you renew the +certificates before they expire. Recording a reminder somewhere is probably a good +idea. +

          If you have any more questions, please visit the rsyslog forum and simply ask ;) +

          Copyright

          +

          Copyright (c) 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/tls_cert_udp_relay.html rsyslog-5.10.1/doc/tls_cert_udp_relay.html --- rsyslog-7.6.0/doc/tls_cert_udp_relay.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/tls_cert_udp_relay.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,105 @@ + +TLS-protected syslog: UDP relay setup + + + +

          Encrypting Syslog Traffic with TLS (SSL)

          +

          Written by Rainer +Gerhards (2008-07-03)

          + + + +

          Setting up the UDP syslog relay

          +

          In this step, we configure the UDP relay ada.example.net. +As a reminder, that machine relays messages from a local router, which only +supports UDP syslog, to the central syslog server. The router does not talk +directly to it, because we would like to have TLS protection for its sensitve +logs. If the router and the syslog relay are on a sufficiently secure private +network, this setup can be considered reasonable secure. In any case, it is the +best alternative among the possible configuration scenarios. + + + + +

          +

          Steps to do: +

            +
          • make sure you have a functional CA (Setting up the CA) +
          • generate a machine certificate for ada.example.net (follow instructions in + Generating Machine Certificates) +
          • make sure you copy over ca.pem, machine-key.pem ad machine-cert.pem to the client. +Ensure that no user except root can access them (even read permissions are really bad). +
          • configure the client so that it checks the server identity and sends messages only +if the server identity is known. +
          +

          These were essentially the same steps as for any +TLS syslog client. We now need to add the +capability to forward the router logs: +

            +
          • make sure that the firewall rules permit message recpetion on UDP port 514 (if you use +a non-standard port for UDP syslog, make sure that port number is permitted). +
          • you may want to limit who can send syslog messages via UDP. A great place to do this +is inside the firewall, but you can also do it in rsyslog.conf via an $AllowedSender +directive. We have used one in the sample config below. Please be aware that this is +a kind of weak authentication, but definitely better than nothing... +
          • add the UDP input plugin to rsyslog's config and start a UDP listener +
          • make sure that your forwarding-filter permits to forward messages received +from the remote router to the server. In our sample scenario, we do not need to +add anything special, because all messages are forwarded. This includes messages +received from remote hosts. +
          +

          At this point, please be reminded once again that your security needs may be quite different from +what we assume in this tutorial. Evaluate your options based on your security needs. +

          Sample syslog.conf

          +

          Keep in mind that this rsyslog.conf sends messages via TCP, only. Also, we do not +show any rules to write local files. Feel free to add them. +

          +# start a UDP listener for the remote router
          +$ModLoad imudp    # load UDP server plugin
          +$AllowedSender UDP, 192.0.2.1 # permit only the router
          +$UDPServerRun 514 # listen on default syslog UDP port 514
          +
          +# make gtls driver the default
          +$DefaultNetstreamDriver gtls
          +
          +# certificate files
          +$DefaultNetstreamDriverCAFile /rsyslog/protected/ca.pem
          +$DefaultNetstreamDriverCertFile /rsyslog/protected/machine-cert.pem
          +$DefaultNetstreamDriverKeyFile /rsyslog/protected/machine-key.pem
          +
          +$ActionSendStreamDriverAuthMode x509/name
          +$ActionSendStreamDriverPermittedPeer central.example.net
          +$ActionSendStreamDriverMode 1 # run driver in TLS-only mode
          +*.* @@central.example.net:10514 # forward everything to remote server
          +
          +

          Be sure to safeguard at least the private key (machine-key.pem)! +If some third party obtains it, you security is broken! +

          Copyright

          +

          Copyright © 2008 Rainer +Gerhards and +Adiscon.

          +

          Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version +1.2 or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license can be viewed at +http://www.gnu.org/copyleft/fdl.html.

          + diff -Nru rsyslog-7.6.0/doc/troubleshoot.html rsyslog-5.10.1/doc/troubleshoot.html --- rsyslog-7.6.0/doc/troubleshoot.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/troubleshoot.html 2012-09-18 15:03:57.000000000 +0000 @@ -0,0 +1,164 @@ + +troubleshooting rsyslog + +

          troubleshooting rsyslog

          +

          Having trouble with rsyslog? +This page provides some tips on where to look for help and what to do +if you need to ask for assistance. This page is continously being expanded. +

          Useful troubleshooting ressources are: +

            +
          • The rsyslog documentation - note that the online version always covers +the most recent development version. However, there is a version-specific +doc set in each tarball. If you installed rsyslog from a package, there usually +is a rsyslog-doc package, that often needs to be installed separately. +
          • The rsyslog wiki provides user tips and experiences. +
          • Check the bugzilla to see if your problem is a known +(and even fixed ;)) bug. +
          +

          Malformed Messages and Message Properties +

          A common trouble source are ill-formed syslog messages, which +lead to to all sorts of interesting problems, including malformed hostnames and dates. +Read the quoted guide to find relief. A common symptom is that the %HOSTNAME% property is +used for generating dynafile names, but some glibberish shows up. This is caused by the +malformed syslog messages, so be sure to read the +guide if you face that problem. Just let me add that the +common work-around is to use %FROMHOST% or %FROMHOST-IP% instead. These do not take the +hostname from the message, but rather use the host that sent the message (taken from +the socket layer). Of course, this does not work over NAT or relay chains, where the +only cure is to make sure senders emit well-formed messages. +

          Configuration Problems +

          Rsyslog 3.21.1 and above has been enhanced to support extended configuration checking. +It offers a special command line switch (-N1) that puts it into "config verfication mode". +In that mode, it interprets and check the configuration file, but does not startup. This +mode can be used in parallel to a running instance of rsyslogd. +

          To enable it, run rsyslog interactively as follows: +

          /path/to/rsyslogd -f/path/to/config-file -N1 +

          You should also specify other options you usually give (like -c3 and whatever else). +Any problems experienced are reported to stderr [aka "your screen" (if not redirected)]. +

          Configuration Graphs +

          Starting with rsyslog 4.3.1, the +"$GenerateConfigGraph" +command is supported, a very valuable troubleshooting tool. It permits to +generate a graph of how rsyslogd understood its configuration file. It is assumed that +many configuration issues can easily be detected just by looking at the configuration graph. +Full details of how to generate the graphs, and what to look for can be found in the +"$GenerateConfigGraph" +manual page. +

          Asking for Help +

          If you can't find the answer yourself, you should look at these places for +community help. +

            +
          • The rsyslog forum. This is +the preferred method of obtaining support. +
          • The rsyslog mailing list. +This is a low-volume list which occasional gets traffic spikes. +The mailing list is probably a good place for complex questions. +
          +

          Debug Log +

          If you ask for help, there are chances that we need to ask for an rsyslog debug log. +The debug log is a detailled report of what rsyslog does during processing. As such, it may +even be useful for your very own troubleshooting. People have seen things inside their debug +log that enabled them to find problems they did not see before. So having a look at the +debug log, even before asking for help, may be useful. +

          Note that the debug log contains most of those things we consider useful. This is a lot +of information, but may still be too few. So it sometimes may happen that you will be asked +to run a specific version which has additional debug output. Also, we revise from time to +time what is worth putting into the standard debug log. As such, log content may change +from version to version. We do not guarantee any specific debug log contents, so do not +rely on that. The amount of debug logging can also be controlled via some environment +options. Please see debugging support for further details. +

          In general, it is advisable to run rsyslogd in the foreground to obtain the log. +To do so, make sure you know which options are usually used when you start rsyslogd +as a background daemon. Let's assume "-c3" is the only option used. Then, do the following: +

            +
          • make sure rsyslogd as a daemon is stopped (verify with ps -ef|grep rsyslogd) +
          • make sure you have a console session with root permissions +
          • run rsyslogd interactively: /sbin/rsyslogd ..your options.. -dn > logfile +
            where "your options" is what you usually use. /sbin/rsyslogd is the full path +to the rsyslogd binary (location different depending on distro). +In our case, the command would be +
            /sbin/rsyslogd -c3 -dn > logfile +
          • press ctrl-C when you have sufficient data (e.g. a device logged a record) +
            NOTE: rsyslogd will NOT stop automatically - you need to ctrl-c out of it! +
          • Once you have done all that, you can review logfile. It contains the debug output. +
          • When you are done, make sure you re-enable (and start) the background daemon! +
          +

          If you need to submit the logfile, you may want to check if it contains any +passwords or other sensitive data. If it does, you can change it to some consistent +meaningless value. Do not delete the lines, as this renders the debug log +unusable (and makes Rainer quite angry for wasted time, aka significantly reduces the chance +he will remain motivated to look at your problem ;)). For the same reason, make sure +whatever you change is change consistently. Really! +

          Debug log file can get quite large. Before submitting them, it is a good idea to zip them. +Rainer has handled files of around 1 to 2 GB. If your's is larger ask before submitting. Often, +it is sufficient to submit the first 2,000 lines of the log file and around another 1,000 around +the area where you see a problem. Also, +ask you can submit a file via private mail. Private mail is usually a good way to go for large files +or files with sensitive content. However, do NOT send anything sensitive that you do not want +the outside to be known. While Rainer so far made effort no to leak any sensitive information, +there is no guarantee that doesn't happen. If you need a guarantee, you are probably a +candidate for a commercial support contract. Free support +comes without any guarantees, include no guarantee on confidentiality +[aka "we don't want to be sued for work were are not even paid for ;)]. +So if you submit debug logs, do so at your sole risk. By submitting them, you accept +this policy. +

          Segmentation Faults +

          Rsyslog has a very rapid development process, complex capabilities and now gradually gets +more and more exposure. While we are happy about this, it also has some bad effects: some +deployment scenarios have probably never been tested and it may be impossible to test +them for the development team because of resources needed. So while we try to avoid this, +you may see a serious problem during deployments in demanding, non-standard, environments +(hopefully not with a stable version, but chances are good you'll run into troubles with +the development versions). +

          Active support from the user base is very important to help us track down those things. +Most often, serious problems are the result of some memory misadressing. During development, +we routinely use valgrind, a very well and capable memory debugger. This helps us to create +pretty clean code. But valgrind can not detect everything, most importantly not code pathes +that are never executed. So of most use for us is information about aborts and abort locations. +

          Unforutnately, faults rooted in adressing errors typically show up only later, so the +actual abort location is in an unrelated spot. To help track down the original spot, +libc +later than 5.4.23 offers support for finding, and possible temporary relief from it, +by means of the MALLOC_CHECK_ environment variable. Setting it to 2 is a useful troubleshooting +aid for us. It will make the program abort as soon as the check routines detect anything +suspicious (unfortunately, this may still not be the root cause, but hopefully closer to it). +Setting it to 0 may even make some problems disappear (but it will NOT fix them!). +With functionality comes cost, and so exporting MALLOC_CHECK_ without need comes at +a performance penalty. However, we strongly recommend adding this instrumentation to your +test environment should you see any serious problems. Chances are good it will help us +interpret a dump better, and thus be able to quicker craft a fix. +

          In order to get useful information, we need some backtrace of the abort. First, you need +to make sure that a core file is created. Under Fedora, for example, that means you need +to have an "ulimit -c unlimited" in place. +

          Now let's assume you got a core file (e.g. in /core.1234). So what to do next? Sending a +core file to us is most often pointless - we need to have the exact same system configuration in +order to interpret it correctly. Obviously, chances are extremely slim for this to be. So we would +appreciate if you could extract the most important information. This is done as follows: +

            +
          • $gdb /path/to/rsyslogd +
          • $info thread +
          • you'll see a number of threads (in the range 0 to n with n being the highest number). For + each of them, do the following (let's assume that i is the thread number): +
              +
            • $ thread i (e.g. thread 0, thread 1, ...) +
            • $bt +
            +
          • then you can quit gdb with "$q" +
          +

          Then please send all information that gdb spit out to the development team. It is best to first +ask on the forum or mailing list on how to do that. The developers will keep in contact with you +and, I fear, will probably ask for other things as well ;) +

          Note that we strive for highest reliability of the engine even in unusual deployment scenarios. +Unfortunately, this is hard to achieve, especially with limited resources. So we are depending on +cooperation from users. This is your chance to make a big contribution to the project without the +need to program or do anything else except get a problem solved ;) +

          [manual index] +[rsyslog site]

          +

          This documentation is part of the +rsyslog project.
          +Copyright © 2008-2010 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

          + + + diff -Nru rsyslog-7.6.0/doc/v3compatibility.html rsyslog-5.10.1/doc/v3compatibility.html --- rsyslog-7.6.0/doc/v3compatibility.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/v3compatibility.html 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,196 @@ + +Compatibility notes for rsyslog v3 + + + +

          Compatibility Notes for rsyslog v3

          +

          Written by Rainer Gerhards +(2008-03-28)

          +

          Rsyslog aims to be a drop-in replacement for sysklogd. +However, version 3 has some considerable enhancements, which lead to +some backward compatibility issues both in regard to sysklogd and +rsyslog v1 and v2. Most of these issues are avoided by default by not +specifying the -c option on the rsyslog command line. That will enable +backwards-compatibility mode. However, please note that things may be +suboptimal in backward compatibility mode, so the advise is to work +through this document, update your rsyslog.conf, remove the no longer +supported startup options and then add -c3 as the first option to the +rsyslog command line. That will enable native mode.

          +

          Please note that rsyslogd helps you during that process by +logging appropriate messages about compatibility mode and +backwards-compatibility statemtents automatically generated. You may +want your syslogd log for those. They immediately follow rsyslogd's +startup message.

          +

          Inputs

          +

          With v2 and below, inputs were automatically started together +with rsyslog. In v3, inputs are optional! They come in the form of +plug-in modules. +At least one input module +must be loaded to make rsyslog do any useful work. +The config file directives doc briefly lists which config statements +are available by which modules.

          +

          It is suggested that input modules be loaded in the top part +of the config file. Here is an example, also highlighting the most +important modules:

          +

          $ModLoad immark # provides --MARK-- +message capability
          +$ModLoad imudp # provides UDP syslog reception
          +$ModLoad imtcp # provides TCP syslog reception
          +
          $ModLoad imgssapi # provides GSSAPI syslog +reception
          +
          $ModLoad imuxsock # provides support for local +system logging (e.g. +via logger command)
          +$ModLoad imklog # provides kernel logging support (previously done +by rklogd)

          +

          Command Line Options

          +

          A number of command line options have been removed. New config +file directives have been added for them. The -h and -e option have +been removed even in compatibility mode. They are ignored but an +informative message is logged. Please note that -h was never supported +in v2, but was silently ignored. It disappeared some time ago in the +final v1 builds. It can be replaced by applying proper filtering inside +syslog.conf.

          +

          -c option / Compatibility Mode

          +

          The -c option is new and tells rsyslogd about the desired +backward compatibility mode. It must always be the first option on the +command line, as it influences processing of the other options. To use +the rsyslog v3 native +interface, specify -c3. To use compatibility mode , +either do not use -c at all or use -c<vers> where vers is +the +rsyslog version that it shall be compatible to. Use -c0 to be +command-line compatible to sysklogd.

          Please note that rsyslogd issues warning messages if the -c3 command line option is not given. +This is to alert you that your are running in compatibility mode. +Compatibility mode interfers with you rsyslog.conf commands and may +cause some undesired side-effects. It is meant to be used with a plain +old rsyslog.conf - if you use new features, things become messy. So the +best advise is to work through this document, convert your options and +config file and then use rsyslog in native mode. In order to aid you in +this process, rsyslog logs every compatibility-mode config file +directive it has generated. So you can simply copy them from your +logfile and paste them to the config.

          +

          -e Option

          +This option is no longer supported, as the "last message repeated n +times" feature is now turned off by default. We changed this default +because this feature is causing a lot of trouble and we need to make it +either go away or change the way it works. For more information, please +see our dedicted forum +thread on "last message repeated n times". This thread also +contains information on how to configure rsyslogd so that it continues +to support this feature (as long as it is not totally removed). +

          -m Option

          +

          The -m command line option is emulated in compatibiltiy mode. +To replace it, use the following config directives (compatibility mode +auto-generates them):

          +

          $ModLoad immark
          +$MarkMessageInterval 1800 # 30 minutes

          +

          -r Option

          +

          Is no longer available in native mode. However, it +is +understood in compatibility mode (if no -c option is given). Use the $UDPSeverRun +<port> config file directives. You can now also +set the local address the server should listen to via $UDPServerAddress +<ip> config directive.

          +

          The following example configures an UDP syslog server at the +local address 192.0.2.1 on port 514:

          +

          $ModLoad imudp
          +$UDPServerAddress 192.0.2.1 # this MUST be before the $UDPServerRun +directive!
          +$UDPServerRun 514

          +

          "$UDPServerAddress *" means listen on all local interfaces. +This is the default if no directive is specified.

          +

          Please note that now multiple listeners are supported. For +example, you can do the following:

          +

          $ModLoad imudp
          +$UDPServerAddress 192.0.2.1 # this MUST be before the $UDPServerRun +directive!
          +$UDPServerRun 514
          +$UDPServerAddress * # all local interfaces
          +$UDPServerRun 1514

          +

          These config file settings run two listeners: one +at 192.0.2.1:514 and one on port 1514, which listens on all local +interfaces.

          +

          Default port for UDP (and TCP) Servers

          +

          Please note that with pre-v3 rsyslogd, a service database +lookup was made when a UDP server was started and no port was +configured. Only if that failed, the IANA default of 514 was used. For +TCP servers, this lookup was never done and 514 always used if no +specific port was configured. For consitency, both TCP and UDP now use +port 514 as default. If a lookup is desired, you need to specify it in +the "Run" directive, e.g. "$UDPServerRun syslog".

          +

          klogd

          +

          klogd has (finally) been replaced by a loadable input module. +To enable klogd functionality, do

          +

          $ModLoad imklog

          +

          Note that this can not be handled by the compatibility layer, +as klogd was a separate binary.A limited set of klogd command line +settings is now supported +via rsyslog.conf. That set of configuration directives is to be +expanded. 

          +

          Output File Syncing

          +Rsyslogd tries to keep as compatible to +stock syslogd as possible. As such, it retained stock syslogd's default +of syncing every file write if not specified otherwise (by placing a +dash in front of the output file name). While this was a useful feature +in past days where hardware was much less reliable and UPS seldom, this +no longer is useful in today's worl. Instead, the syncing is a high +performace hit. With it, rsyslogd writes files around 50 *times* slower +than without it. It also affects overall system performance due to the +high IO activity. In rsyslog v3, syncing has been turned off by +default. This is done via a specific configuration directive +"$ActionFileEnableSync on/off" which is off by default. So even if +rsyslogd finds sync selector lines, it ignores them by default. In +order to enable file syncing, the administrator must specify +"$ActionFileEnableSync on" at the top of rsyslog.conf. This ensures +that syncing only happens in some installations where the administrator +actually wanted that (performance-intense) feature. In the fast +majority of cases (if not all), this dramatically increases rsyslogd +performance without any negative effects. +

          Output File Format

          +

          Rsyslog supports high precision RFC 3339 timestamps and puts these into +local log files by default. This is a departure from previous syslogd +behaviour. We decided to sacrify some backward-compatibility in an +effort to provide a better logging solution. Rsyslog has been +supporting the high-precision timestamps for over three years as of +this writing, but nobody used them because they were not default (one +may also assume that most people didn't even know about them). Now, we +are writing the great high-precision time stamps, which greatly aid in +getting the right sequence of logging events. If you do not like that, +you can easily turn them off by placing +

          $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat +

          right at the start of your rsyslog.conf. This will use the +previous format. Please note that the name is case-sensitive and must +be specificed exactly as shown above. Please also note that you can of +course use any other format of your liking. To do so, simply specify +the template to use or set a new default template via the +$ActionFileDefaultTemplate directive. Keep in mind, though, that +templates must be defined before they are used.

          Keep in mind that +when receiving messages from remote hosts, the timestamp is just as +precise as the remote host provided it. In most cases, this means you +will only a receive a standard timestamp with second precision. If +rsyslog is running at the remote end, you can configure it to provide +high-precision timestamps (see below).

          Forwarding Format

          When +forwarding messages to remote syslog servers, rsyslogd by default uses +the plain old syslog format with second-level resolution inside the +timestamps. We could have made it emit high precision timestamps. +However, that would have broken almost all receivers, including earlier +versions of rsyslog. To avoid this hassle, high-precision timestamps +need to be explicitely enabled. To make this as painless as possible, +rsyslog comes with a canned template that contains everything +necessary.  To enable high-precision timestamps, just use:

          $ActionForwardDefaultTemplate RSYSLOG_ForwardFormat # for plain TCP and UDP

          $ActionGSSForwardDefaultTemplate RSYSLOG_ForwardFormat # for GSS-API

          And, of course, you can always set different forwarding formats by just specifying the right template.

          If +you are running in a system with only rsyslog 3.12.5 and above in the +receiver roles, it is suggested to add one (or both) of the above +statements to the top of your rsyslog.conf (but after the $ModLoad's!) +- that will enable you to use the best in timestamp support availble. +Please note that when you use this format with other receivers, they +will probably become pretty confused and not detect the timestamp at +all. In earlier rsyslog versions, for example, that leads to +duplication of timestamp and hostname fields and disables the detection +of the orignal hostname in a relayed/NATed environment. So use the new +format with care.

          Queue Modes for the Main Message Queue

          +

          Either "FixedArray" or "LinkedList" is recommended. "Direct" +is available, but should not be used except for a very good reason +("Direct" disables queueing and will potentially lead to message loss +on the input side).

          + diff -Nru rsyslog-7.6.0/doc/v4compatibility.html rsyslog-5.10.1/doc/v4compatibility.html --- rsyslog-7.6.0/doc/v4compatibility.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/v4compatibility.html 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,96 @@ + +Compatibility notes for rsyslog v4 + + +

          Compatibility Notes for rsyslog v4

          +

          Written by Rainer Gerhards +(2009-07-15)

          +

          The changes introduced in rsyslog v4 are numerous, but not very intrusive. +This document describes things to keep in mind when moving from v3 to v4. It +does not list enhancements nor does it talk about compatibility concerns introduced +by v3 (for this, see the rsyslog v3 compatibility notes). +

          HUP processing

          +

          With v3 and below, rsyslog used the traditional HUP behaviour. That meant that +all output files are closed and the configuration file is re-read and the new configuration +applied. +

          With a program as simple and static as sysklogd, this was not much of an issue. The +most important config settings (like udp reception) of a traditional syslogd can not be +modified via the configuration file. So a config file reload only meant setting up a new set of filters. It also didn't account as problem that while doing so messages may be lost - without +any threading and queuing model, a traditional syslogd will potentially always loose +messages, so it is irrelevant if this happens, too, during the short config re-read +phase. +

          In rsyslog, things are quite different: the program is more or less a framework into +which loadable modules are loaded as needed for a particular configuration. The software +that will acutally be running is taylored via the config file. Thus, a re-read of +the config file requires a full, very heavy restart, because the software acutally +running with the new config can be totally different from what ran with the old config. +

          Consequently, the traditional HUP is a very heavy operation and may even cause some +data loss because queues must be shut down, listeners stopped and so on. Some of these +operations (depending on their configuration) involve intentional message loss. The operation +also takes up a lot of system resources and needs quite some time (maybe seconds) to be +completed. During this restart period, the syslog subsytem is not fully available. +

          From the software developer's point of view, the full restart done by a HUP is rather complex, +especially if user-timeout limits set on action completion are taken into consideration (for +those in the know: at the extreme ends this means we need to cancel threads as a last resort, +but than we need to make sure that such cancellation does not happen at points where it +would be fatal for a restart). A regular restart, where the process is actually terminated, is +much less complex, because the operating system does a full cleanup after process termination, +so rsyslogd does not need to take care for exotic cleanup cases and leave that to the OS. +In the end result, restart-type HUPs clutter the code, increase complexity (read: add bugs) +and cost performance. +

          On the contrary, a HUP is typically needed for log rotation, and the real desire is +to close files. This is a non-disruptive and very lightweigth operation. +

          Many people have said that they are used to HUP the syslogd to apply configuration +changes. This is true, but it is questionable if that really justifies all the cost that +comes with it. After all, it is the difference between typing +

          +$ kill -HUP `cat /var/run/rsyslogd.pid`
          +
          +versus +
          +$ /etc/init.d/rsyslog restart
          +
          +Semantically, both is mostly the same thing. The only difference is that with the restart +command rsyslogd can spit config error message to stderr, so that the user is able to see +any problems and fix them. With a HUP, we do not have access to stderr and thus can log +error messages only to their configured destinations; exprience tells that most users +will never find them there. What, by the way, is another strong argument against +restarting rsyslogd by HUPing it. +

          So a restart via HUP is not strictly necessary +and most other deamons require that a restart command is typed in if a restart is required. +

          Rsyslog will follow this paradigm in the next versions, resulting in many benefits. In v4, +we provide some support for the old-style semantics. We introduced a setting $HUPisRestart +which may be set to "on" (tradional, heavy operationg) +or "off" (new, lightweight "file close only" operation). +The initial versions had the default set to traditional behavior, but starting with 4.5.1 +we are now using the new behavior as the default. +

          Most importantly, this may break some scripts, but my sincere belief is that +there are very few scripts that automatically change rsyslog's config and then do a +HUP to reload it. Anyhow, if you have some of these, it may be a good idea to change +them now instead of turning restart-type HUPs on. Other than that, one mainly needs +to change the habit of how to restart rsyslog after a configuration change. +

          Please note that restart-type HUP is depricated and will go away in rsyslog v5. +So it is a good idea to become ready for the new version now and also enjoy some of the +benefits of the "real restart", like the better error-reporting capability. +

          Note that code complexity reduction (and thus performance improvement) needs the restart-type +HUP code to be removed, so these changes can (and will) only happen in version 5. +

          outchannels

          +Note: as always documented, outchannels are an experimental feature that may be +removed and/or changed in the future. +There is one concrete change done starting with 4.6.7: let's assume an +outchannel "mychannel" was defined. Then, this channel could be used inside an + +*.* $mychannel + +This is still supported and will remain to be supported in v4. However, there is +a new variant which explicitely tells this is to be handled by omfile. This new +syntax is as follows: + +*.* :omfile:$mychannel + +Note that future versions, specifically starting with v6, the older syntax is no +longer supported. So users are strongly advised to switch to the new syntax. As an +aid to the conversion process, rsyslog 4.7.4 and above issue a warning message +if the old-style directive is seen -- but still accept the old syntax without +any problems. + diff -Nru rsyslog-7.6.0/doc/v5compatibility.html rsyslog-5.10.1/doc/v5compatibility.html --- rsyslog-7.6.0/doc/v5compatibility.html 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/doc/v5compatibility.html 2012-10-15 13:45:04.000000000 +0000 @@ -0,0 +1,36 @@ + +Compatibility notes for rsyslog v5 + + +

          Compatibility Notes for rsyslog v5

          +

          Written by Rainer Gerhards +(2009-07-15)

          +

          The changes introduced in rsyslog v5 are numerous, but not very intrusive. +This document describes things to keep in mind when moving from v4 to v5. It +does not list enhancements nor does it talk about compatibility concerns introduced +by earlier versions (for this, see their respective compatibility documents). +

          HUP processing

          +

          The $HUPisRestart directive is supported by some early v5 versions, but has been removed +in 5.1.3 and above. That means that restart-type HUP processing is no longer +available. This processing was redundant and had a lot a drawbacks. +For details, please see the +rsyslog v4 compatibility notes which elaborate +on the reasons and the (few) things you may need to change. +

          Please note that starting with 5.8.11 HUP will also requery the local hostname. +

          Queue on-disk format

          +

          The queue information file format has been changed. When upgrading from v4 to +v5, make sure that the queue is emptied and no on-disk structure present. We did +not go great length in understanding the old format, as there was too little demand +for that (and it being quite some effort if done right). +

          Queue Worker Thread Shutdown

          +

          Previous rsyslog versions had the capability to "run" on zero queue worker +if no work was required. This was done to save a very limited number of resources. However, +it came at the price of great complexity. In v5, we have decided to let a minium of one +worker run all the time. The additional resource consumption is probably not noticable at +all, however, this enabled us to do some important code cleanups, resulting in faster +and more reliable code (complex code is hard to maintain and error-prone). From the +regular user's point of view, this change should be barely noticable. I am including the +note for expert users, who will notice it in rsyslog debug output and other analysis tools. +So it is no error if each queue in non-direct mode now always runs at least one worker +thread. + diff -Nru rsyslog-7.6.0/freebsd/rsyslogd rsyslog-5.10.1/freebsd/rsyslogd --- rsyslog-7.6.0/freebsd/rsyslogd 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/freebsd/rsyslogd 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,83 @@ +#!/bin/sh +# Sample startup script for rsyslogd on FreeBSD. +# It worked on my machine, but this does not necessarily +# mean it works on all machines - it's not thouroughly +# tested. Please note that it may also work on other +# BSD variants, too. +# +# As of this writing, there was an issue with the mysql client +# library on startup. If compiled with MySQL support, rsyslogd +# would not necessarily start correctly but could eventually +# die with a "mysql client libary not found" (or similar) +# message. I do not know its cause neither the cure. If you +# have one, let me know. +# +# ATTENTION: you need also to change the /etc/rc.config file +# and disable stock syslogd and then enable rsyslogd! +# +# rgerhards 2005-08-09 +# + +# PROVIDE: rsyslogd +# REQUIRE: mountcritremote cleanvar +# BEFORE: SERVERS + +. /etc/rc.subr + +name="rsyslogd" +rcvar=`set_rcvar` +pidfile="/var/run/rsyslogd.pid" +command="/usr/sbin/${name}" +required_files="/etc/rsyslog.conf" +start_precmd="rsyslogd_precmd" +extra_commands="reload" + +_sockfile="/var/run/rsyslogd.sockets" +evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" +altlog_proglist="named" + +rsyslogd_precmd() +{ + # Transitional symlink for old binaries + # + if [ ! -L /dev/log ]; then + ln -sf /var/run/log /dev/log + fi + rm -f /var/run/log + + # Create default list of syslog sockets to watch + # + ( umask 022 ; > $_sockfile ) + + # If running named(8) or ntpd(8) chrooted, added appropriate + # syslog socket to list of sockets to watch. + # + for _l in $altlog_proglist; do + eval _ldir=\$${_l}_chrootdir + if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then + echo "${_ldir}/var/run/log" >> $_sockfile + fi + done + + # If other sockets have been provided, change run_rc_command()'s + # internal copy of $rsyslogd_flags to force use of specific + # rsyslogd sockets. + # + if [ -s $_sockfile ]; then + echo "/var/run/log" >> $_sockfile + eval $evalargs + fi + + return 0 +} + +set_socketlist() +{ + _socketargs= + for _s in `cat $_sockfile | tr '\n' ' '` ; do + _socketargs="-l $_s $_socketargs" + done + echo $_socketargs +} +load_rc_config $name +run_rc_command "$1" diff -Nru rsyslog-7.6.0/grammar/grammar.c rsyslog-5.10.1/grammar/grammar.c --- rsyslog-7.6.0/grammar/grammar.c 2014-02-12 12:07:14.000000000 +0000 +++ rsyslog-5.10.1/grammar/grammar.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2347 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.5. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 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 - 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 . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.5" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 31 "grammar.y" - -#include -#include -#include "rainerscript.h" -#include "parserif.h" -#define YYDEBUG 1 -extern int yylineno; - -/* keep compile rule clean of errors */ -extern int yylex(void); -extern int yyerror(char*); - - -/* Line 268 of yacc.c */ -#line 85 "grammar.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - FUNC = 259, - BEGINOBJ = 260, - ENDOBJ = 261, - BEGIN_ACTION = 262, - BEGIN_PROPERTY = 263, - BEGIN_CONSTANT = 264, - BEGIN_TPL = 265, - BEGIN_RULESET = 266, - STOP = 267, - SET = 268, - UNSET = 269, - CONTINUE = 270, - CALL = 271, - LEGACY_ACTION = 272, - LEGACY_RULESET = 273, - PRIFILT = 274, - PROPFILT = 275, - BSD_TAG_SELECTOR = 276, - BSD_HOST_SELECTOR = 277, - IF = 278, - THEN = 279, - ELSE = 280, - OR = 281, - AND = 282, - NOT = 283, - VAR = 284, - STRING = 285, - NUMBER = 286, - CMP_EQ = 287, - CMP_NE = 288, - CMP_LE = 289, - CMP_GE = 290, - CMP_LT = 291, - CMP_GT = 292, - CMP_CONTAINS = 293, - CMP_CONTAINSI = 294, - CMP_STARTSWITH = 295, - CMP_STARTSWITHI = 296, - UMINUS = 297 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define FUNC 259 -#define BEGINOBJ 260 -#define ENDOBJ 261 -#define BEGIN_ACTION 262 -#define BEGIN_PROPERTY 263 -#define BEGIN_CONSTANT 264 -#define BEGIN_TPL 265 -#define BEGIN_RULESET 266 -#define STOP 267 -#define SET 268 -#define UNSET 269 -#define CONTINUE 270 -#define CALL 271 -#define LEGACY_ACTION 272 -#define LEGACY_RULESET 273 -#define PRIFILT 274 -#define PROPFILT 275 -#define BSD_TAG_SELECTOR 276 -#define BSD_HOST_SELECTOR 277 -#define IF 278 -#define THEN 279 -#define ELSE 280 -#define OR 281 -#define AND 282 -#define NOT 283 -#define VAR 284 -#define STRING 285 -#define NUMBER 286 -#define CMP_EQ 287 -#define CMP_NE 288 -#define CMP_LE 289 -#define CMP_GE 290 -#define CMP_LT 291 -#define CMP_GT 292 -#define CMP_CONTAINS 293 -#define CMP_CONTAINSI 294 -#define CMP_STARTSWITH 295 -#define CMP_STARTSWITHI 296 -#define UMINUS 297 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - -/* Line 293 of yacc.c */ -#line 44 "grammar.y" - - char *s; - long long n; - es_str_t *estr; - enum cnfobjType objType; - struct cnfobj *obj; - struct cnfstmt *stmt; - struct nvlst *nvlst; - struct objlst *objlst; - struct cnfexpr *expr; - struct cnfarray *arr; - struct cnffunc *func; - struct cnffparamlst *fparams; - - - -/* Line 293 of yacc.c */ -#line 222 "grammar.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -/* Copy the second part of user declarations. */ - - -/* Line 343 of yacc.c */ -#line 234 "grammar.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 305 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 58 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 18 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 71 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 134 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 297 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 47, 44, 2, - 53, 54, 45, 42, 55, 43, 2, 46, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, - 2, 51, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 56, 2, 57, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 49, 2, 50, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 48 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 13, 16, 19, 23, - 27, 34, 41, 42, 45, 48, 52, 56, 57, 60, - 64, 66, 68, 70, 73, 75, 80, 87, 93, 97, - 100, 103, 105, 109, 111, 115, 119, 121, 123, 126, - 128, 132, 136, 139, 143, 147, 151, 155, 159, 163, - 167, 171, 175, 179, 183, 187, 191, 195, 199, 203, - 207, 210, 214, 219, 221, 223, 225, 227, 229, 233, - 237, 239 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 59, 0, -1, -1, 59, 60, -1, 59, 68, -1, - 59, 18, -1, 59, 21, -1, 59, 22, -1, 5, - 64, 6, -1, 10, 64, 6, -1, 10, 64, 6, - 49, 61, 50, -1, 11, 64, 6, 49, 67, 50, - -1, -1, 61, 62, -1, 61, 63, -1, 8, 64, - 6, -1, 9, 64, 6, -1, -1, 64, 65, -1, - 3, 51, 66, -1, 30, -1, 74, -1, 68, -1, - 67, 68, -1, 70, -1, 23, 72, 24, 69, -1, - 23, 72, 24, 69, 25, 69, -1, 13, 29, 51, - 72, 52, -1, 14, 29, 52, -1, 19, 69, -1, - 20, 69, -1, 68, -1, 49, 67, 50, -1, 71, - -1, 70, 44, 71, -1, 7, 64, 6, -1, 17, - -1, 12, -1, 16, 3, -1, 15, -1, 72, 27, - 72, -1, 72, 26, 72, -1, 28, 72, -1, 72, - 32, 72, -1, 72, 33, 72, -1, 72, 34, 72, - -1, 72, 35, 72, -1, 72, 36, 72, -1, 72, - 37, 72, -1, 72, 38, 72, -1, 72, 39, 72, - -1, 72, 40, 72, -1, 72, 41, 72, -1, 72, - 44, 72, -1, 72, 42, 72, -1, 72, 43, 72, - -1, 72, 45, 72, -1, 72, 46, 72, -1, 72, - 47, 72, -1, 53, 72, 54, -1, 43, 72, -1, - 4, 53, 54, -1, 4, 53, 73, 54, -1, 31, - -1, 30, -1, 29, -1, 74, -1, 72, -1, 72, - 55, 73, -1, 56, 75, 57, -1, 30, -1, 75, - 55, 30, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 122, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 134, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 155, 159, 160, 161, - 162, 163, 164, 165, 166, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NAME", "FUNC", "BEGINOBJ", "ENDOBJ", - "BEGIN_ACTION", "BEGIN_PROPERTY", "BEGIN_CONSTANT", "BEGIN_TPL", - "BEGIN_RULESET", "STOP", "SET", "UNSET", "CONTINUE", "CALL", - "LEGACY_ACTION", "LEGACY_RULESET", "PRIFILT", "PROPFILT", - "BSD_TAG_SELECTOR", "BSD_HOST_SELECTOR", "IF", "THEN", "ELSE", "OR", - "AND", "NOT", "VAR", "STRING", "NUMBER", "CMP_EQ", "CMP_NE", "CMP_LE", - "CMP_GE", "CMP_LT", "CMP_GT", "CMP_CONTAINS", "CMP_CONTAINSI", - "CMP_STARTSWITH", "CMP_STARTSWITHI", "'+'", "'-'", "'&'", "'*'", "'/'", - "'%'", "UMINUS", "'{'", "'}'", "'='", "';'", "'('", "')'", "','", "'['", - "']'", "$accept", "conf", "obj", "propconst", "property", "constant", - "nvlst", "nv", "value", "script", "stmt", "block", "actlst", "s_act", - "expr", "fparams", "array", "arrayelt", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 43, 45, 38, 42, 47, 37, 297, 123, - 125, 61, 59, 40, 41, 44, 91, 93 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 58, 59, 59, 59, 59, 59, 59, 60, 60, - 60, 60, 61, 61, 61, 62, 63, 64, 64, 65, - 66, 66, 67, 67, 68, 68, 68, 68, 68, 68, - 68, 69, 69, 70, 70, 71, 71, 71, 71, 71, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 73, 73, 74, - 75, 75 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 3, 3, - 6, 6, 0, 2, 2, 3, 3, 0, 2, 3, - 1, 1, 1, 2, 1, 4, 6, 5, 3, 2, - 2, 1, 3, 1, 3, 3, 1, 1, 2, 1, - 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 3, 4, 1, 1, 1, 1, 1, 3, 3, - 1, 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 1, 17, 17, 17, 17, 37, 0, 0, - 39, 0, 36, 5, 0, 0, 6, 7, 0, 3, - 4, 24, 33, 0, 0, 0, 0, 0, 0, 38, - 0, 31, 29, 30, 0, 0, 65, 64, 63, 0, - 0, 0, 0, 66, 0, 0, 8, 18, 35, 9, - 0, 0, 28, 0, 22, 0, 42, 60, 0, 70, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 34, 0, 12, 0, 0, 32, 23, 61, 67, 0, - 59, 0, 69, 25, 41, 40, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 54, 55, 53, 56, - 57, 58, 20, 19, 21, 0, 0, 27, 0, 62, - 71, 0, 17, 17, 10, 13, 14, 11, 68, 26, - 0, 0, 15, 16 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 19, 115, 125, 126, 23, 47, 113, 53, - 31, 32, 21, 22, 88, 89, 43, 60 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -50 -static const yytype_int16 yypact[] = -{ - -50, 266, -50, -50, -50, -50, -50, -50, -11, -10, - -50, 22, -50, -50, 129, 129, -50, -50, 51, -50, - -50, 3, -50, 8, 10, 20, 21, 7, -2, -50, - 143, -50, -50, -50, -13, 51, -50, -50, -50, 51, - 51, 11, 218, -50, 5, 26, -50, -50, -50, 29, - 35, 51, -50, 76, -50, 0, -50, -50, 171, -50, - -49, 129, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - -50, -23, -50, 143, 194, -50, -50, -50, 147, 31, - -50, 56, -50, 27, 258, 258, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, -1, -1, -1, -50, - -50, -50, -50, -50, -50, 1, 115, -50, 51, -50, - -50, 129, -50, -50, -50, -50, -50, -50, -50, -50, - 32, 36, -50, -50 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -50, -50, -50, -50, -50, -50, -4, -50, -50, 14, - 4, -12, -50, 54, -3, -18, 24, -50 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 24, 25, 26, 33, 34, 20, 91, 112, 92, 122, - 123, 45, 4, 45, 46, 42, 48, 7, 27, 28, - 10, 11, 12, 45, 45, 29, 49, 50, 35, 36, - 37, 38, 56, 41, 54, 45, 57, 58, 132, 45, - 55, 59, 133, 39, 77, 78, 79, 44, 84, 93, - 52, 124, 121, 40, 87, 34, 41, 86, 51, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 81, 82, 35, - 36, 37, 38, 4, 83, 119, 120, 54, 7, 8, - 9, 10, 11, 12, 39, 14, 15, 116, 80, 18, - 128, 0, 0, 0, 40, 114, 0, 41, 0, 129, - 74, 75, 76, 77, 78, 79, 0, 0, 130, 131, - 86, 0, 4, 0, 0, 0, 85, 7, 8, 9, - 10, 11, 12, 0, 14, 15, 4, 0, 18, 0, - 0, 7, 8, 9, 10, 11, 12, 0, 14, 15, - 4, 0, 18, 0, 0, 7, 8, 9, 10, 11, - 12, 0, 14, 15, 0, 127, 18, 0, 0, 0, - 0, 0, 0, 62, 63, 0, 0, 0, 30, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 0, 0, 62, 63, 0, - 0, 0, 118, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 0, - 62, 63, 0, 0, 0, 90, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 61, 0, 62, 63, 117, 0, 0, 0, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 2, 0, 0, 0, - 0, 3, 0, 4, 0, 0, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79 -}; - -#define yypact_value_is_default(yystate) \ - ((yystate) == (-50)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - -static const yytype_int8 yycheck[] = -{ - 4, 5, 6, 15, 4, 1, 55, 30, 57, 8, - 9, 3, 7, 3, 6, 18, 6, 12, 29, 29, - 15, 16, 17, 3, 3, 3, 6, 6, 28, 29, - 30, 31, 35, 56, 30, 3, 39, 40, 6, 3, - 53, 30, 6, 43, 45, 46, 47, 44, 51, 61, - 52, 50, 25, 53, 54, 4, 56, 53, 51, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 51, 49, 28, - 29, 30, 31, 7, 49, 54, 30, 83, 12, 13, - 14, 15, 16, 17, 43, 19, 20, 83, 44, 23, - 118, -1, -1, -1, 53, 81, -1, 56, -1, 121, - 42, 43, 44, 45, 46, 47, -1, -1, 122, 123, - 116, -1, 7, -1, -1, -1, 50, 12, 13, 14, - 15, 16, 17, -1, 19, 20, 7, -1, 23, -1, - -1, 12, 13, 14, 15, 16, 17, -1, 19, 20, - 7, -1, 23, -1, -1, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 50, 23, -1, -1, -1, - -1, -1, -1, 26, 27, -1, -1, -1, 49, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, -1, -1, 26, 27, -1, - -1, -1, 55, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, - 26, 27, -1, -1, -1, 54, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 24, -1, 26, 27, 52, -1, -1, -1, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 0, -1, -1, -1, - -1, 5, -1, 7, -1, -1, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 59, 0, 5, 7, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 60, - 68, 70, 71, 64, 64, 64, 64, 29, 29, 3, - 49, 68, 69, 69, 4, 28, 29, 30, 31, 43, - 53, 56, 72, 74, 44, 3, 6, 65, 6, 6, - 6, 51, 52, 67, 68, 53, 72, 72, 72, 30, - 75, 24, 26, 27, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 71, 51, 49, 49, 72, 50, 68, 54, 72, 73, - 54, 55, 57, 69, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 30, 66, 74, 61, 67, 52, 55, 54, - 30, 25, 8, 9, 50, 62, 63, 50, 73, 69, - 64, 64, 6, 6 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* This macro is provided for backward compatibility. */ - -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: - -/* Line 1806 of yacc.c */ -#line 123 "grammar.y" - { cnfDoObj((yyvsp[(2) - (2)].obj)); } - break; - - case 4: - -/* Line 1806 of yacc.c */ -#line 124 "grammar.y" - { cnfDoScript((yyvsp[(2) - (2)].stmt)); } - break; - - case 5: - -/* Line 1806 of yacc.c */ -#line 125 "grammar.y" - { cnfDoCfsysline((yyvsp[(2) - (2)].s)); } - break; - - case 6: - -/* Line 1806 of yacc.c */ -#line 126 "grammar.y" - { cnfDoBSDTag((yyvsp[(2) - (2)].s)); } - break; - - case 7: - -/* Line 1806 of yacc.c */ -#line 127 "grammar.y" - { cnfDoBSDHost((yyvsp[(2) - (2)].s)); } - break; - - case 8: - -/* Line 1806 of yacc.c */ -#line 128 "grammar.y" - { (yyval.obj) = cnfobjNew((yyvsp[(1) - (3)].objType), (yyvsp[(2) - (3)].nvlst)); } - break; - - case 9: - -/* Line 1806 of yacc.c */ -#line 129 "grammar.y" - { (yyval.obj) = cnfobjNew(CNFOBJ_TPL, (yyvsp[(2) - (3)].nvlst)); } - break; - - case 10: - -/* Line 1806 of yacc.c */ -#line 131 "grammar.y" - { (yyval.obj) = cnfobjNew(CNFOBJ_TPL, (yyvsp[(2) - (6)].nvlst)); - (yyval.obj)->subobjs = (yyvsp[(5) - (6)].objlst); - } - break; - - case 11: - -/* Line 1806 of yacc.c */ -#line 135 "grammar.y" - { (yyval.obj) = cnfobjNew(CNFOBJ_RULESET, (yyvsp[(2) - (6)].nvlst)); - (yyval.obj)->script = (yyvsp[(5) - (6)].stmt); - } - break; - - case 12: - -/* Line 1806 of yacc.c */ -#line 138 "grammar.y" - { (yyval.objlst) = NULL; } - break; - - case 13: - -/* Line 1806 of yacc.c */ -#line 139 "grammar.y" - { (yyval.objlst) = objlstAdd((yyvsp[(1) - (2)].objlst), (yyvsp[(2) - (2)].obj)); } - break; - - case 14: - -/* Line 1806 of yacc.c */ -#line 140 "grammar.y" - { (yyval.objlst) = objlstAdd((yyvsp[(1) - (2)].objlst), (yyvsp[(2) - (2)].obj)); } - break; - - case 15: - -/* Line 1806 of yacc.c */ -#line 141 "grammar.y" - { (yyval.obj) = cnfobjNew(CNFOBJ_PROPERTY, (yyvsp[(2) - (3)].nvlst)); } - break; - - case 16: - -/* Line 1806 of yacc.c */ -#line 142 "grammar.y" - { (yyval.obj) = cnfobjNew(CNFOBJ_CONSTANT, (yyvsp[(2) - (3)].nvlst)); } - break; - - case 17: - -/* Line 1806 of yacc.c */ -#line 143 "grammar.y" - { (yyval.nvlst) = NULL; } - break; - - case 18: - -/* Line 1806 of yacc.c */ -#line 144 "grammar.y" - { (yyvsp[(2) - (2)].nvlst)->next = (yyvsp[(1) - (2)].nvlst); (yyval.nvlst) = (yyvsp[(2) - (2)].nvlst); } - break; - - case 19: - -/* Line 1806 of yacc.c */ -#line 145 "grammar.y" - { (yyval.nvlst) = nvlstSetName((yyvsp[(3) - (3)].nvlst), (yyvsp[(1) - (3)].estr)); } - break; - - case 20: - -/* Line 1806 of yacc.c */ -#line 146 "grammar.y" - { (yyval.nvlst) = nvlstNewStr((yyvsp[(1) - (1)].estr)); } - break; - - case 21: - -/* Line 1806 of yacc.c */ -#line 147 "grammar.y" - { (yyval.nvlst) = nvlstNewArray((yyvsp[(1) - (1)].arr)); } - break; - - case 22: - -/* Line 1806 of yacc.c */ -#line 148 "grammar.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } - break; - - case 23: - -/* Line 1806 of yacc.c */ -#line 149 "grammar.y" - { (yyval.stmt) = scriptAddStmt((yyvsp[(1) - (2)].stmt), (yyvsp[(2) - (2)].stmt)); } - break; - - case 24: - -/* Line 1806 of yacc.c */ -#line 150 "grammar.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } - break; - - case 25: - -/* Line 1806 of yacc.c */ -#line 151 "grammar.y" - { (yyval.stmt) = cnfstmtNew(S_IF); - (yyval.stmt)->d.s_if.expr = (yyvsp[(2) - (4)].expr); - (yyval.stmt)->d.s_if.t_then = (yyvsp[(4) - (4)].stmt); - (yyval.stmt)->d.s_if.t_else = NULL; } - break; - - case 26: - -/* Line 1806 of yacc.c */ -#line 155 "grammar.y" - { (yyval.stmt) = cnfstmtNew(S_IF); - (yyval.stmt)->d.s_if.expr = (yyvsp[(2) - (6)].expr); - (yyval.stmt)->d.s_if.t_then = (yyvsp[(4) - (6)].stmt); - (yyval.stmt)->d.s_if.t_else = (yyvsp[(6) - (6)].stmt); } - break; - - case 27: - -/* Line 1806 of yacc.c */ -#line 159 "grammar.y" - { (yyval.stmt) = cnfstmtNewSet((yyvsp[(2) - (5)].s), (yyvsp[(4) - (5)].expr)); } - break; - - case 28: - -/* Line 1806 of yacc.c */ -#line 160 "grammar.y" - { (yyval.stmt) = cnfstmtNewUnset((yyvsp[(2) - (3)].s)); } - break; - - case 29: - -/* Line 1806 of yacc.c */ -#line 161 "grammar.y" - { (yyval.stmt) = cnfstmtNewPRIFILT((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].stmt)); } - break; - - case 30: - -/* Line 1806 of yacc.c */ -#line 162 "grammar.y" - { (yyval.stmt) = cnfstmtNewPROPFILT((yyvsp[(1) - (2)].s), (yyvsp[(2) - (2)].stmt)); } - break; - - case 31: - -/* Line 1806 of yacc.c */ -#line 163 "grammar.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } - break; - - case 32: - -/* Line 1806 of yacc.c */ -#line 164 "grammar.y" - { (yyval.stmt) = (yyvsp[(2) - (3)].stmt); } - break; - - case 33: - -/* Line 1806 of yacc.c */ -#line 165 "grammar.y" - { (yyval.stmt) = (yyvsp[(1) - (1)].stmt); } - break; - - case 34: - -/* Line 1806 of yacc.c */ -#line 166 "grammar.y" - { (yyval.stmt) = scriptAddStmt((yyvsp[(1) - (3)].stmt), (yyvsp[(3) - (3)].stmt)); } - break; - - case 35: - -/* Line 1806 of yacc.c */ -#line 168 "grammar.y" - { (yyval.stmt) = cnfstmtNewAct((yyvsp[(2) - (3)].nvlst)); } - break; - - case 36: - -/* Line 1806 of yacc.c */ -#line 169 "grammar.y" - { (yyval.stmt) = cnfstmtNewLegaAct((yyvsp[(1) - (1)].s)); } - break; - - case 37: - -/* Line 1806 of yacc.c */ -#line 170 "grammar.y" - { (yyval.stmt) = cnfstmtNew(S_STOP); } - break; - - case 38: - -/* Line 1806 of yacc.c */ -#line 171 "grammar.y" - { (yyval.stmt) = cnfstmtNewCall((yyvsp[(2) - (2)].estr)); } - break; - - case 39: - -/* Line 1806 of yacc.c */ -#line 172 "grammar.y" - { (yyval.stmt) = cnfstmtNewContinue(); } - break; - - case 40: - -/* Line 1806 of yacc.c */ -#line 173 "grammar.y" - { (yyval.expr) = cnfexprNew(AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 41: - -/* Line 1806 of yacc.c */ -#line 174 "grammar.y" - { (yyval.expr) = cnfexprNew(OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 42: - -/* Line 1806 of yacc.c */ -#line 175 "grammar.y" - { (yyval.expr) = cnfexprNew(NOT, NULL, (yyvsp[(2) - (2)].expr)); } - break; - - case 43: - -/* Line 1806 of yacc.c */ -#line 176 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_EQ, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 44: - -/* Line 1806 of yacc.c */ -#line 177 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_NE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 45: - -/* Line 1806 of yacc.c */ -#line 178 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_LE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 46: - -/* Line 1806 of yacc.c */ -#line 179 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_GE, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 47: - -/* Line 1806 of yacc.c */ -#line 180 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_LT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 48: - -/* Line 1806 of yacc.c */ -#line 181 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_GT, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 49: - -/* Line 1806 of yacc.c */ -#line 182 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_CONTAINS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 50: - -/* Line 1806 of yacc.c */ -#line 183 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_CONTAINSI, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 51: - -/* Line 1806 of yacc.c */ -#line 184 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_STARTSWITH, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 52: - -/* Line 1806 of yacc.c */ -#line 185 "grammar.y" - { (yyval.expr) = cnfexprNew(CMP_STARTSWITHI, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 53: - -/* Line 1806 of yacc.c */ -#line 186 "grammar.y" - { (yyval.expr) = cnfexprNew('&', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 54: - -/* Line 1806 of yacc.c */ -#line 187 "grammar.y" - { (yyval.expr) = cnfexprNew('+', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 55: - -/* Line 1806 of yacc.c */ -#line 188 "grammar.y" - { (yyval.expr) = cnfexprNew('-', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 56: - -/* Line 1806 of yacc.c */ -#line 189 "grammar.y" - { (yyval.expr) = cnfexprNew('*', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 57: - -/* Line 1806 of yacc.c */ -#line 190 "grammar.y" - { (yyval.expr) = cnfexprNew('/', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 58: - -/* Line 1806 of yacc.c */ -#line 191 "grammar.y" - { (yyval.expr) = cnfexprNew('%', (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } - break; - - case 59: - -/* Line 1806 of yacc.c */ -#line 192 "grammar.y" - { (yyval.expr) = (yyvsp[(2) - (3)].expr); } - break; - - case 60: - -/* Line 1806 of yacc.c */ -#line 193 "grammar.y" - { (yyval.expr) = cnfexprNew('M', NULL, (yyvsp[(2) - (2)].expr)); } - break; - - case 61: - -/* Line 1806 of yacc.c */ -#line 194 "grammar.y" - { (yyval.expr) = (struct cnfexpr*) cnffuncNew((yyvsp[(1) - (3)].estr), NULL); } - break; - - case 62: - -/* Line 1806 of yacc.c */ -#line 195 "grammar.y" - { (yyval.expr) = (struct cnfexpr*) cnffuncNew((yyvsp[(1) - (4)].estr), (yyvsp[(3) - (4)].fparams)); } - break; - - case 63: - -/* Line 1806 of yacc.c */ -#line 196 "grammar.y" - { (yyval.expr) = (struct cnfexpr*) cnfnumvalNew((yyvsp[(1) - (1)].n)); } - break; - - case 64: - -/* Line 1806 of yacc.c */ -#line 197 "grammar.y" - { (yyval.expr) = (struct cnfexpr*) cnfstringvalNew((yyvsp[(1) - (1)].estr)); } - break; - - case 65: - -/* Line 1806 of yacc.c */ -#line 198 "grammar.y" - { (yyval.expr) = (struct cnfexpr*) cnfvarNew((yyvsp[(1) - (1)].s)); } - break; - - case 66: - -/* Line 1806 of yacc.c */ -#line 199 "grammar.y" - { (yyval.expr) = (struct cnfexpr*) (yyvsp[(1) - (1)].arr); } - break; - - case 67: - -/* Line 1806 of yacc.c */ -#line 200 "grammar.y" - { (yyval.fparams) = cnffparamlstNew((yyvsp[(1) - (1)].expr), NULL); } - break; - - case 68: - -/* Line 1806 of yacc.c */ -#line 201 "grammar.y" - { (yyval.fparams) = cnffparamlstNew((yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].fparams)); } - break; - - case 69: - -/* Line 1806 of yacc.c */ -#line 202 "grammar.y" - { (yyval.arr) = (yyvsp[(2) - (3)].arr); } - break; - - case 70: - -/* Line 1806 of yacc.c */ -#line 203 "grammar.y" - { (yyval.arr) = cnfarrayNew((yyvsp[(1) - (1)].estr)); } - break; - - case 71: - -/* Line 1806 of yacc.c */ -#line 204 "grammar.y" - { (yyval.arr) = cnfarrayAdd((yyvsp[(1) - (3)].arr), (yyvsp[(3) - (3)].estr)); } - break; - - - -/* Line 1806 of yacc.c */ -#line 2108 "grammar.c" - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - -/* Line 2067 of yacc.c */ -#line 206 "grammar.y" - -/* -int yyerror(char *s) -{ - printf("parse failure on or before line %d: %s\n", yylineno, s); - return 0; -} -*/ - diff -Nru rsyslog-7.6.0/grammar/grammar.h rsyslog-5.10.1/grammar/grammar.h --- rsyslog-7.6.0/grammar/grammar.h 2014-02-12 12:07:14.000000000 +0000 +++ rsyslog-5.10.1/grammar/grammar.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.5. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 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 - 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 . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NAME = 258, - FUNC = 259, - BEGINOBJ = 260, - ENDOBJ = 261, - BEGIN_ACTION = 262, - BEGIN_PROPERTY = 263, - BEGIN_CONSTANT = 264, - BEGIN_TPL = 265, - BEGIN_RULESET = 266, - STOP = 267, - SET = 268, - UNSET = 269, - CONTINUE = 270, - CALL = 271, - LEGACY_ACTION = 272, - LEGACY_RULESET = 273, - PRIFILT = 274, - PROPFILT = 275, - BSD_TAG_SELECTOR = 276, - BSD_HOST_SELECTOR = 277, - IF = 278, - THEN = 279, - ELSE = 280, - OR = 281, - AND = 282, - NOT = 283, - VAR = 284, - STRING = 285, - NUMBER = 286, - CMP_EQ = 287, - CMP_NE = 288, - CMP_LE = 289, - CMP_GE = 290, - CMP_LT = 291, - CMP_GT = 292, - CMP_CONTAINS = 293, - CMP_CONTAINSI = 294, - CMP_STARTSWITH = 295, - CMP_STARTSWITHI = 296, - UMINUS = 297 - }; -#endif -/* Tokens. */ -#define NAME 258 -#define FUNC 259 -#define BEGINOBJ 260 -#define ENDOBJ 261 -#define BEGIN_ACTION 262 -#define BEGIN_PROPERTY 263 -#define BEGIN_CONSTANT 264 -#define BEGIN_TPL 265 -#define BEGIN_RULESET 266 -#define STOP 267 -#define SET 268 -#define UNSET 269 -#define CONTINUE 270 -#define CALL 271 -#define LEGACY_ACTION 272 -#define LEGACY_RULESET 273 -#define PRIFILT 274 -#define PROPFILT 275 -#define BSD_TAG_SELECTOR 276 -#define BSD_HOST_SELECTOR 277 -#define IF 278 -#define THEN 279 -#define ELSE 280 -#define OR 281 -#define AND 282 -#define NOT 283 -#define VAR 284 -#define STRING 285 -#define NUMBER 286 -#define CMP_EQ 287 -#define CMP_NE 288 -#define CMP_LE 289 -#define CMP_GE 290 -#define CMP_LT 291 -#define CMP_GT 292 -#define CMP_CONTAINS 293 -#define CMP_CONTAINSI 294 -#define CMP_STARTSWITH 295 -#define CMP_STARTSWITHI 296 -#define UMINUS 297 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - -/* Line 2068 of yacc.c */ -#line 44 "grammar.y" - - char *s; - long long n; - es_str_t *estr; - enum cnfobjType objType; - struct cnfobj *obj; - struct cnfstmt *stmt; - struct nvlst *nvlst; - struct objlst *objlst; - struct cnfexpr *expr; - struct cnfarray *arr; - struct cnffunc *func; - struct cnffparamlst *fparams; - - - -/* Line 2068 of yacc.c */ -#line 151 "grammar.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - -extern YYSTYPE yylval; - - diff -Nru rsyslog-7.6.0/grammar/grammar.y rsyslog-5.10.1/grammar/grammar.y --- rsyslog-7.6.0/grammar/grammar.y 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/grammar/grammar.y 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ - /* Bison file for rsyslog config format v2 (RainerScript). - * Please note: this file introduces the new config format, but maintains - * backward compatibility. In order to do so, the grammar is not 100% clean, - * but IMHO still sufficiently easy both to understand for programmers - * maitaining the code as well as users writing the config file. Users are, - * of course, encouraged to use new constructs only. But it needs to be noted - * that some of the legacy constructs (specifically the in-front-of-action - * PRI filter) are very hard to beat in ease of use, at least for simpler - * cases. - * - * Copyright 2011-2012 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * The rsyslog runtime library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The rsyslog runtime library 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the rsyslog runtime library. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. - */ -%{ -#include -#include -#include "rainerscript.h" -#include "parserif.h" -#define YYDEBUG 1 -extern int yylineno; - -/* keep compile rule clean of errors */ -extern int yylex(void); -extern int yyerror(char*); -%} - -%union { - char *s; - long long n; - es_str_t *estr; - enum cnfobjType objType; - struct cnfobj *obj; - struct cnfstmt *stmt; - struct nvlst *nvlst; - struct objlst *objlst; - struct cnfexpr *expr; - struct cnfarray *arr; - struct cnffunc *func; - struct cnffparamlst *fparams; -} - -%token NAME -%token FUNC -%token BEGINOBJ -%token ENDOBJ -%token BEGIN_ACTION -%token BEGIN_PROPERTY -%token BEGIN_CONSTANT -%token BEGIN_TPL -%token BEGIN_RULESET -%token STOP -%token SET -%token UNSET -%token CONTINUE -%token CALL -%token LEGACY_ACTION -%token LEGACY_RULESET -%token PRIFILT -%token PROPFILT -%token BSD_TAG_SELECTOR -%token BSD_HOST_SELECTOR -%token IF -%token THEN -%token ELSE -%token OR -%token AND -%token NOT -%token VAR -%token STRING -%token NUMBER -%token CMP_EQ -%token CMP_NE -%token CMP_LE -%token CMP_GE -%token CMP_LT -%token CMP_GT -%token CMP_CONTAINS -%token CMP_CONTAINSI -%token CMP_STARTSWITH -%token CMP_STARTSWITHI - -%type nv nvlst value -%type obj property constant -%type propconst -%type expr -%type stmt s_act actlst block script -%type fparams -%type array arrayelt - -%left AND OR -%left CMP_EQ CMP_NE CMP_LE CMP_GE CMP_LT CMP_GT CMP_CONTAINS CMP_CONTAINSI CMP_STARTSWITH CMP_STARTSWITHI -%left '+' '-' '&' -%left '*' '/' '%' -%nonassoc UMINUS NOT - -%expect 1 /* dangling else */ -/* If more erors show up, Use "bison -v grammar.y" if more conflicts arise and - * check grammar.output for were exactly these conflicts exits. - */ -%% -/* note: we use left recursion below, because that saves stack space AND - * offers the right sequence so that we can submit the top-layer objects - * one by one. - */ -conf: /* empty (to end recursion) */ - | conf obj { cnfDoObj($2); } - | conf stmt { cnfDoScript($2); } - | conf LEGACY_RULESET { cnfDoCfsysline($2); } - | conf BSD_TAG_SELECTOR { cnfDoBSDTag($2); } - | conf BSD_HOST_SELECTOR { cnfDoBSDHost($2); } -obj: BEGINOBJ nvlst ENDOBJ { $$ = cnfobjNew($1, $2); } - | BEGIN_TPL nvlst ENDOBJ { $$ = cnfobjNew(CNFOBJ_TPL, $2); } - | BEGIN_TPL nvlst ENDOBJ '{' propconst '}' - { $$ = cnfobjNew(CNFOBJ_TPL, $2); - $$->subobjs = $5; - } - | BEGIN_RULESET nvlst ENDOBJ '{' script '}' - { $$ = cnfobjNew(CNFOBJ_RULESET, $2); - $$->script = $5; - } -propconst: { $$ = NULL; } - | propconst property { $$ = objlstAdd($1, $2); } - | propconst constant { $$ = objlstAdd($1, $2); } -property: BEGIN_PROPERTY nvlst ENDOBJ { $$ = cnfobjNew(CNFOBJ_PROPERTY, $2); } -constant: BEGIN_CONSTANT nvlst ENDOBJ { $$ = cnfobjNew(CNFOBJ_CONSTANT, $2); } -nvlst: { $$ = NULL; } - | nvlst nv { $2->next = $1; $$ = $2; } -nv: NAME '=' value { $$ = nvlstSetName($3, $1); } -value: STRING { $$ = nvlstNewStr($1); } - | array { $$ = nvlstNewArray($1); } -script: stmt { $$ = $1; } - | script stmt { $$ = scriptAddStmt($1, $2); } -stmt: actlst { $$ = $1; } - | IF expr THEN block { $$ = cnfstmtNew(S_IF); - $$->d.s_if.expr = $2; - $$->d.s_if.t_then = $4; - $$->d.s_if.t_else = NULL; } - | IF expr THEN block ELSE block { $$ = cnfstmtNew(S_IF); - $$->d.s_if.expr = $2; - $$->d.s_if.t_then = $4; - $$->d.s_if.t_else = $6; } - | SET VAR '=' expr ';' { $$ = cnfstmtNewSet($2, $4); } - | UNSET VAR ';' { $$ = cnfstmtNewUnset($2); } - | PRIFILT block { $$ = cnfstmtNewPRIFILT($1, $2); } - | PROPFILT block { $$ = cnfstmtNewPROPFILT($1, $2); } -block: stmt { $$ = $1; } - | '{' script '}' { $$ = $2; } -actlst: s_act { $$ = $1; } - | actlst '&' s_act { $$ = scriptAddStmt($1, $3); } -/* s_act are actions and action-like statements */ -s_act: BEGIN_ACTION nvlst ENDOBJ { $$ = cnfstmtNewAct($2); } - | LEGACY_ACTION { $$ = cnfstmtNewLegaAct($1); } - | STOP { $$ = cnfstmtNew(S_STOP); } - | CALL NAME { $$ = cnfstmtNewCall($2); } - | CONTINUE { $$ = cnfstmtNewContinue(); } -expr: expr AND expr { $$ = cnfexprNew(AND, $1, $3); } - | expr OR expr { $$ = cnfexprNew(OR, $1, $3); } - | NOT expr { $$ = cnfexprNew(NOT, NULL, $2); } - | expr CMP_EQ expr { $$ = cnfexprNew(CMP_EQ, $1, $3); } - | expr CMP_NE expr { $$ = cnfexprNew(CMP_NE, $1, $3); } - | expr CMP_LE expr { $$ = cnfexprNew(CMP_LE, $1, $3); } - | expr CMP_GE expr { $$ = cnfexprNew(CMP_GE, $1, $3); } - | expr CMP_LT expr { $$ = cnfexprNew(CMP_LT, $1, $3); } - | expr CMP_GT expr { $$ = cnfexprNew(CMP_GT, $1, $3); } - | expr CMP_CONTAINS expr { $$ = cnfexprNew(CMP_CONTAINS, $1, $3); } - | expr CMP_CONTAINSI expr { $$ = cnfexprNew(CMP_CONTAINSI, $1, $3); } - | expr CMP_STARTSWITH expr { $$ = cnfexprNew(CMP_STARTSWITH, $1, $3); } - | expr CMP_STARTSWITHI expr { $$ = cnfexprNew(CMP_STARTSWITHI, $1, $3); } - | expr '&' expr { $$ = cnfexprNew('&', $1, $3); } - | expr '+' expr { $$ = cnfexprNew('+', $1, $3); } - | expr '-' expr { $$ = cnfexprNew('-', $1, $3); } - | expr '*' expr { $$ = cnfexprNew('*', $1, $3); } - | expr '/' expr { $$ = cnfexprNew('/', $1, $3); } - | expr '%' expr { $$ = cnfexprNew('%', $1, $3); } - | '(' expr ')' { $$ = $2; } - | '-' expr %prec UMINUS { $$ = cnfexprNew('M', NULL, $2); } - | FUNC '(' ')' { $$ = (struct cnfexpr*) cnffuncNew($1, NULL); } - | FUNC '(' fparams ')' { $$ = (struct cnfexpr*) cnffuncNew($1, $3); } - | NUMBER { $$ = (struct cnfexpr*) cnfnumvalNew($1); } - | STRING { $$ = (struct cnfexpr*) cnfstringvalNew($1); } - | VAR { $$ = (struct cnfexpr*) cnfvarNew($1); } - | array { $$ = (struct cnfexpr*) $1; } -fparams: expr { $$ = cnffparamlstNew($1, NULL); } - | expr ',' fparams { $$ = cnffparamlstNew($1, $3); } -array: '[' arrayelt ']' { $$ = $2; } -arrayelt: STRING { $$ = cnfarrayNew($1); } - | arrayelt ',' STRING { $$ = cnfarrayAdd($1, $3); } - -%% -/* -int yyerror(char *s) -{ - printf("parse failure on or before line %d: %s\n", yylineno, s); - return 0; -} -*/ diff -Nru rsyslog-7.6.0/grammar/lexer.c rsyslog-5.10.1/grammar/lexer.c --- rsyslog-7.6.0/grammar/lexer.c 2014-02-12 12:07:15.000000000 +0000 +++ rsyslog-5.10.1/grammar/lexer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,3441 +0,0 @@ - -#line 3 "lexer.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define yywrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 99 -#define YY_END_OF_BUFFER 100 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[477] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 100, 98, 97, 97, 98, 98, - 98, 42, 70, 98, 98, 98, 98, 75, 98, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 43, 44, 69, 97, 70, 98, 98, 98, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 90, 89, 89, 90, 90, 76, 78, 90, - 81, 77, 79, 80, 87, 87, 87, 55, 55, 54, - 53, 52, 40, 39, 39, 40, 38, 36, 36, 38, - 38, 38, 11, 13, 38, 17, 18, 9, 12, 8, - - 14, 10, 32, 32, 3, 24, 7, 25, 37, 37, - 37, 37, 37, 37, 37, 15, 16, 0, 0, 96, - 0, 0, 74, 74, 74, 72, 83, 75, 0, 75, - 75, 75, 75, 75, 1, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 0, 0, 0, 75, 75, 75, - 75, 75, 75, 75, 75, 1, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 0, 82, 0, 0, - 88, 84, 77, 87, 87, 86, 56, 52, 41, 22, - 0, 35, 0, 0, 33, 0, 34, 0, 85, 30, - - 0, 32, 20, 23, 19, 21, 37, 37, 37, 37, - 4, 37, 37, 0, 92, 0, 91, 0, 0, 94, - 0, 74, 74, 71, 71, 72, 73, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 48, - 75, 75, 75, 68, 0, 95, 74, 0, 0, 68, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 48, 75, 75, 75, 0, 0, 0, 33, - 0, 0, 31, 5, 37, 6, 37, 37, 0, 93, - 74, 71, 71, 73, 75, 47, 75, 75, 46, 75, - 75, 75, 75, 75, 75, 75, 75, 45, 75, 75, - - 0, 0, 0, 75, 47, 75, 75, 46, 75, 75, - 75, 75, 75, 75, 75, 75, 45, 75, 75, 0, - 0, 0, 0, 0, 37, 37, 2, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 49, - 0, 0, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 49, 0, 37, 37, 75, 75, 75, - 75, 0, 63, 75, 75, 75, 75, 75, 75, 75, - 0, 0, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 37, 37, 0, 66, 75, 75, 0, 58, - 75, 75, 0, 64, 75, 75, 75, 75, 0, 67, - - 0, 75, 75, 75, 75, 75, 75, 37, 37, 75, - 50, 75, 75, 75, 75, 0, 60, 75, 67, 75, - 50, 75, 75, 75, 26, 37, 0, 62, 75, 75, - 75, 0, 61, 0, 59, 75, 37, 37, 75, 75, - 75, 75, 27, 28, 75, 0, 57, 75, 75, 37, - 75, 75, 75, 29, 0, 65, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 51, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, - 21, 21, 21, 21, 21, 22, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 39, - 55, 56, 57, 29, 58, 1, 59, 60, 61, 62, - - 63, 64, 65, 66, 67, 39, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 51, 79, 80, - 81, 39, 82, 29, 83, 84, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[85] = - { 0, - 1, 2, 3, 4, 5, 6, 1, 7, 1, 1, - 6, 1, 1, 8, 9, 10, 11, 12, 13, 14, - 14, 15, 16, 17, 1, 18, 1, 19, 1, 20, - 21, 22, 22, 22, 20, 23, 23, 23, 23, 23, - 23, 23, 24, 23, 23, 23, 24, 23, 24, 23, - 25, 23, 26, 23, 1, 6, 1, 27, 20, 21, - 22, 22, 22, 20, 23, 23, 23, 23, 23, 23, - 24, 23, 23, 23, 24, 23, 24, 23, 23, 26, - 23, 1, 1, 1 - } ; - -static yyconst flex_int16_t yy_base[552] = - { 0, - 0, 84, 168, 0, 250, 251, 253, 256, 248, 253, - 275, 0, 359, 0, 1179, 3414, 3414, 3414, 0, 1159, - 0, 3414, 3414, 1146, 248, 0, 1036, 0, 0, 412, - 415, 406, 407, 414, 407, 422, 407, 405, 428, 426, - 413, 3414, 3414, 0, 484, 447, 1035, 507, 520, 534, - 553, 598, 558, 564, 591, 466, 500, 594, 595, 630, - 631, 628, 3414, 3414, 3414, 444, 1045, 3414, 3414, 1030, - 3414, 0, 3414, 3414, 1020, 960, 939, 0, 3414, 3414, - 3414, 449, 3414, 3414, 3414, 0, 3414, 3414, 3414, 926, - 447, 578, 3414, 3414, 450, 3414, 3414, 3414, 3414, 3414, - - 3414, 901, 526, 560, 3414, 245, 886, 870, 421, 0, - 485, 532, 554, 554, 458, 3414, 3414, 644, 870, 3414, - 707, 674, 0, 681, 490, 0, 3414, 0, 840, 560, - 599, 609, 744, 749, 0, 749, 751, 460, 545, 762, - 757, 750, 756, 759, 754, 801, 791, 0, 851, 815, - 0, 821, 693, 842, 832, 856, 858, 887, 866, 913, - 926, 842, 761, 840, 846, 816, 887, 905, 913, 906, - 923, 912, 845, 921, 917, 925, 537, 3414, 540, 816, - 3414, 3414, 0, 814, 805, 3414, 0, 684, 0, 3414, - 626, 3414, 958, 0, 0, 528, 3414, 971, 3414, 623, - - 0, 793, 3414, 3414, 3414, 3414, 0, 844, 867, 920, - 0, 855, 922, 1002, 3414, 794, 3414, 1051, 1005, 1011, - 695, 1018, 646, 0, 0, 0, 0, 950, 958, 1088, - 976, 985, 969, 1098, 1096, 1090, 1096, 1097, 1109, 0, - 1100, 1101, 1113, 0, 1026, 3414, 1029, 442, 687, 1166, - 1137, 1185, 1141, 1122, 1156, 1170, 1109, 1171, 1172, 1178, - 1186, 1152, 1167, 1187, 1188, 1203, 1232, 887, 0, 0, - 900, 0, 3414, 0, 1181, 0, 1187, 1192, 607, 3414, - 550, 0, 0, 0, 1201, 0, 1197, 1211, 0, 1234, - 1218, 1218, 487, 1228, 1223, 1231, 1223, 0, 1234, 1227, - - 1030, 1032, 1275, 1240, 1236, 1241, 1248, 1242, 1272, 1251, - 1266, 1265, 1260, 1267, 1285, 1284, 1280, 1281, 1289, 1331, - 1020, 0, 1022, 0, 1297, 1284, 0, 1296, 1310, 1300, - 1304, 1360, 1301, 1301, 1321, 1313, 1318, 1325, 1338, 0, - 486, 581, 1335, 1340, 1336, 1339, 1388, 1341, 1355, 1354, - 1370, 1378, 1390, 1353, 645, 1363, 1367, 1430, 1373, 1375, - 1434, 1448, 3414, 439, 1377, 1459, 1403, 1379, 1391, 1399, - 594, 970, 1463, 1429, 1428, 1477, 1432, 1480, 1453, 1446, - 1447, 1450, 1415, 607, 1505, 3414, 1425, 1471, 1508, 3414, - 1454, 1479, 1526, 3414, 1490, 822, 1533, 1492, 990, 3414, - - 1138, 1492, 1509, 1512, 1498, 1554, 1529, 1492, 1506, 1581, - 0, 1518, 1509, 1513, 1587, 1598, 3414, 1601, 1142, 1604, - 1519, 1571, 1615, 1618, 422, 1537, 1622, 3414, 1534, 1548, - 1574, 1629, 3414, 1645, 3414, 1594, 1591, 1599, 1598, 1648, - 1603, 1612, 0, 414, 1608, 1666, 3414, 1603, 1613, 1623, - 1689, 1636, 1638, 0, 1692, 3414, 1612, 1645, 1643, 1668, - 1637, 1656, 1635, 1648, 1658, 1669, 1681, 1688, 1681, 1689, - 1671, 1693, 251, 1708, 3414, 3414, 1777, 1804, 1831, 1858, - 1885, 1893, 1919, 1946, 1965, 1979, 2004, 2023, 2042, 2068, - 2089, 2108, 2135, 2162, 2178, 2205, 2232, 2248, 2275, 2298, - - 2324, 2338, 2365, 2392, 2419, 2446, 2465, 2479, 2504, 2523, - 2539, 2559, 2581, 2607, 2631, 2653, 2673, 2700, 2722, 2747, - 2763, 2790, 2817, 2833, 2860, 2882, 2889, 2911, 2938, 2960, - 1733, 2973, 3000, 3027, 3054, 3081, 3108, 3135, 3162, 3189, - 3208, 3231, 3254, 3276, 3296, 3323, 3337, 3346, 3355, 3364, - 3386 - } ; - -static yyconst flex_int16_t yy_def[552] = - { 0, - 476, 476, 476, 3, 477, 477, 478, 478, 479, 479, - 476, 11, 476, 13, 476, 476, 476, 476, 480, 481, - 482, 476, 476, 476, 483, 483, 484, 485, 486, 485, - 485, 485, 485, 485, 485, 485, 485, 485, 485, 485, - 485, 476, 476, 483, 487, 488, 489, 490, 491, 492, - 492, 492, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 476, 476, 476, 493, 494, 476, 476, 476, - 476, 495, 476, 476, 496, 496, 476, 497, 476, 476, - 476, 476, 476, 476, 476, 498, 476, 476, 476, 476, - 499, 500, 476, 476, 501, 476, 476, 476, 476, 476, - - 476, 476, 476, 476, 476, 476, 476, 476, 502, 502, - 502, 502, 502, 502, 502, 476, 476, 503, 504, 476, - 476, 476, 483, 483, 505, 506, 476, 507, 508, 507, - 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 509, 510, 511, 512, 510, - 513, 476, 511, 514, 512, 512, 515, 516, 507, 517, - 517, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 518, 476, 519, 520, - 476, 476, 521, 522, 522, 476, 523, 476, 524, 476, - 525, 476, 526, 527, 528, 529, 476, 530, 476, 476, - - 531, 476, 476, 476, 476, 476, 532, 532, 532, 532, - 532, 532, 532, 476, 476, 533, 476, 476, 476, 476, - 534, 535, 536, 537, 538, 539, 540, 541, 541, 541, - 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, - 541, 541, 541, 542, 476, 476, 535, 476, 543, 544, - 545, 545, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 546, 476, 547, 528, - 476, 548, 476, 532, 532, 532, 532, 532, 534, 476, - 536, 537, 538, 540, 541, 541, 541, 541, 541, 541, - 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, - - 543, 543, 543, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 546, - 476, 549, 476, 550, 532, 532, 532, 541, 541, 541, - 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, - 476, 476, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 546, 532, 532, 541, 541, 541, - 541, 476, 476, 541, 541, 541, 541, 541, 541, 541, - 476, 551, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 532, 532, 476, 476, 541, 541, 476, 476, - 541, 541, 476, 476, 541, 541, 541, 541, 551, 476, - - 551, 252, 252, 252, 252, 252, 252, 532, 532, 541, - 541, 541, 541, 541, 541, 476, 476, 541, 551, 252, - 252, 252, 252, 252, 532, 532, 476, 476, 541, 541, - 541, 476, 476, 476, 476, 252, 532, 532, 541, 541, - 541, 252, 532, 532, 541, 476, 476, 541, 252, 532, - 541, 541, 252, 532, 476, 476, 541, 252, 541, 252, - 541, 252, 541, 252, 541, 252, 541, 252, 541, 252, - 541, 252, 541, 252, 476, 0, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476 - } ; - -static yyconst flex_int16_t yy_nxt[3499] = - { 0, - 16, 17, 18, 17, 19, 16, 20, 21, 16, 22, - 16, 16, 16, 23, 24, 16, 25, 26, 27, 28, - 28, 28, 29, 16, 16, 16, 26, 26, 26, 30, - 28, 31, 28, 32, 28, 33, 28, 34, 28, 28, - 35, 36, 28, 28, 37, 28, 38, 39, 40, 41, - 28, 28, 28, 28, 16, 16, 16, 28, 30, 28, - 31, 28, 32, 28, 33, 28, 34, 28, 35, 36, - 28, 28, 37, 28, 38, 39, 40, 41, 28, 28, - 28, 42, 43, 44, 16, 45, 18, 45, 19, 16, - 20, 21, 16, 22, 16, 16, 16, 46, 47, 16, - - 48, 26, 27, 28, 28, 28, 49, 16, 16, 16, - 26, 26, 26, 50, 51, 52, 51, 53, 51, 54, - 51, 55, 51, 51, 56, 57, 51, 51, 58, 51, - 59, 60, 61, 62, 51, 51, 51, 51, 16, 16, - 16, 28, 50, 51, 52, 51, 53, 51, 54, 51, - 55, 51, 56, 57, 51, 51, 58, 51, 59, 60, - 61, 62, 51, 51, 51, 42, 43, 44, 63, 64, - 65, 64, 63, 66, 67, 63, 63, 63, 63, 63, - 68, 63, 63, 69, 63, 63, 70, 63, 63, 63, - 63, 63, 63, 71, 63, 63, 63, 72, 72, 72, - - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 73, 63, 74, 63, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 63, - 63, 63, 76, 76, 79, 79, 79, 79, 79, 79, - 81, 124, 475, 77, 77, 81, 125, 82, 82, 82, - 203, 204, 82, 82, 82, 83, 84, 85, 84, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - - 83, 83, 83, 83, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 83, - 83, 83, 83, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 83, 83, 83, 87, - 88, 89, 88, 90, 91, 87, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 87, 102, 103, 104, - 104, 87, 105, 106, 107, 108, 87, 87, 109, 110, - 111, 110, 110, 110, 110, 110, 110, 110, 110, 110, - - 110, 112, 113, 110, 110, 110, 114, 115, 110, 110, - 110, 110, 110, 116, 87, 117, 87, 109, 110, 111, - 110, 110, 110, 110, 110, 110, 110, 110, 110, 112, - 113, 110, 110, 110, 114, 115, 110, 110, 110, 110, - 87, 87, 87, 130, 131, 248, 133, 134, 135, 178, - 137, 138, 192, 140, 141, 145, 136, 249, 132, 144, - 197, 142, 151, 208, 151, 139, 152, 152, 188, 188, - 188, 450, 130, 131, 133, 134, 143, 135, 137, 437, - 138, 140, 141, 145, 136, 146, 132, 146, 144, 341, - 142, 208, 225, 139, 213, 160, 391, 235, 148, 179, - - 148, 342, 193, 123, 143, 198, 149, 123, 123, 168, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 124, 123, 123, 213, 160, 125, 235, 155, 209, 169, - 123, 123, 123, 123, 123, 123, 156, 168, 197, 129, - 129, 129, 178, 170, 334, 200, 200, 150, 128, 158, - 128, 151, 280, 159, 159, 128, 209, 128, 169, 267, - 267, 123, 123, 123, 123, 161, 150, 128, 158, 128, - 151, 170, 159, 159, 128, 210, 128, 236, 201, 202, - 202, 202, 194, 198, 371, 194, 372, 160, 123, 123, - 123, 128, 179, 160, 161, 194, 194, 371, 164, 372, - - 211, 160, 212, 210, 165, 201, 236, 160, 228, 280, - 128, 150, 128, 158, 128, 151, 160, 159, 159, 128, - 160, 128, 160, 160, 160, 166, 164, 162, 211, 160, - 212, 192, 165, 167, 160, 160, 228, 160, 160, 229, - 171, 163, 200, 200, 172, 214, 215, 214, 280, 160, - 178, 230, 160, 160, 166, 128, 162, 160, 409, 160, - 160, 167, 160, 173, 175, 160, 160, 229, 171, 163, - 176, 160, 172, 160, 160, 219, 220, 219, 174, 230, - 221, 193, 222, 220, 222, 409, 160, 223, 160, 160, - 301, 302, 173, 175, 245, 246, 245, 280, 176, 160, - - 179, 160, 160, 188, 188, 188, 174, 216, 216, 217, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 216, 216, 216, 216, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 216, 216, - 216, 231, 232, 233, 234, 237, 217, 239, 240, 241, - - 242, 243, 146, 253, 146, 238, 151, 185, 151, 160, - 152, 152, 202, 202, 202, 148, 185, 148, 181, 231, - 232, 233, 234, 149, 237, 239, 240, 241, 242, 243, - 151, 253, 151, 238, 152, 152, 151, 160, 151, 476, - 152, 152, 123, 247, 246, 247, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 155, 248, - 123, 248, 227, 476, 160, 123, 123, 123, 123, 123, - 123, 249, 120, 249, 156, 415, 274, 129, 129, 129, - 227, 158, 252, 151, 277, 159, 159, 254, 160, 255, - 160, 244, 160, 263, 160, 206, 123, 123, 123, 123, - - 244, 128, 415, 128, 244, 274, 321, 321, 128, 275, - 252, 205, 244, 277, 199, 254, 160, 255, 160, 323, - 323, 263, 160, 123, 123, 123, 150, 128, 158, 128, - 151, 256, 159, 159, 128, 160, 128, 275, 259, 150, - 128, 158, 128, 151, 128, 159, 159, 128, 257, 128, - 258, 190, 262, 160, 160, 278, 260, 186, 265, 256, - 160, 160, 185, 160, 264, 160, 261, 259, 276, 160, - 128, 160, 266, 160, 251, 400, 257, 268, 268, 258, - 262, 160, 160, 128, 278, 260, 265, 285, 160, 160, - 271, 271, 264, 160, 261, 400, 276, 160, 286, 160, - - 266, 160, 251, 214, 215, 214, 219, 220, 219, 289, - 269, 221, 219, 220, 219, 290, 285, 221, 291, 222, - 220, 222, 185, 272, 223, 401, 286, 245, 246, 245, - 247, 246, 247, 301, 302, 476, 476, 269, 289, 191, - 191, 196, 196, 182, 290, 401, 291, 181, 122, 127, - 272, 216, 216, 217, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - - 218, 218, 218, 218, 218, 216, 216, 216, 216, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 216, 216, 216, 287, 288, 292, 293, 294, - 295, 296, 297, 419, 298, 299, 300, 400, 311, 160, - 150, 128, 158, 128, 151, 308, 159, 159, 128, 122, - 128, 120, 160, 287, 288, 292, 293, 294, 295, 296, - 244, 297, 298, 299, 304, 300, 311, 160, 476, 244, - 128, 160, 128, 244, 308, 316, 309, 128, 306, 307, - 160, 244, 160, 401, 128, 476, 160, 401, 150, 128, - - 158, 128, 151, 304, 159, 159, 128, 160, 128, 160, - 160, 160, 160, 312, 316, 309, 306, 307, 160, 310, - 160, 313, 314, 128, 160, 305, 160, 160, 160, 325, - 315, 317, 318, 326, 327, 160, 319, 178, 160, 160, - 160, 312, 128, 160, 328, 329, 160, 310, 330, 313, - 314, 320, 320, 305, 160, 160, 160, 325, 315, 317, - 318, 326, 327, 331, 337, 319, 332, 333, 335, 336, - 338, 160, 328, 329, 339, 340, 160, 330, 341, 476, - 160, 160, 160, 343, 476, 345, 476, 179, 160, 344, - 342, 160, 331, 337, 332, 333, 335, 336, 338, 347, - - 349, 346, 339, 340, 160, 160, 160, 160, 160, 160, - 160, 343, 160, 350, 345, 348, 160, 344, 351, 160, - 160, 353, 334, 476, 160, 160, 356, 347, 349, 160, - 346, 352, 357, 160, 160, 160, 178, 354, 358, 359, - 160, 350, 360, 348, 361, 364, 365, 351, 160, 353, - 355, 355, 160, 160, 366, 356, 367, 160, 369, 352, - 357, 362, 362, 362, 368, 354, 358, 370, 359, 374, - 360, 363, 361, 364, 365, 160, 160, 373, 375, 376, - 160, 160, 476, 366, 367, 377, 179, 369, 378, 362, - 362, 362, 368, 160, 160, 160, 370, 379, 374, 363, - - 383, 476, 476, 160, 160, 373, 375, 376, 160, 160, - 160, 381, 476, 377, 384, 387, 380, 378, 160, 382, - 476, 160, 160, 160, 388, 379, 392, 396, 160, 383, - 160, 385, 385, 385, 395, 389, 389, 389, 160, 397, - 381, 386, 384, 387, 380, 390, 160, 398, 382, 362, - 362, 362, 388, 476, 392, 396, 160, 408, 160, 363, - 393, 393, 393, 395, 385, 385, 385, 397, 160, 160, - 394, 402, 160, 410, 386, 398, 476, 403, 389, 389, - 389, 393, 393, 393, 404, 408, 160, 160, 390, 391, - 160, 394, 476, 160, 405, 406, 160, 160, 407, 402, - - 160, 410, 412, 160, 411, 403, 385, 385, 385, 389, - 389, 389, 413, 404, 160, 160, 386, 160, 160, 390, - 160, 160, 405, 406, 414, 418, 407, 393, 393, 393, - 412, 160, 160, 411, 416, 416, 416, 394, 160, 425, - 420, 413, 421, 426, 417, 160, 422, 429, 160, 160, - 431, 423, 160, 414, 418, 416, 416, 416, 430, 160, - 160, 476, 424, 476, 439, 417, 160, 425, 420, 160, - 476, 421, 426, 476, 476, 422, 429, 160, 423, 431, - 160, 440, 427, 427, 427, 438, 430, 160, 432, 432, - 432, 424, 428, 439, 160, 476, 476, 160, 433, 416, - - 416, 416, 434, 434, 434, 427, 427, 427, 436, 417, - 440, 160, 435, 438, 441, 428, 432, 432, 432, 434, - 434, 434, 160, 427, 427, 427, 433, 476, 443, 435, - 432, 432, 432, 428, 442, 444, 448, 436, 445, 160, - 433, 451, 441, 452, 160, 449, 434, 434, 434, 446, - 446, 446, 160, 453, 459, 160, 435, 443, 160, 447, - 454, 476, 442, 476, 444, 448, 445, 446, 446, 446, - 451, 452, 160, 457, 449, 458, 461, 447, 160, 463, - 160, 453, 459, 160, 465, 160, 160, 460, 160, 454, - 455, 455, 455, 455, 455, 455, 160, 466, 464, 467, - - 456, 462, 457, 456, 458, 461, 160, 463, 160, 160, - 468, 469, 465, 160, 471, 460, 160, 473, 470, 475, - 476, 476, 472, 476, 160, 466, 464, 467, 160, 160, - 462, 476, 476, 160, 476, 476, 160, 160, 468, 474, - 469, 476, 476, 471, 476, 473, 273, 470, 160, 476, - 476, 472, 273, 273, 273, 476, 160, 160, 476, 476, - 476, 160, 476, 476, 476, 476, 476, 474, 476, 476, - 476, 476, 476, 476, 476, 476, 160, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - - 75, 75, 75, 75, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 118, 476, - 476, 476, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 121, 121, 121, 121, 121, 121, 121, 123, - 123, 476, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 128, 128, 128, 476, 476, 128, 128, - 476, 128, 476, 476, 128, 128, 128, 128, 128, 128, - 128, 128, 129, 129, 476, 476, 476, 476, 129, 129, - - 129, 129, 129, 129, 129, 147, 476, 147, 476, 476, - 476, 147, 147, 476, 147, 476, 476, 476, 476, 147, - 476, 476, 476, 147, 147, 147, 147, 147, 147, 147, - 150, 476, 150, 476, 150, 476, 150, 476, 476, 476, - 476, 476, 150, 150, 150, 150, 150, 150, 150, 153, - 476, 476, 153, 153, 476, 153, 153, 153, 476, 476, - 476, 153, 153, 153, 153, 153, 153, 153, 154, 154, - 476, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 157, 476, 476, 476, 157, - - 476, 476, 157, 157, 476, 476, 476, 476, 157, 157, - 157, 157, 157, 157, 157, 160, 160, 160, 160, 160, - 476, 160, 160, 476, 160, 476, 476, 160, 160, 160, - 160, 160, 160, 160, 160, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 183, - 476, 183, 183, 476, 476, 476, 476, 183, 183, 183, - - 183, 183, 183, 183, 183, 184, 184, 184, 184, 184, - 184, 184, 476, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 187, 476, 476, 476, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 189, - 476, 189, 189, 476, 476, 476, 476, 189, 189, 189, - 189, 189, 189, 189, 189, 191, 191, 191, 191, 191, - 191, 476, 191, 191, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, - - 191, 191, 195, 476, 195, 476, 476, 476, 476, 195, - 195, 476, 476, 476, 476, 476, 476, 195, 195, 195, - 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 207, 207, 476, 476, 476, 476, 207, 207, 207, - 207, 207, 207, 207, 207, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, - - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 224, - 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 226, 226, 476, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 128, 128, 128, 476, 476, 128, 128, - 476, 128, 476, 476, 128, 128, 128, 128, 128, 128, - 128, 128, 129, 129, 129, 476, 476, 476, 129, 129, - - 129, 129, 129, 129, 129, 147, 476, 147, 476, 476, - 476, 147, 147, 476, 147, 476, 476, 476, 476, 147, - 476, 476, 476, 147, 147, 147, 147, 147, 147, 147, - 150, 476, 150, 476, 150, 476, 150, 476, 476, 476, - 476, 476, 150, 150, 150, 150, 150, 150, 150, 153, - 153, 476, 153, 153, 153, 476, 476, 476, 153, 153, - 153, 153, 153, 153, 153, 156, 476, 476, 476, 156, - 476, 476, 476, 476, 476, 476, 476, 476, 156, 156, - 156, 156, 156, 156, 156, 244, 476, 476, 244, 476, - 244, 476, 244, 476, 244, 476, 476, 244, 244, 476, - - 244, 244, 244, 244, 244, 244, 244, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 157, 476, 476, 476, 476, 476, - 157, 157, 476, 476, 157, 157, 157, 476, 476, 476, - 157, 157, 157, 157, 157, 157, 157, 250, 476, 476, - 250, 250, 250, 250, 250, 476, 250, 250, 476, 250, - 250, 476, 250, 250, 250, 250, 250, 250, 250, 250, - 160, 160, 160, 160, 160, 476, 160, 160, 476, 160, - 476, 476, 160, 160, 160, 160, 160, 160, 160, 160, - - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 476, 476, - 476, 476, 476, 476, 476, 177, 476, 476, 476, 476, - 177, 177, 177, 476, 476, 177, 177, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 183, 476, 183, 183, 476, 476, - 476, 476, 183, 183, 183, 183, 183, 183, 183, 183, - 184, 184, 184, 184, 184, 184, 184, 476, 184, 184, - - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 187, 476, 476, - 476, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 189, 476, 189, 189, 476, 476, - 476, 476, 189, 189, 189, 189, 189, 189, 189, 189, - 191, 191, 191, 191, 191, 191, 476, 191, 191, 191, - 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 191, 191, 191, 191, 476, - 476, 476, 476, 476, 476, 191, 476, 476, 476, 476, - - 476, 476, 191, 476, 476, 191, 476, 191, 195, 195, - 195, 195, 195, 195, 195, 270, 476, 476, 476, 476, - 476, 270, 270, 476, 270, 270, 476, 476, 476, 476, - 270, 270, 270, 270, 270, 270, 270, 270, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 476, 476, 476, - 476, 476, 476, 196, 476, 476, 476, 476, 476, 476, - 196, 476, 476, 196, 476, 196, 207, 207, 476, 476, - 476, 476, 207, 207, 207, 207, 207, 207, 207, 207, - - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 216, 216, 216, 216, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 281, 281, 281, 281, 281, 281, 281, 281, 281, - 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - - 281, 281, 281, 281, 281, 281, 281, 281, 282, 282, - 476, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 283, 283, 476, 283, 283, - 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, - 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, - 283, 283, 226, 226, 476, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 284, - 284, 476, 284, 284, 284, 284, 284, 284, 284, 284, - - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 128, 128, 128, 476, - 476, 128, 128, 476, 128, 476, 476, 128, 128, 128, - 128, 128, 128, 128, 128, 244, 476, 476, 244, 476, - 244, 476, 244, 476, 244, 476, 476, 244, 244, 476, - 244, 244, 244, 244, 244, 244, 244, 303, 303, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 303, 303, 303, 303, 303, 303, 303, - 250, 476, 476, 250, 250, 250, 250, 250, 476, 250, - 250, 476, 250, 250, 476, 250, 250, 250, 250, 250, - - 250, 250, 250, 160, 160, 160, 160, 160, 476, 160, - 160, 476, 160, 476, 476, 160, 160, 160, 160, 160, - 160, 160, 160, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 322, 322, 476, 476, 476, 476, 322, 322, 322, 324, - 324, 476, 476, 476, 476, 324, 324, 324, 191, 191, - 476, 476, 476, 476, 191, 191, 191, 196, 196, 476, - 476, 476, 476, 196, 196, 196, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 15, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476 - - } ; - -static yyconst flex_int16_t yy_chk[3499] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 5, 6, 7, 7, 7, 8, 8, 8, - 9, 25, 473, 5, 6, 10, 25, 9, 9, 9, - 106, 106, 10, 10, 10, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 30, 31, 248, 32, 33, 34, 66, - 35, 36, 91, 37, 38, 41, 34, 248, 31, 40, - 95, 39, 46, 109, 46, 36, 46, 46, 82, 82, - 82, 444, 30, 31, 32, 33, 39, 34, 35, 425, - 36, 37, 38, 41, 34, 45, 31, 45, 40, 341, - 39, 109, 125, 36, 115, 56, 364, 138, 45, 66, - - 45, 341, 91, 125, 39, 95, 45, 48, 48, 56, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 115, 56, 48, 138, 49, 111, 57, - 48, 48, 48, 48, 48, 48, 49, 56, 196, 49, - 49, 49, 177, 57, 293, 103, 103, 50, 50, 50, - 50, 50, 281, 50, 50, 50, 111, 50, 57, 179, - 179, 48, 48, 48, 48, 50, 51, 51, 51, 51, - 51, 57, 51, 51, 51, 112, 51, 139, 103, 104, - 104, 104, 92, 196, 342, 92, 342, 53, 48, 48, - 48, 50, 177, 54, 50, 92, 92, 371, 53, 371, - - 113, 53, 114, 112, 54, 103, 139, 54, 130, 279, - 51, 52, 52, 52, 52, 52, 53, 52, 52, 52, - 55, 52, 54, 58, 59, 55, 53, 52, 113, 53, - 114, 191, 54, 55, 55, 54, 130, 58, 59, 131, - 58, 52, 200, 200, 59, 118, 118, 118, 223, 55, - 355, 132, 58, 59, 55, 52, 52, 62, 384, 60, - 61, 55, 55, 60, 61, 58, 59, 131, 58, 52, - 62, 62, 59, 60, 61, 122, 122, 122, 60, 132, - 122, 191, 124, 124, 124, 384, 62, 124, 60, 61, - 249, 249, 60, 61, 153, 153, 153, 221, 62, 62, - - 355, 60, 61, 188, 188, 188, 60, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 133, 134, 136, 137, 140, 216, 141, 142, 143, - - 144, 145, 146, 163, 146, 140, 147, 185, 147, 163, - 147, 147, 202, 202, 202, 146, 184, 146, 180, 133, - 134, 136, 137, 146, 140, 141, 142, 143, 144, 145, - 150, 163, 150, 140, 150, 150, 152, 163, 152, 155, - 152, 152, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 149, 156, - 154, 157, 129, 156, 166, 154, 154, 154, 154, 154, - 154, 156, 119, 157, 157, 396, 208, 157, 157, 157, - 157, 159, 162, 159, 212, 159, 159, 164, 164, 165, - 162, 158, 166, 173, 165, 108, 154, 154, 154, 154, - - 158, 158, 396, 158, 158, 208, 268, 268, 158, 209, - 162, 107, 158, 212, 102, 164, 164, 165, 162, 271, - 271, 173, 165, 154, 154, 154, 160, 160, 160, 160, - 160, 167, 160, 160, 160, 167, 160, 209, 170, 161, - 161, 161, 161, 161, 158, 161, 161, 161, 168, 161, - 169, 90, 172, 168, 170, 213, 171, 77, 175, 167, - 172, 169, 76, 167, 174, 175, 171, 170, 210, 174, - 160, 171, 176, 176, 161, 372, 168, 193, 193, 169, - 172, 168, 170, 161, 213, 171, 175, 228, 172, 169, - 198, 198, 174, 175, 171, 399, 210, 174, 229, 171, - - 176, 176, 161, 214, 214, 214, 219, 219, 219, 231, - 193, 219, 220, 220, 220, 232, 228, 220, 233, 222, - 222, 222, 75, 198, 222, 372, 229, 245, 245, 245, - 247, 247, 247, 301, 301, 302, 302, 193, 231, 321, - 321, 323, 323, 70, 232, 399, 233, 67, 47, 27, - 198, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 230, 230, 234, 235, 236, - 237, 238, 239, 401, 241, 242, 243, 419, 257, 257, - 251, 251, 251, 251, 251, 254, 251, 251, 251, 24, - 251, 20, 254, 230, 230, 234, 235, 236, 237, 238, - 250, 239, 241, 242, 251, 243, 257, 257, 15, 250, - 250, 253, 250, 250, 254, 262, 255, 250, 253, 253, - 254, 250, 262, 401, 251, 0, 255, 419, 252, 252, - - 252, 252, 252, 251, 252, 252, 252, 263, 252, 253, - 256, 258, 259, 258, 262, 255, 253, 253, 260, 256, - 262, 259, 260, 250, 255, 252, 261, 264, 265, 275, - 261, 264, 265, 277, 278, 263, 266, 267, 256, 258, - 259, 258, 252, 266, 285, 287, 260, 256, 288, 259, - 260, 267, 267, 252, 261, 264, 265, 275, 261, 264, - 265, 277, 278, 290, 296, 266, 291, 292, 294, 295, - 297, 266, 285, 287, 299, 300, 305, 288, 303, 303, - 304, 306, 308, 304, 0, 307, 0, 267, 307, 306, - 303, 310, 290, 296, 291, 292, 294, 295, 297, 310, - - 313, 309, 299, 300, 305, 312, 311, 314, 304, 306, - 308, 304, 309, 314, 307, 311, 307, 306, 315, 310, - 317, 318, 312, 0, 316, 315, 325, 310, 313, 319, - 309, 316, 326, 312, 311, 314, 320, 319, 328, 329, - 309, 314, 330, 311, 331, 333, 334, 315, 317, 318, - 320, 320, 316, 315, 335, 325, 336, 319, 338, 316, - 326, 332, 332, 332, 337, 319, 328, 339, 329, 344, - 330, 332, 331, 333, 334, 343, 345, 343, 345, 346, - 344, 348, 0, 335, 336, 348, 320, 338, 349, 347, - 347, 347, 337, 354, 350, 349, 339, 350, 344, 347, - - 356, 0, 0, 343, 345, 343, 345, 346, 344, 348, - 351, 352, 0, 348, 357, 359, 351, 349, 352, 353, - 0, 354, 350, 349, 360, 350, 365, 368, 347, 356, - 353, 358, 358, 358, 367, 361, 361, 361, 351, 369, - 352, 358, 357, 359, 351, 361, 352, 370, 353, 362, - 362, 362, 360, 0, 365, 368, 347, 383, 353, 362, - 366, 366, 366, 367, 373, 373, 373, 369, 375, 374, - 366, 374, 377, 387, 373, 370, 0, 375, 376, 376, - 376, 378, 378, 378, 379, 383, 380, 381, 376, 377, - 382, 378, 0, 379, 380, 381, 375, 374, 382, 374, - - 377, 387, 391, 373, 388, 375, 385, 385, 385, 389, - 389, 389, 392, 379, 380, 381, 385, 376, 382, 389, - 378, 379, 380, 381, 395, 398, 382, 393, 393, 393, - 391, 373, 402, 388, 397, 397, 397, 393, 405, 408, - 402, 392, 403, 409, 397, 376, 404, 412, 378, 403, - 414, 405, 404, 395, 398, 406, 406, 406, 413, 421, - 402, 0, 407, 0, 429, 406, 405, 408, 402, 407, - 0, 403, 409, 0, 0, 404, 412, 403, 405, 414, - 404, 430, 410, 410, 410, 426, 413, 421, 415, 415, - 415, 407, 410, 429, 406, 0, 0, 407, 415, 416, - - 416, 416, 418, 418, 418, 420, 420, 420, 422, 416, - 430, 422, 418, 426, 431, 420, 423, 423, 423, 424, - 424, 424, 406, 427, 427, 427, 423, 0, 437, 424, - 432, 432, 432, 427, 436, 438, 441, 422, 439, 422, - 432, 445, 431, 448, 420, 442, 434, 434, 434, 440, - 440, 440, 442, 449, 457, 423, 434, 437, 424, 440, - 450, 0, 436, 0, 438, 441, 439, 446, 446, 446, - 445, 448, 420, 452, 442, 453, 459, 446, 453, 461, - 442, 449, 457, 423, 463, 458, 424, 458, 464, 450, - 451, 451, 451, 455, 455, 455, 462, 464, 462, 465, - - 451, 460, 452, 455, 453, 459, 453, 461, 460, 466, - 466, 467, 463, 458, 469, 458, 464, 471, 468, 474, - 0, 0, 470, 0, 462, 464, 462, 465, 468, 470, - 460, 0, 0, 472, 0, 0, 460, 466, 466, 472, - 467, 0, 0, 469, 0, 471, 531, 468, 474, 0, - 0, 470, 531, 531, 531, 0, 468, 470, 0, 0, - 0, 472, 0, 0, 0, 0, 0, 472, 0, 0, - 0, 0, 0, 0, 0, 0, 474, 477, 477, 477, - 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, - 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, - - 477, 477, 477, 477, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 479, 479, 479, 479, 479, 479, 479, 479, 479, - 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, - 479, 479, 479, 479, 479, 479, 479, 479, 480, 0, - 0, 0, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 481, 481, 481, 481, 481, - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - - 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 481, 482, 482, 482, 482, 482, 482, 482, 483, - 483, 0, 483, 483, 483, 483, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 484, 484, 484, 484, - 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 484, 485, 485, 485, 0, 0, 485, 485, - 0, 485, 0, 0, 485, 485, 485, 485, 485, 485, - 485, 485, 486, 486, 0, 0, 0, 0, 486, 486, - - 486, 486, 486, 486, 486, 487, 0, 487, 0, 0, - 0, 487, 487, 0, 487, 0, 0, 0, 0, 487, - 0, 0, 0, 487, 487, 487, 487, 487, 487, 487, - 488, 0, 488, 0, 488, 0, 488, 0, 0, 0, - 0, 0, 488, 488, 488, 488, 488, 488, 488, 489, - 0, 0, 489, 489, 0, 489, 489, 489, 0, 0, - 0, 489, 489, 489, 489, 489, 489, 489, 490, 490, - 0, 490, 490, 490, 490, 490, 490, 490, 490, 490, - 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - 490, 490, 490, 490, 490, 491, 0, 0, 0, 491, - - 0, 0, 491, 491, 0, 0, 0, 0, 491, 491, - 491, 491, 491, 491, 491, 492, 492, 492, 492, 492, - 0, 492, 492, 0, 492, 0, 0, 492, 492, 492, - 492, 492, 492, 492, 492, 493, 493, 493, 493, 493, - 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, - 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, - 493, 493, 494, 494, 494, 494, 494, 494, 494, 494, - 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, - 494, 494, 494, 494, 494, 494, 494, 494, 494, 495, - 0, 495, 495, 0, 0, 0, 0, 495, 495, 495, - - 495, 495, 495, 495, 495, 496, 496, 496, 496, 496, - 496, 496, 0, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 497, 0, 0, 0, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 497, 497, 497, 497, 498, - 0, 498, 498, 0, 0, 0, 0, 498, 498, 498, - 498, 498, 498, 498, 498, 499, 499, 499, 499, 499, - 499, 0, 499, 499, 499, 499, 499, 499, 499, 499, - 499, 499, 499, 499, 499, 499, 499, 499, 499, 499, - - 499, 499, 500, 0, 500, 0, 0, 0, 0, 500, - 500, 0, 0, 0, 0, 0, 0, 500, 500, 500, - 500, 500, 500, 500, 501, 501, 501, 501, 501, 501, - 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, - 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, - 501, 502, 502, 0, 0, 0, 0, 502, 502, 502, - 502, 502, 502, 502, 502, 503, 503, 503, 503, 503, - 503, 503, 503, 503, 503, 503, 503, 503, 503, 503, - 503, 503, 503, 503, 503, 503, 503, 503, 503, 503, - 503, 503, 504, 504, 504, 504, 504, 504, 504, 504, - - 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, - 504, 504, 504, 504, 504, 504, 504, 504, 504, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 506, 506, 0, 506, - 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, - 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, - 506, 506, 506, 507, 507, 507, 0, 0, 507, 507, - 0, 507, 0, 0, 507, 507, 507, 507, 507, 507, - 507, 507, 508, 508, 508, 0, 0, 0, 508, 508, - - 508, 508, 508, 508, 508, 509, 0, 509, 0, 0, - 0, 509, 509, 0, 509, 0, 0, 0, 0, 509, - 0, 0, 0, 509, 509, 509, 509, 509, 509, 509, - 510, 0, 510, 0, 510, 0, 510, 0, 0, 0, - 0, 0, 510, 510, 510, 510, 510, 510, 510, 511, - 511, 0, 511, 511, 511, 0, 0, 0, 511, 511, - 511, 511, 511, 511, 511, 512, 0, 0, 0, 512, - 0, 0, 0, 0, 0, 0, 0, 0, 512, 512, - 512, 512, 512, 512, 512, 513, 0, 0, 513, 0, - 513, 0, 513, 0, 513, 0, 0, 513, 513, 0, - - 513, 513, 513, 513, 513, 513, 513, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 515, 0, 0, 0, 0, 0, - 515, 515, 0, 0, 515, 515, 515, 0, 0, 0, - 515, 515, 515, 515, 515, 515, 515, 516, 0, 0, - 516, 516, 516, 516, 516, 0, 516, 516, 0, 516, - 516, 0, 516, 516, 516, 516, 516, 516, 516, 516, - 517, 517, 517, 517, 517, 0, 517, 517, 0, 517, - 0, 0, 517, 517, 517, 517, 517, 517, 517, 517, - - 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, - 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, - 518, 518, 518, 518, 518, 518, 518, 519, 0, 0, - 0, 0, 0, 0, 0, 519, 0, 0, 0, 0, - 519, 519, 519, 0, 0, 519, 519, 520, 520, 520, - 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, - 520, 520, 520, 520, 520, 520, 520, 520, 520, 520, - 520, 520, 520, 520, 521, 0, 521, 521, 0, 0, - 0, 0, 521, 521, 521, 521, 521, 521, 521, 521, - 522, 522, 522, 522, 522, 522, 522, 0, 522, 522, - - 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, - 522, 522, 522, 522, 522, 522, 522, 523, 0, 0, - 0, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 524, 0, 524, 524, 0, 0, - 0, 0, 524, 524, 524, 524, 524, 524, 524, 524, - 525, 525, 525, 525, 525, 525, 0, 525, 525, 525, - 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - 525, 525, 525, 525, 525, 525, 525, 526, 526, 0, - 0, 0, 0, 0, 0, 526, 0, 0, 0, 0, - - 0, 0, 526, 0, 0, 526, 0, 526, 527, 527, - 527, 527, 527, 527, 527, 528, 0, 0, 0, 0, - 0, 528, 528, 0, 528, 528, 0, 0, 0, 0, - 528, 528, 528, 528, 528, 528, 528, 528, 529, 529, - 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, - 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, - 529, 529, 529, 529, 529, 530, 530, 0, 0, 0, - 0, 0, 0, 530, 0, 0, 0, 0, 0, 0, - 530, 0, 0, 530, 0, 530, 532, 532, 0, 0, - 0, 0, 532, 532, 532, 532, 532, 532, 532, 532, - - 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 533, 533, 533, 533, 533, 533, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 536, 536, 536, 536, 536, 536, 536, 536, 536, - 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - - 536, 536, 536, 536, 536, 536, 536, 536, 537, 537, - 0, 537, 537, 537, 537, 537, 537, 537, 537, 537, - 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, - 537, 537, 537, 537, 537, 538, 538, 0, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 539, 539, 0, 539, 539, 539, 539, 539, - 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, - 539, 539, 539, 539, 539, 539, 539, 539, 539, 540, - 540, 0, 540, 540, 540, 540, 540, 540, 540, 540, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 541, 541, 541, 0, - 0, 541, 541, 0, 541, 0, 0, 541, 541, 541, - 541, 541, 541, 541, 541, 542, 0, 0, 542, 0, - 542, 0, 542, 0, 542, 0, 0, 542, 542, 0, - 542, 542, 542, 542, 542, 542, 542, 543, 543, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 543, 543, 543, 543, 543, 543, 543, - 544, 0, 0, 544, 544, 544, 544, 544, 0, 544, - 544, 0, 544, 544, 0, 544, 544, 544, 544, 544, - - 544, 544, 544, 545, 545, 545, 545, 545, 0, 545, - 545, 0, 545, 0, 0, 545, 545, 545, 545, 545, - 545, 545, 545, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 547, 547, 0, 0, 0, 0, 547, 547, 547, 548, - 548, 0, 0, 0, 0, 548, 548, 548, 549, 549, - 0, 0, 0, 0, 549, 549, 549, 550, 550, 0, - 0, 0, 0, 550, 550, 550, 551, 551, 551, 551, - 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, - - 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, - 551, 551, 551, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476, 476, 476, - 476, 476, 476, 476, 476, 476, 476, 476 - - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[100] = - { 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, - }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "lexer.l" -/* Lex file for rsyslog config format v2 (RainerScript). -* Please note: this file introduces the new config format, but maintains -* backward compatibility. In order to do so, the grammar is not 100% clean, -* but IMHO still sufficiently easy both to understand for programmers -* maitaining the code as well as users writing the config file. Users are, -* of course, encouraged to use new constructs only. But it needs to be noted -* that some of the legacy constructs (specifically the in-front-of-action -* PRI filter) are very hard to beat in ease of use, at least for simpler -* cases. So while we hope that cfsysline support can be dropped some time in -* the future, we will probably keep these useful constructs. -* -* Copyright 2011-2013 Rainer Gerhards and Adiscon GmbH. -* -* This file is part of the rsyslog runtime library. -* -* The rsyslog runtime library is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* The rsyslog runtime library 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with the rsyslog runtime library. If not, see . -* -* A copy of the GPL can be found in the file "COPYING" in this distribution. -* A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. -*/ -/*%option noyywrap nodefault case-insensitive */ -/* avoid compiler warning: `yyunput' defined but not used */ -#define YY_NO_INPUT 1 - -/* INOBJ is selected if we are inside an object (name/value pairs!) */ - -/* COMMENT is "the usual trick" to handle C-style comments */ - -/* INCL is in $IncludeConfig processing (skip to include file) */ - -/* LINENO: support for setting the linenumber */ - -/* INCALL: support for the call statement */ - -/* EXPR is a bit ugly, but we need it to support pre v6-syntax. The problem -* is that cfsysline statement start with $..., the same like variables in -* an expression. However, cfsysline statements can never appear inside an -* expression. So we create a specific expr mode, which is turned on after -* we lexed a keyword that needs to be followed by an expression (using -* knowledge from the upper layer...). In expr mode, we strictly do -* expression-based parsing. Expr mode is stopped when we reach a token -* that can not be part of an expression (currently only "then"). As I -* wrote this ugly, but the price needed to pay in order to remain -* compatible to the previous format. -*/ -#line 63 "lexer.l" -#include -#include -#include -#include -#include -#include "rainerscript.h" -#include "parserif.h" -#include "grammar.h" -static int preCommentState; /* save for lex state before a comment */ - -struct bufstack { - struct bufstack *prev; - YY_BUFFER_STATE bs; - int lineno; - char *fn; - es_str_t *estr; -} *currbs = NULL; - -char *cnfcurrfn; /* name of currently processed file */ - -int popfile(void); -int cnfSetLexFile(char *fname); - -extern int yydebug; - -/* somehow, I need these prototype even though the headers are - * included. I guess that's some autotools magic I don't understand... - */ -#if !defined(__FreeBSD__) -int fileno(FILE *stream); -#endif - -#line 1520 "lexer.c" - -#define INITIAL 0 -#define INOBJ 1 -#define COMMENT 2 -#define INCL 3 -#define LINENO 4 -#define INCALL 5 -#define EXPR 6 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -int yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 97 "lexer.l" - - - /* keywords */ -#line 1718 "lexer.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 477 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 3414 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - - yylineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 100 "lexer.l" -{ BEGIN EXPR; return IF; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 101 "lexer.l" -{ BEGIN INITIAL; return THEN; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 102 "lexer.l" -{ BEGIN INITIAL; return ';'; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 103 "lexer.l" -{ return OR; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 104 "lexer.l" -{ return AND; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 105 "lexer.l" -{ return NOT; } - YY_BREAK -case 7: -#line 107 "lexer.l" -case 8: -#line 108 "lexer.l" -case 9: -#line 109 "lexer.l" -case 10: -#line 110 "lexer.l" -case 11: -#line 111 "lexer.l" -case 12: -#line 112 "lexer.l" -case 13: -#line 113 "lexer.l" -case 14: -#line 114 "lexer.l" -case 15: -#line 115 "lexer.l" -case 16: -#line 116 "lexer.l" -case 17: -#line 117 "lexer.l" -case 18: -YY_RULE_SETUP -#line 117 "lexer.l" -{ return yytext[0]; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 118 "lexer.l" -{ return CMP_EQ; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 119 "lexer.l" -{ return CMP_LE; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 120 "lexer.l" -{ return CMP_GE; } - YY_BREAK -case 22: -#line 122 "lexer.l" -case 23: -YY_RULE_SETUP -#line 122 "lexer.l" -{ return CMP_NE; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 123 "lexer.l" -{ return CMP_LT; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 124 "lexer.l" -{ return CMP_GT; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 125 "lexer.l" -{ return CMP_CONTAINS; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 126 "lexer.l" -{ return CMP_CONTAINSI; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 127 "lexer.l" -{ return CMP_STARTSWITH; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 128 "lexer.l" -{ return CMP_STARTSWITHI; } - YY_BREAK -case 30: -#line 130 "lexer.l" -case 31: -#line 131 "lexer.l" -case 32: -YY_RULE_SETUP -#line 131 "lexer.l" -{ yylval.n = strtoll(yytext, NULL, 0); return NUMBER; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 132 "lexer.l" -{ yylval.s = strdup(yytext+1); return VAR; } - YY_BREAK -case 34: -/* rule 34 can match eol */ -YY_RULE_SETUP -#line 133 "lexer.l" -{ - yytext[yyleng-1] = '\0'; - unescapeStr((uchar*)yytext+1, yyleng-2); - yylval.estr = es_newStrFromBuf(yytext+1, strlen(yytext)-1); - return STRING; } - YY_BREAK -case 35: -/* rule 35 can match eol */ -YY_RULE_SETUP -#line 138 "lexer.l" -{ - yytext[yyleng-1] = '\0'; - unescapeStr((uchar*)yytext+1, yyleng-2); - yylval.estr = es_newStrFromBuf(yytext+1, strlen(yytext)-1); - return STRING; } - YY_BREAK -case 36: -/* rule 36 can match eol */ -YY_RULE_SETUP -#line 143 "lexer.l" - - YY_BREAK -case 37: -YY_RULE_SETUP -#line 144 "lexer.l" -{ yylval.estr = es_newStrFromCStr(yytext, yyleng); - return FUNC; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 146 "lexer.l" -{ parser_errmsg("invalid character '%s' in expression " - "- is there an invalid escape sequence somewhere?", - yytext); } - YY_BREAK -case 39: -/* rule 39 can match eol */ -YY_RULE_SETUP -#line 149 "lexer.l" - - YY_BREAK -case 40: -YY_RULE_SETUP -#line 150 "lexer.l" -{ parser_errmsg("invalid character '%s' in 'call' statement" - "- is there an invalid escape sequence somewhere?", - yytext); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 153 "lexer.l" -{ yylval.estr = es_newStrFromCStr(yytext, yyleng); - BEGIN INITIAL; - return NAME; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 156 "lexer.l" -{ return '&'; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 157 "lexer.l" -{ return '{'; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 158 "lexer.l" -{ return '}'; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 159 "lexer.l" -{ return STOP; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 160 "lexer.l" -{ return ELSE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 161 "lexer.l" -{ BEGIN INCALL; return CALL; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 162 "lexer.l" -{ BEGIN EXPR; return SET; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 163 "lexer.l" -{ BEGIN EXPR; return UNSET; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 164 "lexer.l" -{ return CONTINUE; } - YY_BREAK -/* line number support because the "preprocessor" combines lines and so needs - * to tell us the real source line. - */ -case 51: -YY_RULE_SETUP -#line 168 "lexer.l" -{ BEGIN LINENO; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 169 "lexer.l" -{ yylineno = atoi(yytext) - 1; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 170 "lexer.l" -{ BEGIN INITIAL; } - YY_BREAK -case 54: -/* rule 54 can match eol */ -YY_RULE_SETUP -#line 171 "lexer.l" - - YY_BREAK -/* $IncludeConfig must be detected as part of CFSYSLINE, because this is - * always the longest match :-( - */ -case 55: -/* rule 55 can match eol */ -YY_RULE_SETUP -#line 175 "lexer.l" - - YY_BREAK -case 56: -YY_RULE_SETUP -#line 176 "lexer.l" -{ if(cnfDoInclude(yytext) != 0) - yyterminate(); - BEGIN INITIAL; } - YY_BREAK -case 57: -/* rule 57 can match eol */ -YY_RULE_SETUP -#line 179 "lexer.l" -{ yylval.objType = CNFOBJ_MAINQ; - BEGIN INOBJ; return BEGINOBJ; } - YY_BREAK -case 58: -/* rule 58 can match eol */ -YY_RULE_SETUP -#line 181 "lexer.l" -{ yylval.objType = CNFOBJ_GLOBAL; - BEGIN INOBJ; return BEGINOBJ; } - YY_BREAK -case 59: -/* rule 59 can match eol */ -YY_RULE_SETUP -#line 183 "lexer.l" -{ yylval.objType = CNFOBJ_TPL; - BEGIN INOBJ; return BEGIN_TPL; } - YY_BREAK -case 60: -/* rule 60 can match eol */ -YY_RULE_SETUP -#line 185 "lexer.l" -{ yylval.objType = CNFOBJ_RULESET; - BEGIN INOBJ; return BEGIN_RULESET; } - YY_BREAK -case 61: -/* rule 61 can match eol */ -YY_RULE_SETUP -#line 187 "lexer.l" -{ yylval.objType = CNFOBJ_PROPERTY; - BEGIN INOBJ; return BEGIN_PROPERTY; } - YY_BREAK -case 62: -/* rule 62 can match eol */ -YY_RULE_SETUP -#line 189 "lexer.l" -{ yylval.objType = CNFOBJ_CONSTANT; - BEGIN INOBJ; return BEGIN_CONSTANT; } - YY_BREAK -case 63: -/* rule 63 can match eol */ -YY_RULE_SETUP -#line 191 "lexer.l" -{ yylval.objType = CNFOBJ_INPUT; - BEGIN INOBJ; return BEGINOBJ; } - YY_BREAK -case 64: -/* rule 64 can match eol */ -YY_RULE_SETUP -#line 193 "lexer.l" -{ yylval.objType = CNFOBJ_MODULE; - BEGIN INOBJ; return BEGINOBJ; } - YY_BREAK -case 65: -/* rule 65 can match eol */ -YY_RULE_SETUP -#line 195 "lexer.l" -{ yylval.objType = CNFOBJ_LOOKUP_TABLE; - BEGIN INOBJ; return BEGINOBJ; } - YY_BREAK -case 66: -/* rule 66 can match eol */ -YY_RULE_SETUP -#line 197 "lexer.l" -{ BEGIN INOBJ; return BEGIN_ACTION; } - YY_BREAK -case 67: -/* rule 67 can match eol */ -YY_RULE_SETUP -#line 198 "lexer.l" -{ - yylval.s = strdup(rmLeadingSpace(yytext)); - dbgprintf("lexer: propfilt is '%s'\n", yylval.s); - return PROPFILT; - } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 203 "lexer.l" -{ yylval.s = strdup(rmLeadingSpace(yytext)); return PRIFILT; } - YY_BREAK -case 69: -#line 205 "lexer.l" -case 70: -#line 206 "lexer.l" -case 71: -/* rule 71 can match eol */ -#line 207 "lexer.l" -case 72: -/* rule 72 can match eol */ -#line 208 "lexer.l" -case 73: -/* rule 73 can match eol */ -#line 209 "lexer.l" -case 74: -/* rule 74 can match eol */ -#line 210 "lexer.l" -case 75: -/* rule 75 can match eol */ -YY_RULE_SETUP -#line 210 "lexer.l" -{ yylval.s = yytext; return LEGACY_ACTION; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 211 "lexer.l" -{ BEGIN INITIAL; return ENDOBJ; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 212 "lexer.l" -{ yylval.estr = es_newStrFromCStr(yytext, yyleng); - return NAME; } - YY_BREAK -case 78: -#line 215 "lexer.l" -case 79: -#line 216 "lexer.l" -case 80: -#line 217 "lexer.l" -case 81: -YY_RULE_SETUP -#line 217 "lexer.l" -{ return(yytext[0]); } - YY_BREAK -case 82: -/* rule 82 can match eol */ -YY_RULE_SETUP -#line 218 "lexer.l" -{ - yytext[yyleng-1] = '\0'; - unescapeStr((uchar*)yytext+1, yyleng-2); - yylval.estr = es_newStrFromBuf(yytext+1, strlen(yytext)-1); - return STRING; } - YY_BREAK -/*yylval.estr = es_newStrFromBuf(yytext+1, yyleng-2); - return VALUE; }*/ -case 83: -YY_RULE_SETUP -#line 225 "lexer.l" -{ preCommentState = YY_START; BEGIN COMMENT; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 226 "lexer.l" -{ preCommentState = YY_START; BEGIN COMMENT; } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 227 "lexer.l" -{ preCommentState = YY_START; BEGIN COMMENT; } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 228 "lexer.l" -{ BEGIN preCommentState; } - YY_BREAK -case 87: -/* rule 87 can match eol */ -YY_RULE_SETUP -#line 229 "lexer.l" - - YY_BREAK -case 88: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 230 "lexer.l" -/* skip comments in input */ - YY_BREAK -case 89: -/* rule 89 can match eol */ -YY_RULE_SETUP -#line 231 "lexer.l" - - YY_BREAK -case 90: -YY_RULE_SETUP -#line 232 "lexer.l" -{ parser_errmsg("invalid character '%s' in object definition " - "- is there an invalid escape sequence somewhere?", - yytext); } - YY_BREAK -case 91: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 235 "lexer.l" -{ /* see comment on $IncludeConfig above */ - if(!strncasecmp(yytext, "$includeconfig ", 14)) { - yyless(14); - BEGIN INCL; - } else if(!strncasecmp(yytext, "$ruleset ", 9)) { - yylval.s = strdup(yytext); - return LEGACY_RULESET; - } else { - cnfDoCfsysline(strdup(yytext)); - } - } - YY_BREAK -case 92: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 246 "lexer.l" -{ yylval.s = strdup(yytext); return BSD_TAG_SELECTOR; } - YY_BREAK -case 93: -/* rule 93 can match eol */ -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 247 "lexer.l" -{ yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } - YY_BREAK -case 94: -/* rule 94 can match eol */ -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 248 "lexer.l" -{ yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } - YY_BREAK -case 95: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 249 "lexer.l" -{ yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } - YY_BREAK -case 96: -/* rule 96 can match eol */ -YY_RULE_SETUP -#line 250 "lexer.l" -/* skip comments in input */ - YY_BREAK -case 97: -/* rule 97 can match eol */ -YY_RULE_SETUP -#line 251 "lexer.l" -/* drop whitespace */ - YY_BREAK -case 98: -YY_RULE_SETUP -#line 252 "lexer.l" -{ parser_errmsg("invalid character '%s' " - "- is there an invalid escape sequence somewhere?", - yytext); } - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(INOBJ): -case YY_STATE_EOF(COMMENT): -case YY_STATE_EOF(INCL): -case YY_STATE_EOF(LINENO): -case YY_STATE_EOF(INCALL): -case YY_STATE_EOF(EXPR): -#line 255 "lexer.l" -{ if(popfile() != 0) yyterminate(); } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 257 "lexer.l" -YY_FATAL_ERROR( "flex scanner jammed" ); - YY_BREAK -#line 2352 "lexer.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 477 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 477 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 476); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - - yylineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void yyset_lineno (int line_number ) -{ - - yylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str ) -{ - yyin = in_str ; -} - -void yyset_out (FILE * out_str ) -{ - yyout = out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int bdebug ) -{ - yy_flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - /* We do not touch yylineno unless the option is enabled. */ - yylineno = 1; - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 257 "lexer.l" - - -int -cnfParseBuffer(char *buf, unsigned lenBuf) -{ - struct bufstack *bs; - int r = 0; - yydebug = 1; - BEGIN INITIAL; - /* maintain stack */ - if((bs = malloc(sizeof(struct bufstack))) == NULL) { - r = 1; - goto done; - } - - if(currbs != NULL) - currbs->lineno = yylineno; - bs->prev = currbs; - bs->fn = strdup("*buffer*"); - bs->bs = yy_scan_buffer(buf,lenBuf); - bs->estr = NULL; - currbs = bs; - cnfcurrfn = bs->fn; - yylineno = 1; -done: return r; -} - -/* set a new buffers. Returns 0 on success, something else otherwise. */ -int -cnfSetLexFile(char *fname) -{ - es_str_t *str = NULL; - FILE *fp; - int r = 0; - struct bufstack *bs; - - if(fname == NULL) { - fp = stdin; - } else { - if((fp = fopen(fname, "r")) == NULL) { - r = 1; - goto done; - } - } - readConfFile(fp, &str); - if(fp != stdin) - fclose(fp); - - /* maintain stack */ - if((bs = malloc(sizeof(struct bufstack))) == NULL) { - r = 1; - goto done; - } - - if(currbs != NULL) - currbs->lineno = yylineno; - bs->prev = currbs; - bs->fn = strdup(fname == NULL ? "stdin" : fname); - bs->bs = yy_scan_buffer((char*)es_getBufAddr(str),es_strlen(str)); - bs->estr = str; /* needed so we can free it later */ - currbs = bs; - cnfcurrfn = bs->fn; - yylineno = 1; - dbgprintf("config parser: pushed file %s on top of stack\n", fname); - -done: - if(r != 0) { - if(str != NULL) - es_deleteStr(str); - } - return r; -} - - -/* returns 0 on success, something else otherwise */ -int -popfile(void) -{ - struct bufstack *bs = currbs; - - if(bs == NULL) - return 1; - - /* delete current entry. But we must not free the file name if - * this is the top-level file, because then it may still be used - * in error messages for other processing steps. - * TODO: change this to another method which stores the file - * name inside the config objects. In the longer term, this is - * necessary, as otherwise we may provide wrong file name information - * at the end of include files as well. -- rgerhards, 2011-07-22 - */ - dbgprintf("config parser: reached end of file %s\n", bs->fn); - yy_delete_buffer(bs->bs); - if(bs->prev != NULL) - free(bs->fn); - free(bs->estr); - - /* switch back to previous */ - currbs = bs->prev; - free(bs); - - if(currbs == NULL) { - dbgprintf("config parser: parsing completed\n"); - return 1; /* all processed */ - } - - yy_switch_to_buffer(currbs->bs); - yylineno = currbs->lineno; - cnfcurrfn = currbs->fn; - dbgprintf("config parser: resume parsing of file %s at line %d\n", - cnfcurrfn, yylineno); - return 0; -} - -void -tellLexEndParsing(void) -{ - free(cnfcurrfn); - cnfcurrfn= NULL; -} - diff -Nru rsyslog-7.6.0/grammar/lexer.l rsyslog-5.10.1/grammar/lexer.l --- rsyslog-7.6.0/grammar/lexer.l 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/grammar/lexer.l 1970-01-01 00:00:00.000000000 +0000 @@ -1,375 +0,0 @@ - /* Lex file for rsyslog config format v2 (RainerScript). - * Please note: this file introduces the new config format, but maintains - * backward compatibility. In order to do so, the grammar is not 100% clean, - * but IMHO still sufficiently easy both to understand for programmers - * maitaining the code as well as users writing the config file. Users are, - * of course, encouraged to use new constructs only. But it needs to be noted - * that some of the legacy constructs (specifically the in-front-of-action - * PRI filter) are very hard to beat in ease of use, at least for simpler - * cases. So while we hope that cfsysline support can be dropped some time in - * the future, we will probably keep these useful constructs. - * - * Copyright 2011-2013 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * The rsyslog runtime library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The rsyslog runtime library 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the rsyslog runtime library. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. - */ - -%option noyywrap nodefault case-insensitive yylineno - /*%option noyywrap nodefault case-insensitive */ - -/* avoid compiler warning: `yyunput' defined but not used */ -%option nounput noinput - - -%x INOBJ - /* INOBJ is selected if we are inside an object (name/value pairs!) */ -%x COMMENT - /* COMMENT is "the usual trick" to handle C-style comments */ -%x INCL - /* INCL is in $IncludeConfig processing (skip to include file) */ -%x LINENO - /* LINENO: support for setting the linenumber */ -%x INCALL - /* INCALL: support for the call statement */ -%x EXPR - /* EXPR is a bit ugly, but we need it to support pre v6-syntax. The problem - * is that cfsysline statement start with $..., the same like variables in - * an expression. However, cfsysline statements can never appear inside an - * expression. So we create a specific expr mode, which is turned on after - * we lexed a keyword that needs to be followed by an expression (using - * knowledge from the upper layer...). In expr mode, we strictly do - * expression-based parsing. Expr mode is stopped when we reach a token - * that can not be part of an expression (currently only "then"). As I - * wrote this ugly, but the price needed to pay in order to remain - * compatible to the previous format. - */ -%{ -#include -#include -#include -#include -#include -#include "rainerscript.h" -#include "parserif.h" -#include "grammar.h" -static int preCommentState; /* save for lex state before a comment */ - -struct bufstack { - struct bufstack *prev; - YY_BUFFER_STATE bs; - int lineno; - char *fn; - es_str_t *estr; -} *currbs = NULL; - -char *cnfcurrfn; /* name of currently processed file */ - -int popfile(void); -int cnfSetLexFile(char *fname); - -extern int yydebug; - -/* somehow, I need these prototype even though the headers are - * included. I guess that's some autotools magic I don't understand... - */ -#if !defined(__FreeBSD__) -int fileno(FILE *stream); -#endif - -%} - -%% - - /* keywords */ -"if" { BEGIN EXPR; return IF; } -"then" { BEGIN INITIAL; return THEN; } -";" { BEGIN INITIAL; return ';'; } -"or" { return OR; } -"and" { return AND; } -"not" { return NOT; } -"=" | -"," | -"*" | -"/" | -"%" | -"+" | -"&" | -"-" | -"[" | -"]" | -"(" | -")" { return yytext[0]; } -"==" { return CMP_EQ; } -"<=" { return CMP_LE; } -">=" { return CMP_GE; } -"!=" | -"<>" { return CMP_NE; } -"<" { return CMP_LT; } -">" { return CMP_GT; } -"contains" { return CMP_CONTAINS; } -"contains_i" { return CMP_CONTAINSI; } -"startswith" { return CMP_STARTSWITH; } -"startswith_i" { return CMP_STARTSWITHI; } -0[0-7]+ | /* octal number */ -0x[0-7a-f] | /* hex number, following rule is dec; strtoll handles all! */ -([1-9][0-9]*|0) { yylval.n = strtoll(yytext, NULL, 0); return NUMBER; } -\$[$!./]{0,1}[a-z][!a-z0-9\-_\.]* { yylval.s = strdup(yytext+1); return VAR; } -\'([^'\\]|\\['"\\$bntr]|\\x[0-9a-f][0-9a-f]|\\[0-7][0-7][0-7])*\' { - yytext[yyleng-1] = '\0'; - unescapeStr((uchar*)yytext+1, yyleng-2); - yylval.estr = es_newStrFromBuf(yytext+1, strlen(yytext)-1); - return STRING; } -\"([^"\\$]|\\["'\\$bntr]|\\x[0-9a-f][0-9a-f]|\\[0-7][0-7][0-7])*\" { - yytext[yyleng-1] = '\0'; - unescapeStr((uchar*)yytext+1, yyleng-2); - yylval.estr = es_newStrFromBuf(yytext+1, strlen(yytext)-1); - return STRING; } -[ \t\n] -[a-z][a-z0-9_]* { yylval.estr = es_newStrFromCStr(yytext, yyleng); - return FUNC; } -. { parser_errmsg("invalid character '%s' in expression " - "- is there an invalid escape sequence somewhere?", - yytext); } -[ \t\n] -. { parser_errmsg("invalid character '%s' in 'call' statement" - "- is there an invalid escape sequence somewhere?", - yytext); } -[a-zA-Z][a-zA-Z0-9_\.]* { yylval.estr = es_newStrFromCStr(yytext, yyleng); - BEGIN INITIAL; - return NAME; } -"&" { return '&'; } -"{" { return '{'; } -"}" { return '}'; } -"stop" { return STOP; } -"else" { return ELSE; } -"call" { BEGIN INCALL; return CALL; } -"set" { BEGIN EXPR; return SET; } -"unset" { BEGIN EXPR; return UNSET; } -"continue" { return CONTINUE; } - /* line number support because the "preprocessor" combines lines and so needs - * to tell us the real source line. - */ -"preprocfilelinenumber(" { BEGIN LINENO; } -[0-9]+ { yylineno = atoi(yytext) - 1; } -")" { BEGIN INITIAL; } -.|\n - /* $IncludeConfig must be detected as part of CFSYSLINE, because this is - * always the longest match :-( - */ -.|\n -[^ \t\n]+ { if(cnfDoInclude(yytext) != 0) - yyterminate(); - BEGIN INITIAL; } -"main_queue"[ \n\t]*"(" { yylval.objType = CNFOBJ_MAINQ; - BEGIN INOBJ; return BEGINOBJ; } -"global"[ \n\t]*"(" { yylval.objType = CNFOBJ_GLOBAL; - BEGIN INOBJ; return BEGINOBJ; } -"template"[ \n\t]*"(" { yylval.objType = CNFOBJ_TPL; - BEGIN INOBJ; return BEGIN_TPL; } -"ruleset"[ \n\t]*"(" { yylval.objType = CNFOBJ_RULESET; - BEGIN INOBJ; return BEGIN_RULESET; } -"property"[ \n\t]*"(" { yylval.objType = CNFOBJ_PROPERTY; - BEGIN INOBJ; return BEGIN_PROPERTY; } -"constant"[ \n\t]*"(" { yylval.objType = CNFOBJ_CONSTANT; - BEGIN INOBJ; return BEGIN_CONSTANT; } -"input"[ \n\t]*"(" { yylval.objType = CNFOBJ_INPUT; - BEGIN INOBJ; return BEGINOBJ; } -"module"[ \n\t]*"(" { yylval.objType = CNFOBJ_MODULE; - BEGIN INOBJ; return BEGINOBJ; } -"lookup_table"[ \n\t]*"(" { yylval.objType = CNFOBJ_LOOKUP_TABLE; - BEGIN INOBJ; return BEGINOBJ; } -"action"[ \n\t]*"(" { BEGIN INOBJ; return BEGIN_ACTION; } -^[ \t]*:\$?[a-z\-]+[ ]*,[ ]*!?[a-z]+[ ]*,[ ]*\"(\\\"|[^\"])*\" { - yylval.s = strdup(rmLeadingSpace(yytext)); - dbgprintf("lexer: propfilt is '%s'\n", yylval.s); - return PROPFILT; - } -^[ \t]*[\*a-z][\*a-z]*[0-7]*[\.,][,!=;\.\*a-z0-7]+ { yylval.s = strdup(rmLeadingSpace(yytext)); return PRIFILT; } -"~" | -"*" | -\-\/[^*][^\n]* | -\/[^*][^\n]* | -:[a-z0-9]+:[^\n]* | -[\|\.\-\@\^?~>][^\n]+ | -[a-z0-9_][a-z0-9_\-\+,;]* { yylval.s = yytext; return LEGACY_ACTION; } -")" { BEGIN INITIAL; return ENDOBJ; } -[a-z][a-z0-9_\.]* { yylval.estr = es_newStrFromCStr(yytext, yyleng); - return NAME; } -"," | -"[" | -"]" | -"=" { return(yytext[0]); } -\"([^"\\]|\\['"?\\abfnrtv]|\\[0-7]{1,3})*\" { - yytext[yyleng-1] = '\0'; - unescapeStr((uchar*)yytext+1, yyleng-2); - yylval.estr = es_newStrFromBuf(yytext+1, strlen(yytext)-1); - return STRING; } - /*yylval.estr = es_newStrFromBuf(yytext+1, yyleng-2); - return VALUE; }*/ -"/*" { preCommentState = YY_START; BEGIN COMMENT; } -"/*" { preCommentState = YY_START; BEGIN COMMENT; } -"/*" { preCommentState = YY_START; BEGIN COMMENT; } -"*/" { BEGIN preCommentState; } -([^*]|\n)+|. -#.*$ /* skip comments in input */ -[ \n\t] -. { parser_errmsg("invalid character '%s' in object definition " - "- is there an invalid escape sequence somewhere?", - yytext); } -\$[a-z]+.*$ { /* see comment on $IncludeConfig above */ - if(!strncasecmp(yytext, "$includeconfig ", 14)) { - yyless(14); - BEGIN INCL; - } else if(!strncasecmp(yytext, "$ruleset ", 9)) { - yylval.s = strdup(yytext); - return LEGACY_RULESET; - } else { - cnfDoCfsysline(strdup(yytext)); - } - } -![^ \t\n]+[ \t]*$ { yylval.s = strdup(yytext); return BSD_TAG_SELECTOR; } -[+-]\*[ \t\n]*#.*$ { yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } -[+-]\*[ \t\n]*$ { yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } -^[ \t]*[+-][a-z0-9.:-]+[ \t]*$ { yylval.s = strdup(yytext); return BSD_HOST_SELECTOR; } -\#.*\n /* skip comments in input */ -[\n\t ] /* drop whitespace */ -. { parser_errmsg("invalid character '%s' " - "- is there an invalid escape sequence somewhere?", - yytext); } -<> { if(popfile() != 0) yyterminate(); } - -%% -int -cnfParseBuffer(char *buf, unsigned lenBuf) -{ - struct bufstack *bs; - int r = 0; - yydebug = 1; - BEGIN INITIAL; - /* maintain stack */ - if((bs = malloc(sizeof(struct bufstack))) == NULL) { - r = 1; - goto done; - } - - if(currbs != NULL) - currbs->lineno = yylineno; - bs->prev = currbs; - bs->fn = strdup("*buffer*"); - bs->bs = yy_scan_buffer(buf, lenBuf); - bs->estr = NULL; - currbs = bs; - cnfcurrfn = bs->fn; - yylineno = 1; -done: return r; -} - -/* set a new buffers. Returns 0 on success, something else otherwise. */ -int -cnfSetLexFile(char *fname) -{ - es_str_t *str = NULL; - FILE *fp; - int r = 0; - struct bufstack *bs; - - if(fname == NULL) { - fp = stdin; - } else { - if((fp = fopen(fname, "r")) == NULL) { - r = 1; - goto done; - } - } - readConfFile(fp, &str); - if(fp != stdin) - fclose(fp); - - /* maintain stack */ - if((bs = malloc(sizeof(struct bufstack))) == NULL) { - r = 1; - goto done; - } - - if(currbs != NULL) - currbs->lineno = yylineno; - bs->prev = currbs; - bs->fn = strdup(fname == NULL ? "stdin" : fname); - bs->bs = yy_scan_buffer((char*)es_getBufAddr(str), es_strlen(str)); - bs->estr = str; /* needed so we can free it later */ - currbs = bs; - cnfcurrfn = bs->fn; - yylineno = 1; - dbgprintf("config parser: pushed file %s on top of stack\n", fname); - -done: - if(r != 0) { - if(str != NULL) - es_deleteStr(str); - } - return r; -} - - -/* returns 0 on success, something else otherwise */ -int -popfile(void) -{ - struct bufstack *bs = currbs; - - if(bs == NULL) - return 1; - - /* delete current entry. But we must not free the file name if - * this is the top-level file, because then it may still be used - * in error messages for other processing steps. - * TODO: change this to another method which stores the file - * name inside the config objects. In the longer term, this is - * necessary, as otherwise we may provide wrong file name information - * at the end of include files as well. -- rgerhards, 2011-07-22 - */ - dbgprintf("config parser: reached end of file %s\n", bs->fn); - yy_delete_buffer(bs->bs); - if(bs->prev != NULL) - free(bs->fn); - free(bs->estr); - - /* switch back to previous */ - currbs = bs->prev; - free(bs); - - if(currbs == NULL) { - dbgprintf("config parser: parsing completed\n"); - return 1; /* all processed */ - } - - yy_switch_to_buffer(currbs->bs); - yylineno = currbs->lineno; - cnfcurrfn = currbs->fn; - dbgprintf("config parser: resume parsing of file %s at line %d\n", - cnfcurrfn, yylineno); - return 0; -} - -void -tellLexEndParsing(void) -{ - free(cnfcurrfn); - cnfcurrfn= NULL; -} diff -Nru rsyslog-7.6.0/grammar/Makefile.am rsyslog-5.10.1/grammar/Makefile.am --- rsyslog-7.6.0/grammar/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/grammar/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -BUILT_SOURCES = grammar.h -CLEANFILES = grammar.h grammar.c -AM_YFLAGS = -d -noinst_LTLIBRARIES = libgrammar.la -#bin_PROGRAMS = testdriver # TODO: make this conditional - -libgrammar_la_SOURCES = \ - grammar.y \ - lexer.l \ - rainerscript.c \ - rainerscript.h \ - parserif.h \ - grammar.h -libgrammar_la_CPPFLAGS = $(RSRT_CFLAGS) - -#testdriver_SOURCES = testdriver.c libgrammar.la -#testdriver_CPPFLAGS = $(RSRT_CFLAGS) -#testdriver_LDADD = libgrammar.la -#testdriver_LDFLAGS = -lestr diff -Nru rsyslog-7.6.0/grammar/Makefile.in rsyslog-5.10.1/grammar/Makefile.in --- rsyslog-7.6.0/grammar/Makefile.in 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/grammar/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,640 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = grammar -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in grammar.c \ - grammar.h lexer.c -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libgrammar_la_LIBADD = -am_libgrammar_la_OBJECTS = libgrammar_la-grammar.lo \ - libgrammar_la-lexer.lo libgrammar_la-rainerscript.lo -libgrammar_la_OBJECTS = $(am_libgrammar_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) -LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) -AM_V_LEX = $(am__v_LEX_@AM_V@) -am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) -am__v_LEX_0 = @echo " LEX " $@; -YLWRAP = $(top_srcdir)/ylwrap -YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) -LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) -AM_V_YACC = $(am__v_YACC_@AM_V@) -am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) -am__v_YACC_0 = @echo " YACC " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libgrammar_la_SOURCES) -DIST_SOURCES = $(libgrammar_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -BUILT_SOURCES = grammar.h -CLEANFILES = grammar.h grammar.c -AM_YFLAGS = -d -noinst_LTLIBRARIES = libgrammar.la -#bin_PROGRAMS = testdriver # TODO: make this conditional -libgrammar_la_SOURCES = \ - grammar.y \ - lexer.l \ - rainerscript.c \ - rainerscript.h \ - parserif.h \ - grammar.h - -libgrammar_la_CPPFLAGS = $(RSRT_CFLAGS) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu grammar/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu grammar/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -grammar.h: grammar.c - @if test ! -f $@; then rm -f grammar.c; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) grammar.c; else :; fi -libgrammar.la: $(libgrammar_la_OBJECTS) $(libgrammar_la_DEPENDENCIES) $(EXTRA_libgrammar_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libgrammar_la_OBJECTS) $(libgrammar_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrammar_la-grammar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrammar_la-lexer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrammar_la-rainerscript.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libgrammar_la-grammar.lo: grammar.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgrammar_la-grammar.lo -MD -MP -MF $(DEPDIR)/libgrammar_la-grammar.Tpo -c -o libgrammar_la-grammar.lo `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgrammar_la-grammar.Tpo $(DEPDIR)/libgrammar_la-grammar.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='grammar.c' object='libgrammar_la-grammar.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-grammar.lo `test -f 'grammar.c' || echo '$(srcdir)/'`grammar.c - -libgrammar_la-lexer.lo: lexer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgrammar_la-lexer.lo -MD -MP -MF $(DEPDIR)/libgrammar_la-lexer.Tpo -c -o libgrammar_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgrammar_la-lexer.Tpo $(DEPDIR)/libgrammar_la-lexer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lexer.c' object='libgrammar_la-lexer.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-lexer.lo `test -f 'lexer.c' || echo '$(srcdir)/'`lexer.c - -libgrammar_la-rainerscript.lo: rainerscript.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgrammar_la-rainerscript.lo -MD -MP -MF $(DEPDIR)/libgrammar_la-rainerscript.Tpo -c -o libgrammar_la-rainerscript.lo `test -f 'rainerscript.c' || echo '$(srcdir)/'`rainerscript.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgrammar_la-rainerscript.Tpo $(DEPDIR)/libgrammar_la-rainerscript.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rainerscript.c' object='libgrammar_la-rainerscript.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgrammar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgrammar_la-rainerscript.lo `test -f 'rainerscript.c' || echo '$(srcdir)/'`rainerscript.c - -.l.c: - $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) - -.y.c: - $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -rm -f grammar.c - -rm -f grammar.h - -rm -f lexer.c - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: all check install install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am - - -#testdriver_SOURCES = testdriver.c libgrammar.la -#testdriver_CPPFLAGS = $(RSRT_CFLAGS) -#testdriver_LDADD = libgrammar.la -#testdriver_LDFLAGS = -lestr - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/grammar/parserif.h rsyslog-5.10.1/grammar/parserif.h --- rsyslog-7.6.0/grammar/parserif.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/grammar/parserif.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#ifndef PARSERIF_H_DEFINED -#define PARSERIF_H_DEFINED -#include "rainerscript.h" -int cnfSetLexFile(char*); -int yyparse(); -char *cnfcurrfn; -void dbgprintf(char *fmt, ...) __attribute__((format(printf, 1, 2))); -void parser_errmsg(char *fmt, ...) __attribute__((format(printf, 1, 2))); -void parser_warnmsg(char *fmt, ...) __attribute__((format(printf, 1, 2))); -void tellLexEndParsing(void); -extern int yydebug; -extern int yylineno; - -/* entry points to be called after the parser has processed the - * element in question. Actual processing must than be done inside - * these functions. - */ -void cnfDoObj(struct cnfobj *o); -void cnfDoScript(struct cnfstmt *script); -void cnfDoCfsysline(char *ln); -void cnfDoBSDTag(char *ln); -void cnfDoBSDHost(char *ln); -#endif diff -Nru rsyslog-7.6.0/grammar/rainerscript.c rsyslog-5.10.1/grammar/rainerscript.c --- rsyslog-7.6.0/grammar/rainerscript.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/grammar/rainerscript.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4046 +0,0 @@ -/* rainerscript.c - routines to support RainerScript config language - * - * Module begun 2011-07-01 by Rainer Gerhards - * - * Copyright 2011-2013 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * The rsyslog runtime library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The rsyslog runtime library 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the rsyslog runtime library. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. - */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "rsyslog.h" -#include "rainerscript.h" -#include "conf.h" -#include "parserif.h" -#include "parse.h" -#include "rsconf.h" -#include "grammar.h" -#include "queue.h" -#include "srUtils.h" -#include "regexp.h" -#include "obj.h" -#include "modules.h" -#include "ruleset.h" -#include "msg.h" -#include "unicode-helper.h" - -DEFobjCurrIf(obj) -DEFobjCurrIf(regexp) - -struct cnfexpr* cnfexprOptimize(struct cnfexpr *expr); -static void cnfstmtOptimizePRIFilt(struct cnfstmt *stmt); -static void cnfarrayPrint(struct cnfarray *ar, int indent); -struct cnffunc * cnffuncNew_prifilt(int fac); - -/* debug support: convert token to a human-readable string. Note that - * this function only supports a single thread due to a static buffer. - * This is deemed a solid solution, as it is intended to be used during - * startup, only. - * NOTE: This function MUST be updated if new tokens are defined in the - * grammar. - */ -char * -tokenToString(int token) -{ - char *tokstr; - static char tokbuf[512]; - - switch(token) { - case NAME: tokstr = "NAME"; break; - case FUNC: tokstr = "FUNC"; break; - case BEGINOBJ: tokstr ="BEGINOBJ"; break; - case ENDOBJ: tokstr ="ENDOBJ"; break; - case BEGIN_ACTION: tokstr ="BEGIN_ACTION"; break; - case BEGIN_PROPERTY: tokstr ="BEGIN_PROPERTY"; break; - case BEGIN_CONSTANT: tokstr ="BEGIN_CONSTANT"; break; - case BEGIN_TPL: tokstr ="BEGIN_TPL"; break; - case BEGIN_RULESET: tokstr ="BEGIN_RULESET"; break; - case STOP: tokstr ="STOP"; break; - case SET: tokstr ="SET"; break; - case UNSET: tokstr ="UNSET"; break; - case CONTINUE: tokstr ="CONTINUE"; break; - case CALL: tokstr ="CALL"; break; - case LEGACY_ACTION: tokstr ="LEGACY_ACTION"; break; - case LEGACY_RULESET: tokstr ="LEGACY_RULESET"; break; - case PRIFILT: tokstr ="PRIFILT"; break; - case PROPFILT: tokstr ="PROPFILT"; break; - case IF: tokstr ="IF"; break; - case THEN: tokstr ="THEN"; break; - case ELSE: tokstr ="ELSE"; break; - case OR: tokstr ="OR"; break; - case AND: tokstr ="AND"; break; - case NOT: tokstr ="NOT"; break; - case VAR: tokstr ="VAR"; break; - case STRING: tokstr ="STRING"; break; - case NUMBER: tokstr ="NUMBER"; break; - case CMP_EQ: tokstr ="CMP_EQ"; break; - case CMP_NE: tokstr ="CMP_NE"; break; - case CMP_LE: tokstr ="CMP_LE"; break; - case CMP_GE: tokstr ="CMP_GE"; break; - case CMP_LT: tokstr ="CMP_LT"; break; - case CMP_GT: tokstr ="CMP_GT"; break; - case CMP_CONTAINS: tokstr ="CMP_CONTAINS"; break; - case CMP_CONTAINSI: tokstr ="CMP_CONTAINSI"; break; - case CMP_STARTSWITH: tokstr ="CMP_STARTSWITH"; break; - case CMP_STARTSWITHI: tokstr ="CMP_STARTSWITHI"; break; - case UMINUS: tokstr ="UMINUS"; break; - default: snprintf(tokbuf, sizeof(tokbuf), "%c[%d]", token, token); - tokstr = tokbuf; break; - } - return tokstr; -} - - -char* -getFIOPName(unsigned iFIOP) -{ - char *pRet; - switch(iFIOP) { - case FIOP_CONTAINS: - pRet = "contains"; - break; - case FIOP_ISEQUAL: - pRet = "isequal"; - break; - case FIOP_STARTSWITH: - pRet = "startswith"; - break; - case FIOP_REGEX: - pRet = "regex"; - break; - case FIOP_EREREGEX: - pRet = "ereregex"; - break; - case FIOP_ISEMPTY: - pRet = "isempty"; - break; - default: - pRet = "NOP"; - break; - } - return pRet; -} - - -/* This function takes the filter part of a property - * based filter and decodes it. It processes the line up to the beginning - * of the action part. - */ -static rsRetVal -DecodePropFilter(uchar *pline, struct cnfstmt *stmt) -{ - rsParsObj *pPars = NULL; - cstr_t *pCSCompOp = NULL; - cstr_t *pCSPropName = NULL; - int iOffset; /* for compare operations */ - DEFiRet; - - ASSERT(pline != NULL); - - DBGPRINTF("Decoding property-based filter '%s'\n", pline); - - /* create parser object starting with line string without leading colon */ - if((iRet = rsParsConstructFromSz(&pPars, pline+1)) != RS_RET_OK) { - parser_errmsg("error %d constructing parser object", iRet); - ABORT_FINALIZE(iRet); - } - - /* read property */ - iRet = parsDelimCStr(pPars, &pCSPropName, ',', 1, 1, 1); - if(iRet != RS_RET_OK) { - parser_errmsg("error %d parsing filter property", iRet); - rsParsDestruct(pPars); - ABORT_FINALIZE(iRet); - } - CHKiRet(msgPropDescrFill(&stmt->d.s_propfilt.prop, cstrGetSzStrNoNULL(pCSPropName), - cstrLen(pCSPropName))); - - /* read operation */ - iRet = parsDelimCStr(pPars, &pCSCompOp, ',', 1, 1, 1); - if(iRet != RS_RET_OK) { - parser_errmsg("error %d compare operation property - ignoring selector", iRet); - rsParsDestruct(pPars); - ABORT_FINALIZE(iRet); - } - - /* we now first check if the condition is to be negated. To do so, we first - * must make sure we have at least one char in the param and then check the - * first one. - * rgerhards, 2005-09-26 - */ - if(rsCStrLen(pCSCompOp) > 0) { - if(*rsCStrGetBufBeg(pCSCompOp) == '!') { - stmt->d.s_propfilt.isNegated = 1; - iOffset = 1; /* ignore '!' */ - } else { - stmt->d.s_propfilt.isNegated = 0; - iOffset = 0; - } - } else { - stmt->d.s_propfilt.isNegated = 0; - iOffset = 0; - } - - if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "contains", 8)) { - stmt->d.s_propfilt.operation = FIOP_CONTAINS; - } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "isequal", 7)) { - stmt->d.s_propfilt.operation = FIOP_ISEQUAL; - } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "isempty", 7)) { - stmt->d.s_propfilt.operation = FIOP_ISEMPTY; - } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "startswith", 10)) { - stmt->d.s_propfilt.operation = FIOP_STARTSWITH; - } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (unsigned char*) "regex", 5)) { - stmt->d.s_propfilt.operation = FIOP_REGEX; - } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (unsigned char*) "ereregex", 8)) { - stmt->d.s_propfilt.operation = FIOP_EREREGEX; - } else { - parser_errmsg("error: invalid compare operation '%s'", - (char*) rsCStrGetSzStrNoNULL(pCSCompOp)); - ABORT_FINALIZE(RS_RET_ERR); - } - - if(stmt->d.s_propfilt.operation != FIOP_ISEMPTY) { - /* read compare value */ - iRet = parsQuotedCStr(pPars, &stmt->d.s_propfilt.pCSCompValue); - if(iRet != RS_RET_OK) { - parser_errmsg("error %d compare value property", iRet); - rsParsDestruct(pPars); - ABORT_FINALIZE(iRet); - } - } - -finalize_it: - if(pPars != NULL) - rsParsDestruct(pPars); - if(pCSCompOp != NULL) - rsCStrDestruct(&pCSCompOp); - if(pCSPropName != NULL) - cstrDestruct(&pCSPropName); - RETiRet; -} - -static void -prifiltInvert(struct funcData_prifilt *prifilt) -{ - int i; - for(i = 0 ; i < LOG_NFACILITIES+1 ; ++i) { - prifilt->pmask[i] = ~prifilt->pmask[i]; - } -} - -/* set prifilt so that it matches for some severities, sev is its numerical - * value. Mode is one of the compop tokens CMP_EQ, CMP_LT, CMP_LE, CMP_GT, - * CMP_GE, CMP_NE. - */ -static void -prifiltSetSeverity(struct funcData_prifilt *prifilt, int sev, int mode) -{ - static int lessthanmasks[] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; - int i; - for(i = 0 ; i < LOG_NFACILITIES+1 ; ++i) { - if(mode == CMP_EQ || mode == CMP_NE) - prifilt->pmask[i] = 1 << sev; - else if(mode == CMP_LT) - prifilt->pmask[i] = lessthanmasks[sev]; - else if(mode == CMP_LE) - prifilt->pmask[i] = lessthanmasks[sev+1]; - else if(mode == CMP_GT) - prifilt->pmask[i] = ~lessthanmasks[sev+1]; - else if(mode == CMP_GE) - prifilt->pmask[i] = ~lessthanmasks[sev]; - else - DBGPRINTF("prifiltSetSeverity: program error, invalid mode %s\n", - tokenToString(mode)); - } - if(mode == CMP_NE) - prifiltInvert(prifilt); -} - -/* set prifilt so that it matches for some facilities, fac is its numerical - * value. Mode is one of the compop tokens CMP_EQ, CMP_LT, CMP_LE, CMP_GT, - * CMP_GE, CMP_NE. For the given facilities, all severities are enabled. - * NOTE: fac MUST be in the range 0..24 (not multiplied by 8)! - */ -static void -prifiltSetFacility(struct funcData_prifilt *prifilt, int fac, int mode) -{ - int i; - - memset(prifilt->pmask, 0, sizeof(prifilt->pmask)); - switch(mode) { - case CMP_EQ: - prifilt->pmask[fac] = TABLE_ALLPRI; - break; - case CMP_NE: - prifilt->pmask[fac] = TABLE_ALLPRI; - prifiltInvert(prifilt); - break; - case CMP_LT: - for(i = 0 ; i < fac ; ++i) - prifilt->pmask[i] = TABLE_ALLPRI; - break; - case CMP_LE: - for(i = 0 ; i < fac+1 ; ++i) - prifilt->pmask[i] = TABLE_ALLPRI; - break; - case CMP_GE: - for(i = fac ; i < LOG_NFACILITIES+1 ; ++i) - prifilt->pmask[i] = TABLE_ALLPRI; - break; - case CMP_GT: - for(i = fac+1 ; i < LOG_NFACILITIES+1 ; ++i) - prifilt->pmask[i] = TABLE_ALLPRI; - break; - default:break; - } -} - -/* combine a prifilt with AND/OR (the respective token values are - * used to keep things simple). - */ -static void -prifiltCombine(struct funcData_prifilt *prifilt, struct funcData_prifilt *prifilt2, int mode) -{ - int i; - for(i = 0 ; i < LOG_NFACILITIES+1 ; ++i) { - if(mode == AND) - prifilt->pmask[i] = prifilt->pmask[i] & prifilt2->pmask[i]; - else - prifilt->pmask[i] = prifilt->pmask[i] | prifilt2->pmask[i]; - } -} - - -void -readConfFile(FILE *fp, es_str_t **str) -{ - char ln[10240]; - char buf[512]; - int lenBuf; - int bWriteLineno = 0; - int len, i; - int start; /* start index of to be submitted text */ - int bContLine = 0; - int lineno = 0; - - *str = es_newStr(4096); - - while(fgets(ln, sizeof(ln), fp) != NULL) { - ++lineno; - if(bWriteLineno) { - bWriteLineno = 0; - lenBuf = sprintf(buf, "PreprocFileLineNumber(%d)\n", lineno); - es_addBuf(str, buf, lenBuf); - } - len = strlen(ln); - /* if we are continuation line, we need to drop leading WS */ - if(bContLine) { - for(start = 0 ; start < len && isspace(ln[start]) ; ++start) - /* JUST SCAN */; - } else { - start = 0; - } - for(i = len - 1 ; i >= start && isspace(ln[i]) ; --i) - /* JUST SCAN */; - if(i >= 0) { - if(ln[i] == '\\') { - --i; - bContLine = 1; - } else { - if(bContLine) /* write line number if we had cont line */ - bWriteLineno = 1; - bContLine = 0; - } - /* add relevant data to buffer */ - es_addBuf(str, ln+start, i+1 - start); - } - if(!bContLine) - es_addChar(str, '\n'); - } - /* indicate end of buffer to flex */ - es_addChar(str, '\0'); - es_addChar(str, '\0'); -} - -/* comparison function for qsort() and bsearch() string array compare */ -static int -qs_arrcmp(const void *s1, const void *s2) -{ - return es_strcmp(*((es_str_t**)s1), *((es_str_t**)s2)); -} - - -struct objlst* -objlstNew(struct cnfobj *o) -{ - struct objlst *lst; - - if((lst = malloc(sizeof(struct objlst))) != NULL) { - lst->next = NULL; - lst->obj = o; - } -cnfobjPrint(o); - - return lst; -} - -/* add object to end of object list, always returns pointer to root object */ -struct objlst* -objlstAdd(struct objlst *root, struct cnfobj *o) -{ - struct objlst *l; - struct objlst *newl; - - newl = objlstNew(o); - if(root == 0) { - root = newl; - } else { /* find last, linear search ok, as only during config phase */ - for(l = root ; l->next != NULL ; l = l->next) - ; - l->next = newl; - } - return root; -} - -/* add stmt to current script, always return root stmt pointer */ -struct cnfstmt* -scriptAddStmt(struct cnfstmt *root, struct cnfstmt *s) -{ - struct cnfstmt *l; - - if(root == NULL) { - root = s; - } else { /* find last, linear search ok, as only during config phase */ - for(l = root ; l->next != NULL ; l = l->next) - ; - l->next = s; - } - return root; -} - -void -objlstDestruct(struct objlst *lst) -{ - struct objlst *toDel; - - while(lst != NULL) { - toDel = lst; - lst = lst->next; - cnfobjDestruct(toDel->obj); - free(toDel); - } -} - -void -objlstPrint(struct objlst *lst) -{ - dbgprintf("objlst %p:\n", lst); - while(lst != NULL) { - cnfobjPrint(lst->obj); - lst = lst->next; - } -} - -struct nvlst* -nvlstNewStr(es_str_t *value) -{ - struct nvlst *lst; - - if((lst = malloc(sizeof(struct nvlst))) != NULL) { - lst->next = NULL; - lst->val.datatype = 'S'; - lst->val.d.estr = value; - lst->bUsed = 0; - } - - return lst; -} - -struct nvlst* -nvlstNewArray(struct cnfarray *ar) -{ - struct nvlst *lst; - - if((lst = malloc(sizeof(struct nvlst))) != NULL) { - lst->next = NULL; - lst->val.datatype = 'A'; - lst->val.d.ar = ar; - lst->bUsed = 0; - } - - return lst; -} - -struct nvlst* -nvlstSetName(struct nvlst *lst, es_str_t *name) -{ - lst->name = name; - return lst; -} - -void -nvlstDestruct(struct nvlst *lst) -{ - struct nvlst *toDel; - - while(lst != NULL) { - toDel = lst; - lst = lst->next; - es_deleteStr(toDel->name); - varDelete(&toDel->val); - free(toDel); - } -} - -void -nvlstPrint(struct nvlst *lst) -{ - char *name, *value; - dbgprintf("nvlst %p:\n", lst); - while(lst != NULL) { - name = es_str2cstr(lst->name, NULL); - switch(lst->val.datatype) { - case 'A': - dbgprintf("\tname: '%s':\n", name); - cnfarrayPrint(lst->val.d.ar, 5); - break; - case 'S': - value = es_str2cstr(lst->val.d.estr, NULL); - dbgprintf("\tname: '%s', value '%s'\n", name, value); - free(value); - break; - default:dbgprintf("nvlstPrint: unknown type '%s'\n", - tokenToString(lst->val.datatype)); - break; - } - free(name); - lst = lst->next; - } -} - -/* find a name starting at node lst. Returns node with this - * name or NULL, if none found. - */ -struct nvlst* -nvlstFindName(struct nvlst *lst, es_str_t *name) -{ - while(lst != NULL && es_strcmp(lst->name, name)) - lst = lst->next; - return lst; -} - - -/* find a name starting at node lst. Same as nvlstFindName, but - * for classical C strings. This is useful because the config system - * uses C string constants. - */ -static inline struct nvlst* -nvlstFindNameCStr(struct nvlst *lst, char *name) -{ - es_size_t lenName = strlen(name); - while(lst != NULL && es_strcasebufcmp(lst->name, (uchar*)name, lenName)) - lst = lst->next; - return lst; -} - - -/* check if there are duplicate names inside a nvlst and emit - * an error message, if so. - */ -static inline void -nvlstChkDupes(struct nvlst *lst) -{ - char *cstr; - - while(lst != NULL) { - if(nvlstFindName(lst->next, lst->name) != NULL) { - cstr = es_str2cstr(lst->name, NULL); - parser_errmsg("duplicate parameter '%s' -- " - "interpretation is ambigious, one value " - "will be randomly selected. Fix this problem.", - cstr); - free(cstr); - } - lst = lst->next; - } -} - - -/* check for unused params and emit error message is found. This must - * be called after all config params have been pulled from the object - * (otherwise the flags are not correctly set). - */ -void -nvlstChkUnused(struct nvlst *lst) -{ - char *cstr; - - while(lst != NULL) { - if(!lst->bUsed) { - cstr = es_str2cstr(lst->name, NULL); - parser_errmsg("parameter '%s' not known -- " - "typo in config file?", - cstr); - free(cstr); - } - lst = lst->next; - } -} - - -static inline int -doGetSize(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - unsigned char *c; - es_size_t i; - long long n; - int r; - c = es_getBufAddr(valnode->val.d.estr); - n = 0; - i = 0; - while(i < es_strlen(valnode->val.d.estr) && isdigit(*c)) { - n = 10 * n + *c - '0'; - ++i; - ++c; - } - if(i < es_strlen(valnode->val.d.estr)) { - ++i; - switch(*c) { - /* traditional binary-based definitions */ - case 'k': n *= 1024; break; - case 'm': n *= 1024 * 1024; break; - case 'g': n *= 1024 * 1024 * 1024; break; - case 't': n *= (int64) 1024 * 1024 * 1024 * 1024; break; /* tera */ - case 'p': n *= (int64) 1024 * 1024 * 1024 * 1024 * 1024; break; /* peta */ - case 'e': n *= (int64) 1024 * 1024 * 1024 * 1024 * 1024 * 1024; break; /* exa */ - /* and now the "new" 1000-based definitions */ - case 'K': n *= 1000; break; - case 'M': n *= 1000000; break; - case 'G': n *= 1000000000; break; - /* we need to use the multiplication below because otherwise - * the compiler gets an error during constant parsing */ - case 'T': n *= (int64) 1000 * 1000000000; break; /* tera */ - case 'P': n *= (int64) 1000000 * 1000000000; break; /* peta */ - case 'E': n *= (int64) 1000000000 * 1000000000; break; /* exa */ - default: --i; break; /* indicates error */ - } - } - if(i == es_strlen(valnode->val.d.estr)) { - val->val.datatype = 'N'; - val->val.d.n = n; - r = 1; - } else { - parser_errmsg("parameter '%s' does not contain a valid size", - param->name); - r = 0; - } - return r; -} - - -static inline int -doGetBinary(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - int r = 1; - val->val.datatype = 'N'; - if(!es_strbufcmp(valnode->val.d.estr, (unsigned char*) "on", 2)) { - val->val.d.n = 1; - } else if(!es_strbufcmp(valnode->val.d.estr, (unsigned char*) "off", 3)) { - val->val.d.n = 0; - } else { - parser_errmsg("parameter '%s' must be \"on\" or \"off\" but " - "is neither. Results unpredictable.", param->name); - val->val.d.n = 0; - r = 0; - } - return r; -} - -static inline int -doGetQueueType(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - char *cstr; - int r = 1; - if(!es_strcasebufcmp(valnode->val.d.estr, (uchar*)"fixedarray", 10)) { - val->val.d.n = QUEUETYPE_FIXED_ARRAY; - } else if(!es_strcasebufcmp(valnode->val.d.estr, (uchar*)"linkedlist", 10)) { - val->val.d.n = QUEUETYPE_LINKEDLIST; - } else if(!es_strcasebufcmp(valnode->val.d.estr, (uchar*)"disk", 4)) { - val->val.d.n = QUEUETYPE_DISK; - } else if(!es_strcasebufcmp(valnode->val.d.estr, (uchar*)"direct", 6)) { - val->val.d.n = QUEUETYPE_DIRECT; - } else { - cstr = es_str2cstr(valnode->val.d.estr, NULL); - parser_errmsg("param '%s': unknown queue type: '%s'", - param->name, cstr); - free(cstr); - r = 0; - } - val->val.datatype = 'N'; - return r; -} - - -/* A file create-mode must be a four-digit octal number - * starting with '0'. - */ -static inline int -doGetFileCreateMode(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - int fmtOK = 0; - char *cstr; - uchar *c; - - if(es_strlen(valnode->val.d.estr) == 4) { - c = es_getBufAddr(valnode->val.d.estr); - if( (c[0] == '0') - && (c[1] >= '0' && c[1] <= '7') - && (c[2] >= '0' && c[2] <= '7') - && (c[3] >= '0' && c[3] <= '7') ) { - fmtOK = 1; - } - } - - if(fmtOK) { - val->val.datatype = 'N'; - val->val.d.n = (c[1]-'0') * 64 + (c[2]-'0') * 8 + (c[3]-'0'); - } else { - cstr = es_str2cstr(valnode->val.d.estr, NULL); - parser_errmsg("file modes need to be specified as " - "4-digit octal numbers starting with '0' -" - "parameter '%s=\"%s\"' is not a file mode", - param->name, cstr); - free(cstr); - } - return fmtOK; -} - -static inline int -doGetGID(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - char *cstr; - int r; - struct group *resultBuf; - struct group wrkBuf; - char stringBuf[2048]; /* 2048 has been proven to be large enough */ - - cstr = es_str2cstr(valnode->val.d.estr, NULL); - getgrnam_r(cstr, &wrkBuf, stringBuf, sizeof(stringBuf), &resultBuf); - if(resultBuf == NULL) { - parser_errmsg("parameter '%s': ID for group %s could not " - "be found", param->name, cstr); - r = 0; - } else { - val->val.datatype = 'N'; - val->val.d.n = resultBuf->gr_gid; - dbgprintf("param '%s': uid %d obtained for group '%s'\n", - param->name, (int) resultBuf->gr_gid, cstr); - r = 1; - } - free(cstr); - return r; -} - -static inline int -doGetUID(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - char *cstr; - int r; - struct passwd *resultBuf; - struct passwd wrkBuf; - char stringBuf[2048]; /* 2048 has been proven to be large enough */ - - cstr = es_str2cstr(valnode->val.d.estr, NULL); - getpwnam_r(cstr, &wrkBuf, stringBuf, sizeof(stringBuf), &resultBuf); - if(resultBuf == NULL) { - parser_errmsg("parameter '%s': ID for user %s could not " - "be found", param->name, cstr); - r = 0; - } else { - val->val.datatype = 'N'; - val->val.d.n = resultBuf->pw_uid; - dbgprintf("param '%s': uid %d obtained for user '%s'\n", - param->name, (int) resultBuf->pw_uid, cstr); - r = 1; - } - free(cstr); - return r; -} - -/* note: we support all integer formats that es_str2num support, - * so hex and octal representations are also valid. - */ -static inline int -doGetInt(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - long long n; - int bSuccess; - - n = es_str2num(valnode->val.d.estr, &bSuccess); - if(!bSuccess) { - parser_errmsg("parameter '%s' is not a proper number", - param->name); - } - val->val.datatype = 'N'; - val->val.d.n = n; - return bSuccess; -} - -static inline int -doGetNonNegInt(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - int bSuccess; - - if((bSuccess = doGetInt(valnode, param, val))) { - if(val->val.d.n < 0) { - parser_errmsg("parameter '%s' cannot be less than zero (was %lld)", - param->name, val->val.d.n); - bSuccess = 0; - } - } - return bSuccess; -} - -static inline int -doGetPositiveInt(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - int bSuccess; - - if((bSuccess = doGetInt(valnode, param, val))) { - if(val->val.d.n < 1) { - parser_errmsg("parameter '%s' cannot be less than one (was %lld)", - param->name, val->val.d.n); - bSuccess = 0; - } - } - return bSuccess; -} - -static inline int -doGetWord(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - es_size_t i; - int r = 1; - unsigned char *c; - - val->val.datatype = 'S'; - val->val.d.estr = es_newStr(32); - c = es_getBufAddr(valnode->val.d.estr); - for(i = 0 ; i < es_strlen(valnode->val.d.estr) && !isspace(c[i]) ; ++i) { - es_addChar(&val->val.d.estr, c[i]); - } - if(i != es_strlen(valnode->val.d.estr)) { - parser_errmsg("parameter '%s' contains whitespace, which is not " - "permitted", - param->name); - r = 0; - } - return r; -} - -static inline int -doGetArray(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - int r = 1; - - switch(valnode->val.datatype) { - case 'S': - /* a constant string is assumed to be a single-element array */ - val->val.datatype = 'A'; - val->val.d.ar = cnfarrayNew(es_strdup(valnode->val.d.estr)); - break; - case 'A': - val->val.datatype = 'A'; - val->val.d.ar = cnfarrayDup(valnode->val.d.ar); - break; - default:parser_errmsg("parameter '%s' must be an array, but is a " - "different datatype", param->name); - r = 0; - break; - } - return r; -} - -static inline int -doGetChar(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - int r = 1; - if(es_strlen(valnode->val.d.estr) != 1) { - parser_errmsg("parameter '%s' must contain exactly one character " - "but contains %d - cannot be processed", - param->name, es_strlen(valnode->val.d.estr)); - r = 0; - } - val->val.datatype = 'S'; - val->val.d.estr = es_strdup(valnode->val.d.estr); - return r; -} - -/* get a single parameter according to its definition. Helper to - * nvlstGetParams. returns 1 if success, 0 otherwise - */ -static inline int -nvlstGetParam(struct nvlst *valnode, struct cnfparamdescr *param, - struct cnfparamvals *val) -{ - uchar *cstr; - int r; - - DBGPRINTF("nvlstGetParam: name '%s', type %d, valnode->bUsed %d\n", - param->name, (int) param->type, valnode->bUsed); - if(valnode->val.datatype != 'S' && param->type != eCmdHdlrArray) { - parser_errmsg("parameter '%s' is not a string, which is not " - "permitted", - param->name); - r = 0; - goto done; - } - valnode->bUsed = 1; - val->bUsed = 1; - switch(param->type) { - case eCmdHdlrQueueType: - r = doGetQueueType(valnode, param, val); - break; - case eCmdHdlrUID: - r = doGetUID(valnode, param, val); - break; - case eCmdHdlrGID: - r = doGetGID(valnode, param, val); - break; - case eCmdHdlrBinary: - r = doGetBinary(valnode, param, val); - break; - case eCmdHdlrFileCreateMode: - r = doGetFileCreateMode(valnode, param, val); - break; - case eCmdHdlrInt: - r = doGetInt(valnode, param, val); - break; - case eCmdHdlrNonNegInt: - r = doGetNonNegInt(valnode, param, val); - break; - case eCmdHdlrPositiveInt: - r = doGetPositiveInt(valnode, param, val); - break; - case eCmdHdlrSize: - r = doGetSize(valnode, param, val); - break; - case eCmdHdlrGetChar: - r = doGetChar(valnode, param, val); - break; - case eCmdHdlrFacility: - cstr = (uchar*) es_str2cstr(valnode->val.d.estr, NULL); - val->val.datatype = 'N'; - val->val.d.n = decodeSyslogName(cstr, syslogFacNames); - free(cstr); - r = 1; - break; - case eCmdHdlrSeverity: - cstr = (uchar*) es_str2cstr(valnode->val.d.estr, NULL); - val->val.datatype = 'N'; - val->val.d.n = decodeSyslogName(cstr, syslogPriNames); - free(cstr); - r = 1; - break; - case eCmdHdlrGetWord: - r = doGetWord(valnode, param, val); - break; - case eCmdHdlrString: - val->val.datatype = 'S'; - val->val.d.estr = es_strdup(valnode->val.d.estr); - r = 1; - break; - case eCmdHdlrArray: - r = doGetArray(valnode, param, val); - break; - case eCmdHdlrGoneAway: - parser_errmsg("parameter '%s' is no longer supported", - param->name); - r = 1; /* this *is* valid! */ - break; - default: - dbgprintf("error: invalid param type\n"); - r = 0; - break; - } -done: return r; -} - - -/* obtain conf params from an nvlst and emit error messages if - * necessary. If an already-existing param value is passed, that is - * used. If NULL is passed instead, a new one is allocated. In that case, - * it is the caller's duty to free it when no longer needed. - * NULL is returned on error, otherwise a pointer to the vals array. - */ -struct cnfparamvals* -nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params, - struct cnfparamvals *vals) -{ - int i; - int bValsWasNULL; - int bInError = 0; - struct nvlst *valnode; - struct cnfparamdescr *param; - - if(params->version != CNFPARAMBLK_VERSION) { - dbgprintf("nvlstGetParams: invalid param block version " - "%d, expected %d\n", - params->version, CNFPARAMBLK_VERSION); - return NULL; - } - - if(vals == NULL) { - bValsWasNULL = 1; - if((vals = calloc(params->nParams, - sizeof(struct cnfparamvals))) == NULL) - return NULL; - } else { - bValsWasNULL = 0; - } - - for(i = 0 ; i < params->nParams ; ++i) { - param = params->descr + i; - if((valnode = nvlstFindNameCStr(lst, param->name)) == NULL) { - if(param->flags & CNFPARAM_REQUIRED) { - parser_errmsg("parameter '%s' required but not specified - " - "fix config", param->name); - bInError = 1; - } - continue; - } - if(vals[i].bUsed) { - parser_errmsg("parameter '%s' specified more than once - " - "one instance is ignored. Fix config", param->name); - continue; - } - if(!nvlstGetParam(valnode, param, vals + i)) { - bInError = 1; - } - } - - if(bInError) { - if(bValsWasNULL) - cnfparamvalsDestruct(vals, params); - vals = NULL; - } - - return vals; -} - - -/* check if at least one cnfparamval is actually set - * returns 1 if so, 0 otherwise - */ -int -cnfparamvalsIsSet(struct cnfparamblk *params, struct cnfparamvals *vals) -{ - int i; - - if(vals == NULL) - return 0; - if(params->version != CNFPARAMBLK_VERSION) { - dbgprintf("nvlstGetParams: invalid param block version " - "%d, expected %d\n", - params->version, CNFPARAMBLK_VERSION); - return 0; - } - for(i = 0 ; i < params->nParams ; ++i) { - if(vals[i].bUsed) - return 1; - } - return 0; -} - - -void -cnfparamsPrint(struct cnfparamblk *params, struct cnfparamvals *vals) -{ - int i; - char *cstr; - - for(i = 0 ; i < params->nParams ; ++i) { - dbgprintf("%s: ", params->descr[i].name); - if(vals[i].bUsed) { - // TODO: other types! - switch(vals[i].val.datatype) { - case 'S': - cstr = es_str2cstr(vals[i].val.d.estr, NULL); - dbgprintf(" '%s'", cstr); - free(cstr); - break; - case 'A': - cnfarrayPrint(vals[i].val.d.ar, 0); - break; - case 'N': - dbgprintf("%lld", vals[i].val.d.n); - break; - default: - dbgprintf("(unsupported datatype %c)", - vals[i].val.datatype); - } - } else { - dbgprintf("(unset)"); - } - dbgprintf("\n"); - } -} - -struct cnfobj* -cnfobjNew(enum cnfobjType objType, struct nvlst *lst) -{ - struct cnfobj *o; - - if((o = malloc(sizeof(struct nvlst))) != NULL) { - nvlstChkDupes(lst); - o->objType = objType; - o->nvlst = lst; - o->subobjs = NULL; - o->script = NULL; - } - - return o; -} - -void -cnfobjDestruct(struct cnfobj *o) -{ - if(o != NULL) { - nvlstDestruct(o->nvlst); - objlstDestruct(o->subobjs); - free(o); - } -} - -void -cnfobjPrint(struct cnfobj *o) -{ - dbgprintf("obj: '%s'\n", cnfobjType2str(o->objType)); - nvlstPrint(o->nvlst); -} - - -struct cnfexpr* -cnfexprNew(unsigned nodetype, struct cnfexpr *l, struct cnfexpr *r) -{ - struct cnfexpr *expr; - - /* optimize some constructs during parsing */ - if(nodetype == 'M' && r->nodetype == 'N') { - ((struct cnfnumval*)r)->val *= -1; - expr = r; - goto done; - } - - if((expr = malloc(sizeof(struct cnfexpr))) != NULL) { - expr->nodetype = nodetype; - expr->l = l; - expr->r = r; - } -done: - return expr; -} - - -/* ensure that retval is a number; if string is no number, - * try to convert it to one. The semantics from es_str2num() - * are used (bSuccess tells if the conversion went well or not). - */ -static long long -var2Number(struct var *r, int *bSuccess) -{ - long long n; - if(r->datatype == 'S') { - n = es_str2num(r->d.estr, bSuccess); - } else { - if(r->datatype == 'J') { -#ifdef HAVE_JSON_OBJECT_NEW_INT64 - n = (r->d.json == NULL) ? 0 : json_object_get_int64(r->d.json); -#else /* HAVE_JSON_OBJECT_NEW_INT64 */ - n = (r->d.json == NULL) ? 0 : json_object_get_int(r->d.json); -#endif /* HAVE_JSON_OBJECT_NEW_INT64 */ - } else { - n = r->d.n; - } - if(bSuccess != NULL) - *bSuccess = 1; - } - return n; -} - -/* ensure that retval is a string - */ -static inline es_str_t * -var2String(struct var *r, int *bMustFree) -{ - es_str_t *estr; - char *cstr; - rs_size_t lenstr; - if(r->datatype == 'N') { - *bMustFree = 1; - estr = es_newStrFromNumber(r->d.n); - } else if(r->datatype == 'J') { - *bMustFree = 1; - if(r->d.json == NULL) { - cstr = "", - lenstr = 0; - } else { - cstr = (char*)json_object_get_string(r->d.json); - lenstr = strlen(cstr); - } - estr = es_newStrFromCStr(cstr, lenstr); - } else { - *bMustFree = 0; - estr = r->d.estr; - } - return estr; -} - -static uchar* -var2CString(struct var *r, int *bMustFree) -{ - uchar *cstr; - es_str_t *estr; - estr = var2String(r, bMustFree); - cstr = (uchar*) es_str2cstr(estr, NULL); - if(*bMustFree) - es_deleteStr(estr); - *bMustFree = 1; - return cstr; -} - -/* frees struct var members, but not the struct itself. This is because - * it usually is allocated on the stack. Callers why dynamically allocate - * struct var need to free the struct themselfes! - */ -static void -varFreeMembers(struct var *r) -{ - /* Note: we do NOT need to free JSON objects, as we use - * json_object_object_get() to obtain the values, which does not - * increment the reference count. So json_object_put() [free] is - * neither required nor permitted (would free the original object!). - * So for the time being the string data type is the only one that - * we currently need to free. - */ - if(r->datatype == 'S') es_deleteStr(r->d.estr); -} - -static rsRetVal -doExtractFieldByChar(uchar *str, uchar delim, int matchnbr, uchar **resstr) -{ - int iCurrFld; - int iLen; - uchar *pBuf; - uchar *pFld; - uchar *pFldEnd; - DEFiRet; - - /* first, skip to the field in question */ - iCurrFld = 1; - pFld = str; - while(*pFld && iCurrFld < matchnbr) { - /* skip fields until the requested field or end of string is found */ - while(*pFld && (uchar) *pFld != delim) - ++pFld; /* skip to field terminator */ - if(*pFld == delim) { - ++pFld; /* eat it */ - ++iCurrFld; - } - } - dbgprintf("field() field requested %d, field found %d\n", matchnbr, iCurrFld); - - if(iCurrFld == matchnbr) { - /* field found, now extract it */ - /* first of all, we need to find the end */ - pFldEnd = pFld; - while(*pFldEnd && *pFldEnd != delim) - ++pFldEnd; - --pFldEnd; /* we are already at the delimiter - so we need to - * step back a little not to copy it as part of the field. */ - /* we got our end pointer, now do the copy */ - iLen = pFldEnd - pFld + 1; /* the +1 is for an actual char, NOT \0! */ - CHKmalloc(pBuf = MALLOC((iLen + 1) * sizeof(char))); - /* now copy */ - memcpy(pBuf, pFld, iLen); - pBuf[iLen] = '\0'; /* terminate it */ - *resstr = pBuf; - } else { - ABORT_FINALIZE(RS_RET_FIELD_NOT_FOUND); - } -finalize_it: - RETiRet; -} - - -static rsRetVal -doExtractFieldByStr(uchar *str, char *delim, rs_size_t lenDelim, int matchnbr, uchar **resstr) -{ - int iCurrFld; - int iLen; - uchar *pBuf; - uchar *pFld; - uchar *pFldEnd; - DEFiRet; - - /* first, skip to the field in question */ - iCurrFld = 1; - pFld = str; - while(pFld != NULL && iCurrFld < matchnbr) { - if((pFld = (uchar*) strstr((char*)pFld, delim)) != NULL) { - pFld += lenDelim; - ++iCurrFld; - } - } - dbgprintf("field() field requested %d, field found %d\n", matchnbr, iCurrFld); - - if(iCurrFld == matchnbr) { - /* field found, now extract it */ - /* first of all, we need to find the end */ - pFldEnd = (uchar*) strstr((char*)pFld, delim); - if(pFldEnd == NULL) { - iLen = strlen((char*) pFld); - } else { /* found delmiter! Note that pFldEnd *is* already on - * the first delmi char, we don't need that. */ - iLen = pFldEnd - pFld; - } - /* we got our end pointer, now do the copy */ - CHKmalloc(pBuf = MALLOC((iLen + 1) * sizeof(char))); - /* now copy */ - memcpy(pBuf, pFld, iLen); - pBuf[iLen] = '\0'; /* terminate it */ - *resstr = pBuf; - } else { - ABORT_FINALIZE(RS_RET_FIELD_NOT_FOUND); - } -finalize_it: - RETiRet; -} - -static inline void -doFunc_re_extract(struct cnffunc *func, struct var *ret, void* usrptr) -{ - size_t submatchnbr; - short matchnbr; - regmatch_t pmatch[50]; - int bMustFree; - es_str_t *estr; - char *str; - struct var r[CNFFUNC_MAX_ARGS]; - int iLenBuf; - unsigned iOffs; - short iTry = 0; - uchar bFound = 0; - iOffs = 0; - sbool bHadNoMatch = 0; - - cnfexprEval(func->expr[0], &r[0], usrptr); - /* search string is already part of the compiled regex, so we don't - * need it here! - */ - cnfexprEval(func->expr[2], &r[2], usrptr); - cnfexprEval(func->expr[3], &r[3], usrptr); - str = (char*) var2CString(&r[0], &bMustFree); - matchnbr = (short) var2Number(&r[2], NULL); - submatchnbr = (size_t) var2Number(&r[3], NULL); - if(submatchnbr >= sizeof(pmatch)/sizeof(regmatch_t)) { - DBGPRINTF("re_extract() submatch %d is too large\n", submatchnbr); - bHadNoMatch = 1; - goto finalize_it; - } - - /* first see if we find a match, iterating through the series of - * potential matches over the string. - */ - while(!bFound) { - int iREstat; - iREstat = regexp.regexec(func->funcdata, (char*)(str + iOffs), - submatchnbr+1, pmatch, 0); - dbgprintf("re_extract: regexec return is %d\n", iREstat); - if(iREstat == 0) { - if(pmatch[0].rm_so == -1) { - dbgprintf("oops ... start offset of successful regexec is -1\n"); - break; - } - if(iTry == matchnbr) { - bFound = 1; - } else { - dbgprintf("re_extract: regex found at offset %d, new offset %d, tries %d\n", - iOffs, (int) (iOffs + pmatch[0].rm_eo), iTry); - iOffs += pmatch[0].rm_eo; - ++iTry; - } - } else { - break; - } - } - dbgprintf("re_extract: regex: end search, found %d\n", bFound); - if(!bFound) { - bHadNoMatch = 1; - goto finalize_it; - } else { - /* Match- but did it match the one we wanted? */ - /* we got no match! */ - if(pmatch[submatchnbr].rm_so == -1) { - bHadNoMatch = 1; - goto finalize_it; - } - /* OK, we have a usable match - we now need to malloc pB */ - iLenBuf = pmatch[submatchnbr].rm_eo - pmatch[submatchnbr].rm_so; - estr = es_newStrFromBuf(str + iOffs + pmatch[submatchnbr].rm_so, - iLenBuf); - } - -finalize_it: - if(bMustFree) free(str); - varFreeMembers(&r[0]); - varFreeMembers(&r[2]); - varFreeMembers(&r[3]); - - if(bHadNoMatch) { - cnfexprEval(func->expr[4], &r[4], usrptr); - estr = var2String(&r[4], &bMustFree); - /* Note that we do NOT free the string that was returned/created - * for r[4]. We pass it to the caller, which in turn frees it. - * This saves us doing one unnecessary memory alloc & write. - */ - } - ret->datatype = 'S'; - ret->d.estr = estr; - return; -} - - -/* note that we do not need to evaluate any parameters, as the template pointer - * is set during initialization(). - * TODO: think if we can keep our buffer; but that may not be trival thinking about - * multiple threads. - */ -static void -doFunc_exec_template(struct cnffunc *__restrict__ const func, - struct var *__restrict__ const ret, - msg_t *const pMsg) -{ - rsRetVal localRet; - uchar *pBuf = NULL; - size_t lenBuf = 0; - - localRet = tplToString(func->funcdata, pMsg, &pBuf, &lenBuf, NULL); - if(localRet == RS_RET_OK) { - ret->d.estr = es_newStrFromCStr((char*)pBuf, ustrlen(pBuf)); - } else { - ret->d.estr = es_newStrFromCStr("", 0); - } - ret->datatype = 'S'; - free(pBuf); - - return; -} - - -/* Perform a function call. This has been moved out of cnfExprEval in order - * to keep the code small and easier to maintain. - */ -static inline void -doFuncCall(struct cnffunc *func, struct var *ret, void* usrptr) -{ - char *fname; - char *envvar; - int bMustFree; - es_str_t *estr; - char *str; - uchar *resStr; - int retval; - struct var r[CNFFUNC_MAX_ARGS]; - int delim; - int matchnbr; - struct funcData_prifilt *pPrifilt; - rsRetVal localRet; - - dbgprintf("rainerscript: executing function id %d\n", func->fID); - switch(func->fID) { - case CNFFUNC_STRLEN: - if(func->expr[0]->nodetype == 'S') { - /* if we already have a string, we do not need to - * do one more recursive call. - */ - ret->d.n = es_strlen(((struct cnfstringval*) func->expr[0])->estr); - } else { - cnfexprEval(func->expr[0], &r[0], usrptr); - estr = var2String(&r[0], &bMustFree); - ret->d.n = es_strlen(estr); - if(bMustFree) es_deleteStr(estr); - if(r[0].datatype == 'S') es_deleteStr(r[0].d.estr); - } - ret->datatype = 'N'; - break; - case CNFFUNC_GETENV: - /* note: the optimizer shall have replaced calls to getenv() - * with a constant argument to a single string (once obtained via - * getenv()). So we do NOT need to check if there is just a - * string following. - */ - cnfexprEval(func->expr[0], &r[0], usrptr); - estr = var2String(&r[0], &bMustFree); - str = (char*) es_str2cstr(estr, NULL); - envvar = getenv(str); - if(envvar == NULL) { - ret->d.estr = es_newStr(0); - } else { - ret->d.estr = es_newStrFromCStr(envvar, strlen(envvar)); - } - ret->datatype = 'S'; - if(bMustFree) es_deleteStr(estr); - varFreeMembers(&r[0]); - free(str); - break; - case CNFFUNC_TOLOWER: - cnfexprEval(func->expr[0], &r[0], usrptr); - estr = var2String(&r[0], &bMustFree); - if(!bMustFree) /* let caller handle that M) */ - estr = es_strdup(estr); - es_tolower(estr); - ret->datatype = 'S'; - ret->d.estr = estr; - varFreeMembers(&r[0]); - break; - case CNFFUNC_CSTR: - cnfexprEval(func->expr[0], &r[0], usrptr); - estr = var2String(&r[0], &bMustFree); - if(!bMustFree) /* let caller handle that M) */ - estr = es_strdup(estr); - ret->datatype = 'S'; - ret->d.estr = estr; - varFreeMembers(&r[0]); - break; - case CNFFUNC_CNUM: - if(func->expr[0]->nodetype == 'N') { - ret->d.n = ((struct cnfnumval*)func->expr[0])->val; - } else if(func->expr[0]->nodetype == 'S') { - ret->d.n = es_str2num(((struct cnfstringval*) func->expr[0])->estr, - NULL); - } else { - cnfexprEval(func->expr[0], &r[0], usrptr); - ret->d.n = var2Number(&r[0], NULL); - varFreeMembers(&r[0]); - } - ret->datatype = 'N'; - break; - case CNFFUNC_RE_MATCH: - cnfexprEval(func->expr[0], &r[0], usrptr); - str = (char*) var2CString(&r[0], &bMustFree); - retval = regexp.regexec(func->funcdata, str, 0, NULL, 0); - if(retval == 0) - ret->d.n = 1; - else { - ret->d.n = 0; - if(retval != REG_NOMATCH) { - DBGPRINTF("re_match: regexec returned error %d\n", retval); - } - } - ret->datatype = 'N'; - if(bMustFree) free(str); - varFreeMembers(&r[0]); - break; - case CNFFUNC_RE_EXTRACT: - doFunc_re_extract(func, ret, usrptr); - break; - case CNFFUNC_EXEC_TEMPLATE: - doFunc_exec_template(func, ret, (msg_t*) usrptr); - break; - case CNFFUNC_FIELD: - cnfexprEval(func->expr[0], &r[0], usrptr); - cnfexprEval(func->expr[1], &r[1], usrptr); - cnfexprEval(func->expr[2], &r[2], usrptr); - str = (char*) var2CString(&r[0], &bMustFree); - matchnbr = var2Number(&r[2], NULL); - if(r[1].datatype == 'S') { - char *delimstr; - delimstr = (char*) es_str2cstr(r[1].d.estr, NULL); - localRet = doExtractFieldByStr((uchar*)str, delimstr, es_strlen(r[1].d.estr), - matchnbr, &resStr); - free(delimstr); - } else { - delim = var2Number(&r[1], NULL); - localRet = doExtractFieldByChar((uchar*)str, (char) delim, matchnbr, &resStr); - } - if(localRet == RS_RET_OK) { - ret->d.estr = es_newStrFromCStr((char*)resStr, strlen((char*)resStr)); - free(resStr); - } else if(localRet == RS_RET_FIELD_NOT_FOUND) { - ret->d.estr = es_newStrFromCStr("***FIELD NOT FOUND***", - sizeof("***FIELD NOT FOUND***")-1); - } else { - ret->d.estr = es_newStrFromCStr("***ERROR in field() FUNCTION***", - sizeof("***ERROR in field() FUNCTION***")-1); - } - ret->datatype = 'S'; - if(bMustFree) free(str); - varFreeMembers(&r[0]); - varFreeMembers(&r[1]); - varFreeMembers(&r[2]); - break; - case CNFFUNC_PRIFILT: - pPrifilt = (struct funcData_prifilt*) func->funcdata; - if( (pPrifilt->pmask[((msg_t*)usrptr)->iFacility] == TABLE_NOPRI) || - ((pPrifilt->pmask[((msg_t*)usrptr)->iFacility] - & (1<<((msg_t*)usrptr)->iSeverity)) == 0) ) - ret->d.n = 0; - else - ret->d.n = 1; - ret->datatype = 'N'; - break; - case CNFFUNC_LOOKUP: -dbgprintf("DDDD: executing lookup\n"); - ret->datatype = 'S'; - if(func->funcdata == NULL) { - ret->d.estr = es_newStrFromCStr("TABLE-NOT-FOUND", sizeof("TABLE-NOT-FOUND")-1); - break; - } - cnfexprEval(func->expr[1], &r[1], usrptr); - str = (char*) var2CString(&r[1], &bMustFree); - ret->d.estr = lookupKey_estr(func->funcdata, (uchar*)str); - if(bMustFree) free(str); - if(r[1].datatype == 'S') es_deleteStr(r[1].d.estr); - break; - default: - if(Debug) { - fname = es_str2cstr(func->fname, NULL); - dbgprintf("rainerscript: invalid function id %u (name '%s')\n", - (unsigned) func->fID, fname); - free(fname); - } - ret->datatype = 'N'; - ret->d.n = 0; - } -} - -static inline void -evalVar(struct cnfvar *var, void *usrptr, struct var *ret) -{ - rs_size_t propLen; - uchar *pszProp = NULL; - unsigned short bMustBeFreed = 0; - rsRetVal localRet; - struct json_object *json; - - if(var->prop.id == PROP_CEE || - var->prop.id == PROP_LOCAL_VAR || - var->prop.id == PROP_GLOBAL_VAR ) { - localRet = msgGetJSONPropJSON((msg_t*)usrptr, &var->prop, &json); - ret->datatype = 'J'; - ret->d.json = (localRet == RS_RET_OK) ? json : NULL; - - DBGPRINTF("rainerscript: var %d:%s: '%s'\n", var->prop.id, var->prop.name, - (ret->d.json == NULL) ? "" : json_object_get_string(ret->d.json)); - } else { - ret->datatype = 'S'; - pszProp = (uchar*) MsgGetProp((msg_t*)usrptr, NULL, &var->prop, &propLen, &bMustBeFreed, NULL); - ret->d.estr = es_newStrFromCStr((char*)pszProp, propLen); - DBGPRINTF("rainerscript: var %d: '%s'\n", var->prop.id, pszProp); - if(bMustBeFreed) - free(pszProp); - } - -} - -/* perform a string comparision operation against a while array. Semantic is - * that one one comparison is true, the whole construct is true. - * TODO: we can obviously optimize this process. One idea is to - * compile a regex, which should work faster than serial comparison. - * Note: compiling a regex does NOT work at all. I experimented with that - * and it was generally 5 to 10 times SLOWER than what we do here... - */ -static int -evalStrArrayCmp(es_str_t *estr_l, struct cnfarray* ar, int cmpop) -{ - int i; - int r = 0; - es_str_t **res; - if(cmpop == CMP_EQ) { - res = bsearch(&estr_l, ar->arr, ar->nmemb, sizeof(es_str_t*), qs_arrcmp); - r = res != NULL; - } else if(cmpop == CMP_NE) { - res = bsearch(&estr_l, ar->arr, ar->nmemb, sizeof(es_str_t*), qs_arrcmp); - r = res == NULL; - } else { - for(i = 0 ; (r == 0) && (i < ar->nmemb) ; ++i) { - switch(cmpop) { - case CMP_STARTSWITH: - r = es_strncmp(estr_l, ar->arr[i], es_strlen(ar->arr[i])) == 0; - break; - case CMP_STARTSWITHI: - r = es_strncasecmp(estr_l, ar->arr[i], es_strlen(ar->arr[i])) == 0; - break; - case CMP_CONTAINS: - r = es_strContains(estr_l, ar->arr[i]) != -1; - break; - case CMP_CONTAINSI: - r = es_strCaseContains(estr_l, ar->arr[i]) != -1; - break; - } - } - } - return r; -} - -#define FREE_BOTH_RET \ - varFreeMembers(&r); \ - varFreeMembers(&l) - -#define COMP_NUM_BINOP(x) \ - cnfexprEval(expr->l, &l, usrptr); \ - cnfexprEval(expr->r, &r, usrptr); \ - ret->datatype = 'N'; \ - ret->d.n = var2Number(&l, &convok_l) x var2Number(&r, &convok_r); \ - FREE_BOTH_RET - -/* NOTE: array as right-hand argument MUST be handled by user */ -#define PREP_TWO_STRINGS \ - cnfexprEval(expr->l, &l, usrptr); \ - estr_l = var2String(&l, &bMustFree2); \ - if(expr->r->nodetype == 'S') { \ - estr_r = ((struct cnfstringval*)expr->r)->estr;\ - bMustFree = 0; \ - } else if(expr->r->nodetype != 'A') { \ - cnfexprEval(expr->r, &r, usrptr); \ - estr_r = var2String(&r, &bMustFree); \ - } else { \ - /* Note: this is not really necessary, but if we do not */ \ - /* do it, we get a very irritating compiler warning... */ \ - estr_r = NULL; \ - } - -#define FREE_TWO_STRINGS \ - if(bMustFree) es_deleteStr(estr_r); \ - if(expr->r->nodetype != 'S' && expr->r->nodetype != 'A') varFreeMembers(&r); \ - if(bMustFree2) es_deleteStr(estr_l); \ - varFreeMembers(&l) - -/* evaluate an expression. - * Note that we try to avoid malloc whenever possible (because of - * the large overhead it has, especially on highly threaded programs). - * As such, the each caller level must provide buffer space for the - * result on its stack during recursion. This permits the callee to store - * the return value without malloc. As the value is a somewhat larger - * struct, we could otherwise not return it without malloc. - * Note that we implement boolean shortcut operations. For our needs, there - * simply is no case where full evaluation would make any sense at all. - */ -void -cnfexprEval(const struct cnfexpr *const expr, struct var *ret, void* usrptr) -{ - struct var r, l; /* memory for subexpression results */ - es_str_t *estr_r, *estr_l; - int convok_r, convok_l; - int bMustFree, bMustFree2; - long long n_r, n_l; - - DBGPRINTF("eval expr %p, type '%s'\n", expr, tokenToString(expr->nodetype)); - switch(expr->nodetype) { - /* note: comparison operations are extremely similar. The code can be copyied, only - * places flagged with "CMP" need to be changed. - */ - case CMP_EQ: - /* this is optimized in regard to right param as a PoC for all compOps - * So this is a NOT yet the copy template! - */ - cnfexprEval(expr->l, &l, usrptr); - ret->datatype = 'N'; - if(l.datatype == 'S') { - if(expr->r->nodetype == 'S') { - ret->d.n = !es_strcmp(l.d.estr, ((struct cnfstringval*)expr->r)->estr); /*CMP*/ - } else if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(l.d.estr, (struct cnfarray*) expr->r, CMP_EQ); - } else { - cnfexprEval(expr->r, &r, usrptr); - if(r.datatype == 'S') { - ret->d.n = !es_strcmp(l.d.estr, r.d.estr); /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l == r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree); - ret->d.n = !es_strcmp(l.d.estr, estr_r); /*CMP*/ - if(bMustFree) es_deleteStr(estr_r); - } - } - varFreeMembers(&r); - } - } else if(l.datatype == 'J') { - estr_l = var2String(&l, &bMustFree); - if(expr->r->nodetype == 'S') { - ret->d.n = !es_strcmp(estr_l, ((struct cnfstringval*)expr->r)->estr); /*CMP*/ - } else if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(estr_l, (struct cnfarray*) expr->r, CMP_EQ); - } else { - cnfexprEval(expr->r, &r, usrptr); - if(r.datatype == 'S') { - ret->d.n = !es_strcmp(estr_l, r.d.estr); /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l == r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree2); - ret->d.n = !es_strcmp(estr_l, estr_r); /*CMP*/ - if(bMustFree2) es_deleteStr(estr_r); - } - } - varFreeMembers(&r); - } - if(bMustFree) es_deleteStr(estr_l); - } else { - cnfexprEval(expr->r, &r, usrptr); - if(r.datatype == 'S') { - n_r = var2Number(&r, &convok_r); - if(convok_r) { - ret->d.n = (l.d.n == n_r); /*CMP*/ - } else { - estr_l = var2String(&l, &bMustFree); - ret->d.n = !es_strcmp(r.d.estr, estr_l); /*CMP*/ - if(bMustFree) es_deleteStr(estr_l); - } - } else { - ret->d.n = (l.d.n == r.d.n); /*CMP*/ - } - varFreeMembers(&r); - } - varFreeMembers(&l); - break; - case CMP_NE: - cnfexprEval(expr->l, &l, usrptr); - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - if(l.datatype == 'S') { - if(expr->r->nodetype == 'S') { - ret->d.n = es_strcmp(l.d.estr, ((struct cnfstringval*)expr->r)->estr); /*CMP*/ - } else if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(l.d.estr, (struct cnfarray*) expr->r, CMP_NE); - } else { - if(r.datatype == 'S') { - ret->d.n = es_strcmp(l.d.estr, r.d.estr); /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l != r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree); - ret->d.n = es_strcmp(l.d.estr, estr_r); /*CMP*/ - if(bMustFree) es_deleteStr(estr_r); - } - } - } - } else if(l.datatype == 'J') { - estr_l = var2String(&l, &bMustFree); - if(r.datatype == 'S') { - ret->d.n = es_strcmp(estr_l, r.d.estr); /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l != r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree2); - ret->d.n = es_strcmp(estr_l, estr_r); /*CMP*/ - if(bMustFree2) es_deleteStr(estr_r); - } - } - if(bMustFree) es_deleteStr(estr_l); - } else { - if(r.datatype == 'S') { - n_r = var2Number(&r, &convok_r); - if(convok_r) { - ret->d.n = (l.d.n != n_r); /*CMP*/ - } else { - estr_l = var2String(&l, &bMustFree); - ret->d.n = es_strcmp(r.d.estr, estr_l); /*CMP*/ - if(bMustFree) es_deleteStr(estr_l); - } - } else { - ret->d.n = (l.d.n != r.d.n); /*CMP*/ - } - } - FREE_BOTH_RET; - break; - case CMP_LE: - cnfexprEval(expr->l, &l, usrptr); - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - if(l.datatype == 'S') { - if(r.datatype == 'S') { - ret->d.n = es_strcmp(l.d.estr, r.d.estr) <= 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l <= r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree); - ret->d.n = es_strcmp(l.d.estr, estr_r) <= 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_r); - } - } - } else if(l.datatype == 'J') { - estr_l = var2String(&l, &bMustFree); - if(r.datatype == 'S') { - ret->d.n = es_strcmp(estr_l, r.d.estr) <= 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l <= r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree2); - ret->d.n = es_strcmp(estr_l, estr_r) <= 0; /*CMP*/ - if(bMustFree2) es_deleteStr(estr_r); - } - } - if(bMustFree) es_deleteStr(estr_l); - } else { - if(r.datatype == 'S') { - n_r = var2Number(&r, &convok_r); - if(convok_r) { - ret->d.n = (l.d.n <= n_r); /*CMP*/ - } else { - estr_l = var2String(&l, &bMustFree); - ret->d.n = es_strcmp(r.d.estr, estr_l) <= 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_l); - } - } else { - ret->d.n = (l.d.n <= r.d.n); /*CMP*/ - } - } - FREE_BOTH_RET; - break; - case CMP_GE: - cnfexprEval(expr->l, &l, usrptr); - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - if(l.datatype == 'S') { - if(r.datatype == 'S') { - ret->d.n = es_strcmp(l.d.estr, r.d.estr) >= 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l >= r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree); - ret->d.n = es_strcmp(l.d.estr, estr_r) >= 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_r); - } - } - } else if(l.datatype == 'J') { - estr_l = var2String(&l, &bMustFree); - if(r.datatype == 'S') { - ret->d.n = es_strcmp(estr_l, r.d.estr) >= 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l >= r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree2); - ret->d.n = es_strcmp(estr_l, estr_r) >= 0; /*CMP*/ - if(bMustFree2) es_deleteStr(estr_r); - } - } - if(bMustFree) es_deleteStr(estr_l); - } else { - if(r.datatype == 'S') { - n_r = var2Number(&r, &convok_r); - if(convok_r) { - ret->d.n = (l.d.n >= n_r); /*CMP*/ - } else { - estr_l = var2String(&l, &bMustFree); - ret->d.n = es_strcmp(r.d.estr, estr_l) >= 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_l); - } - } else { - ret->d.n = (l.d.n >= r.d.n); /*CMP*/ - } - } - FREE_BOTH_RET; - break; - case CMP_LT: - cnfexprEval(expr->l, &l, usrptr); - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - if(l.datatype == 'S') { - if(r.datatype == 'S') { - ret->d.n = es_strcmp(l.d.estr, r.d.estr) < 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l < r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree); - ret->d.n = es_strcmp(l.d.estr, estr_r) < 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_r); - } - } - } else if(l.datatype == 'J') { - estr_l = var2String(&l, &bMustFree); - if(r.datatype == 'S') { - ret->d.n = es_strcmp(estr_l, r.d.estr) < 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l < r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree2); - ret->d.n = es_strcmp(estr_l, estr_r) < 0; /*CMP*/ - if(bMustFree2) es_deleteStr(estr_r); - } - } - if(bMustFree) es_deleteStr(estr_l); - } else { - if(r.datatype == 'S') { - n_r = var2Number(&r, &convok_r); - if(convok_r) { - ret->d.n = (l.d.n < n_r); /*CMP*/ - } else { - estr_l = var2String(&l, &bMustFree); - ret->d.n = es_strcmp(r.d.estr, estr_l) < 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_l); - } - } else { - ret->d.n = (l.d.n < r.d.n); /*CMP*/ - } - } - FREE_BOTH_RET; - break; - case CMP_GT: - cnfexprEval(expr->l, &l, usrptr); - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - if(l.datatype == 'S') { - if(r.datatype == 'S') { - ret->d.n = es_strcmp(l.d.estr, r.d.estr) > 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l > r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree); - ret->d.n = es_strcmp(l.d.estr, estr_r) > 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_r); - } - } - } else if(l.datatype == 'J') { - estr_l = var2String(&l, &bMustFree); - if(r.datatype == 'S') { - ret->d.n = es_strcmp(estr_l, r.d.estr) > 0; /*CMP*/ - } else { - n_l = var2Number(&l, &convok_l); - if(convok_l) { - ret->d.n = (n_l > r.d.n); /*CMP*/ - } else { - estr_r = var2String(&r, &bMustFree2); - ret->d.n = es_strcmp(estr_l, estr_r) > 0; /*CMP*/ - if(bMustFree2) es_deleteStr(estr_r); - } - } - if(bMustFree) es_deleteStr(estr_l); - } else { - if(r.datatype == 'S') { - n_r = var2Number(&r, &convok_r); - if(convok_r) { - ret->d.n = (l.d.n > n_r); /*CMP*/ - } else { - estr_l = var2String(&l, &bMustFree); - ret->d.n = es_strcmp(r.d.estr, estr_l) > 0; /*CMP*/ - if(bMustFree) es_deleteStr(estr_l); - } - } else { - ret->d.n = (l.d.n > r.d.n); /*CMP*/ - } - } - FREE_BOTH_RET; - break; - case CMP_STARTSWITH: - PREP_TWO_STRINGS; - ret->datatype = 'N'; - if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(estr_l, (struct cnfarray*) expr->r, CMP_STARTSWITH); - bMustFree = 0; - } else { - ret->d.n = es_strncmp(estr_l, estr_r, estr_r->lenStr) == 0; - } - FREE_TWO_STRINGS; - break; - case CMP_STARTSWITHI: - PREP_TWO_STRINGS; - ret->datatype = 'N'; - if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(estr_l, (struct cnfarray*) expr->r, CMP_STARTSWITHI); - bMustFree = 0; - } else { - ret->d.n = es_strncasecmp(estr_l, estr_r, estr_r->lenStr) == 0; - } - FREE_TWO_STRINGS; - break; - case CMP_CONTAINS: - PREP_TWO_STRINGS; - ret->datatype = 'N'; - if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(estr_l, (struct cnfarray*) expr->r, CMP_CONTAINS); - bMustFree = 0; - } else { - ret->d.n = es_strContains(estr_l, estr_r) != -1; - } - FREE_TWO_STRINGS; - break; - case CMP_CONTAINSI: - PREP_TWO_STRINGS; - ret->datatype = 'N'; - if(expr->r->nodetype == 'A') { - ret->d.n = evalStrArrayCmp(estr_l, (struct cnfarray*) expr->r, CMP_CONTAINSI); - bMustFree = 0; - } else { - ret->d.n = es_strCaseContains(estr_l, estr_r) != -1; - } - FREE_TWO_STRINGS; - break; - case OR: - cnfexprEval(expr->l, &l, usrptr); - ret->datatype = 'N'; - if(var2Number(&l, &convok_l)) { - ret->d.n = 1ll; - } else { - cnfexprEval(expr->r, &r, usrptr); - if(var2Number(&r, &convok_r)) - ret->d.n = 1ll; - else - ret->d.n = 0ll; - varFreeMembers(&r); - } - varFreeMembers(&l); - break; - case AND: - cnfexprEval(expr->l, &l, usrptr); - ret->datatype = 'N'; - if(var2Number(&l, &convok_l)) { - cnfexprEval(expr->r, &r, usrptr); - if(var2Number(&r, &convok_r)) - ret->d.n = 1ll; - else - ret->d.n = 0ll; - varFreeMembers(&r); - } else { - ret->d.n = 0ll; - } - varFreeMembers(&l); - break; - case NOT: - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - ret->d.n = !var2Number(&r, &convok_r); - varFreeMembers(&r); - break; - case 'N': - ret->datatype = 'N'; - ret->d.n = ((struct cnfnumval*)expr)->val; - break; - case 'S': - ret->datatype = 'S'; - ret->d.estr = es_strdup(((struct cnfstringval*)expr)->estr); - break; - case 'A': - /* if an array is used with "normal" operations, it just evaluates - * to its first element. - */ - ret->datatype = 'S'; - ret->d.estr = es_strdup(((struct cnfarray*)expr)->arr[0]); - break; - case 'V': - evalVar((struct cnfvar*)expr, usrptr, ret); - break; - case '&': - /* TODO: think about optimization, should be possible ;) */ - PREP_TWO_STRINGS; - if(expr->r->nodetype == 'A') { - estr_r = ((struct cnfarray*)expr->r)->arr[0]; - bMustFree = 0; - } - ret->datatype = 'S'; - ret->d.estr = es_strdup(estr_l); - es_addStr(&ret->d.estr, estr_r); - FREE_TWO_STRINGS; - break; - case '+': - COMP_NUM_BINOP(+); - break; - case '-': - COMP_NUM_BINOP(-); - break; - case '*': - COMP_NUM_BINOP(*); - break; - case '/': - COMP_NUM_BINOP(/); - break; - case '%': - COMP_NUM_BINOP(%); - break; - case 'M': - cnfexprEval(expr->r, &r, usrptr); - ret->datatype = 'N'; - ret->d.n = -var2Number(&r, &convok_r); - varFreeMembers(&r); - break; - case 'F': - doFuncCall((struct cnffunc*) expr, ret, usrptr); - break; - default: - ret->datatype = 'N'; - ret->d.n = 0ll; - dbgprintf("eval error: unknown nodetype %u['%c']\n", - (unsigned) expr->nodetype, (char) expr->nodetype); - break; - } - DBGPRINTF("eval expr %p, return datatype '%c'\n", expr, ret->datatype); -} - -//--------------------------------------------------------- - -void -cnfarrayContentDestruct(struct cnfarray *ar) -{ - unsigned short i; - for(i = 0 ; i < ar->nmemb ; ++i) { - es_deleteStr(ar->arr[i]); - } - free(ar->arr); -} - -static inline void -cnffuncDestruct(struct cnffunc *func) -{ - unsigned short i; - - for(i = 0 ; i < func->nParams ; ++i) { - cnfexprDestruct(func->expr[i]); - } - /* some functions require special destruction */ - switch(func->fID) { - case CNFFUNC_RE_MATCH: - case CNFFUNC_RE_EXTRACT: - if(func->funcdata != NULL) - regexp.regfree(func->funcdata); - break; - default:break; - } - if(func->fID != CNFFUNC_EXEC_TEMPLATE) - free(func->funcdata); - free(func->fname); -} - -/* Destruct an expression and all sub-expressions contained in it. - */ -void -cnfexprDestruct(struct cnfexpr *expr) -{ - - if(expr == NULL) { - /* this is valid and can happen during optimizer run! */ - DBGPRINTF("cnfexprDestruct got NULL ptr - valid, so doing nothing\n"); - return; - } - - DBGPRINTF("cnfexprDestruct expr %p, type '%s'\n", expr, tokenToString(expr->nodetype)); - switch(expr->nodetype) { - case CMP_NE: - case CMP_EQ: - case CMP_LE: - case CMP_GE: - case CMP_LT: - case CMP_GT: - case CMP_STARTSWITH: - case CMP_STARTSWITHI: - case CMP_CONTAINS: - case CMP_CONTAINSI: - case OR: - case AND: - case '&': - case '+': - case '-': - case '*': - case '/': - case '%': /* binary */ - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - break; - case NOT: - case 'M': /* unary */ - cnfexprDestruct(expr->r); - break; - case 'N': - break; - case 'S': - es_deleteStr(((struct cnfstringval*)expr)->estr); - break; - case 'V': - free(((struct cnfvar*)expr)->name); - msgPropDescrDestruct(&(((struct cnfvar*)expr)->prop)); - break; - case 'F': - cnffuncDestruct((struct cnffunc*)expr); - break; - case 'A': - cnfarrayContentDestruct((struct cnfarray*)expr); - break; - default:break; - } - free(expr); -} - -//---- END - - -/* Evaluate an expression as a bool. This is added because expressions are - * mostly used inside filters, and so this function is quite common and - * important. - */ -int -cnfexprEvalBool(struct cnfexpr *expr, void *usrptr) -{ - int convok; - struct var ret; - cnfexprEval(expr, &ret, usrptr); - return var2Number(&ret, &convok); -} - -inline static void -doIndent(int indent) -{ - int i; - for(i = 0 ; i < indent ; ++i) - dbgprintf(" "); -} - -static void -pmaskPrint(uchar *pmask, int indent) -{ - int i; - doIndent(indent); - dbgprintf("pmask: "); - for (i = 0; i <= LOG_NFACILITIES; i++) - if (pmask[i] == TABLE_NOPRI) - dbgprintf(" X "); - else - dbgprintf("%2X ", pmask[i]); - dbgprintf("\n"); -} - -static void -cnfarrayPrint(struct cnfarray *ar, int indent) -{ - int i; - doIndent(indent); dbgprintf("ARRAY:\n"); - for(i = 0 ; i < ar->nmemb ; ++i) { - doIndent(indent+1); - cstrPrint("string '", ar->arr[i]); - dbgprintf("'\n"); - } -} - -void -cnfexprPrint(struct cnfexpr *expr, int indent) -{ - struct cnffunc *func; - int i; - - switch(expr->nodetype) { - case CMP_EQ: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("==\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_NE: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("!=\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_LE: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("<=\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_GE: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf(">=\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_LT: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("<\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_GT: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf(">\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_CONTAINS: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("CONTAINS\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_CONTAINSI: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("CONTAINS_I\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_STARTSWITH: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("STARTSWITH\n"); - cnfexprPrint(expr->r, indent+1); - break; - case CMP_STARTSWITHI: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("STARTSWITH_I\n"); - cnfexprPrint(expr->r, indent+1); - break; - case OR: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("OR\n"); - cnfexprPrint(expr->r, indent+1); - break; - case AND: - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("AND\n"); - cnfexprPrint(expr->r, indent+1); - break; - case NOT: - doIndent(indent); - dbgprintf("NOT\n"); - cnfexprPrint(expr->r, indent+1); - break; - case 'S': - doIndent(indent); - cstrPrint("string '", ((struct cnfstringval*)expr)->estr); - dbgprintf("'\n"); - break; - case 'A': - cnfarrayPrint((struct cnfarray*)expr, indent); - break; - case 'N': - doIndent(indent); - dbgprintf("%lld\n", ((struct cnfnumval*)expr)->val); - break; - case 'V': - doIndent(indent); - dbgprintf("var '%s'\n", ((struct cnfvar*)expr)->name); - break; - case 'F': - doIndent(indent); - func = (struct cnffunc*) expr; - cstrPrint("function '", func->fname); - dbgprintf("' (id:%d, params:%hu)\n", func->fID, func->nParams); - if(func->fID == CNFFUNC_PRIFILT) { - struct funcData_prifilt *pD; - pD = (struct funcData_prifilt*) func->funcdata; - pmaskPrint(pD->pmask, indent+1); - } - for(i = 0 ; i < func->nParams ; ++i) { - cnfexprPrint(func->expr[i], indent+1); - } - break; - case '&': - case '+': - case '-': - case '*': - case '/': - case '%': - case 'M': - if(expr->l != NULL) - cnfexprPrint(expr->l, indent+1); - doIndent(indent); - dbgprintf("%c\n", (char) expr->nodetype); - cnfexprPrint(expr->r, indent+1); - break; - default: - dbgprintf("error: unknown nodetype %u['%c']\n", - (unsigned) expr->nodetype, (char) expr->nodetype); - break; - } -} -/* print only the given stmt - * if "subtree" equals 1, the full statement subtree is printed, else - * really only the statement. - */ -void -cnfstmtPrintOnly(struct cnfstmt *stmt, int indent, sbool subtree) -{ - char *cstr; - switch(stmt->nodetype) { - case S_NOP: - doIndent(indent); dbgprintf("NOP\n"); - break; - case S_STOP: - doIndent(indent); dbgprintf("STOP\n"); - break; - case S_CALL: - cstr = es_str2cstr(stmt->d.s_call.name, NULL); - doIndent(indent); dbgprintf("CALL [%s, queue:%d]\n", cstr, - stmt->d.s_call.ruleset == NULL ? 0 : 1); - free(cstr); - break; - case S_ACT: - doIndent(indent); dbgprintf("ACTION %p [%s:%s]\n", stmt->d.act, - modGetName(stmt->d.act->pMod), stmt->printable); - break; - case S_IF: - doIndent(indent); dbgprintf("IF\n"); - cnfexprPrint(stmt->d.s_if.expr, indent+1); - if(subtree) { - doIndent(indent); dbgprintf("THEN\n"); - cnfstmtPrint(stmt->d.s_if.t_then, indent+1); - if(stmt->d.s_if.t_else != NULL) { - doIndent(indent); dbgprintf("ELSE\n"); - cnfstmtPrint(stmt->d.s_if.t_else, indent+1); - } - doIndent(indent); dbgprintf("END IF\n"); - } - break; - case S_SET: - doIndent(indent); dbgprintf("SET %s =\n", - stmt->d.s_set.varname); - cnfexprPrint(stmt->d.s_set.expr, indent+1); - doIndent(indent); dbgprintf("END SET\n"); - break; - case S_UNSET: - doIndent(indent); dbgprintf("UNSET %s\n", - stmt->d.s_unset.varname); - break; - case S_PRIFILT: - doIndent(indent); dbgprintf("PRIFILT '%s'\n", stmt->printable); - pmaskPrint(stmt->d.s_prifilt.pmask, indent); - if(subtree) { - cnfstmtPrint(stmt->d.s_prifilt.t_then, indent+1); - if(stmt->d.s_prifilt.t_else != NULL) { - doIndent(indent); dbgprintf("ELSE\n"); - cnfstmtPrint(stmt->d.s_prifilt.t_else, indent+1); - } - doIndent(indent); dbgprintf("END PRIFILT\n"); - } - break; - case S_PROPFILT: - doIndent(indent); dbgprintf("PROPFILT\n"); - doIndent(indent); dbgprintf("\tProperty.: '%s'\n", - propIDToName(stmt->d.s_propfilt.prop.id)); - if(stmt->d.s_propfilt.prop.id == PROP_CEE || - stmt->d.s_propfilt.prop.id == PROP_LOCAL_VAR || - stmt->d.s_propfilt.prop.id == PROP_GLOBAL_VAR) { - doIndent(indent); - dbgprintf("\tCEE-Prop.: '%s'\n", stmt->d.s_propfilt.prop.name); - } - doIndent(indent); dbgprintf("\tOperation: "); - if(stmt->d.s_propfilt.isNegated) - dbgprintf("NOT "); - dbgprintf("'%s'\n", getFIOPName(stmt->d.s_propfilt.operation)); - if(stmt->d.s_propfilt.pCSCompValue != NULL) { - doIndent(indent); dbgprintf("\tValue....: '%s'\n", - rsCStrGetSzStrNoNULL(stmt->d.s_propfilt.pCSCompValue)); - } - if(subtree) { - doIndent(indent); dbgprintf("THEN\n"); - cnfstmtPrint(stmt->d.s_propfilt.t_then, indent+1); - doIndent(indent); dbgprintf("END PROPFILT\n"); - } - break; - default: - dbgprintf("error: unknown stmt type %u\n", - (unsigned) stmt->nodetype); - break; - } -} -void -cnfstmtPrint(struct cnfstmt *root, int indent) -{ - struct cnfstmt *stmt; - //dbgprintf("stmt %p, indent %d, type '%c'\n", expr, indent, expr->nodetype); - for(stmt = root ; stmt != NULL ; stmt = stmt->next) { - cnfstmtPrintOnly(stmt, indent, 1); - } -} - -struct cnfnumval* -cnfnumvalNew(long long val) -{ - struct cnfnumval *numval; - if((numval = malloc(sizeof(struct cnfnumval))) != NULL) { - numval->nodetype = 'N'; - numval->val = val; - } - return numval; -} - -struct cnfstringval* -cnfstringvalNew(es_str_t *estr) -{ - struct cnfstringval *strval; - if((strval = malloc(sizeof(struct cnfstringval))) != NULL) { - strval->nodetype = 'S'; - strval->estr = estr; - } - return strval; -} - -/* creates array AND adds first element to it */ -struct cnfarray* -cnfarrayNew(es_str_t *val) -{ - struct cnfarray *ar; - if((ar = malloc(sizeof(struct cnfarray))) != NULL) { - ar->nodetype = 'A'; - ar->nmemb = 1; - if((ar->arr = malloc(sizeof(es_str_t*))) == NULL) { - free(ar); - ar = NULL; - goto done; - } - ar->arr[0] = val; - } -done: return ar; -} - -struct cnfarray* -cnfarrayAdd(struct cnfarray *ar, es_str_t *val) -{ - es_str_t **newptr; - if((newptr = realloc(ar->arr, (ar->nmemb+1)*sizeof(es_str_t*))) == NULL) { - DBGPRINTF("cnfarrayAdd: realloc failed, item ignored, ar->arr=%p\n", ar->arr); - goto done; - } else { - ar->arr = newptr; - ar->arr[ar->nmemb] = val; - ar->nmemb++; - } -done: return ar; -} - -/* duplicate an array (deep copy) */ -struct cnfarray* -cnfarrayDup(struct cnfarray *old) -{ - int i; - struct cnfarray *ar; - ar = cnfarrayNew(es_strdup(old->arr[0])); - for(i = 1 ; i < old->nmemb ; ++i) { - cnfarrayAdd(ar, es_strdup(old->arr[i])); - } - return ar; -} - -struct cnfvar* -cnfvarNew(char *name) -{ - struct cnfvar *var; - if((var = malloc(sizeof(struct cnfvar))) != NULL) { - var->nodetype = 'V'; - var->name = name; - msgPropDescrFill(&var->prop, (uchar*)var->name, strlen(var->name)); - } - return var; -} - -struct cnfstmt * -cnfstmtNew(unsigned s_type) -{ - struct cnfstmt* cnfstmt; - if((cnfstmt = malloc(sizeof(struct cnfstmt))) != NULL) { - cnfstmt->nodetype = s_type; - cnfstmt->printable = NULL; - cnfstmt->next = NULL; - } - return cnfstmt; -} - -void cnfstmtDestructLst(struct cnfstmt *root); - -/* delete a single stmt */ -static void -cnfstmtDestruct(struct cnfstmt *stmt) -{ - switch(stmt->nodetype) { - case S_NOP: - case S_STOP: - break; - case S_CALL: - es_deleteStr(stmt->d.s_call.name); - break; - case S_ACT: - actionDestruct(stmt->d.act); - break; - case S_IF: - cnfexprDestruct(stmt->d.s_if.expr); - if(stmt->d.s_if.t_then != NULL) { - cnfstmtDestructLst(stmt->d.s_if.t_then); - } - if(stmt->d.s_if.t_else != NULL) { - cnfstmtDestructLst(stmt->d.s_if.t_else); - } - break; - case S_SET: - free(stmt->d.s_set.varname); - cnfexprDestruct(stmt->d.s_set.expr); - break; - case S_UNSET: - free(stmt->d.s_set.varname); - break; - case S_PRIFILT: - cnfstmtDestructLst(stmt->d.s_prifilt.t_then); - cnfstmtDestructLst(stmt->d.s_prifilt.t_else); - break; - case S_PROPFILT: - msgPropDescrDestruct(&stmt->d.s_propfilt.prop); - if(stmt->d.s_propfilt.regex_cache != NULL) - rsCStrRegexDestruct(&stmt->d.s_propfilt.regex_cache); - if(stmt->d.s_propfilt.pCSCompValue != NULL) - cstrDestruct(&stmt->d.s_propfilt.pCSCompValue); - cnfstmtDestructLst(stmt->d.s_propfilt.t_then); - break; - default: - dbgprintf("error: unknown stmt type during destruct %u\n", - (unsigned) stmt->nodetype); - break; - } - free(stmt->printable); - free(stmt); -} - -/* delete a stmt and all others following it */ -void -cnfstmtDestructLst(struct cnfstmt *root) -{ - struct cnfstmt *stmt, *todel; - for(stmt = root ; stmt != NULL ; ) { - todel = stmt; - stmt = stmt->next; - cnfstmtDestruct(todel); - } -} - -struct cnfstmt * -cnfstmtNewSet(char *var, struct cnfexpr *expr) -{ - struct cnfstmt* cnfstmt; - if((cnfstmt = cnfstmtNew(S_SET)) != NULL) { - cnfstmt->d.s_set.varname = (uchar*) var; - cnfstmt->d.s_set.expr = expr; - } - return cnfstmt; -} - -struct cnfstmt * -cnfstmtNewCall(es_str_t *name) -{ - struct cnfstmt* cnfstmt; - if((cnfstmt = cnfstmtNew(S_CALL)) != NULL) { - cnfstmt->d.s_call.name = name; - } - return cnfstmt; -} - -struct cnfstmt * -cnfstmtNewUnset(char *var) -{ - struct cnfstmt* cnfstmt; - if((cnfstmt = cnfstmtNew(S_UNSET)) != NULL) { - cnfstmt->d.s_unset.varname = (uchar*) var; - } - return cnfstmt; -} - -struct cnfstmt * -cnfstmtNewContinue(void) -{ - return cnfstmtNew(S_NOP); -} - -struct cnfstmt * -cnfstmtNewPRIFILT(char *prifilt, struct cnfstmt *t_then) -{ - struct cnfstmt* cnfstmt; - if((cnfstmt = cnfstmtNew(S_PRIFILT)) != NULL) { - cnfstmt->printable = (uchar*)prifilt; - cnfstmt->d.s_prifilt.t_then = t_then; - cnfstmt->d.s_prifilt.t_else = NULL; - DecodePRIFilter((uchar*)prifilt, cnfstmt->d.s_prifilt.pmask); - } - return cnfstmt; -} - -struct cnfstmt * -cnfstmtNewPROPFILT(char *propfilt, struct cnfstmt *t_then) -{ - struct cnfstmt* cnfstmt; - if((cnfstmt = cnfstmtNew(S_PROPFILT)) != NULL) { - cnfstmt->printable = (uchar*)propfilt; - cnfstmt->d.s_propfilt.t_then = t_then; - cnfstmt->d.s_propfilt.regex_cache = NULL; - cnfstmt->d.s_propfilt.pCSCompValue = NULL; - if(DecodePropFilter((uchar*)propfilt, cnfstmt) != RS_RET_OK) { - cnfstmt->nodetype = S_NOP; /* disable action! */ - cnfstmtDestructLst(t_then); /* we do no longer need this */ - } - } - return cnfstmt; -} - -struct cnfstmt * -cnfstmtNewAct(struct nvlst *lst) -{ - struct cnfstmt* cnfstmt; - char namebuf[256]; - rsRetVal localRet; - if((cnfstmt = cnfstmtNew(S_ACT)) == NULL) - goto done; - localRet = actionNewInst(lst, &cnfstmt->d.act); - if(localRet == RS_RET_OK_WARN) { - parser_errmsg("warnings occured in file '%s' around line %d", - cnfcurrfn, yylineno); - } else if(localRet != RS_RET_OK) { - parser_errmsg("errors occured in file '%s' around line %d", - cnfcurrfn, yylineno); - cnfstmt->nodetype = S_NOP; /* disable action! */ - goto done; - } - snprintf(namebuf, sizeof(namebuf)-1, "action(type=\"%s\" ...)", - modGetName(cnfstmt->d.act->pMod)); - namebuf[255] = '\0'; /* be on safe side */ - cnfstmt->printable = (uchar*)strdup(namebuf); - nvlstChkUnused(lst); - nvlstDestruct(lst); -done: return cnfstmt; -} - -struct cnfstmt * -cnfstmtNewLegaAct(char *actline) -{ - struct cnfstmt* cnfstmt; - rsRetVal localRet; - if((cnfstmt = cnfstmtNew(S_ACT)) == NULL) - goto done; - cnfstmt->printable = (uchar*)strdup((char*)actline); - localRet = cflineDoAction(loadConf, (uchar**)&actline, &cnfstmt->d.act); - if(localRet != RS_RET_OK && localRet != RS_RET_OK_WARN) { - parser_errmsg("%s occured in file '%s' around line %d", - (localRet == RS_RET_OK_WARN) ? "warnings" : "errors", - cnfcurrfn, yylineno); - if(localRet != RS_RET_OK_WARN) { - cnfstmt->nodetype = S_NOP; /* disable action! */ - goto done; - } - } -done: return cnfstmt; -} - - -/* returns 1 if the two expressions are constants, 0 otherwise - * if both are constants, the expression subtrees are destructed - * (this is an aid for constant folding optimizing) - */ -static int -getConstNumber(struct cnfexpr *expr, long long *l, long long *r) -{ - int ret = 0; - cnfexprOptimize(expr->l); - cnfexprOptimize(expr->r); - if(expr->l->nodetype == 'N') { - if(expr->r->nodetype == 'N') { - ret = 1; - *l = ((struct cnfnumval*)expr->l)->val; - *r = ((struct cnfnumval*)expr->r)->val; - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - } else if(expr->r->nodetype == 'S') { - ret = 1; - *l = ((struct cnfnumval*)expr->l)->val; - *r = es_str2num(((struct cnfstringval*)expr->r)->estr, NULL); - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - } - } else if(expr->l->nodetype == 'S') { - if(expr->r->nodetype == 'N') { - ret = 1; - *l = es_str2num(((struct cnfstringval*)expr->l)->estr, NULL); - *r = ((struct cnfnumval*)expr->r)->val; - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - } else if(expr->r->nodetype == 'S') { - ret = 1; - *l = es_str2num(((struct cnfstringval*)expr->l)->estr, NULL); - *r = es_str2num(((struct cnfstringval*)expr->r)->estr, NULL); - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - } - } - return ret; -} - - -/* constant folding for string concatenation */ -static inline void -constFoldConcat(struct cnfexpr *expr) -{ - es_str_t *estr; - cnfexprOptimize(expr->l); - cnfexprOptimize(expr->r); - if(expr->l->nodetype == 'S') { - if(expr->r->nodetype == 'S') { - estr = ((struct cnfstringval*)expr->l)->estr; - ((struct cnfstringval*)expr->l)->estr = NULL; - es_addStr(&estr, ((struct cnfstringval*)expr->r)->estr); - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - expr->nodetype = 'S'; - ((struct cnfstringval*)expr)->estr = estr; - } else if(expr->r->nodetype == 'N') { - es_str_t *numstr; - estr = ((struct cnfstringval*)expr->l)->estr; - ((struct cnfstringval*)expr->l)->estr = NULL; - numstr = es_newStrFromNumber(((struct cnfnumval*)expr->r)->val); - es_addStr(&estr, numstr); - es_deleteStr(numstr); - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - expr->nodetype = 'S'; - ((struct cnfstringval*)expr)->estr = estr; - } - } else if(expr->l->nodetype == 'N') { - if(expr->r->nodetype == 'S') { - estr = es_newStrFromNumber(((struct cnfnumval*)expr->l)->val); - es_addStr(&estr, ((struct cnfstringval*)expr->r)->estr); - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - expr->nodetype = 'S'; - ((struct cnfstringval*)expr)->estr = estr; - } else if(expr->r->nodetype == 'S') { - es_str_t *numstr; - estr = es_newStrFromNumber(((struct cnfnumval*)expr->l)->val); - numstr = es_newStrFromNumber(((struct cnfnumval*)expr->r)->val); - es_addStr(&estr, numstr); - es_deleteStr(numstr); - cnfexprDestruct(expr->l); - cnfexprDestruct(expr->r); - expr->nodetype = 'S'; - ((struct cnfstringval*)expr)->estr = estr; - } - } -} - - -/* optimize comparisons with syslog severity/facility. This is a special - * handler as the numerical values also support GT, LT, etc ops. - */ -static inline struct cnfexpr* -cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr) -{ - struct cnffunc *func; - - if(expr->l->nodetype != 'V') - FINALIZE; - - if(!strcmp("syslogseverity", ((struct cnfvar*)expr->l)->name)) { - if(expr->r->nodetype == 'N') { - int sev = (int) ((struct cnfnumval*)expr->r)->val; - if(sev >= 0 && sev <= 7) { - DBGPRINTF("optimizer: change comparison OP to FUNC prifilt()\n"); - func = cnffuncNew_prifilt(0); /* fac is irrelevant, set below... */ - prifiltSetSeverity(func->funcdata, sev, expr->nodetype); - cnfexprDestruct(expr); - expr = (struct cnfexpr*) func; - } else { - parser_errmsg("invalid syslogseverity %d, expression will always " - "evaluate to FALSE", sev); - } - } - } else if(!strcmp("syslogfacility", ((struct cnfvar*)expr->l)->name)) { - if(expr->r->nodetype == 'N') { - int fac = (int) ((struct cnfnumval*)expr->r)->val; - if(fac >= 0 && fac <= 24) { - DBGPRINTF("optimizer: change comparison OP to FUNC prifilt()\n"); - func = cnffuncNew_prifilt(0); /* fac is irrelevant, set below... */ - prifiltSetFacility(func->funcdata, fac, expr->nodetype); - cnfexprDestruct(expr); - expr = (struct cnfexpr*) func; - } else { - parser_errmsg("invalid syslogfacility %d, expression will always " - "evaluate to FALSE", fac); - } - } - } -finalize_it: - return expr; -} - -/* optimize a comparison with a variable as left-hand operand - * NOTE: Currently support CMP_EQ, CMP_NE only and code NEEDS - * TO BE CHANGED fgr other comparisons! - */ -static inline struct cnfexpr* -cnfexprOptimize_CMP_var(struct cnfexpr *expr) -{ - struct cnffunc *func; - - if(!strcmp("syslogfacility-text", ((struct cnfvar*)expr->l)->name)) { - if(expr->r->nodetype == 'S') { - char *cstr = es_str2cstr(((struct cnfstringval*)expr->r)->estr, NULL); - int fac = decodeSyslogName((uchar*)cstr, syslogFacNames); - if(fac == -1) { - parser_errmsg("invalid facility '%s', expression will always " - "evaluate to FALSE", cstr); - } else { - /* we can actually optimize! */ - DBGPRINTF("optimizer: change comparison OP to FUNC prifilt()\n"); - func = cnffuncNew_prifilt(fac); - if(expr->nodetype == CMP_NE) - prifiltInvert(func->funcdata); - cnfexprDestruct(expr); - expr = (struct cnfexpr*) func; - } - free(cstr); - } - } else if(!strcmp("syslogseverity-text", ((struct cnfvar*)expr->l)->name)) { - if(expr->r->nodetype == 'S') { - char *cstr = es_str2cstr(((struct cnfstringval*)expr->r)->estr, NULL); - int sev = decodeSyslogName((uchar*)cstr, syslogPriNames); - if(sev == -1) { - parser_errmsg("invalid syslogseverity '%s', expression will always " - "evaluate to FALSE", cstr); - } else { - /* we can acutally optimize! */ - DBGPRINTF("optimizer: change comparison OP to FUNC prifilt()\n"); - func = cnffuncNew_prifilt(0); - prifiltSetSeverity(func->funcdata, sev, expr->nodetype); - cnfexprDestruct(expr); - expr = (struct cnfexpr*) func; - } - free(cstr); - } - } else { - expr = cnfexprOptimize_CMP_severity_facility(expr); - } - return expr; -} - -static inline struct cnfexpr* -cnfexprOptimize_NOT(struct cnfexpr *expr) -{ - struct cnffunc *func; - - if(expr->r->nodetype == 'F') { - func = (struct cnffunc *)expr->r; - if(func->fID == CNFFUNC_PRIFILT) { - DBGPRINTF("optimize NOT prifilt() to inverted prifilt()\n"); - expr->r = NULL; - cnfexprDestruct(expr); - prifiltInvert(func->funcdata); - expr = (struct cnfexpr*) func; - } - } - return expr; -} - -static inline struct cnfexpr* -cnfexprOptimize_AND_OR(struct cnfexpr *expr) -{ - struct cnffunc *funcl, *funcr; - - if(expr->l->nodetype == 'F') { - if(expr->r->nodetype == 'F') { - funcl = (struct cnffunc *)expr->l; - funcr = (struct cnffunc *)expr->r; - if(funcl->fID == CNFFUNC_PRIFILT && funcr->fID == CNFFUNC_PRIFILT) { - DBGPRINTF("optimize combine AND/OR prifilt()\n"); - expr->l = NULL; - prifiltCombine(funcl->funcdata, funcr->funcdata, expr->nodetype); - cnfexprDestruct(expr); - expr = (struct cnfexpr*) funcl; - } - } - } - return expr; -} - - -/* optimize array for EQ/NEQ comparisons. We sort the array in - * this case so that we can apply binary search later on. - */ -static inline void -cnfexprOptimize_CMPEQ_arr(struct cnfarray *arr) -{ - DBGPRINTF("optimizer: sorting array of %d members for CMP_EQ/NEQ comparison\n", arr->nmemb); - qsort(arr->arr, arr->nmemb, sizeof(es_str_t*), qs_arrcmp); -} - - -/* (recursively) optimize an expression */ -struct cnfexpr* -cnfexprOptimize(struct cnfexpr *expr) -{ - long long ln, rn; - struct cnfexpr *exprswap; - - dbgprintf("optimize expr %p, type '%s'\n", expr, tokenToString(expr->nodetype)); - switch(expr->nodetype) { - case '&': - constFoldConcat(expr); - break; - case '+': - if(getConstNumber(expr, &ln, &rn)) { - expr->nodetype = 'N'; - ((struct cnfnumval*)expr)->val = ln + rn; - } - break; - case '-': - if(getConstNumber(expr, &ln, &rn)) { - expr->nodetype = 'N'; - ((struct cnfnumval*)expr)->val = ln - rn; - } - break; - case '*': - if(getConstNumber(expr, &ln, &rn)) { - expr->nodetype = 'N'; - ((struct cnfnumval*)expr)->val = ln * rn; - } - break; - case '/': - if(getConstNumber(expr, &ln, &rn)) { - expr->nodetype = 'N'; - ((struct cnfnumval*)expr)->val = ln / rn; - } - break; - case '%': - if(getConstNumber(expr, &ln, &rn)) { - expr->nodetype = 'N'; - ((struct cnfnumval*)expr)->val = ln % rn; - } - break; - case CMP_NE: - case CMP_EQ: - expr->l = cnfexprOptimize(expr->l); - expr->r = cnfexprOptimize(expr->r); - if(expr->l->nodetype == 'A') { - if(expr->r->nodetype == 'A') { - parser_errmsg("warning: '==' or '<>' " - "comparison of two constant string " - "arrays makes no sense"); - } else { /* swap for simpler execution step */ - exprswap = expr->l; - expr->l = expr->r; - expr->r = exprswap; - } - } - if(expr->r->nodetype == 'A') { - cnfexprOptimize_CMPEQ_arr((struct cnfarray *)expr->r); - } - /* This should be evaluated last because it may change expr - * to a function. - */ - if(expr->l->nodetype == 'V') { - expr = cnfexprOptimize_CMP_var(expr); - } - break; - case CMP_LE: - case CMP_GE: - case CMP_LT: - case CMP_GT: - expr->l = cnfexprOptimize(expr->l); - expr->r = cnfexprOptimize(expr->r); - expr = cnfexprOptimize_CMP_severity_facility(expr); - break; - case CMP_CONTAINS: - case CMP_CONTAINSI: - case CMP_STARTSWITH: - case CMP_STARTSWITHI: - expr->l = cnfexprOptimize(expr->l); - expr->r = cnfexprOptimize(expr->r); - break; - case AND: - case OR: - expr->l = cnfexprOptimize(expr->l); - expr->r = cnfexprOptimize(expr->r); - expr = cnfexprOptimize_AND_OR(expr); - break; - case NOT: - expr->r = cnfexprOptimize(expr->r); - expr = cnfexprOptimize_NOT(expr); - break; - default:/* nodetypes we cannot optimize */ - break; - } - return expr; -} - -/* removes NOPs from a statement list and returns the - * first non-NOP entry. - */ -static inline struct cnfstmt * -removeNOPs(struct cnfstmt *root) -{ - struct cnfstmt *stmt, *toDel, *prevstmt = NULL; - struct cnfstmt *newRoot = NULL; - - if(root == NULL) goto done; - stmt = root; - while(stmt != NULL) { - if(stmt->nodetype == S_NOP) { - if(prevstmt != NULL) - /* end chain, is rebuild if more non-NOPs follow */ - prevstmt->next = NULL; - toDel = stmt; - stmt = stmt->next; - cnfstmtDestruct(toDel); - } else { - if(newRoot == NULL) - newRoot = stmt; - if(prevstmt != NULL) - prevstmt->next = stmt; - prevstmt = stmt; - stmt = stmt->next; - } - } -done: return newRoot; -} - - -static inline void -cnfstmtOptimizeIf(struct cnfstmt *stmt) -{ - struct cnfstmt *t_then, *t_else; - struct cnfexpr *expr; - struct cnffunc *func; - struct funcData_prifilt *prifilt; - - expr = stmt->d.s_if.expr = cnfexprOptimize(stmt->d.s_if.expr); - stmt->d.s_if.t_then = removeNOPs(stmt->d.s_if.t_then); - stmt->d.s_if.t_else = removeNOPs(stmt->d.s_if.t_else); - cnfstmtOptimize(stmt->d.s_if.t_then); - cnfstmtOptimize(stmt->d.s_if.t_else); - - if(stmt->d.s_if.expr->nodetype == 'F') { - func = (struct cnffunc*)expr; - if(func->fID == CNFFUNC_PRIFILT) { - DBGPRINTF("optimizer: change IF to PRIFILT\n"); - t_then = stmt->d.s_if.t_then; - t_else = stmt->d.s_if.t_else; - stmt->nodetype = S_PRIFILT; - prifilt = (struct funcData_prifilt*) func->funcdata; - memcpy(stmt->d.s_prifilt.pmask, prifilt->pmask, - sizeof(prifilt->pmask)); - stmt->d.s_prifilt.t_then = t_then; - stmt->d.s_prifilt.t_else = t_else; - if(func->nParams == 0) - stmt->printable = (uchar*)strdup("[Optimizer Result]"); - else - stmt->printable = (uchar*) - es_str2cstr(((struct cnfstringval*)func->expr[0])->estr, NULL); - cnfexprDestruct(expr); - cnfstmtOptimizePRIFilt(stmt); - } - } -} - -static inline void -cnfstmtOptimizeAct(struct cnfstmt *stmt) -{ - action_t *pAct; - - pAct = stmt->d.act; - if(!strcmp((char*)modGetName(pAct->pMod), "builtin:omdiscard")) { - DBGPRINTF("optimizer: replacing omdiscard by STOP\n"); - actionDestruct(stmt->d.act); - stmt->nodetype = S_STOP; - } -} - -static void -cnfstmtOptimizePRIFilt(struct cnfstmt *stmt) -{ - int i; - int isAlways = 1; - struct cnfstmt *subroot, *last; - - stmt->d.s_prifilt.t_then = removeNOPs(stmt->d.s_prifilt.t_then); - cnfstmtOptimize(stmt->d.s_prifilt.t_then); - - for(i = 0; i <= LOG_NFACILITIES; i++) - if(stmt->d.s_prifilt.pmask[i] != 0xff) { - isAlways = 0; - break; - } - if(!isAlways) - goto done; - - DBGPRINTF("optimizer: removing always-true PRIFILT %p\n", stmt); - if(stmt->d.s_prifilt.t_else != NULL) { - parser_errmsg("error: always-true PRI filter has else part!\n"); - cnfstmtDestructLst(stmt->d.s_prifilt.t_else); - } - free(stmt->printable); - stmt->printable = NULL; - subroot = stmt->d.s_prifilt.t_then; - if(subroot == NULL) { - /* very strange, we set it to NOP, best we can do - * This case is NOT expected in practice - */ - stmt->nodetype = S_NOP; - goto done; - } - for(last = subroot ; last->next != NULL ; last = last->next) - /* find last node in subtree */; - last->next = stmt->next; - memcpy(stmt, subroot, sizeof(struct cnfstmt)); - free(subroot); - -done: return; -} - -/* we abuse "optimize" a bit. Actually, we obtain a ruleset pointer, as - * all rulesets are only known later in the process (now!). - */ -static void -cnfstmtOptimizeCall(struct cnfstmt *stmt) -{ - ruleset_t *pRuleset; - rsRetVal localRet; - uchar *rsName; - - rsName = (uchar*) es_str2cstr(stmt->d.s_call.name, NULL); - localRet = rulesetGetRuleset(loadConf, &pRuleset, rsName); - if(localRet != RS_RET_OK) { - /* in that case, we accept that a NOP will "survive" */ - parser_errmsg("ruleset '%s' cannot be found\n", rsName); - es_deleteStr(stmt->d.s_call.name); - stmt->nodetype = S_NOP; - goto done; - } - DBGPRINTF("CALL obtained ruleset ptr %p for ruleset %s [hasQueue:%d]\n", - pRuleset, rsName, rulesetHasQueue(pRuleset)); - if(rulesetHasQueue(pRuleset)) { - stmt->d.s_call.ruleset = pRuleset; - } else { - stmt->d.s_call.ruleset = NULL; - stmt->d.s_call.stmt = pRuleset->root; - } -done: - free(rsName); - return; -} -/* (recursively) optimize a statement */ -void -cnfstmtOptimize(struct cnfstmt *root) -{ - struct cnfstmt *stmt; - if(root == NULL) goto done; - for(stmt = root ; stmt != NULL ; stmt = stmt->next) { - switch(stmt->nodetype) { - case S_IF: - cnfstmtOptimizeIf(stmt); - break; - case S_PRIFILT: - cnfstmtOptimizePRIFilt(stmt); - break; - case S_PROPFILT: - stmt->d.s_propfilt.t_then = removeNOPs(stmt->d.s_propfilt.t_then); - cnfstmtOptimize(stmt->d.s_propfilt.t_then); - break; - case S_SET: - stmt->d.s_set.expr = cnfexprOptimize(stmt->d.s_set.expr); - break; - case S_ACT: - cnfstmtOptimizeAct(stmt); - break; - case S_CALL: - cnfstmtOptimizeCall(stmt); - break; - case S_STOP: - if(stmt->next != NULL) - parser_errmsg("STOP is followed by unreachable statements!\n"); - break; - case S_UNSET: /* nothing to do */ - break; - case S_NOP: - DBGPRINTF("optimizer error: we see a NOP, how come?\n"); - break; - default: - dbgprintf("error: unknown stmt type %u during optimizer run\n", - (unsigned) stmt->nodetype); - break; - } - } -done: return; -} - - -struct cnffparamlst * -cnffparamlstNew(struct cnfexpr *expr, struct cnffparamlst *next) -{ - struct cnffparamlst* lst; - if((lst = malloc(sizeof(struct cnffparamlst))) != NULL) { - lst->nodetype = 'P'; - lst->expr = expr; - lst->next = next; - } - return lst; -} - -/* Obtain function id from name AND number of params. Issues the - * relevant error messages if errors are detected. - */ -static inline enum cnffuncid -funcName2ID(es_str_t *fname, unsigned short nParams) -{ - if(!es_strbufcmp(fname, (unsigned char*)"strlen", sizeof("strlen") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for strlen() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_STRLEN; - } else if(!es_strbufcmp(fname, (unsigned char*)"getenv", sizeof("getenv") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for getenv() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_GETENV; - } else if(!es_strbufcmp(fname, (unsigned char*)"tolower", sizeof("tolower") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for tolower() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_TOLOWER; - } else if(!es_strbufcmp(fname, (unsigned char*)"cstr", sizeof("cstr") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for cstr() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_CSTR; - } else if(!es_strbufcmp(fname, (unsigned char*)"cnum", sizeof("cnum") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for cnum() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_CNUM; - } else if(!es_strbufcmp(fname, (unsigned char*)"re_match", sizeof("re_match") - 1)) { - if(nParams != 2) { - parser_errmsg("number of parameters for re_match() must be two " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_RE_MATCH; - } else if(!es_strbufcmp(fname, (unsigned char*)"re_extract", sizeof("re_extract") - 1)) { - if(nParams != 5) { - parser_errmsg("number of parameters for re_extract() must be five " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_RE_EXTRACT; - } else if(!es_strbufcmp(fname, (unsigned char*)"field", sizeof("field") - 1)) { - if(nParams != 3) { - parser_errmsg("number of parameters for field() must be three " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_FIELD; - } else if(!es_strbufcmp(fname, (unsigned char*)"exec_template", sizeof("exec_template") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for exec-template() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_EXEC_TEMPLATE; - } else if(!es_strbufcmp(fname, (unsigned char*)"prifilt", sizeof("prifilt") - 1)) { - if(nParams != 1) { - parser_errmsg("number of parameters for prifilt() must be one " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_PRIFILT; - } else if(!es_strbufcmp(fname, (unsigned char*)"lookup", sizeof("lookup") - 1)) { - if(nParams != 2) { - parser_errmsg("number of parameters for lookup() must be two " - "but is %d.", nParams); - return CNFFUNC_INVALID; - } - return CNFFUNC_LOOKUP; - } else { - return CNFFUNC_INVALID; - } -} - - -static inline rsRetVal -initFunc_re_match(struct cnffunc *func) -{ - rsRetVal localRet; - char *regex = NULL; - regex_t *re; - DEFiRet; - - func->funcdata = NULL; - if(func->expr[1]->nodetype != 'S') { - parser_errmsg("param 2 of re_match/extract() must be a constant string"); - FINALIZE; - } - - CHKmalloc(re = malloc(sizeof(regex_t))); - func->funcdata = re; - - regex = es_str2cstr(((struct cnfstringval*) func->expr[1])->estr, NULL); - - if((localRet = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) { - if(regexp.regcomp(re, (char*) regex, REG_EXTENDED) != 0) { - parser_errmsg("cannot compile regex '%s'", regex); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { /* regexp object could not be loaded */ - parser_errmsg("could not load regex support - regex ignored"); - ABORT_FINALIZE(RS_RET_ERR); - } - -finalize_it: - free(regex); - RETiRet; -} - - -static rsRetVal -initFunc_exec_template(struct cnffunc *func) -{ - char *tplName = NULL; - DEFiRet; - - if(func->expr[0]->nodetype != 'S') { - parser_errmsg("exec_template(): param 1 must be a constant string"); - FINALIZE; - } - - tplName = es_str2cstr(((struct cnfstringval*) func->expr[0])->estr, NULL); - func->funcdata = tplFind(ourConf, tplName, strlen(tplName)); - if(func->funcdata == NULL) { - parser_errmsg("exec_template(): template '%s' could not be found", tplName); - FINALIZE; - } - - -finalize_it: - free(tplName); - RETiRet; -} - - -static inline rsRetVal -initFunc_prifilt(struct cnffunc *func) -{ - struct funcData_prifilt *pData; - uchar *cstr; - DEFiRet; - - func->funcdata = NULL; - if(func->expr[0]->nodetype != 'S') { - parser_errmsg("param 1 of prifilt() must be a constant string"); - FINALIZE; - } - - CHKmalloc(pData = calloc(1, sizeof(struct funcData_prifilt))); - func->funcdata = pData; - cstr = (uchar*)es_str2cstr(((struct cnfstringval*) func->expr[0])->estr, NULL); - CHKiRet(DecodePRIFilter(cstr, pData->pmask)); - free(cstr); -finalize_it: - RETiRet; -} - - -static inline rsRetVal -initFunc_lookup(struct cnffunc *func) -{ - uchar *cstr = NULL; - DEFiRet; - - func->funcdata = NULL; - if(func->expr[0]->nodetype != 'S') { - parser_errmsg("table name (param 1) of lookup() must be a constant string"); - FINALIZE; - } - - cstr = (uchar*)es_str2cstr(((struct cnfstringval*) func->expr[0])->estr, NULL); - if((func->funcdata = lookupFindTable(cstr)) == NULL) { - parser_errmsg("lookup table '%s' not found", cstr); - FINALIZE; - } - -finalize_it: - free(cstr); - RETiRet; -} - - -struct cnffunc * -cnffuncNew(es_str_t *fname, struct cnffparamlst* paramlst) -{ - struct cnffunc* func; - struct cnffparamlst *param, *toDel; - unsigned short i; - unsigned short nParams; - - /* we first need to find out how many params we have */ - nParams = 0; - for(param = paramlst ; param != NULL ; param = param->next) - ++nParams; - if((func = malloc(sizeof(struct cnffunc) + (nParams * sizeof(struct cnfexp*)))) - != NULL) { - func->nodetype = 'F'; - func->fname = fname; - func->nParams = nParams; - func->funcdata = NULL; - func->fID = funcName2ID(fname, nParams); - /* shuffle params over to array (access speed!) */ - param = paramlst; - for(i = 0 ; i < nParams ; ++i) { - func->expr[i] = param->expr; - toDel = param; - param = param->next; - free(toDel); - } - /* some functions require special initialization */ - switch(func->fID) { - case CNFFUNC_RE_MATCH: - case CNFFUNC_RE_EXTRACT: - /* need to compile the regexp in param 2, so this MUST be a constant */ - initFunc_re_match(func); - break; - case CNFFUNC_PRIFILT: - initFunc_prifilt(func); - break; - case CNFFUNC_LOOKUP: - initFunc_lookup(func); - break; - case CNFFUNC_EXEC_TEMPLATE: - initFunc_exec_template(func); - break; - default:break; - } - } - return func; -} - - -/* A special function to create a prifilt() expression during optimization - * phase. - */ -struct cnffunc * -cnffuncNew_prifilt(int fac) -{ - struct cnffunc* func; - - if((func = malloc(sizeof(struct cnffunc))) != NULL) { - func->nodetype = 'F'; - func->fname = es_newStrFromCStr("prifilt", sizeof("prifilt")-1); - func->nParams = 0; - func->fID = CNFFUNC_PRIFILT; - func->funcdata = calloc(1, sizeof(struct funcData_prifilt)); - ((struct funcData_prifilt *)func->funcdata)->pmask[fac >> 3] = TABLE_ALLPRI; - } - return func; -} - - -/* returns 0 if everything is OK and config parsing shall continue, - * and 1 if things are so wrong that config parsing shall be aborted. - */ -int -cnfDoInclude(char *name) -{ - char *cfgFile; - char *finalName; - int i; - int result; - glob_t cfgFiles; - struct stat fileInfo; - char nameBuf[MAXFNAME+1]; - char cwdBuf[MAXFNAME+1]; - - finalName = name; - if(stat(name, &fileInfo) == 0) { - /* stat usually fails if we have a wildcard - so this does NOT indicate error! */ - if(S_ISDIR(fileInfo.st_mode)) { - /* if we have a directory, we need to add "*" to get its files */ - snprintf(nameBuf, sizeof(nameBuf), "%s*", name); - finalName = nameBuf; - } - } - - /* Use GLOB_MARK to append a trailing slash for directories. */ - /* Use GLOB_NOMAGIC to detect wildcards that match nothing. */ -#ifdef HAVE_GLOB_NOMAGIC - /* Silently ignore wildcards that match nothing */ - result = glob(finalName, GLOB_MARK | GLOB_NOMAGIC, NULL, &cfgFiles); - if(result == GLOB_NOMATCH) { -#else - result = glob(finalName, GLOB_MARK, NULL, &cfgFiles); - if(result == GLOB_NOMATCH && containsGlobWildcard(finalName)) { -#endif /* HAVE_GLOB_NOMAGIC */ - return 0; - } - - if(result == GLOB_NOSPACE || result == GLOB_ABORTED) { - char errStr[1024]; - rs_strerror_r(errno, errStr, sizeof(errStr)); - if(getcwd(cwdBuf, sizeof(cwdBuf)) == NULL) - strcpy(cwdBuf, "??getcwd() failed??"); - parser_errmsg("error accessing config file or directory '%s' [cwd:%s]: %s", - finalName, cwdBuf, errStr); - return 1; - } - - /* note: bison "stacks" the files, so we need to submit them - * in reverse order to the *stack* in order to get the proper - * parsing order. Also see - * http://bugzilla.adiscon.com/show_bug.cgi?id=411 - */ - for(i = cfgFiles.gl_pathc - 1; i >= 0 ; i--) { - cfgFile = cfgFiles.gl_pathv[i]; - if(stat(cfgFile, &fileInfo) != 0) { - char errStr[1024]; - rs_strerror_r(errno, errStr, sizeof(errStr)); - if(getcwd(cwdBuf, sizeof(cwdBuf)) == NULL) - strcpy(cwdBuf, "??getcwd() failed??"); - parser_errmsg("error accessing config file or directory '%s' " - "[cwd: %s]: %s", cfgFile, cwdBuf, errStr); - return 1; - } - - if(S_ISREG(fileInfo.st_mode)) { /* config file */ - dbgprintf("requested to include config file '%s'\n", cfgFile); - cnfSetLexFile(cfgFile); - } else if(S_ISDIR(fileInfo.st_mode)) { /* config directory */ - dbgprintf("requested to include directory '%s'\n", cfgFile); - cnfDoInclude(cfgFile); - } else { - dbgprintf("warning: unable to process IncludeConfig directive '%s'\n", cfgFile); - } - } - - globfree(&cfgFiles); - return 0; -} - -void -varDelete(struct var *v) -{ - switch(v->datatype) { - case 'S': - es_deleteStr(v->d.estr); - break; - case 'A': - cnfarrayContentDestruct(v->d.ar); - free(v->d.ar); - break; - default:break; - } -} - -void -cnfparamvalsDestruct(struct cnfparamvals *paramvals, struct cnfparamblk *blk) -{ - int i; - if(paramvals == NULL) - return; - for(i = 0 ; i < blk->nParams ; ++i) { - if(paramvals[i].bUsed) { - varDelete(¶mvals[i].val); - } - } - free(paramvals); -} - -/* find the index (or -1!) for a config param by name. This is used to - * address the parameter array. Of course, we could use with static - * indices, but that would create some extra bug potential. So we - * resort to names. As we do this only during the initial config parsing - * stage the (considerable!) extra overhead is OK. -- rgerhards, 2011-07-19 - */ -int -cnfparamGetIdx(struct cnfparamblk *params, char *name) -{ - int i; - for(i = 0 ; i < params->nParams ; ++i) - if(!strcmp(params->descr[i].name, name)) - break; - if(i == params->nParams) - i = -1; /* not found */ - return i; -} - - -void -cstrPrint(char *text, es_str_t *estr) -{ - char *str; - str = es_str2cstr(estr, NULL); - dbgprintf("%s%s", text, str); - free(str); -} - -char * -rmLeadingSpace(char *s) -{ - char *p; - for(p = s ; *p && isspace(*p) ; ++p) - ; - return(p); -} - -/* init must be called once before any parsing of the script files start */ -rsRetVal -initRainerscript(void) -{ - DEFiRet; - CHKiRet(objGetObjInterface(&obj)); -finalize_it: - RETiRet; -} - -/* we need a function to check for octal digits */ -static inline int -isodigit(uchar c) -{ - return(c >= '0' && c <= '7'); -} - -/** - * Get numerical value of a hex digit. This is a helper function. - * @param[in] c a character containing 0..9, A..Z, a..z anything else - * is an (undetected) error. - */ -static inline int -hexDigitVal(char c) -{ - int r; - if(c < 'A') - r = c - '0'; - else if(c < 'a') - r = c - 'A' + 10; - else - r = c - 'a' + 10; - return r; -} - -/* Handle the actual unescaping. - * a helper to unescapeStr(), to help make the function easier to read. - */ -static inline void -doUnescape(unsigned char *c, int len, int *iSrc, int iDst) -{ - if(c[*iSrc] == '\\') { - if(++(*iSrc) == len) { - /* error, incomplete escape, treat as single char */ - c[iDst] = '\\'; - } - /* regular case, unescape */ - switch(c[*iSrc]) { - case 'a': - c[iDst] = '\007'; - break; - case 'b': - c[iDst] = '\b'; - break; - case 'f': - c[iDst] = '\014'; - break; - case 'n': - c[iDst] = '\n'; - break; - case 'r': - c[iDst] = '\r'; - break; - case 't': - c[iDst] = '\t'; - break; - case '\'': - c[iDst] = '\''; - break; - case '"': - c[iDst] = '"'; - break; - case '?': - c[iDst] = '?'; - break; - case '$': - c[iDst] = '$'; - break; - case '\\': - c[iDst] = '\\'; - break; - case 'x': - if( (*iSrc)+2 >= len - || !isxdigit(c[(*iSrc)+1]) - || !isxdigit(c[(*iSrc)+2])) { - /* error, incomplete escape, use as is */ - c[iDst] = '\\'; - --(*iSrc); - } - c[iDst] = (hexDigitVal(c[(*iSrc)+1]) << 4) + - hexDigitVal(c[(*iSrc)+2]); - *iSrc += 2; - break; - case '0': /* octal escape */ - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - if( (*iSrc)+2 >= len - || !isodigit(c[(*iSrc)+1]) - || !isodigit(c[(*iSrc)+2])) { - /* error, incomplete escape, use as is */ - c[iDst] = '\\'; - --(*iSrc); - } - c[iDst] = ((c[(*iSrc) ] - '0') << 6) + - ((c[(*iSrc)+1] - '0') << 3) + - ( c[(*iSrc)+2] - '0'); - *iSrc += 2; - break; - default: - /* error, incomplete escape, indicate by '?' */ - c[iDst] = '?'; - break; - } - } else { - /* regular character */ - c[iDst] = c[*iSrc]; - } -} - -void -unescapeStr(uchar *s, int len) -{ - int iSrc, iDst; - assert(s != NULL); - - /* scan for first escape sequence (if we are luky, there is none!) */ - iSrc = 0; - while(iSrc < len && s[iSrc] != '\\') - ++iSrc; - /* now we have a sequence or end of string. In any case, we process - * all remaining characters (maybe 0!) and unescape. - */ - if(iSrc != len) { - iDst = iSrc; - while(iSrc < len) { - doUnescape(s, len, &iSrc, iDst); - ++iSrc; - ++iDst; - } - s[iDst] = '\0'; - } -} - -char * -tokenval2str(int tok) -{ - if(tok < 256) return ""; - switch(tok) { - case NAME: return "NAME"; - case FUNC: return "FUNC"; - case BEGINOBJ: return "BEGINOBJ"; - case ENDOBJ: return "ENDOBJ"; - case BEGIN_ACTION: return "BEGIN_ACTION"; - case BEGIN_PROPERTY: return "BEGIN_PROPERTY"; - case BEGIN_CONSTANT: return "BEGIN_CONSTANT"; - case BEGIN_TPL: return "BEGIN_TPL"; - case BEGIN_RULESET: return "BEGIN_RULESET"; - case STOP: return "STOP"; - case SET: return "SET"; - case UNSET: return "UNSET"; - case CONTINUE: return "CONTINUE"; - case CALL: return "CALL"; - case LEGACY_ACTION: return "LEGACY_ACTION"; - case LEGACY_RULESET: return "LEGACY_RULESET"; - case PRIFILT: return "PRIFILT"; - case PROPFILT: return "PROPFILT"; - case BSD_TAG_SELECTOR: return "BSD_TAG_SELECTOR"; - case BSD_HOST_SELECTOR: return "BSD_HOST_SELECTOR"; - case IF: return "IF"; - case THEN: return "THEN"; - case ELSE: return "ELSE"; - case OR: return "OR"; - case AND: return "AND"; - case NOT: return "NOT"; - case VAR: return "VAR"; - case STRING: return "STRING"; - case NUMBER: return "NUMBER"; - case CMP_EQ: return "CMP_EQ"; - case CMP_NE: return "CMP_NE"; - case CMP_LE: return "CMP_LE"; - case CMP_GE: return "CMP_GE"; - case CMP_LT: return "CMP_LT"; - case CMP_GT: return "CMP_GT"; - case CMP_CONTAINS: return "CMP_CONTAINS"; - case CMP_CONTAINSI: return "CMP_CONTAINSI"; - case CMP_STARTSWITH: return "CMP_STARTSWITH"; - case CMP_STARTSWITHI: return "CMP_STARTSWITHI"; - case UMINUS: return "UMINUS"; - default: return "UNKNOWN TOKEN"; - } -} diff -Nru rsyslog-7.6.0/grammar/rainerscript.h rsyslog-5.10.1/grammar/rainerscript.h --- rsyslog-7.6.0/grammar/rainerscript.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/grammar/rainerscript.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -#ifndef INC_UTILS_H -#define INC_UTILS_H -#include -#include -#include -#include -#include -#include "typedefs.h" - -#define LOG_NFACILITIES 24 /* current number of syslog facilities */ -#define CNFFUNC_MAX_ARGS 32 - /**< maximum number of arguments that any function can have (among - * others, this is used to size data structures). - */ - -extern int Debug; /* 1 if in debug mode, 0 otherwise -- to be enhanced */ - -enum cnfobjType { - CNFOBJ_ACTION, - CNFOBJ_RULESET, - CNFOBJ_GLOBAL, - CNFOBJ_INPUT, - CNFOBJ_MODULE, - CNFOBJ_TPL, - CNFOBJ_PROPERTY, - CNFOBJ_CONSTANT, - CNFOBJ_MAINQ, - CNFOBJ_LOOKUP_TABLE, - CNFOBJ_INVALID = 0 -}; - -static inline char* -cnfobjType2str(enum cnfobjType ot) -{ - switch(ot) { - case CNFOBJ_ACTION: - return "action"; - break; - case CNFOBJ_RULESET: - return "ruleset"; - break; - case CNFOBJ_GLOBAL: - return "global"; - break; - case CNFOBJ_INPUT: - return "input"; - break; - case CNFOBJ_MODULE: - return "module"; - break; - case CNFOBJ_TPL: - return "template"; - break; - case CNFOBJ_PROPERTY: - return "property"; - break; - case CNFOBJ_CONSTANT: - return "constant"; - break; - case CNFOBJ_MAINQ: - return "main_queue"; - case CNFOBJ_LOOKUP_TABLE: - return "lookup_table"; - break; - default:return "error: invalid cnfobjType"; - } -} - -enum cnfactType { CNFACT_V2, CNFACT_LEGACY }; - -/* a variant type, for example used for expression evaluation - * 2011-07-15/rger: note that there exists a "legacy" object var_t, - * which implements the same idea, but in a suboptimal manner. I have - * stipped this down as much as possible, but will keep it for a while - * to avoid unnecessary complexity during development. TODO: in the long - * term, var_t shall be replaced by struct var. - */ -struct var { - union { - es_str_t *estr; - struct cnfarray *ar; - long long n; - struct json_object *json; - } d; - char datatype; /* 'N' number, 'S' string, 'J' JSON, 'A' array - * Note: 'A' is only supported during config phase - */ -}; - -struct cnfobj { - enum cnfobjType objType; - struct nvlst *nvlst; - struct objlst *subobjs; - struct cnfstmt *script; -}; - -struct objlst { - struct objlst *next; - struct cnfobj *obj; -}; - -struct nvlst { - struct nvlst *next; - es_str_t *name; - struct var val; - unsigned char bUsed; - /**< was this node used during config processing? If not, this - * indicates an error. After all, the user specified a setting - * that the software does not know. - */ -}; - -/* the following structures support expressions, and may (very much later - * be the sole foundation for the AST. - * - * nodetypes (list not yet complete) - * F - function - * N - number - * P - fparamlst - * R - rule - * S - string - * V - var - * A - (string) array - * ... plus the S_* #define's below: - */ -#define S_STOP 4000 -#define S_PRIFILT 4001 -#define S_PROPFILT 4002 -#define S_IF 4003 -#define S_ACT 4004 -#define S_NOP 4005 /* usually used to disable some statement */ -#define S_SET 4006 -#define S_UNSET 4007 -#define S_CALL 4008 - -enum cnfFiltType { CNFFILT_NONE, CNFFILT_PRI, CNFFILT_PROP, CNFFILT_SCRIPT }; -static inline char* -cnfFiltType2str(enum cnfFiltType filttype) -{ - switch(filttype) { - case CNFFILT_NONE: - return("filter:none"); - case CNFFILT_PRI: - return("filter:pri"); - case CNFFILT_PROP: - return("filter:prop"); - case CNFFILT_SCRIPT: - return("filter:script"); - } - return("error:invalid_filter_type"); /* should never be reached */ -} - - -struct cnfstmt { - unsigned nodetype; - struct cnfstmt *next; - uchar *printable; /* printable text for debugging */ - union { - struct { - struct cnfexpr *expr; - struct cnfstmt *t_then; - struct cnfstmt *t_else; - } s_if; - struct { - uchar *varname; - struct cnfexpr *expr; - } s_set; - struct { - uchar *varname; - } s_unset; - struct { - es_str_t *name; - struct cnfstmt *stmt; - ruleset_t *ruleset; /* non-NULL if the ruleset has a queue assigned */ - } s_call; - struct { - uchar pmask[LOG_NFACILITIES+1]; /* priority mask */ - struct cnfstmt *t_then; - struct cnfstmt *t_else; - } s_prifilt; - struct { - fiop_t operation; - regex_t *regex_cache;/* cache for compiled REs, if used */ - struct cstr_s *pCSCompValue;/* value to "compare" against */ - sbool isNegated; - msgPropDescr_t prop; /* requested property */ - struct cnfstmt *t_then; - struct cnfstmt *t_else; - } s_propfilt; - struct action_s *act; - } d; -}; - -struct cnfexpr { - unsigned nodetype; - struct cnfexpr *l; - struct cnfexpr *r; -}; - -struct cnfnumval { - unsigned nodetype; - long long val; -}; - -struct cnfstringval { - unsigned nodetype; - es_str_t *estr; -}; - -struct cnfvar { - unsigned nodetype; - char *name; - msgPropDescr_t prop; -}; - -struct cnfarray { - unsigned nodetype; - int nmemb; - es_str_t **arr; -}; - -struct cnffparamlst { - unsigned nodetype; /* P */ - struct cnffparamlst *next; - struct cnfexpr *expr; -}; - -enum cnffuncid { - CNFFUNC_INVALID = 0, /**< defunct entry, do not use (should normally not be present) */ - CNFFUNC_NAME = 1, /**< use name to call function (for future use) */ - CNFFUNC_STRLEN, - CNFFUNC_GETENV, - CNFFUNC_TOLOWER, - CNFFUNC_CSTR, - CNFFUNC_CNUM, - CNFFUNC_RE_MATCH, - CNFFUNC_RE_EXTRACT, - CNFFUNC_FIELD, - CNFFUNC_PRIFILT, - CNFFUNC_LOOKUP, - CNFFUNC_EXEC_TEMPLATE -}; - -struct cnffunc { - unsigned nodetype; - es_str_t *fname; - unsigned short nParams; - enum cnffuncid fID; /* function ID for built-ins, 0 means use name */ - void *funcdata; /* global data for function-specific use (e.g. compiled regex) */ - struct cnfexpr *expr[]; -}; - -/* future extensions -struct x { - int nodetype; -}; -*/ - - -/* the following defines describe the parameter block for puling - * config parameters. Note that the focus is on ease and saveness of - * use, not performance. For example, we address parameters by name - * instead of index, because the former is less error-prone. The (severe) - * performance hit does not matter, as it is a one-time hit during config - * load but never during actual processing. So there is really no reason - * to care. - */ -struct cnfparamdescr { /* first the param description */ - char *name; /**< not a es_str_t to ease definition in code */ - ecslCmdHdrlType type; - unsigned flags; -}; -/* flags for cnfparamdescr: */ -#define CNFPARAM_REQUIRED 0x0001 - -struct cnfparamblk { /* now the actual param block use in API calls */ - unsigned short version; - unsigned short nParams; - struct cnfparamdescr *descr; -}; -#define CNFPARAMBLK_VERSION 1 - /**< caller must have same version as engine -- else things may - * be messed up. But note that we may support multiple versions - * inside the engine, if at some later stage we want to do - * that. -- rgerhards, 2011-07-15 - */ -struct cnfparamvals { /* the values we obtained for param descr. */ - struct var val; - unsigned char bUsed; -}; - -struct funcData_prifilt { - uchar pmask[LOG_NFACILITIES+1]; /* priority mask */ -}; - - -int cnfParseBuffer(char *buf, unsigned lenBuf); -void readConfFile(FILE *fp, es_str_t **str); -struct objlst* objlstNew(struct cnfobj *obj); -void objlstDestruct(struct objlst *lst); -void objlstPrint(struct objlst *lst); -struct nvlst* nvlstNewArray(struct cnfarray *ar); -struct nvlst* nvlstNewStr(es_str_t *value); -struct nvlst* nvlstSetName(struct nvlst *lst, es_str_t *name); -void nvlstDestruct(struct nvlst *lst); -void nvlstPrint(struct nvlst *lst); -void nvlstChkUnused(struct nvlst *lst); -struct nvlst* nvlstFindName(struct nvlst *lst, es_str_t *name); -struct cnfobj* cnfobjNew(enum cnfobjType objType, struct nvlst *lst); -void cnfobjDestruct(struct cnfobj *o); -void cnfobjPrint(struct cnfobj *o); -struct cnfexpr* cnfexprNew(unsigned nodetype, struct cnfexpr *l, struct cnfexpr *r); -void cnfexprPrint(struct cnfexpr *expr, int indent); -void cnfexprEval(const struct cnfexpr *const expr, struct var *ret, void *pusr); -int cnfexprEvalBool(struct cnfexpr *expr, void *usrptr); -void cnfexprDestruct(struct cnfexpr *expr); -struct cnfnumval* cnfnumvalNew(long long val); -struct cnfstringval* cnfstringvalNew(es_str_t *estr); -struct cnfvar* cnfvarNew(char *name); -struct cnffunc * cnffuncNew(es_str_t *fname, struct cnffparamlst* paramlst); -struct cnffparamlst * cnffparamlstNew(struct cnfexpr *expr, struct cnffparamlst *next); -int cnfDoInclude(char *name); -int cnfparamGetIdx(struct cnfparamblk *params, char *name); -struct cnfparamvals* nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params, - struct cnfparamvals *vals); -void cnfparamsPrint(struct cnfparamblk *params, struct cnfparamvals *vals); -int cnfparamvalsIsSet(struct cnfparamblk *params, struct cnfparamvals *vals); -void varDelete(struct var *v); -void cnfparamvalsDestruct(struct cnfparamvals *paramvals, struct cnfparamblk *blk); -struct cnfstmt * cnfstmtNew(unsigned s_type); -void cnfstmtPrintOnly(struct cnfstmt *stmt, int indent, sbool subtree); -void cnfstmtPrint(struct cnfstmt *stmt, int indent); -struct cnfstmt* scriptAddStmt(struct cnfstmt *root, struct cnfstmt *s); -struct objlst* objlstAdd(struct objlst *root, struct cnfobj *o); -char *rmLeadingSpace(char *s); -struct cnfstmt * cnfstmtNewPRIFILT(char *prifilt, struct cnfstmt *t_then); -struct cnfstmt * cnfstmtNewPROPFILT(char *propfilt, struct cnfstmt *t_then); -struct cnfstmt * cnfstmtNewAct(struct nvlst *lst); -struct cnfstmt * cnfstmtNewLegaAct(char *actline); -struct cnfstmt * cnfstmtNewSet(char *var, struct cnfexpr *expr); -struct cnfstmt * cnfstmtNewUnset(char *var); -struct cnfstmt * cnfstmtNewCall(es_str_t *name); -struct cnfstmt * cnfstmtNewContinue(void); -void cnfstmtDestructLst(struct cnfstmt *root); -void cnfstmtOptimize(struct cnfstmt *root); -struct cnfarray* cnfarrayNew(es_str_t *val); -struct cnfarray* cnfarrayDup(struct cnfarray *old); -struct cnfarray* cnfarrayAdd(struct cnfarray *ar, es_str_t *val); -void cnfarrayContentDestruct(struct cnfarray *ar); -char* getFIOPName(unsigned iFIOP); -rsRetVal initRainerscript(void); -void unescapeStr(uchar *s, int len); -char * tokenval2str(int tok); - -/* debug helper */ -void cstrPrint(char *text, es_str_t *estr); -#endif diff -Nru rsyslog-7.6.0/INSTALL rsyslog-5.10.1/INSTALL --- rsyslog-7.6.0/INSTALL 2014-02-12 12:06:38.000000000 +0000 +++ rsyslog-5.10.1/INSTALL 2012-10-17 14:42:46.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -226,11 +226,6 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended diff -Nru rsyslog-7.6.0/install-sh rsyslog-5.10.1/install-sh --- rsyslog-7.6.0/install-sh 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/install-sh 2012-10-17 14:42:37.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,10 +156,6 @@ -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) no_target_directory=true;; @@ -190,10 +186,6 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -208,11 +200,7 @@ 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 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ for src do - # Protect names problematic for `test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -392,7 +385,7 @@ case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru rsyslog-7.6.0/java/Makefile.in rsyslog-5.10.1/java/Makefile.in --- rsyslog-7.6.0/java/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/java/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -59,17 +59,16 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ SOURCES = DIST_SOURCES = JAVAC = javac am__installdirs = "$(DESTDIR)$(javadir)" -am__java_sources = $(java_JAVA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -87,11 +86,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -105,56 +101,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -162,8 +132,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -183,16 +151,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -204,14 +167,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -245,6 +205,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -322,7 +283,7 @@ clean-libtool: -rm -rf .libs _libs -classjava.stamp: $(am__java_sources) +classjava.stamp: $(java_JAVA) @list1='$?'; list2=; if test -n "$$list1"; then \ for p in $$list1; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ @@ -331,7 +292,7 @@ echo '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) '"$$list2"; \ $(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) $$list2; \ else :; fi - echo timestamp > $@ + echo timestamp > classjava.stamp install-javaJAVA: classjava.stamp @$(NORMAL_INSTALL) test -z "$(javadir)" || $(MKDIR_P) "$(DESTDIR)$(javadir)" @@ -403,15 +364,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/ltmain.sh rsyslog-5.10.1/ltmain.sh --- rsyslog-7.6.0/ltmain.sh 2014-02-12 12:06:24.000000000 +0000 +++ rsyslog-5.10.1/ltmain.sh 2012-10-17 14:42:26.000000000 +0000 @@ -1,9 +1,9 @@ +# Generated from ltmain.m4sh. -# libtool (GNU libtool) 2.4.2 +# ltmain.sh (GNU libtool) 2.2.6b # 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, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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. @@ -32,57 +32,50 @@ # # 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 +# --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 +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or 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 +# 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. +# MODE-ARGS vary depending on the MODE. # 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 Debian-2.4.2-1ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . -PROGRAM=libtool +PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1ubuntu1" +VERSION="2.2.6b Debian-2.2.6b-2ubuntu3" TIMESTAMP="" -package_revision=1.3337 +package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -98,15 +91,10 @@ 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. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -119,28 +107,24 @@ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL $lt_unset CDPATH -# 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" : ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${ECHO="echo"} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} +: ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -160,27 +144,6 @@ 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 - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -195,183 +158,33 @@ # 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 - - -# 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 - - -# 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,/*$,/,' - -# 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 + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` } -# 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 +# Generated shell functions inserted here. - # 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 - - # 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: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -383,7 +196,7 @@ ;; *) save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} + IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -402,15 +215,6 @@ # 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' - -# 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. @@ -439,7 +243,7 @@ # name if it has been set yet. func_echo () { - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" + $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... @@ -454,25 +258,18 @@ : } -# 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 + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # 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 + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -529,9 +326,9 @@ case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -581,7 +378,7 @@ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "$my_tmpdir" + $ECHO "X$my_tmpdir" | $Xsed } @@ -595,7 +392,7 @@ { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -622,7 +419,7 @@ { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ + my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -691,39 +488,15 @@ 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 () -{ - 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 -} + + # 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; / { + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -736,28 +509,22 @@ # Echo short help message to standard output and exit. func_usage () { - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { + $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - echo + $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } -# 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'* @@ -767,18 +534,11 @@ 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`"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(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 + }' < "$progpath" + exit $? } # func_missing_arg argname @@ -786,106 +546,63 @@ # exit_cmd. func_missing_arg () { - $opt_debug - - func_error "missing argument for $1." + func_error "missing argument for $1" exit_cmd=exit } +exit_cmd=: -# 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 () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - 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_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 () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - 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 -exit_cmd=: +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# 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_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -919,16 +636,16 @@ # Display the features supported by this script. func_features () { - echo "host: $host" + $ECHO "host: $host" if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" + $ECHO "enable shared libraries" else - echo "disable shared libraries" + $ECHO "disable shared libraries" fi if test "$build_old_libs" = yes; then - echo "enable static libraries" + $ECHO "enable static libraries" else - echo "disable static libraries" + $ECHO "disable static libraries" fi exit $? @@ -975,209 +692,117 @@ 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 () +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. { - 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 -$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 -$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 - - 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 - - - -# 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 -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do + # Parse non-mode specific arguments: + while test "$#" -gt 0; do opt="$1" shift + case $opt in - --debug|-x) opt_debug='set -x' + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" + opt_debug='set -x' $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" + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" 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 + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + 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 $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" 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) + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false + + --verbose| -v) preserve_args="$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" + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here 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+"$@"} + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_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 - ;; + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; esac done - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -1185,44 +810,82 @@ opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac - $opt_help || { - # Sanity checks first: - func_check_version_match + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" +# 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 +$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 +$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 +$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 - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + exit $EXIT_MISMATCH + fi +} + - # 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 +## ----------- ## +## Main. ## +## ----------- ## - # 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 + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" -## ----------- ## -## Main. ## -## ----------- ## + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; 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=$mode' for more information." +} + # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -1287,9 +950,12 @@ # temporary ltwrapper_script. 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="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi } # func_ltwrapper_p file @@ -1335,37 +1001,6 @@ } -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1378,15 +1013,13 @@ if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_append_quoted CC_quoted "$arg" + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1397,13 +1030,11 @@ CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1466,486 +1097,6 @@ } } - -################################################## -# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # -################################################## - -# func_convert_core_file_wine_to_w32 ARG -# Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a -# correctly configured wine environment available, with the winepath program -# in $build's $PATH. -# -# ARG is the $build file name to be converted to w32 format. -# Result is available in $func_convert_core_file_wine_to_w32_result, and will -# be empty on error (or when ARG is empty) -func_convert_core_file_wine_to_w32 () -{ - $opt_debug - func_convert_core_file_wine_to_w32_result="$1" - if test -n "$1"; then - # Unfortunately, winepath does not exit with a non-zero error code, so we - # are forced to check the contents of stdout. On the other hand, if the - # command is not found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both error code of - # zero AND non-empty stdout, which explains the odd construction: - func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` - 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"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - 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 -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" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # 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"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - 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. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# 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. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - 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" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - 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. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# 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" - 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" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - 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" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - 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" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# 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. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - 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}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - 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 ';.'; - # and winepath ignores them completely. - 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_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - 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_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# 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" - 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_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - 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_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - 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 ';.', and winepath ignores them completely. - func_stripname : : "$1" - 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_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - # func_mode_compile arg... func_mode_compile () { @@ -1986,12 +1137,12 @@ ;; -pie | -fpie | -fPIE) - func_append pie_flag " $arg" + pie_flag="$pie_flag $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" + later="$later $arg" continue ;; @@ -2012,14 +1163,15 @@ save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_append_quoted lastarg "$arg" + func_quote_for_eval "$arg" + lastarg="$lastarg $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - func_append base_compile " $lastarg" + base_compile="$base_compile $lastarg" continue ;; @@ -2035,7 +1187,8 @@ esac # case $arg_mode # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" + func_quote_for_eval "$lastarg" + base_compile="$base_compile $func_quote_for_eval_result" done # for arg case $arg_mode in @@ -2060,7 +1213,7 @@ *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.obj | *.sx) func_xform "$libobj" libobj=$func_xform_result ;; @@ -2135,7 +1288,7 @@ # 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} + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -2166,16 +1319,17 @@ $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - func_append removelist " $output_obj" + removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" + removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -2195,7 +1349,7 @@ if test -z "$output_obj"; then # Place PIC objects in $objdir - func_append command " -o $lobj" + command="$command -o $lobj" fi func_show_eval_locale "$command" \ @@ -2242,11 +1396,11 @@ command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - func_append command " -o $obj" + command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" + command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -2291,13 +1445,13 @@ } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $opt_mode in + case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -2328,11 +1482,10 @@ -o OUTPUT-FILE set the output file name to OUTPUT-FILE -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 + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building 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 - -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -2385,7 +1538,7 @@ The following components of INSTALL-COMMAND are treated specially: - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -2405,8 +1558,6 @@ -all-static do not do any dynamic linking at all -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 -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) @@ -2435,11 +1586,6 @@ -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -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. @@ -2473,44 +1619,18 @@ ;; *) - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode \`$mode'" ;; esac - echo + $ECHO $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? } -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help # func_mode_execute arg... @@ -2523,16 +1643,13 @@ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $opt_dlopen; do + for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - # 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" @@ -2554,7 +1671,7 @@ dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" + dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -2595,7 +1712,7 @@ for file do case $file in - -* | *.la | *.lo ) ;; + -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -2611,7 +1728,8 @@ ;; esac # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then @@ -2636,66 +1754,29 @@ # 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 - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - 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 \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" + $ECHO "export $shlibpath_var" fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -2705,7 +1786,7 @@ if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " + $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done @@ -2714,55 +1795,53 @@ # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - 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 "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 " during execution" - fi - if test -n "$runpath_var"; then - 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" - 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'" - fi - echo + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $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 "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 " during execution" + fi + if test -n "$runpath_var"; then + $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 "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" + $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'" fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" + $ECHO "pages." + ;; + *) + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -2773,7 +1852,7 @@ # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -2787,12 +1866,7 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac + install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= @@ -2802,12 +1876,10 @@ install_type= isdir=no stripme= - no_mode=: for arg do - arg2= if test -n "$dest"; then - func_append files " $dest" + files="$files $dest" dest=$arg continue fi @@ -2815,9 +1887,10 @@ case $arg in -d) isdir=yes ;; -f) - if $install_cp; then :; else - prev=$arg - fi + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac ;; -g | -m | -o) prev=$arg @@ -2831,10 +1904,6 @@ *) # 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 - arg2=$install_override_mode - no_mode=false - fi prev= else dest=$arg @@ -2845,11 +1914,7 @@ # Aesthetically quote the argument. func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" + install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -2858,13 +1923,6 @@ test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -2919,13 +1977,10 @@ case $file in *.$libext) # Do the static libraries later. - func_append staticlibs " $file" + staticlibs="$staticlibs $file" ;; *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - # 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" @@ -2939,23 +1994,23 @@ if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; + *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; + *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - func_append dir "$objdir" + dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2968,9 +2023,9 @@ if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2988,7 +2043,7 @@ 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" \ + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -3028,7 +2083,7 @@ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) @@ -3128,7 +2183,7 @@ if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -3147,7 +2202,7 @@ file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -3166,7 +2221,7 @@ } else # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -3202,13 +2257,11 @@ # Set up the ranlib parameters. oldlib="$destdir/$name" - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -3227,7 +2280,7 @@ fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -3270,22 +2323,6 @@ extern \"C\" { #endif -#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 - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#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 - /* External symbol declarations for the compiler. */\ " @@ -3295,11 +2332,10 @@ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$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'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -3335,7 +2371,7 @@ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -3348,52 +2384,10 @@ func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" 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="" - 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 - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } done $opt_dry_run || { @@ -3421,19 +2415,36 @@ if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - echo >> "$output_objdir/$my_dlsyms" "\ + $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist +$lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -3446,7 +2457,7 @@ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - echo >> "$output_objdir/$my_dlsyms" "\ + $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -3473,7 +2484,7 @@ # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -3489,7 +2500,7 @@ for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; + *) symtab_cflags="$symtab_cflags $arg" ;; esac done @@ -3504,16 +2515,16 @@ case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -3527,8 +2538,8 @@ # really was required. # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } @@ -3538,7 +2549,6 @@ # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -3549,11 +2559,9 @@ win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static - # 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\" | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ @@ -3582,131 +2590,6 @@ $ECHO "$win32_libid_type" } -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./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 - # 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 - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $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 -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - 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 - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} # func_extract_an_archive dir oldlib @@ -3715,18 +2598,7 @@ $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; 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" - sleep 2 - done - 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 - $opt_dry_run || rm -f "$lockfile" - fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -3797,7 +2669,7 @@ darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -3812,30 +2684,25 @@ func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. + +# func_emit_wrapper_part1 [arg=no] # -# 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 -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} +# Emit the first part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part1 () +{ + func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part1_arg1=$1 + fi $ECHO "\ #! $SHELL @@ -3851,6 +2718,7 @@ # 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='$sed_quote_subst' # Be Bourne compatible @@ -3881,135 +2749,31 @@ else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# 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 -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $ECHO "\ # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -4019,13 +2783,30 @@ esac fi - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done +" +} +# end: func_emit_wrapper_part1 + +# func_emit_wrapper_part2 [arg=no] +# +# Emit the second part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part2 () +{ + func_emit_wrapper_part2_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part2_arg1=$1 + fi + + $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -4033,7 +2814,7 @@ fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -4088,18 +2869,6 @@ if test -f \"\$progdir/\$program\"; then" - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -4108,28 +2877,253 @@ # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 fi else # The program doesn't exist. \$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 + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } - +# end: func_emit_wrapper_part2 + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# 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 +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + # split this up so that func_emit_cwrapperexe_src + # can call each part independently. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_path_tmp1=`( cmd //c echo "$1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_tmp1=`cygpath -w "$1"` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result="" + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_to_host_pathlist_tmp2="$1" + # Once set for this call, this variable should not be + # reassigned. It is used in tha fallback case. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e 's|^:*||' -e 's|:*$||'` + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" + fi + fi + fi + IFS=: + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result" ; then + func_error "Could not determine the host path(s) corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout @@ -4147,23 +3141,31 @@ This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. + + Currently, it simply execs the wrapper *script* "$SHELL $output", + but could eventually absorb all of the scripts functionality and + exec $objdir/$outputname directly. */ EOF cat <<"EOF" -#ifdef _MSC_VER -# define _CRT_SECURE_NO_DEPRECATE 1 -#endif #include #include #ifdef _MSC_VER # include # include # include +# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include +# define HAVE_SETENV +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif # endif #endif #include @@ -4175,44 +3177,6 @@ #include #include -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#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) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#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__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) @@ -4228,7 +3192,14 @@ # define S_IXGRP 0 #endif -/* path handling portability macros */ +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -4259,6 +3230,10 @@ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -4271,13 +3246,22 @@ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} #else -static int lt_debug = 0; +# define LTWRAPPER_DEBUGPRINTF(args) #endif -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ +const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -4287,27 +3271,41 @@ int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); +void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_opt_process_env_set (const char *arg); +void lt_opt_process_env_prepend (const char *arg); +void lt_opt_process_env_append (const char *arg); +int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); + +static const char *script_text_part1 = +EOF + + func_emit_wrapper_part1 yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + cat <"))); for (i = 0; i < newargc; i++) { - lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", - i, nonnull (newargz[i])); + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF @@ -4523,14 +3560,11 @@ mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ - newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - lt_debugprintf (__FILE__, __LINE__, - "(main) failed to launch target \"%s\": %s\n", - lt_argv_zero, nonnull (strerror (errno))); + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; @@ -4552,7 +3586,7 @@ { void *p = (void *) malloc (num); if (!p) - lt_fatal (__FILE__, __LINE__, "memory exhausted"); + lt_fatal ("Memory exhausted"); return p; } @@ -4586,8 +3620,8 @@ { struct stat st; - lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", - nonempty (path)); + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; @@ -4604,8 +3638,8 @@ int rval = 0; struct stat st; - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; @@ -4631,8 +3665,8 @@ int tmp_len; char *concat_name; - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -4685,8 +3719,7 @@ { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); + lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -4711,8 +3744,7 @@ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); + lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -4738,9 +3770,8 @@ int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -4762,9 +3793,8 @@ } else { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); @@ -4777,8 +3807,7 @@ tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); + lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -4804,25 +3833,11 @@ return str; } -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, +lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -4831,32 +3846,20 @@ } void -lt_fatal (const char *file, int line, const char *message, ...) +lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - void lt_setenv (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -4901,12 +3904,95 @@ return new_value; } +int +lt_split_name_value (const char *arg, char** name, char** value) +{ + const char *p; + int len; + if (!arg || !*arg) + return 1; + + p = strchr (arg, (int)'='); + + if (!p) + return 1; + + *value = xstrdup (++p); + + len = strlen (arg) - strlen (*value); + *name = XMALLOC (char, len); + strncpy (*name, arg, len-1); + (*name)[len - 1] = '\0'; + + return 0; +} + +void +lt_opt_process_env_set (const char *arg) +{ + char *name = NULL; + char *value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); + } + + lt_setenv (name, value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_prepend (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_append (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 1); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + void lt_update_exe_path (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); if (name && *name && value && *value) { @@ -4925,9 +4011,9 @@ void lt_update_lib_path (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); if (name && *name && value && *value) { @@ -4937,158 +4023,11 @@ } } -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} EOF } # end: func_emit_cwrapperexe_src -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - # func_mode_link arg... func_mode_link () { @@ -5133,7 +4072,6 @@ new_inherited_linker_flags= avoid_version=no - bindir= dlfiles= dlprefiles= dlself=no @@ -5226,11 +4164,6 @@ esac case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -5262,9 +4195,9 @@ ;; *) if test "$prev" = dlfiles; then - func_append dlfiles " $arg" + dlfiles="$dlfiles $arg" else - func_append dlprefiles " $arg" + dlprefiles="$dlprefiles $arg" fi prev= continue @@ -5288,7 +4221,7 @@ *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; @@ -5307,7 +4240,7 @@ moreargs= for fil in `cat "$save_arg"` do -# func_append moreargs " $fil" +# moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. @@ -5336,7 +4269,7 @@ if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" + dlfiles="$dlfiles $pic_object" prev= continue else @@ -5348,7 +4281,7 @@ # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - func_append dlprefiles " $pic_object" + dlprefiles="$dlprefiles $pic_object" prev= fi @@ -5418,12 +4351,12 @@ if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) func_append rpath " $arg" ;; + *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) func_append xrpath " $arg" ;; + *) xrpath="$xrpath $arg" ;; esac fi prev= @@ -5435,28 +4368,28 @@ continue ;; weak) - func_append weak_libs " $arg" + weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - func_append compiler_flags " $qarg" + compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -5492,11 +4425,6 @@ continue ;; - -bindir) - prev=bindir - continue - ;; - -dlopen) prev=dlfiles continue @@ -5547,16 +4475,15 @@ ;; -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -5568,30 +4495,24 @@ ;; esac case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; + *" -L$dir "*) ;; *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; + *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; + *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac @@ -5601,7 +4522,7 @@ -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; @@ -5615,7 +4536,7 @@ ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" + deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -5635,7 +4556,7 @@ ;; esac fi - func_append deplibs " $arg" + deplibs="$deplibs $arg" continue ;; @@ -5647,22 +4568,21 @@ # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; @@ -5729,17 +4649,13 @@ # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) func_append xrpath " $dir" ;; + *) xrpath="$xrpath $dir" ;; esac continue ;; @@ -5792,8 +4708,8 @@ for flag in $args; do 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" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -5808,9 +4724,9 @@ for flag in $args; do 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" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -5838,27 +4754,23 @@ arg="$func_quote_for_eval_result" ;; - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -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 - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files -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) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - func_append compiler_flags " $arg" + compiler_flags="$compiler_flags $arg" continue ;; @@ -5870,7 +4782,7 @@ *.$objext) # A standard object. - func_append objs " $arg" + objs="$objs $arg" ;; *.lo) @@ -5901,7 +4813,7 @@ if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" + dlfiles="$dlfiles $pic_object" prev= continue else @@ -5913,7 +4825,7 @@ # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - func_append dlprefiles " $pic_object" + dlprefiles="$dlprefiles $pic_object" prev= fi @@ -5958,25 +4870,24 @@ *.$libext) # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. - func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" + dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" + dlprefiles="$dlprefiles $arg" prev= else - func_append deplibs " $func_resolve_sysroot_result" + deplibs="$deplibs $arg" fi continue ;; @@ -6014,7 +4925,7 @@ 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 \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi @@ -6023,8 +4934,6 @@ func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -6045,12 +4954,12 @@ # 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_duplicate_deps ; then case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append libs " $deplib" + libs="$libs $deplib" done if test "$linkmode" = lib; then @@ -6063,9 +4972,9 @@ if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac - func_append pre_post_deps " $pre_post_dep" + pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= @@ -6135,19 +5044,17 @@ for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= - func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; + *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; + *) deplibs="$deplibs $deplib" ;; esac done done @@ -6163,17 +5070,16 @@ lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - func_append compiler_flags " $deplib" + compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi @@ -6258,7 +5164,7 @@ if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi @@ -6271,8 +5177,7 @@ test "$pass" = conv && 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" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then @@ -6286,8 +5191,7 @@ finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -6298,21 +5202,17 @@ -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result + dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) func_append xrpath " $dir" ;; + *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; + *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -6330,7 +5230,7 @@ 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 \ + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -6340,15 +5240,15 @@ ;; esac if test "$valid_a_lib" != yes; then - echo + $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." - 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" - 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." + $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" + $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 $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -6375,11 +5275,11 @@ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - func_append newdlprefiles " $deplib" + newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - func_append newdlfiles " $deplib" + newdlfiles="$newdlfiles $deplib" fi fi continue @@ -6421,20 +5321,20 @@ # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then @@ -6445,17 +5345,17 @@ 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" + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $deplib" + tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" @@ -6466,15 +5366,9 @@ # 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 - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi + for l in $old_library $library_names; do + linklib="$l" + done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -6491,9 +5385,9 @@ # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" + dlprefiles="$dlprefiles $lib $dependency_libs" else - func_append newdlfiles " $lib" + newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen @@ -6515,14 +5409,14 @@ # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" + dir="$libdir" + absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -6530,12 +5424,12 @@ dir="$ladir" absdir="$abs_ladir" # Remove this search path later - func_append notinst_path " $abs_ladir" + notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - func_append notinst_path " $abs_ladir" + notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -6546,46 +5440,20 @@ if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi fi # $pass = dlpreopen if test -z "$libdir"; then @@ -6603,7 +5471,7 @@ if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" + newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -6616,8 +5484,7 @@ for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? @@ -6628,12 +5495,12 @@ # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps ; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $deplib" + tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... @@ -6648,7 +5515,7 @@ # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; + *) temp_rpath="$temp_rpath$absdir:" ;; esac fi @@ -6660,7 +5527,7 @@ *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac ;; esac @@ -6669,7 +5536,7 @@ *) case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac @@ -6694,12 +5561,12 @@ case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" + notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then - func_append notinst_deplibs " $lib" + notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; @@ -6716,7 +5583,7 @@ fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo + $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -6734,7 +5601,7 @@ *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac ;; esac @@ -6743,7 +5610,7 @@ *) case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac @@ -6797,7 +5664,7 @@ linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$opt_mode" != relink; then + if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= @@ -6819,9 +5686,9 @@ if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" 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" + $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" fi @@ -6848,12 +5715,12 @@ test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" + add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi @@ -6875,7 +5742,7 @@ if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -6889,13 +5756,13 @@ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$opt_mode" = relink; then + if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= @@ -6909,7 +5776,7 @@ elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -6926,7 +5793,7 @@ if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi @@ -6961,21 +5828,21 @@ # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - echo + $ECHO $ECHO "*** Warning: This system can not 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." + $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 - 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." + $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 "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + $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 "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -7003,33 +5870,27 @@ temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; + *) xrpath="$xrpath $temp_xrpath";; esac;; - *) func_append temp_deplibs " $libdir";; + *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi - func_append newlib_search_path " $absdir" + newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $func_resolve_sysroot_result" + tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then @@ -7039,10 +5900,8 @@ case $deplib in -L*) path="$deplib" ;; *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -7069,8 +5928,8 @@ if test -z "$darwin_install_name"; then 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}" + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -7103,7 +5962,7 @@ 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'` + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -7120,7 +5979,7 @@ for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; + *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= @@ -7178,10 +6037,10 @@ -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; + *) tmp_libs="$tmp_libs $deplib" ;; esac ;; - *) func_append tmp_libs " $deplib" ;; + *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -7197,7 +6056,7 @@ ;; esac if test -n "$i" ; then - func_append tmp_libs " $i" + tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs @@ -7238,7 +6097,7 @@ # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - func_append objs "$old_deplibs" + objs="$objs$old_deplibs" ;; lib) @@ -7271,10 +6130,10 @@ if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - echo + $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" + libobjs="$libobjs $objs" fi fi @@ -7333,14 +6192,13 @@ # which 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) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|qnx|sunos) + freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" @@ -7453,7 +6311,7 @@ versuffix="$major.$revision" ;; - linux) # correct to gnu/linux during the next big refactor + linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -7476,7 +6334,7 @@ done # Make executables depend on our current version. - func_append verstring ":${current}.0" + verstring="$verstring:${current}.0" ;; qnx) @@ -7544,10 +6402,10 @@ fi func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" + libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$opt_mode" != relink; then + if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -7563,7 +6421,7 @@ continue fi fi - func_append removelist " $p" + removelist="$removelist $p" ;; *) ;; esac @@ -7574,28 +6432,27 @@ # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" + oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" + temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -7609,7 +6466,7 @@ for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; + *) dlfiles="$dlfiles $lib" ;; esac done @@ -7619,19 +6476,19 @@ for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; + *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" + deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -7648,7 +6505,7 @@ *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" + deplibs="$deplibs -lc" fi ;; esac @@ -7697,7 +6554,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" i="" ;; esac @@ -7708,21 +6565,21 @@ set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" else droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: dynamic linker does not accept needed library $i." - 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 I believe you do not have" - echo "*** because a test_compile did reveal that the linker did not use it for" - echo "*** its dynamic dependency list that programs get resolved with at runtime." + $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 I believe you do not have" + $ECHO "*** because a test_compile did reveal that the linker did not use it for" + $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" ;; esac done @@ -7740,7 +6597,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" i="" ;; esac @@ -7751,29 +6608,29 @@ set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" else droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: dynamic linker does not accept needed library $i." - 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" - echo "*** because a test_compile did reveal that the linker did not use this one" - echo "*** as a dynamic dependency that programs can get resolved with at runtime." + $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" + $ECHO "*** because a test_compile did reveal that the linker did not use this one" + $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - echo + $ECHO $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - echo "*** make it link in! You will probably need to install it or some" - echo "*** library that it depends on before this library will be fully" - echo "*** functional. Installing it before continuing would be even better." + $ECHO "*** make it link in! You will probably need to install it or some" + $ECHO "*** library that it depends on before this library will be fully" + $ECHO "*** functional. Installing it before continuing would be even better." fi ;; *) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" ;; esac done @@ -7790,27 +6647,15 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi 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` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then - shopt -s nocaseglob - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -7827,13 +6672,13 @@ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e '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" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi @@ -7842,12 +6687,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - 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" - echo "*** because I did check the linker path looking for a file starting" + $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" + $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -7858,7 +6703,7 @@ ;; *) # Add a -L argument. - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. @@ -7874,7 +6719,7 @@ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac @@ -7885,9 +6730,9 @@ 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 - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi @@ -7896,12 +6741,12 @@ fi if test -n "$a_deplib" ; then droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - 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" - echo "*** because I did check the linker path looking for a file starting" + $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" + $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -7912,32 +6757,32 @@ ;; *) # Add a -L argument. - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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 "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi - case $tmp_deplibs in - *[!\ \ ]*) - echo + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else - echo "*** Warning: inter-library dependencies are not known to be supported." + $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi - echo "*** All declared inter-library dependencies are being dropped." + $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - ;; - esac + fi ;; esac versuffix=$versuffix_save @@ -7949,23 +6794,23 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO + $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." + $ECHO "*** a static module, that should work as long as the dlopening" + $ECHO "*** application is linked with the -dlopen flag." 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 "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + $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 "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -7975,16 +6820,16 @@ build_libtool_libs=no fi else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." + $ECHO "*** The inter-library dependencies that have been dropped here will be" + $ECHO "*** automatically added whenever a program is linked with this library" + $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; 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." + $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" build_libtool_libs=module @@ -8001,9 +6846,9 @@ # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -8016,7 +6861,7 @@ *) case " $deplibs " in *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac @@ -8026,10 +6871,10 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" @@ -8041,22 +6886,15 @@ # 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. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + test "$mode" != relink && 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" else @@ -8065,18 +6903,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" + dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; + *) perm_rpath="$perm_rpath $libdir" ;; esac fi done @@ -8084,13 +6922,17 @@ if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -8098,7 +6940,7 @@ fi shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -8124,18 +6966,18 @@ linknames= for link do - func_append linknames " $link" + linknames="$linknames $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= 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" - func_append delfiles " $export_symbols" + delfiles="$delfiles $export_symbols" fi orig_export_symbols= @@ -8166,45 +7008,13 @@ $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do + for cmd in $cmds; do 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 - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - 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" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -8226,7 +7036,7 @@ 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" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -8238,7 +7048,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -8248,7 +7058,7 @@ case " $convenience " in *" $test_deplib "*) ;; *) - func_append tmp_deplibs " $test_deplib" + tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done @@ -8268,21 +7078,21 @@ test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" + libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" + linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then + if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -8327,8 +7137,7 @@ save_libobjs=$libobjs fi save_output=$output - func_basename "$output" - output_la=$func_basename_result + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. @@ -8341,16 +7150,13 @@ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output + $ECHO 'INPUT (' > $output for obj in $save_libobjs do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output + $ECHO "$obj" >> $output done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result + $ECHO ')' >> $output + delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -8364,12 +7170,10 @@ fi for obj do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output + $ECHO "$obj" >> $output done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -8393,19 +7197,17 @@ # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" + objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -8415,12 +7217,11 @@ # reloadable object file. All subsequent reloadable object # 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 $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - func_append delfiles " $output" + delfiles="$delfiles $output" else output= @@ -8454,7 +7255,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8475,7 +7276,7 @@ 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" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -8487,7 +7288,7 @@ # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -8528,10 +7329,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" + libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -8547,7 +7348,7 @@ lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8559,7 +7360,7 @@ IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test "$mode" = relink; 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 @@ -8640,21 +7441,18 @@ 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'` + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && 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 "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -8714,8 +7512,8 @@ case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac @@ -8726,14 +7524,14 @@ if test "$tagname" = CXX ; 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" + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -8747,7 +7545,7 @@ *) case " $compile_deplibs " in *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac @@ -8757,17 +7555,17 @@ -L*) case " $new_libs " in *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -8775,7 +7573,7 @@ # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi @@ -8794,18 +7592,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; + *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in @@ -8814,12 +7612,12 @@ case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; + *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; + *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac @@ -8845,18 +7643,18 @@ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done @@ -8870,8 +7668,8 @@ if test -n "$libobjs" && test "$build_old_libs" = yes; 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` + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -8883,15 +7681,15 @@ wrappers_required=yes case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; + *cegcc) + # Disable wrappers for cegcc, we are cross compiling anyway. + wrappers_required=no + ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -8900,19 +7698,13 @@ esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -8935,7 +7727,7 @@ # We should set the runpath_var. rpath= for dir in $perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8943,7 +7735,7 @@ # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8953,18 +7745,11 @@ # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - exit $EXIT_SUCCESS fi @@ -8979,7 +7764,7 @@ 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'` + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -8991,19 +7776,13 @@ fi # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - # Now create the wrapper script. func_verbose "creating $output" @@ -9021,7 +7800,18 @@ fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -9101,7 +7891,7 @@ else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" + oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" @@ -9109,10 +7899,10 @@ if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" + oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. @@ -9123,10 +7913,10 @@ # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" + oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -9142,9 +7932,9 @@ done | sort | sort -uc >/dev/null 2>&1); then : else - echo "copying selected object files to avoid basename conflicts..." + $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -9168,30 +7958,18 @@ esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" ;; - *) func_append oldobjs " $obj" ;; + *) oldobjs="$oldobjs $obj" ;; esac done fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -9265,7 +8043,7 @@ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -9285,23 +8063,12 @@ *.la) func_basename "$deplib" 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' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" + newdependency_libs="$newdependency_libs $libdir/$name" ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -9315,9 +8082,9 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + newdlfiles="$newdlfiles $libdir/$name" ;; - *) func_append newdlfiles " $lib" ;; + *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" @@ -9334,7 +8101,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done @@ -9346,7 +8113,7 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - func_append newdlfiles " $abs" + newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -9355,33 +8122,15 @@ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - func_append newdlprefiles " $abs" + newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. tdlname=$dlname 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 - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -9440,7 +8189,7 @@ exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && +{ test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} @@ -9460,9 +8209,9 @@ for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; esac done @@ -9471,23 +8220,24 @@ rmdirs= + origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - odir="$objdir" + objdir="$origobjdir" else - odir="$dir/$objdir" + objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + test "$mode" = uninstall && objdir="$dir" - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; esac fi @@ -9513,17 +8263,18 @@ # Delete the libtool libraries and symlinks. for n in $library_names; do - func_append rmfiles " $odir/$n" + rmfiles="$rmfiles $objdir/$n" done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - case "$opt_mode" in + case "$mode" in clean) - case " $library_names " in + case " $library_names " in + # " " in the beginning catches empty $dlname *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -9551,19 +8302,19 @@ # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" + rmfiles="$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 - func_append rmfiles " $dir/$non_pic_object" + rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test "$mode" = clean ; then noexename=$name case $file in *.exe) @@ -9573,7 +8324,7 @@ noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - func_append rmfiles " $file" + rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. @@ -9582,7 +8333,7 @@ func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -9590,12 +8341,12 @@ # 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}" + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" + rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" + rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi @@ -9603,6 +8354,7 @@ esac func_show_eval "$RM $rmfiles" 'exit_status=1' done + objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -9614,16 +8366,16 @@ exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && +{ test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$opt_mode" && { +test -z "$mode" && { 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 \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff -Nru rsyslog-7.6.0/m4/libtool.m4 rsyslog-5.10.1/m4/libtool.m4 --- rsyslog-7.6.0/m4/libtool.m4 2014-02-12 12:06:25.000000000 +0000 +++ rsyslog-5.10.1/m4/libtool.m4 2012-10-17 14:42:26.000000000 +0000 @@ -1,8 +1,7 @@ # 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. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -11,8 +10,7 @@ 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. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -39,7 +37,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 57 LT_INIT +# serial 56 LT_INIT # LT_PREREQ(VERSION) @@ -68,7 +66,6 @@ # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -85,8 +82,6 @@ AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -123,7 +118,7 @@ *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) @@ -143,11 +138,6 @@ m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -170,13 +160,10 @@ dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl -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 _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -192,6 +179,7 @@ _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -205,6 +193,23 @@ ;; esac +# 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. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -245,28 +250,6 @@ ])# _LT_SETUP -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -425,7 +408,7 @@ # 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"`']) +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -435,7 +418,7 @@ # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -534,20 +517,12 @@ LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -558,9 +533,9 @@ # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -568,38 +543,16 @@ esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + _LT_OUTPUT_LIBTOOL_INIT ]) -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# 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 -# 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). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -609,11 +562,20 @@ AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. -cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -639,7 +601,7 @@ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2011 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -684,13 +646,15 @@ # appending to config.log, which fails on DOS, as config.log is still kept # 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 && - 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 -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + 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 + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi ])# LT_OUTPUT @@ -753,12 +717,15 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS - _LT_PROG_REPLACE_SHELLFNS + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -803,7 +770,6 @@ m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -825,31 +791,6 @@ ])# _LT_LANG -m4_ifndef([AC_PROG_GO], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -880,10 +821,6 @@ m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -894,13 +831,11 @@ AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -986,13 +921,7 @@ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - 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 + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -1000,7 +929,6 @@ rm -rf libconftest.dylib* rm -f conftest.* fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -1012,34 +940,6 @@ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) - - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _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 - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -1067,7 +967,7 @@ else _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" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1077,8 +977,8 @@ ]) -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -1087,13 +987,7 @@ _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\"`' - 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(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -1101,7 +995,7 @@ *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo _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}" @@ -1117,141 +1011,202 @@ fi ]) -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# 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 - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _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" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# 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). +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" -# _LT_WITH_SYSROOT -# ---------------- -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).], -[], [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 #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH - 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.])]) # _LT_ENABLE_LOCK # --------------- @@ -1281,7 +1236,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1374,27 +1329,14 @@ CFLAGS="$SAVE_CFLAGS" fi ;; -*-*solaris*) +sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - 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" - fi - ;; + yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1412,47 +1354,14 @@ ])# _LT_ENABLE_LOCK -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [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 - # 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 - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1471,27 +1380,18 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1516,15 +1416,15 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1564,7 +1464,7 @@ if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1627,11 +1527,6 @@ lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1657,11 +1552,6 @@ lt_cv_sys_max_cmd_len=196608 ;; - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1701,8 +1591,8 @@ # 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` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1753,7 +1643,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" +[#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1794,13 +1684,7 @@ # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1809,11 +1693,7 @@ if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -1989,16 +1869,16 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2157,7 +2037,6 @@ 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 AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2166,23 +2045,16 @@ 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" ;; - 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 - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2195,7 +2067,7 @@ 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 ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2215,13 +2087,7 @@ if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # 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'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2247,7 +2113,7 @@ case $host_os in aix3*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2256,7 +2122,7 @@ ;; aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2309,7 +2175,7 @@ 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=`$ECHO "X$lib" | $Xsed -e '\''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' ;; esac ;; @@ -2321,7 +2187,7 @@ ;; bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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' @@ -2340,9 +2206,8 @@ need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2363,83 +2228,36 @@ 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}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix 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}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - 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=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + 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}' ;; 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'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2460,7 +2278,7 @@ ;; dgux*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2468,6 +2286,10 @@ shlibpath_var=LD_LIBRARY_PATH ;; +freebsd1*) + dynamic_linker=no + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2475,7 +2297,7 @@ objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[23]].*) objformat=aout ;; + freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2493,7 +2315,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2.*) + freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2513,26 +2335,12 @@ ;; gnu*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2578,14 +2386,12 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2601,7 +2407,7 @@ nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux else version_type=irix fi ;; @@ -2638,9 +2444,9 @@ dynamic_linker=no ;; -# This must be glibc/ELF. +# This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2648,21 +2454,16 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2671,7 +2472,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/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' ' '` + 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;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2715,7 +2516,7 @@ ;; newsos6) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -2784,7 +2585,7 @@ ;; solaris*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2809,7 +2610,7 @@ ;; sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -2833,7 +2634,7 @@ sysv4*MP*) if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -2864,7 +2665,7 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2874,7 +2675,7 @@ ;; uts4*) - version_type=linux # correct to gnu/linux during the next big refactor + version_type=linux 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 @@ -2916,8 +2717,6 @@ The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -3030,7 +2829,6 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -3152,11 +2950,6 @@ esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -3165,8 +2958,8 @@ fi ;; esac -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_TAGDECL([], [reload_cmds], [2])dnl +_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_DECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3218,18 +3011,16 @@ # 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 - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3259,10 +3050,6 @@ lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3271,11 +3058,11 @@ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3296,7 +3083,7 @@ lt_cv_deplibs_check_method=pass_all ;; -# This must be glibc/ELF. +# This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3375,21 +3162,6 @@ ;; esac ]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3397,11 +3169,7 @@ _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) + [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3458,19 +3226,7 @@ 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 - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3483,13 +3239,13 @@ AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3504,67 +3260,6 @@ dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -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 - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - # LT_LIB_M # -------- @@ -3573,7 +3268,7 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3601,12 +3296,7 @@ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3623,7 +3313,6 @@ m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3691,8 +3380,8 @@ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$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 -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'" # Handle CRLF in mingw tool chain opt_cr= @@ -3716,7 +3405,6 @@ # 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -3729,7 +3417,6 @@ else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3751,7 +3438,7 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3763,18 +3450,6 @@ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then 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 - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - #ifdef __cplusplus extern "C" { #endif @@ -3786,7 +3461,7 @@ cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -3812,15 +3487,15 @@ _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" 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 pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3853,13 +3528,6 @@ AC_MSG_RESULT(ok) fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - _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], @@ -3870,8 +3538,6 @@ _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_file_list_spec], [1], - [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3883,6 +3549,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= +AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3933,11 +3600,6 @@ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3987,12 +3649,6 @@ ;; esac ;; - mingw* | cygwin* | os2* | pw32* | 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']) - ;; dgux*) case $cc_basename in ec++*) @@ -4082,8 +3738,8 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene + xlc* | xlC*) + # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -4145,7 +3801,7 @@ ;; solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -4249,12 +3905,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -4297,15 +3947,6 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -4369,13 +4010,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - 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' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4387,40 +4022,25 @@ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; - *Intel*\ [[CF]]*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' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; @@ -4452,7 +4072,7 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4509,11 +4129,9 @@ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. @@ -4532,8 +4150,6 @@ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4554,7 +4170,6 @@ m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4563,40 +4178,30 @@ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] 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". 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")) && ([substr](\$ 3,1,1) != ".")) { 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' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no - ;; + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4611,6 +4216,7 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4655,39 +4261,13 @@ openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) + linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes - - # 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 - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4721,12 +4301,11 @@ _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -4762,12 +4341,10 @@ # _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(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 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' @@ -4785,11 +4362,6 @@ fi ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4815,16 +4387,15 @@ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= 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; $ECHO \"$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' + pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4835,17 +4406,13 @@ lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[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(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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4861,16 +4428,17 @@ fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # 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(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4884,8 +4452,8 @@ _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 $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' fi ;; @@ -4903,8 +4471,8 @@ _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 $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 @@ -4950,8 +4518,8 @@ *) 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 $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 @@ -4991,10 +4559,8 @@ 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". 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")) && ([substr](\$ 3,1,1) != ".")) { 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' fi @@ -5082,9 +4648,9 @@ _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_SYS_MODULE_PATH_AIX _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 "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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' @@ -5093,19 +4659,14 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _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 - # 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' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _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' @@ -5137,64 +4698,20 @@ # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - 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=' - # 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 - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # 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' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - 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. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) @@ -5207,6 +4724,10 @@ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -5219,7 +4740,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) + freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -5228,7 +4749,7 @@ # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -5236,7 +4757,7 @@ 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' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $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' fi @@ -5251,13 +4772,14 @@ ;; 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 "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -5269,16 +4791,16 @@ ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _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 -fPIC ${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 -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -5290,14 +4812,7 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (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)='$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 @@ -5325,34 +4840,19 @@ 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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - 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' - fi + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" 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" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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' @@ -5414,17 +4914,17 @@ _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(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' ;; 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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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' @@ -5434,13 +4934,13 @@ 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(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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' @@ -5453,9 +4953,9 @@ _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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${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 ${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"*) @@ -5631,38 +5131,36 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi @@ -5699,6 +5197,9 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5724,6 +5225,8 @@ to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5734,8 +5237,6 @@ [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5829,15 +5330,14 @@ ])# _LT_LANG_C_CONFIG -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# 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'. -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 +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then @@ -5845,6 +5345,22 @@ else _lt_caught_CXX_error=yes fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# 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'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5856,6 +5372,7 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -5865,8 +5382,6 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5898,7 +5413,6 @@ # Allow CC to be a program name with arguments. lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5916,7 +5430,6 @@ fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5938,8 +5451,8 @@ # 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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -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' @@ -5971,7 +5484,7 @@ # 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"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no @@ -6080,10 +5593,10 @@ _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_SYS_MODULE_PATH_AIX _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 "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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' @@ -6092,19 +5605,14 @@ else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _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 - # 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' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -6134,75 +5642,28 @@ ;; cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - 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=' - # 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' - ;; - *) - # 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(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' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; + # _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(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' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -6225,7 +5686,7 @@ esac ;; - freebsd2.*) + freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -6244,11 +5705,6 @@ gnu*) ;; - haiku*) - _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_separator, $1)=: @@ -6273,11 +5729,11 @@ # 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; $ECHO "X$list" | $Xsed' ;; *) 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' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6338,7 +5794,7 @@ # 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; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then @@ -6348,10 +5804,10 @@ _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 -fPIC ${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 -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6381,7 +5837,7 @@ 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" && $ECHO "X-set_version $verstring" | $Xsed` -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 @@ -6392,9 +5848,9 @@ *) 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' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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 -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6423,7 +5879,7 @@ # 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; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -6460,26 +5916,26 @@ pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + *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`"' + compile_command="$compile_command `find $tpldir -name \*.o | $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`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $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' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $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' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $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 + *) # Version 6 will 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' ;; @@ -6487,7 +5943,7 @@ _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(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -6506,9 +5962,9 @@ # 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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; - xl* | mpixl* | bgxl*) + xl*) # 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' @@ -6528,13 +5984,13 @@ _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6603,7 +6059,7 @@ _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 + output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6638,15 +6094,15 @@ 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(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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~ + $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6662,17 +6118,17 @@ # 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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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 -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6682,7 +6138,7 @@ # 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"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6718,7 +6174,7 @@ solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6739,7 +6195,7 @@ esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6759,14 +6215,14 @@ if test "$GXX" = yes && test "$with_gnu_ld" = no; 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 -nostdlib $LDFLAGS $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 -nostdlib ${wl}-M $wl$lib.exp -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"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6777,7 +6233,7 @@ # 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 -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6831,10 +6287,6 @@ 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(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6890,7 +6342,6 @@ fi # test -n "$compiler" CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6905,29 +6356,6 @@ ])# _LT_LANG_CXX_CONFIG -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf 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). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -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}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6936,7 +6364,6 @@ # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6986,20 +6413,7 @@ } }; _LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF ]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -7011,7 +6425,7 @@ pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -7020,22 +6434,13 @@ test $p = "-R"; then prev=$p continue + else + prev= fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - 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 - -L | -R) + case $p 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. @@ -7055,10 +6460,8 @@ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi - prev= ;; - *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -7094,7 +6497,6 @@ fi $RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -7131,7 +6533,7 @@ solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -7175,16 +6577,32 @@ ])# _LT_SYS_HIDDEN_LIBDEPS +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # 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'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -7194,6 +6612,7 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7202,8 +6621,6 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -7243,9 +6660,7 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} - CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7299,24 +6714,38 @@ GCC=$lt_save_GCC CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # 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'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -7326,6 +6755,7 @@ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -7334,8 +6764,6 @@ _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -7375,9 +6803,7 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} - CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -7433,8 +6859,7 @@ fi # test -n "$compiler" GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS + CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -7471,12 +6896,10 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS +lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -7486,8 +6909,6 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7507,82 +6928,10 @@ AC_LANG_RESTORE GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS +CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# 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'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -7614,11 +6963,9 @@ # Allow CC to be a program name with arguments. lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} -CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7631,8 +6978,7 @@ GCC=$lt_save_GCC AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS +CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG @@ -7652,13 +6998,6 @@ dnl AC_DEFUN([LT_AC_PROG_GCJ], []) -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -7698,15 +7037,6 @@ AC_SUBST([OBJDUMP]) ]) -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) # _LT_DECL_SED # ------------ @@ -7800,8 +7130,8 @@ # 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, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7840,162 +7170,208 @@ ])# _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_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} -# _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##*/}"]) +# 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 () +{ + 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}"}]) +# 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_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}"} +} - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_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"}]) +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} - _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"]) +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} - # 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 +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which 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], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF ;; -esac + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac ]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS diff -Nru rsyslog-7.6.0/m4/lt~obsolete.m4 rsyslog-5.10.1/m4/lt~obsolete.m4 --- rsyslog-7.6.0/m4/lt~obsolete.m4 2014-02-12 12:06:25.000000000 +0000 +++ rsyslog-5.10.1/m4/lt~obsolete.m4 2012-10-17 14:42:27.000000000 +0000 @@ -1,13 +1,13 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 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 5 lt~obsolete.m4 +# serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -77,6 +77,7 @@ m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -89,10 +90,3 @@ m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff -Nru rsyslog-7.6.0/m4/ltoptions.m4 rsyslog-5.10.1/m4/ltoptions.m4 --- rsyslog-7.6.0/m4/ltoptions.m4 2014-02-12 12:06:25.000000000 +0000 +++ rsyslog-5.10.1/m4/ltoptions.m4 2012-10-17 14:42:27.000000000 +0000 @@ -1,14 +1,13 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004, 2005, 2007, 2008 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 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -126,7 +125,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -134,13 +133,13 @@ esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl +_LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -326,24 +325,9 @@ # 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@:>@], + [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], + [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) diff -Nru rsyslog-7.6.0/m4/ltversion.m4 rsyslog-5.10.1/m4/ltversion.m4 --- rsyslog-7.6.0/m4/ltversion.m4 2014-02-12 12:06:25.000000000 +0000 +++ rsyslog-5.10.1/m4/ltversion.m4 2012-10-17 14:42:27.000000000 +0000 @@ -7,17 +7,17 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# @configure_input@ +# Generated from ltversion.in. -# serial 3337 ltversion.m4 +# serial 3017 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.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.2.6b' +macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru rsyslog-7.6.0/Makefile.am rsyslog-5.10.1/Makefile.am --- rsyslog-7.6.0/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -58,11 +58,10 @@ endif EXTRA_DIST = \ - platform/README \ - platform/freebsd/rsyslogd \ - platform/slackware/rc.rsyslogd \ - platform/redhat/rsyslog.conf \ + freebsd/rsyslogd \ + slackware/rc.rsyslogd \ contrib/README \ + rsyslog.conf \ COPYING \ COPYING.LESSER \ COPYING.ASL20 \ @@ -71,7 +70,7 @@ contrib/gnutls/key.pem \ rsyslog.service.in -SUBDIRS = doc compat runtime grammar . plugins/immark plugins/imuxsock plugins/imtcp plugins/imudp plugins/omtesting +SUBDIRS = doc runtime . plugins/immark plugins/imuxsock plugins/imtcp plugins/imudp plugins/omtesting if ENABLE_RSYSLOGD SUBDIRS += tools @@ -81,10 +80,6 @@ SUBDIRS += plugins/imklog endif -if ENABLE_IMKMSG -SUBDIRS += plugins/imkmsg -endif - if ENABLE_IMPSTATS SUBDIRS += plugins/impstats endif @@ -121,6 +116,10 @@ SUBDIRS += plugins/sm_cust_bindcdr endif +if ENABLE_IMTEMPLATE +SUBDIRS += plugins/imtemplate +endif + if ENABLE_OMSTDOUT SUBDIRS += plugins/omstdout endif @@ -149,28 +148,12 @@ SUBDIRS += plugins/omruleset endif -if ENABLE_OMUDPSPOOF -SUBDIRS += plugins/omudpspoof +if ENABLE_OMDBALERTING +SUBDIRS += plugins/omdbalerting endif -if ENABLE_OMMONGODB -SUBDIRS += plugins/ommongodb -endif - -if ENABLE_OMHIREDIS -SUBDIRS += plugins/omhiredis -endif - -if ENABLE_OMZMQ3 -SUBDIRS += plugins/omzmq3 -endif - -if ENABLE_OMRABBITMQ -SUBDIRS += plugins/omrabbitmq -endif - -if ENABLE_IMZMQ3 -SUBDIRS += plugins/imzmq3 +if ENABLE_OMUDPSPOOF +SUBDIRS += plugins/omudpspoof endif if ENABLE_OMUXSOCK @@ -181,12 +164,8 @@ SUBDIRS += plugins/omhdfs endif -if ENABLE_OMJOURNAL -SUBDIRS += plugins/omjournal -endif - -if ENABLE_IMJOURNAL -SUBDIRS += plugins/imjournal +if ENABLE_OMTEMPLATE +SUBDIRS += plugins/omtemplate endif if ENABLE_ELASTICSEARCH @@ -205,10 +184,6 @@ SUBDIRS += plugins/imptcp endif -if ENABLE_IMTTCP -SUBDIRS += plugins/imttcp -endif - if ENABLE_IMDIAG SUBDIRS += plugins/imdiag endif @@ -225,46 +200,6 @@ SUBDIRS += plugins/im3195 endif -if ENABLE_MMNORMALIZE -SUBDIRS += plugins/mmnormalize -endif - -if ENABLE_MMJSONPARSE -SUBDIRS += plugins/mmjsonparse -endif - -if ENABLE_MMAUDIT -SUBDIRS += plugins/mmaudit -endif - -if ENABLE_MMANON -SUBDIRS += plugins/mmanon -endif - -if ENABLE_MMUTF8FIX -SUBDIRS += plugins/mmutf8fix -endif - -if ENABLE_MMCOUNT -SUBDIRS += plugins/mmcount -endif - -if ENABLE_MMSEQUENCE -SUBDIRS += plugins/mmsequence -endif - -if ENABLE_MMFIELDS -SUBDIRS += plugins/mmfields -endif - -if ENABLE_MMPSTRUCDATA -SUBDIRS += plugins/mmpstrucdata -endif - -if ENABLE_MMRFC5424ADDHMAC -SUBDIRS += plugins/mmrfc5424addhmac -endif - if ENABLE_ORACLE SUBDIRS += plugins/omoracle endif @@ -287,6 +222,7 @@ DISTCHECK_CONFIGURE_FLAGS= --enable-gssapi_krb5 \ --enable-imfile \ --enable-snmp \ + --enable-pgsql \ --enable-libdbi \ --enable-mysql \ --enable-relp \ @@ -301,18 +237,17 @@ --enable-omprog \ --enable-imdiag \ --enable-imptcp \ - --enable-imttcp \ --enable-omuxsock \ + --enable-extended-tests \ --enable-impstats \ + --enable-imptcp \ --enable-memcheck \ --enable-pmaixforwardedfrom \ --enable-pmcisconames \ --enable-pmsnare \ + --enable-imtemplate \ + --enable-omtemplate \ --enable-mmsnmptrapd \ --enable-elasticsearch \ - --enable-valgrind \ - --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) -# temporarily disable these checks for make distcheck 2012-09-06 rgerhards -# --enable-extended-tests \ -# --enable-pgsql + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) ACLOCAL_AMFLAGS = -I m4 diff -Nru rsyslog-7.6.0/Makefile.in rsyslog-5.10.1/Makefile.in --- rsyslog-7.6.0/Makefile.in 2014-02-12 12:06:38.000000000 +0000 +++ rsyslog-5.10.1/Makefile.in 2012-10-17 14:42:46.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -45,16 +45,16 @@ @ENABLE_GSSAPI_TRUE@am__append_2 = lmgssutil.la @ENABLE_RSYSLOGD_TRUE@am__append_3 = tools @ENABLE_IMKLOG_TRUE@am__append_4 = plugins/imklog -@ENABLE_IMKMSG_TRUE@am__append_5 = plugins/imkmsg -@ENABLE_IMPSTATS_TRUE@am__append_6 = plugins/impstats -@ENABLE_IMSOLARIS_TRUE@am__append_7 = plugins/imsolaris -@ENABLE_GSSAPI_TRUE@am__append_8 = plugins/omgssapi plugins/imgssapi -@ENABLE_RELP_TRUE@am__append_9 = plugins/omrelp plugins/imrelp -@ENABLE_MYSQL_TRUE@am__append_10 = plugins/ommysql -@ENABLE_OMLIBDBI_TRUE@am__append_11 = plugins/omlibdbi -@ENABLE_PGSQL_TRUE@am__append_12 = plugins/ompgsql -@ENABLE_SNMP_TRUE@am__append_13 = plugins/omsnmp -@ENABLE_SMCUSTBINDCDR_TRUE@am__append_14 = plugins/sm_cust_bindcdr +@ENABLE_IMPSTATS_TRUE@am__append_5 = plugins/impstats +@ENABLE_IMSOLARIS_TRUE@am__append_6 = plugins/imsolaris +@ENABLE_GSSAPI_TRUE@am__append_7 = plugins/omgssapi plugins/imgssapi +@ENABLE_RELP_TRUE@am__append_8 = plugins/omrelp plugins/imrelp +@ENABLE_MYSQL_TRUE@am__append_9 = plugins/ommysql +@ENABLE_OMLIBDBI_TRUE@am__append_10 = plugins/omlibdbi +@ENABLE_PGSQL_TRUE@am__append_11 = plugins/ompgsql +@ENABLE_SNMP_TRUE@am__append_12 = plugins/omsnmp +@ENABLE_SMCUSTBINDCDR_TRUE@am__append_13 = plugins/sm_cust_bindcdr +@ENABLE_IMTEMPLATE_TRUE@am__append_14 = plugins/imtemplate @ENABLE_OMSTDOUT_TRUE@am__append_15 = plugins/omstdout @ENABLE_PMCISCONAMES_TRUE@am__append_16 = plugins/pmcisconames @ENABLE_PMAIXFORWARDEDFROM_TRUE@am__append_17 = plugins/pmaixforwardedfrom @@ -62,37 +62,21 @@ @ENABLE_PMLASTMSG_TRUE@am__append_19 = plugins/pmlastmsg @ENABLE_PMRFC3164SD_TRUE@am__append_20 = plugins/pmrfc3164sd @ENABLE_OMRULESET_TRUE@am__append_21 = plugins/omruleset -@ENABLE_OMUDPSPOOF_TRUE@am__append_22 = plugins/omudpspoof -@ENABLE_OMMONGODB_TRUE@am__append_23 = plugins/ommongodb -@ENABLE_OMHIREDIS_TRUE@am__append_24 = plugins/omhiredis -@ENABLE_OMZMQ3_TRUE@am__append_25 = plugins/omzmq3 -@ENABLE_OMRABBITMQ_TRUE@am__append_26 = plugins/omrabbitmq -@ENABLE_IMZMQ3_TRUE@am__append_27 = plugins/imzmq3 -@ENABLE_OMUXSOCK_TRUE@am__append_28 = plugins/omuxsock -@ENABLE_OMHDFS_TRUE@am__append_29 = plugins/omhdfs -@ENABLE_OMJOURNAL_TRUE@am__append_30 = plugins/omjournal -@ENABLE_IMJOURNAL_TRUE@am__append_31 = plugins/imjournal -@ENABLE_ELASTICSEARCH_TRUE@am__append_32 = plugins/omelasticsearch -@ENABLE_MMSNMPTRAPD_TRUE@am__append_33 = plugins/mmsnmptrapd -@ENABLE_IMFILE_TRUE@am__append_34 = plugins/imfile -@ENABLE_IMPTCP_TRUE@am__append_35 = plugins/imptcp -@ENABLE_IMTTCP_TRUE@am__append_36 = plugins/imttcp -@ENABLE_IMDIAG_TRUE@am__append_37 = plugins/imdiag -@ENABLE_MAIL_TRUE@am__append_38 = plugins/ommail -@ENABLE_OMPROG_TRUE@am__append_39 = plugins/omprog -@ENABLE_RFC3195_TRUE@am__append_40 = plugins/im3195 -@ENABLE_MMNORMALIZE_TRUE@am__append_41 = plugins/mmnormalize -@ENABLE_MMJSONPARSE_TRUE@am__append_42 = plugins/mmjsonparse -@ENABLE_MMAUDIT_TRUE@am__append_43 = plugins/mmaudit -@ENABLE_MMANON_TRUE@am__append_44 = plugins/mmanon -@ENABLE_MMUTF8FIX_TRUE@am__append_45 = plugins/mmutf8fix -@ENABLE_MMCOUNT_TRUE@am__append_46 = plugins/mmcount -@ENABLE_MMSEQUENCE_TRUE@am__append_47 = plugins/mmsequence -@ENABLE_MMFIELDS_TRUE@am__append_48 = plugins/mmfields -@ENABLE_MMPSTRUCDATA_TRUE@am__append_49 = plugins/mmpstrucdata -@ENABLE_MMRFC5424ADDHMAC_TRUE@am__append_50 = plugins/mmrfc5424addhmac -@ENABLE_ORACLE_TRUE@am__append_51 = plugins/omoracle -@ENABLE_GUI_TRUE@am__append_52 = java +@ENABLE_OMDBALERTING_TRUE@am__append_22 = plugins/omdbalerting +@ENABLE_OMUDPSPOOF_TRUE@am__append_23 = plugins/omudpspoof +@ENABLE_OMUXSOCK_TRUE@am__append_24 = plugins/omuxsock +@ENABLE_OMHDFS_TRUE@am__append_25 = plugins/omhdfs +@ENABLE_OMTEMPLATE_TRUE@am__append_26 = plugins/omtemplate +@ENABLE_ELASTICSEARCH_TRUE@am__append_27 = plugins/omelasticsearch +@ENABLE_MMSNMPTRAPD_TRUE@am__append_28 = plugins/mmsnmptrapd +@ENABLE_IMFILE_TRUE@am__append_29 = plugins/imfile +@ENABLE_IMPTCP_TRUE@am__append_30 = plugins/imptcp +@ENABLE_IMDIAG_TRUE@am__append_31 = plugins/imdiag +@ENABLE_MAIL_TRUE@am__append_32 = plugins/ommail +@ENABLE_OMPROG_TRUE@am__append_33 = plugins/omprog +@ENABLE_RFC3195_TRUE@am__append_34 = plugins/im3195 +@ENABLE_ORACLE_TRUE@am__append_35 = plugins/omoracle +@ENABLE_GUI_TRUE@am__append_36 = java subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ @@ -134,12 +118,6 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(systemdsystemunitdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) @@ -149,8 +127,8 @@ @ENABLE_GSSAPI_TRUE@am_lmgssutil_la_OBJECTS = \ @ENABLE_GSSAPI_TRUE@ lmgssutil_la-gss-misc.lo lmgssutil_la_OBJECTS = $(am_lmgssutil_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent lmgssutil_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -185,21 +163,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(lmgssutil_la_SOURCES) $(lmtcpclt_la_SOURCES) \ $(lmtcpsrv_la_SOURCES) @@ -221,34 +199,26 @@ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = doc compat runtime grammar . plugins/immark \ - plugins/imuxsock plugins/imtcp plugins/imudp plugins/omtesting \ - tools plugins/imklog plugins/imkmsg plugins/impstats \ - plugins/imsolaris plugins/omgssapi plugins/imgssapi \ - plugins/omrelp plugins/imrelp plugins/ommysql plugins/omlibdbi \ +DIST_SUBDIRS = doc runtime . plugins/immark plugins/imuxsock \ + plugins/imtcp plugins/imudp plugins/omtesting tools \ + plugins/imklog plugins/impstats plugins/imsolaris \ + plugins/omgssapi plugins/imgssapi plugins/omrelp \ + plugins/imrelp plugins/ommysql plugins/omlibdbi \ plugins/ompgsql plugins/omsnmp plugins/sm_cust_bindcdr \ - plugins/omstdout plugins/pmcisconames \ + plugins/imtemplate plugins/omstdout plugins/pmcisconames \ plugins/pmaixforwardedfrom plugins/pmsnare plugins/pmlastmsg \ - plugins/pmrfc3164sd plugins/omruleset plugins/omudpspoof \ - plugins/ommongodb plugins/omhiredis plugins/omzmq3 \ - plugins/omrabbitmq plugins/imzmq3 plugins/omuxsock \ - plugins/omhdfs plugins/omjournal plugins/imjournal \ - plugins/omelasticsearch plugins/mmsnmptrapd plugins/imfile \ - plugins/imptcp plugins/imttcp plugins/imdiag plugins/ommail \ - plugins/omprog plugins/im3195 plugins/mmnormalize \ - plugins/mmjsonparse plugins/mmaudit plugins/mmanon \ - plugins/mmutf8fix plugins/mmcount plugins/mmsequence \ - plugins/mmfields plugins/mmpstrucdata plugins/mmrfc5424addhmac \ - plugins/omoracle java tests + plugins/pmrfc3164sd plugins/omruleset plugins/omdbalerting \ + plugins/omudpspoof plugins/omuxsock plugins/omhdfs \ + plugins/omtemplate plugins/omelasticsearch plugins/mmsnmptrapd \ + plugins/imfile plugins/imptcp plugins/imdiag plugins/ommail \ + plugins/omprog plugins/im3195 plugins/omoracle java tests DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -277,8 +247,6 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -296,11 +264,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -314,56 +279,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -371,8 +310,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -392,16 +329,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -413,14 +345,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -454,6 +383,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -512,11 +442,10 @@ @HAVE_SYSTEMD_TRUE@ rsyslog.service EXTRA_DIST = \ - platform/README \ - platform/freebsd/rsyslogd \ - platform/slackware/rc.rsyslogd \ - platform/redhat/rsyslog.conf \ + freebsd/rsyslogd \ + slackware/rc.rsyslogd \ contrib/README \ + rsyslog.conf \ COPYING \ COPYING.LESSER \ COPYING.ASL20 \ @@ -528,8 +457,8 @@ # tests are added as last element, because tests may need different # modules that need to be generated first -SUBDIRS = doc compat runtime grammar . plugins/immark plugins/imuxsock \ - plugins/imtcp plugins/imudp plugins/omtesting $(am__append_3) \ +SUBDIRS = doc runtime . plugins/immark plugins/imuxsock plugins/imtcp \ + plugins/imudp plugins/omtesting $(am__append_3) \ $(am__append_4) $(am__append_5) $(am__append_6) \ $(am__append_7) $(am__append_8) $(am__append_9) \ $(am__append_10) $(am__append_11) $(am__append_12) \ @@ -540,13 +469,7 @@ $(am__append_25) $(am__append_26) $(am__append_27) \ $(am__append_28) $(am__append_29) $(am__append_30) \ $(am__append_31) $(am__append_32) $(am__append_33) \ - $(am__append_34) $(am__append_35) $(am__append_36) \ - $(am__append_37) $(am__append_38) $(am__append_39) \ - $(am__append_40) $(am__append_41) $(am__append_42) \ - $(am__append_43) $(am__append_44) $(am__append_45) \ - $(am__append_46) $(am__append_47) $(am__append_48) \ - $(am__append_49) $(am__append_50) $(am__append_51) \ - $(am__append_52) tests + $(am__append_34) $(am__append_35) $(am__append_36) tests # make sure "make distcheck" tries to build all modules. This means that # a developer must always have an environment where every supporting library @@ -557,6 +480,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gssapi_krb5 \ --enable-imfile \ --enable-snmp \ + --enable-pgsql \ --enable-libdbi \ --enable-mysql \ --enable-relp \ @@ -571,28 +495,27 @@ --enable-omprog \ --enable-imdiag \ --enable-imptcp \ - --enable-imttcp \ --enable-omuxsock \ + --enable-extended-tests \ --enable-impstats \ + --enable-imptcp \ --enable-memcheck \ --enable-pmaixforwardedfrom \ --enable-pmcisconames \ --enable-pmsnare \ + --enable-imtemplate \ + --enable-omtemplate \ --enable-mmsnmptrapd \ --enable-elasticsearch \ - --enable-valgrind \ - --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) -# temporarily disable these checks for make distcheck 2012-09-06 rgerhards -# --enable-extended-tests \ -# --enable-pgsql ACLOCAL_AMFLAGS = -I m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -am--refresh: Makefile +am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -628,8 +551,10 @@ $(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 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -672,11 +597,11 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -lmgssutil.la: $(lmgssutil_la_OBJECTS) $(lmgssutil_la_DEPENDENCIES) $(EXTRA_lmgssutil_la_DEPENDENCIES) +lmgssutil.la: $(lmgssutil_la_OBJECTS) $(lmgssutil_la_DEPENDENCIES) $(AM_V_CCLD)$(lmgssutil_la_LINK) $(am_lmgssutil_la_rpath) $(lmgssutil_la_OBJECTS) $(lmgssutil_la_LIBADD) $(LIBS) -lmtcpclt.la: $(lmtcpclt_la_OBJECTS) $(lmtcpclt_la_DEPENDENCIES) $(EXTRA_lmtcpclt_la_DEPENDENCIES) +lmtcpclt.la: $(lmtcpclt_la_OBJECTS) $(lmtcpclt_la_DEPENDENCIES) $(AM_V_CCLD)$(lmtcpclt_la_LINK) $(am_lmtcpclt_la_rpath) $(lmtcpclt_la_OBJECTS) $(lmtcpclt_la_LIBADD) $(LIBS) -lmtcpsrv.la: $(lmtcpsrv_la_OBJECTS) $(lmtcpsrv_la_DEPENDENCIES) $(EXTRA_lmtcpsrv_la_DEPENDENCIES) +lmtcpsrv.la: $(lmtcpsrv_la_OBJECTS) $(lmtcpsrv_la_DEPENDENCIES) $(AM_V_CCLD)$(lmtcpsrv_la_LINK) $(am_lmtcpsrv_la_rpath) $(lmtcpsrv_la_OBJECTS) $(lmtcpsrv_la_LIBADD) $(LIBS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @@ -736,51 +661,58 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< lmgssutil_la-gss-misc.lo: gss-misc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmgssutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmgssutil_la-gss-misc.lo -MD -MP -MF $(DEPDIR)/lmgssutil_la-gss-misc.Tpo -c -o lmgssutil_la-gss-misc.lo `test -f 'gss-misc.c' || echo '$(srcdir)/'`gss-misc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmgssutil_la-gss-misc.Tpo $(DEPDIR)/lmgssutil_la-gss-misc.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gss-misc.c' object='lmgssutil_la-gss-misc.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gss-misc.c' object='lmgssutil_la-gss-misc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmgssutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmgssutil_la-gss-misc.lo `test -f 'gss-misc.c' || echo '$(srcdir)/'`gss-misc.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmgssutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmgssutil_la-gss-misc.lo `test -f 'gss-misc.c' || echo '$(srcdir)/'`gss-misc.c lmtcpclt_la-tcpclt.lo: tcpclt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpclt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmtcpclt_la-tcpclt.lo -MD -MP -MF $(DEPDIR)/lmtcpclt_la-tcpclt.Tpo -c -o lmtcpclt_la-tcpclt.lo `test -f 'tcpclt.c' || echo '$(srcdir)/'`tcpclt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmtcpclt_la-tcpclt.Tpo $(DEPDIR)/lmtcpclt_la-tcpclt.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcpclt.c' object='lmtcpclt_la-tcpclt.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tcpclt.c' object='lmtcpclt_la-tcpclt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpclt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmtcpclt_la-tcpclt.lo `test -f 'tcpclt.c' || echo '$(srcdir)/'`tcpclt.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpclt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmtcpclt_la-tcpclt.lo `test -f 'tcpclt.c' || echo '$(srcdir)/'`tcpclt.c lmtcpsrv_la-tcps_sess.lo: tcps_sess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmtcpsrv_la-tcps_sess.lo -MD -MP -MF $(DEPDIR)/lmtcpsrv_la-tcps_sess.Tpo -c -o lmtcpsrv_la-tcps_sess.lo `test -f 'tcps_sess.c' || echo '$(srcdir)/'`tcps_sess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmtcpsrv_la-tcps_sess.Tpo $(DEPDIR)/lmtcpsrv_la-tcps_sess.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcps_sess.c' object='lmtcpsrv_la-tcps_sess.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tcps_sess.c' object='lmtcpsrv_la-tcps_sess.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmtcpsrv_la-tcps_sess.lo `test -f 'tcps_sess.c' || echo '$(srcdir)/'`tcps_sess.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmtcpsrv_la-tcps_sess.lo `test -f 'tcps_sess.c' || echo '$(srcdir)/'`tcps_sess.c lmtcpsrv_la-tcpsrv.lo: tcpsrv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmtcpsrv_la-tcpsrv.lo -MD -MP -MF $(DEPDIR)/lmtcpsrv_la-tcpsrv.Tpo -c -o lmtcpsrv_la-tcpsrv.lo `test -f 'tcpsrv.c' || echo '$(srcdir)/'`tcpsrv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmtcpsrv_la-tcpsrv.Tpo $(DEPDIR)/lmtcpsrv_la-tcpsrv.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcpsrv.c' object='lmtcpsrv_la-tcpsrv.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tcpsrv.c' object='lmtcpsrv_la-tcpsrv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmtcpsrv_la-tcpsrv.lo `test -f 'tcpsrv.c' || echo '$(srcdir)/'`tcpsrv.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmtcpsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmtcpsrv_la-tcpsrv.lo `test -f 'tcpsrv.c' || echo '$(srcdir)/'`tcpsrv.c mostlyclean-libtool: -rm -f *.lo @@ -807,7 +739,9 @@ @$(NORMAL_UNINSTALL) @list='$(nodist_systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(systemdsystemunitdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(systemdsystemunitdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -1016,11 +950,7 @@ $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir @@ -1028,7 +958,7 @@ $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -1059,8 +989,6 @@ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -1080,7 +1008,6 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -1109,16 +1036,8 @@ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -1152,15 +1071,10 @@ installcheck: installcheck-recursive install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: @@ -1254,9 +1168,9 @@ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES clean-sbinPROGRAMS ctags \ - ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-compile distclean-generic distclean-hdr \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzma \ + dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ diff -Nru rsyslog-7.6.0/missing rsyslog-5.10.1/missing --- rsyslog-7.6.0/missing 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/missing 2012-10-17 14:42:37.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2012-01-06.13; # UTC +scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -84,6 +84,7 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -121,6 +122,15 @@ # Not GNU programs, they don't have --version. ;; + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -216,7 +226,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG=\${$#} + eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -246,7 +256,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG=\${$#} + eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -308,6 +318,41 @@ touch $file ;; + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff -Nru rsyslog-7.6.0/outchannel.c rsyslog-5.10.1/outchannel.c --- rsyslog-7.6.0/outchannel.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/outchannel.c 2012-10-17 14:41:20.000000000 +0000 @@ -35,9 +35,12 @@ #include #include "stringbuf.h" #include "outchannel.h" -#include "rsconf.h" +#include "dirty.h" #include "debug.h" +static struct outchannel *ochRoot = NULL; /* the root of the outchannel list */ +static struct outchannel *ochLast = NULL; /* points to the last element of the outchannel list */ + /* Constructs a outchannel list object. Returns pointer to it * or NULL (if it fails). */ @@ -50,14 +53,14 @@ /* basic initialisaion is done via calloc() - need to * initialize only values != 0. */ - if(loadConf->och.ochLast == NULL) + if(ochLast == NULL) { /* we are the first element! */ - loadConf->och.ochRoot = loadConf->och.ochLast = pOch; + ochRoot = ochLast = pOch; } else { - loadConf->och.ochLast->pNext = pOch; - loadConf->och.ochLast = pOch; + ochLast->pNext = pOch; + ochLast = pOch; } return(pOch); @@ -246,7 +249,7 @@ assert(pName != NULL); - pOch = loadConf->och.ochRoot; + pOch = ochRoot; while(pOch != NULL && !(pOch->iLenName == iLenName && !strcmp(pOch->pszName, pName) @@ -265,7 +268,7 @@ { struct outchannel *pOch, *pOchDel; - pOch = loadConf->och.ochRoot; + pOch = ochRoot; while(pOch != NULL) { dbgprintf("Delete Outchannel: Name='%s'\n ", pOch->pszName == NULL? "NULL" : pOch->pszName); pOchDel = pOch; @@ -284,7 +287,7 @@ { struct outchannel *pOch; - pOch = loadConf->och.ochRoot; + pOch = ochRoot; while(pOch != NULL) { dbgprintf("Outchannel: Name='%s'\n", pOch->pszName == NULL? "NULL" : pOch->pszName); dbgprintf("\tFile Template: '%s'\n", pOch->pszFileTemplate == NULL ? "NULL" : (char*) pOch->pszFileTemplate); diff -Nru rsyslog-7.6.0/parse.c rsyslog-5.10.1/parse.c --- rsyslog-7.6.0/parse.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/parse.c 2012-10-17 14:41:20.000000000 +0000 @@ -211,7 +211,7 @@ * If bRequireOne is set to true, at least one whitespace * must exist, else an error is returned. */ -rsRetVal parsSkipWhitespace(rsParsObj *pThis) +rsRetVal parsSkipWhitespace(rsParsObj *pThis, sbool bRequireOne) { register unsigned char *pC; int numSkipped; @@ -230,14 +230,16 @@ ++numSkipped; } + if(bRequireOne && numSkipped == 0) + iRet = RS_RET_MISSING_WHITESPACE; + RETiRet; } /* Parse string up to a delimiter. * * Input: - * cDelim - the delimiter. Note that SP within a value always is a delimiter, - * so cDelim is actually an *additional* delimiter. + * cDelim - the delimiter * The following two are for whitespace stripping, * 0 means "no", 1 "yes" * - bTrimLeading @@ -258,7 +260,7 @@ CHKiRet(rsCStrConstruct(&pCStr)); if(bTrimLeading) - parsSkipWhitespace(pThis); + parsSkipWhitespace(pThis, 0); pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos; @@ -268,7 +270,7 @@ ++pC; } - if(pThis->iCurrPos < cstrLen(pThis->pCStr)) { //BUGFIX!! + if(*pC == cDelim) { ++pThis->iCurrPos; /* eat delimiter */ } @@ -389,7 +391,7 @@ CHKiRet(cstrConstruct(&pCStr)); - parsSkipWhitespace(pThis); + parsSkipWhitespace(pThis, 0); pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos; /* we parse everything until either '/', ',' or diff -Nru rsyslog-7.6.0/parse.h rsyslog-5.10.1/parse.h --- rsyslog-7.6.0/parse.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/parse.h 2012-10-17 14:41:20.000000000 +0000 @@ -76,7 +76,7 @@ rsRetVal parsInt(rsParsObj *pThis, int* pInt); /* Skip whitespace. Often used to trim parsable entries. */ -rsRetVal parsSkipWhitespace(rsParsObj *pThis); +rsRetVal parsSkipWhitespace(rsParsObj *pThis, sbool bRequireOne); /* Parse string up to a delimiter. * diff -Nru rsyslog-7.6.0/platform/freebsd/rsyslogd rsyslog-5.10.1/platform/freebsd/rsyslogd --- rsyslog-7.6.0/platform/freebsd/rsyslogd 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/platform/freebsd/rsyslogd 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -#!/bin/sh -# Sample startup script for rsyslogd on FreeBSD. -# It worked on my machine, but this does not necessarily -# mean it works on all machines - it's not thouroughly -# tested. Please note that it may also work on other -# BSD variants, too. -# -# As of this writing, there was an issue with the mysql client -# library on startup. If compiled with MySQL support, rsyslogd -# would not necessarily start correctly but could eventually -# die with a "mysql client libary not found" (or similar) -# message. I do not know its cause neither the cure. If you -# have one, let me know. -# -# ATTENTION: you need also to change the /etc/rc.config file -# and disable stock syslogd and then enable rsyslogd! -# -# rgerhards 2005-08-09 -# - -# PROVIDE: rsyslogd -# REQUIRE: mountcritremote cleanvar -# BEFORE: SERVERS - -. /etc/rc.subr - -name="rsyslogd" -rcvar=`set_rcvar` -pidfile="/var/run/rsyslogd.pid" -command="/usr/sbin/${name}" -required_files="/etc/rsyslog.conf" -start_precmd="rsyslogd_precmd" -extra_commands="reload" - -_sockfile="/var/run/rsyslogd.sockets" -evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" -altlog_proglist="named" - -rsyslogd_precmd() -{ - # Transitional symlink for old binaries - # - if [ ! -L /dev/log ]; then - ln -sf /var/run/log /dev/log - fi - rm -f /var/run/log - - # Create default list of syslog sockets to watch - # - ( umask 022 ; > $_sockfile ) - - # If running named(8) or ntpd(8) chrooted, added appropriate - # syslog socket to list of sockets to watch. - # - for _l in $altlog_proglist; do - eval _ldir=\$${_l}_chrootdir - if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then - echo "${_ldir}/var/run/log" >> $_sockfile - fi - done - - # If other sockets have been provided, change run_rc_command()'s - # internal copy of $rsyslogd_flags to force use of specific - # rsyslogd sockets. - # - if [ -s $_sockfile ]; then - echo "/var/run/log" >> $_sockfile - eval $evalargs - fi - - return 0 -} - -set_socketlist() -{ - _socketargs= - for _s in `cat $_sockfile | tr '\n' ' '` ; do - _socketargs="-l $_s $_socketargs" - done - echo $_socketargs -} -load_rc_config $name -run_rc_command "$1" diff -Nru rsyslog-7.6.0/platform/README rsyslog-5.10.1/platform/README --- rsyslog-7.6.0/platform/README 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/platform/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -This subdirectory contains platform-specific files. They are maintained -based on a best effort basis, and are not necessarily the same like the -specific platform ships them. Some files are changed in the way the -rsyslog projects would recommend them; some may even be outdated. diff -Nru rsyslog-7.6.0/platform/redhat/rsyslog.conf rsyslog-5.10.1/platform/redhat/rsyslog.conf --- rsyslog-7.6.0/platform/redhat/rsyslog.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/platform/redhat/rsyslog.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* rsyslog configuration file (for Red Hat-based systems) - * note that most of this config file uses old-style format, - * because it is well-known AND quite suitable for simple cases - * like we have with the default config. For more advanced - * things, RainerScript configuration is suggested. - * - * For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html - * or latest version online at http://www.rsyslog.com/doc/rsyslog_conf.html - * If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html - */ - -#### MODULES #### - -module(load="imuxsock") # provides support for local system logging (e.g. via logger command) -module(load="imklog") # provides kernel logging support (previously done by rklogd) -#module(load"immark") # provides --MARK-- message capability - -# Provides UDP syslog reception -# for parameters see http://www.rsyslog.com/doc/imudp.html -#module(load="imudp") # needs to be done just once -#input(type="imudp" port="514") - -# Provides TCP syslog reception -# for parameters see http://www.rsyslog.com/doc/imtcp.html -#module(load="imtcp") # needs to be done just once -#input(type="imtcp" port="514") - - -#### GLOBAL DIRECTIVES #### - -# Use default timestamp format -$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat - -# File syncing capability is disabled by default. This feature is usually not required, -# not useful and an extreme performance hit -#$ActionFileEnableSync on - -# Include all config files in /etc/rsyslog.d/ -$IncludeConfig /etc/rsyslog.d/*.conf - - -#### RULES #### - -# Log all kernel messages to the console. -# Logging much else clutters up the screen. -#kern.* /dev/console - -# Log anything (except mail) of level info or higher. -# Don't log private authentication messages! -*.info;mail.none;authpriv.none;cron.none /var/log/messages - -# The authpriv file has restricted access. -authpriv.* /var/log/secure - -# Log all the mail messages in one place. -mail.* /var/log/maillog - - -# Log cron stuff -cron.* /var/log/cron - -# Everybody gets emergency messages -*.emerg :omusrmsg:* - -# Save news errors of level crit and higher in a special file. -uucp,news.crit /var/log/spooler - -# Save boot messages also to boot.log -local7.* /var/log/boot.log - - -# ### begin forwarding rule ### -# The statement between the begin ... end define a SINGLE forwarding -# rule. They belong together, do NOT split them. If you create multiple -# forwarding rules, duplicate the whole block! -# Remote Logging (we use TCP for reliable delivery) -# -# An on-disk queue is created for this action. If the remote host is -# down, messages are spooled to disk and sent when it is up again. -#$WorkDirectory /var/lib/rsyslog # where to place spool files -#$ActionQueueFileName fwdRule1 # unique name prefix for spool files -#$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) -#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown -#$ActionQueueType LinkedList # run asynchronously -#$ActionResumeRetryCount -1 # infinite retries if host is down -# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional -#*.* @@remote-host:514 -# ### end of the forwarding rule ### diff -Nru rsyslog-7.6.0/platform/slackware/rc.rsyslogd rsyslog-5.10.1/platform/slackware/rc.rsyslogd --- rsyslog-7.6.0/platform/slackware/rc.rsyslogd 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/platform/slackware/rc.rsyslogd 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -#!/bin/sh -# Start/stop/restart the system logging daemons. -# -# Written for Slackware Linux by Patrick J. Volkerding . -# Modded for rsyslogd by Chris Elvidge Sept 2005 -# - -create_xconsole() -{ - if [ ! -e /dev/xconsole ]; then - mknod -m 640 /dev/xconsole p - else - chmod 0640 /dev/xconsole - fi - chown 0:0 /dev/xconsole -} - -rsyslogd_start() { - if [ -x /usr/sbin/rsyslogd -a -x /usr/sbin/klogd ]; then - echo "Starting rsyslogd / klogd daemons: " -# this one listens on the "usual" socket /dev/log - echo "/usr/sbin/rsyslogd -i $pidfile1" - /usr/sbin/rsyslogd -i "$pidfile1" -# this one listens only to the UDP port - sleep 1 - echo "/usr/sbin/rsyslogd -o -r0 -f $confile2 -i $pidfile2" - /usr/sbin/rsyslogd -o -r0 -f "$confile2" -i "$pidfile2" - sleep 1 # prevent syslogd/klogd race condition on SMP kernels - echo "/usr/sbin/klogd -c 3 -x" - # '-c 3' = display level 'error' or higher messages on console - # '-x' = turn off broken EIP translation - /usr/sbin/klogd -c 3 -x - fi -} - -rsyslogd_stop() { - killall rsyslogd 2> /dev/null - killall klogd 2> /dev/null - /usr/bin/rm pidfile1 2> /dev/null - /usr/bin/rm pidfile2 2> /dev/null -} - -rsyslogd_restart() { - rsyslogd_stop - sleep 1 - rsyslogd_start -} - -confile1=/etc/rsyslog.conf -pidfile1=/var/run/rsyslogd.pid - -confile2=/etc/rsyslog.udp.conf -pidfile2=/var/run/rsyslogd.udp.pid - -case "$1" in -'start') - create_xconsole - rsyslogd_start - ;; -'stop') - rsyslogd_stop - ;; -'restart') - rsyslogd_restart - ;; -*) - echo "usage $0 start|stop|restart" -esac diff -Nru rsyslog-7.6.0/plugins/im3195/im3195.c rsyslog-5.10.1/plugins/im3195/im3195.c --- rsyslog-7.6.0/plugins/im3195/im3195.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/im3195/im3195.c 2012-10-17 14:41:20.000000000 +0000 @@ -48,23 +48,15 @@ #include "cfsysline.h" #include "msg.h" #include "errmsg.h" -#include "unicode-helper.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("im3195") /* Module static data */ DEF_IMOD_STATIC_DATA DEFobjCurrIf(errmsg) -DEFobjCurrIf(prop) /* configuration settings */ - -struct modConfData_s { - EMPTY_STRUCT; -}; - static int listenPort = 601; /* we use a global API object below, because this listener is @@ -73,8 +65,6 @@ */ static srAPIObj* pAPI; -static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ - /* This method is called when a message has been fully received. * It passes the received message to the rsyslog main message @@ -94,37 +84,10 @@ srSLMGGetRawMSG(pSLMG, &pszRawMsg); parseAndSubmitMessage(fromHost, fromHostIP, pszRawMsg, strlen((char*)pszRawMsg), - PARSE_HOSTNAME, eFLOWCTL_FULL_DELAY, pInputName, NULL, 0, NULL); + PARSE_HOSTNAME, eFLOWCTL_FULL_DELAY, (uchar*)"im3195", NULL, 0); } -#if 0 -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf -#endif - - BEGINrunInput CODESTARTrunInput /* this is an endless loop - it is terminated when the thread is @@ -175,12 +138,8 @@ BEGINmodExit CODESTARTmodExit srAPIExitLib(pAPI); /* terminate liblogging */ - /* global variable cleanup */ - if(pInputName != NULL) - prop.Destruct(&pInputName); /* release objects we used */ objRelease(errmsg, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); ENDmodExit @@ -201,15 +160,9 @@ *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"input3195listenport", 0, eCmdHdlrInt, NULL, &listenPort, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); - - CHKiRet(prop.Construct(&pInputName)); - CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("im3195"), sizeof("im3195") - 1)); - CHKiRet(prop.ConstructFinalize(pInputName)); - ENDmodInit /* vim:set ai: */ diff -Nru rsyslog-7.6.0/plugins/im3195/Makefile.in rsyslog-5.10.1/plugins/im3195/Makefile.in --- rsyslog-7.6.0/plugins/im3195/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/im3195/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = im3195_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_im3195_la_OBJECTS = im3195_la-im3195.lo im3195_la_OBJECTS = $(am_im3195_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent im3195_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(im3195_la_SOURCES) DIST_SOURCES = $(im3195_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -im3195.la: $(im3195_la_OBJECTS) $(im3195_la_DEPENDENCIES) $(EXTRA_im3195_la_DEPENDENCIES) +im3195.la: $(im3195_la_OBJECTS) $(im3195_la_DEPENDENCIES) $(AM_V_CCLD)$(im3195_la_LINK) -rpath $(pkglibdir) $(im3195_la_OBJECTS) $(im3195_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< im3195_la-im3195.lo: im3195.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(im3195_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT im3195_la-im3195.lo -MD -MP -MF $(DEPDIR)/im3195_la-im3195.Tpo -c -o im3195_la-im3195.lo `test -f 'im3195.c' || echo '$(srcdir)/'`im3195.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/im3195_la-im3195.Tpo $(DEPDIR)/im3195_la-im3195.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='im3195.c' object='im3195_la-im3195.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='im3195.c' object='im3195_la-im3195.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(im3195_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o im3195_la-im3195.lo `test -f 'im3195.c' || echo '$(srcdir)/'`im3195.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(im3195_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o im3195_la-im3195.lo `test -f 'im3195.c' || echo '$(srcdir)/'`im3195.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imdiag/imdiag.c rsyslog-5.10.1/plugins/imdiag/imdiag.c --- rsyslog-7.6.0/plugins/imdiag/imdiag.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imdiag/imdiag.c 2012-10-17 14:41:20.000000000 +0000 @@ -53,7 +53,6 @@ #include "srUtils.h" #include "msg.h" #include "datetime.h" -#include "ratelimit.h" #include "net.h" /* for permittedPeers, may be removed when this is removed */ MODULE_TYPE_INPUT @@ -78,10 +77,6 @@ /* config settings */ -struct modConfData_s { - EMPTY_STRUCT; -}; - static int iTCPSessMax = 20; /* max number of sessions */ static int iStrmDrvrMode = 0; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */ static uchar *pszStrmDrvrAuthMode = NULL; /* authentication mode to use */ @@ -200,7 +195,7 @@ /* actually submit a message to the rsyslog core */ static rsRetVal -doInjectMsg(int iNum, ratelimit_t *ratelimiter) +doInjectMsg(int iNum) { uchar szMsg[1024]; msg_t *pMsg; @@ -220,7 +215,7 @@ pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME; MsgSetRcvFrom(pMsg, pRcvDummy); CHKiRet(MsgSetRcvFromIP(pMsg, pRcvIPDummy)); - CHKiRet(ratelimitAddMsg(ratelimiter, NULL, pMsg)); + CHKiRet(submitMsg(pMsg)); finalize_it: RETiRet; @@ -238,7 +233,6 @@ int iFrom; int nMsgs; int i; - ratelimit_t *ratelimit; DEFiRet; /* we do not check errors here! */ @@ -246,15 +240,13 @@ iFrom = atoi((char*)wordBuf); getFirstWord(&pszCmd, wordBuf, sizeof(wordBuf)/sizeof(uchar), TO_LOWERCASE); nMsgs = atoi((char*)wordBuf); - ratelimitNew(&ratelimit, "imdiag", "injectmsg"); for(i = 0 ; i < nMsgs ; ++i) { - doInjectMsg(i + iFrom, ratelimit); + doInjectMsg(i + iFrom); } CHKiRet(sendResponse(pSess, "%d messages injected\n", nMsgs)); DBGPRINTF("imdiag: %d messages injected\n", nMsgs); - ratelimitDestruct(ratelimit); finalize_it: RETiRet; @@ -393,37 +385,9 @@ if(pOurTcpsrv != NULL) tcpsrv.Destruct(&pOurTcpsrv); } - free(pNewVal); RETiRet; } - -#if 0 /* can be used to integrate into new config system */ -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf -#endif - /* This function is called to gather input. */ BEGINrunInput diff -Nru rsyslog-7.6.0/plugins/imdiag/Makefile.in rsyslog-5.10.1/plugins/imdiag/Makefile.in --- rsyslog-7.6.0/plugins/imdiag/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/imdiag/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) imdiag_la_DEPENDENCIES = am_imdiag_la_OBJECTS = imdiag_la-imdiag.lo imdiag_la_OBJECTS = $(am_imdiag_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imdiag_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imdiag_la_SOURCES) DIST_SOURCES = $(imdiag_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imdiag.la: $(imdiag_la_OBJECTS) $(imdiag_la_DEPENDENCIES) $(EXTRA_imdiag_la_DEPENDENCIES) +imdiag.la: $(imdiag_la_OBJECTS) $(imdiag_la_DEPENDENCIES) $(AM_V_CCLD)$(imdiag_la_LINK) -rpath $(pkglibdir) $(imdiag_la_OBJECTS) $(imdiag_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imdiag_la-imdiag.lo: imdiag.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imdiag_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imdiag_la-imdiag.lo -MD -MP -MF $(DEPDIR)/imdiag_la-imdiag.Tpo -c -o imdiag_la-imdiag.lo `test -f 'imdiag.c' || echo '$(srcdir)/'`imdiag.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imdiag_la-imdiag.Tpo $(DEPDIR)/imdiag_la-imdiag.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imdiag.c' object='imdiag_la-imdiag.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imdiag.c' object='imdiag_la-imdiag.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imdiag_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imdiag_la-imdiag.lo `test -f 'imdiag.c' || echo '$(srcdir)/'`imdiag.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imdiag_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imdiag_la-imdiag.lo `test -f 'imdiag.c' || echo '$(srcdir)/'`imdiag.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imfile/imfile.c rsyslog-5.10.1/plugins/imfile/imfile.c --- rsyslog-7.6.0/plugins/imfile/imfile.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/imfile/imfile.c 2012-10-17 14:41:20.000000000 +0000 @@ -5,7 +5,7 @@ * * Work originally begun on 2008-02-01 by Rainer Gerhards * - * Copyright 2008-2013 Adiscon GmbH. + * Copyright 2008-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -31,8 +31,6 @@ #include #include #include /* do NOT remove: will soon be done by the module generation macros */ -#include -#include #ifdef HAVE_SYS_STAT_H # include #endif @@ -50,11 +48,9 @@ #include "prop.h" #include "stringbuf.h" #include "ruleset.h" -#include "ratelimit.h" MODULE_TYPE_INPUT /* must be present for input modules, do not remove */ MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imfile") /* defines */ @@ -67,19 +63,9 @@ DEFobjCurrIf(prop) DEFobjCurrIf(ruleset) -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ - -#define NUM_MULTISUB 1024 /* default max number of submits */ -#define DFLT_PollInterval 10 - -#define INIT_FILE_TAB_SIZE 4 /* default file table size - is extended as needed, use 2^x value */ - -/* this structure is used in pure polling mode as well one of the support - * structures for inotify. - */ +#define NUM_MULTISUB 1024 /* max number of submits -- TODO: make configurable */ typedef struct fileInfo_s { uchar *pszFileName; - uchar *pszBasename; /* our files basename part */ uchar *pszTag; size_t lenTag; uchar *pszStateFile; /* file in which state between runs is to be stored */ @@ -89,99 +75,33 @@ int nRecords; /**< How many records did we process before persisting the stream? */ int iPersistStateInterval; /**< how often should state be persisted? (0=on close only) */ strm_t *pStrm; /* its stream (NULL if not assigned) */ - uint8_t readMode; /* which mode to use in ReadMulteLine call? */ - sbool escapeLF; /* escape LF inside the MSG content? */ + int readMode; /* which mode to use in ReadMulteLine call? */ ruleset_t *pRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - ratelimit_t *ratelimiter; multi_submit_t multiSub; } fileInfo_t; -static struct configSettings_s { - uchar *pszFileName; - uchar *pszFileTag; - uchar *pszStateFile; - uchar *pszBindRuleset; - int iPollInterval; - int iPersistStateInterval; /* how often if state file to be persisted? (default 0->never) */ - int iFacility; /* local0 */ - int iSeverity; /* notice, as of rfc 3164 */ - int readMode; /* mode to use for ReadMultiLine call */ - int maxLinesAtOnce; /* how many lines to process in a row? */ - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ -} cs; - -struct instanceConf_s { - uchar *pszFileName; - uchar *pszDirName; - uchar *pszFileBaseName; - uchar *pszTag; - uchar *pszStateFile; - uchar *pszBindRuleset; - int nMultiSub; - int iPersistStateInterval; - int iFacility; - int iSeverity; - uint8_t readMode; - sbool escapeLF; - int maxLinesAtOnce; - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - struct instanceConf_s *next; -}; - /* forward definitions */ static rsRetVal persistStrmState(fileInfo_t *pInfo); -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); /* config variables */ -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - int iPollInterval; /* number of seconds to sleep when there was no file activity */ - instanceConf_t *root, *tail; - sbool configSetViaV2Method; -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ +static uchar *pszFileName = NULL; +static uchar *pszFileTag = NULL; +static uchar *pszStateFile = NULL; +static int iPollInterval = 10; /* number of seconds to sleep when there was no file activity */ +static int iPersistStateInterval = 0; /* how often if state file to be persisted? (default 0->never) */ +static int iFacility = 128; /* local0 */ +static int iSeverity = 5; /* notice, as of rfc 3164 */ +static int readMode = 0; /* mode to use for ReadMultiLine call */ +static int maxLinesAtOnce = 10240; /* how many lines to process in a row? */ +static ruleset_t *pBindRuleset = NULL; /* ruleset to bind listener to (use system default if unspecified) */ static int iFilPtr = 0; /* number of files to be monitored; pointer to next free spot during config */ -static fileInfo_t *files = NULL; -static int currMaxFiles; +#define MAX_INPUT_FILES 100 +static fileInfo_t files[MAX_INPUT_FILES]; static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this input */ -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "pollinginterval", eCmdHdlrPositiveInt, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* input instance parameters */ -static struct cnfparamdescr inppdescr[] = { - { "file", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "statefile", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "tag", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "severity", eCmdHdlrSeverity, 0 }, - { "facility", eCmdHdlrFacility, 0 }, - { "ruleset", eCmdHdlrString, 0 }, - { "readmode", eCmdHdlrInt, 0 }, - { "escapelf", eCmdHdlrBinary, 0 }, - { "maxlinesatonce", eCmdHdlrInt, 0 }, - { "maxsubmitatonce", eCmdHdlrInt, 0 }, - { "persiststateinterval", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; - -#include "im-helper.h" /* must be included AFTER the type definitions! */ - - /* enqueue the read file line as a message. The provided string is * not freed - thuis must be done by the caller. */ @@ -205,7 +125,9 @@ pMsg->iFacility = LOG_FAC(pInfo->iFacility); pMsg->iSeverity = LOG_PRI(pInfo->iSeverity); MsgSetRuleset(pMsg, pInfo->pRuleset); - ratelimitAddMsg(pInfo->ratelimiter, &pInfo->multiSub, pMsg); + pInfo->multiSub.ppMsgs[pInfo->multiSub.nElem++] = pMsg; + if(pInfo->multiSub.nElem == pInfo->multiSub.maxElem) + CHKiRet(multiSubmitMsg(&pInfo->multiSub)); finalize_it: RETiRet; } @@ -249,7 +171,6 @@ /* read back in the object */ CHKiRet(obj.Deserialize(&pThis->pStrm, (uchar*) "strm", psSF, NULL, pThis)); - strm.CheckFileChange(pThis->pStrm); CHKiRet(strm.SeekCurrOffs(pThis->pStrm)); /* note: we do not delete the state file, so that the last position remains @@ -261,8 +182,6 @@ strm.Destruct(&psSF); if(iRet != RS_RET_OK) { - if(pThis->pStrm != NULL) - strm.Destruct(&pThis->pStrm); CHKiRet(strm.Construct(&pThis->pStrm)); CHKiRet(strm.SettOperationsMode(pThis->pStrm, STREAMMODE_READ)); CHKiRet(strm.SetsType(pThis->pStrm, STREAMTYPE_FILE_MONITOR)); @@ -309,7 +228,7 @@ while(glbl.GetGlobalInputTermState() == 0) { if(pThis->maxLinesAtOnce != 0 && nProcessed >= pThis->maxLinesAtOnce) break; - CHKiRet(strm.ReadLine(pThis->pStrm, &pCStr, pThis->readMode, pThis->escapeLF)); + CHKiRet(strm.ReadLine(pThis->pStrm, &pCStr, pThis->readMode)); ++nProcessed; *pbHadFileData = 1; /* this is just a flag, so set it and forget it */ CHKiRet(enqLine(pThis, pCStr)); /* process line */ @@ -321,7 +240,18 @@ } finalize_it: - multiSubmitFlush(&pThis->multiSub); + if(pThis->multiSub.nElem > 0) { + /* submit everything that was not yet submitted */ + CHKiRet(multiSubmitMsg(&pThis->multiSub)); + } + ; /*EMPTY STATEMENT - needed to keep compiler happy - see below! */ + /* Note: the problem above is that pthread:cleanup_pop() is a macro which + * evaluates to something like "} while(0);". So the code would become + * "finalize_it: }", that is a label without a statement. The C standard does + * not permit this. So we add an empty statement "finalize_it: ; }" and + * everybody is happy. Note that without the ;, an error is reported only + * on some platforms/compiler versions. -- rgerhards, 2008-08-15 + */ pthread_cleanup_pop(0); if(pCStr != NULL) { @@ -333,392 +263,25 @@ #pragma GCC diagnostic warning "-Wempty-body" -/* create input instance, set default paramters, and - * add it to the list of instances. +/* This function is the cancel cleanup handler. It is called when rsyslog decides the + * module must be stopped, what most probably happens during shutdown of rsyslogd. When + * this function is called, the runInput() function (below) is already terminated - somewhere + * in the middle of what it was doing. The cancel cleanup handler below should take + * care of any locked mutexes and such, things that really need to be cleaned up + * before processing continues. In general, many plugins do not need to provide + * any code at all here. + * + * IMPORTANT: the calling interface of this function can NOT be modified. It actually is + * called by pthreads. The provided argument is currently not being used. */ -static rsRetVal -createInstance(instanceConf_t **pinst) +static void +inputModuleCleanup(void __attribute__((unused)) *arg) { - instanceConf_t *inst; - DEFiRet; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - inst->next = NULL; - inst->pBindRuleset = NULL; - - inst->pszBindRuleset = NULL; - inst->pszFileName = NULL; - inst->pszTag = NULL; - inst->pszStateFile = NULL; - inst->nMultiSub = NUM_MULTISUB; - inst->iSeverity = 5; - inst->iFacility = 128; - inst->maxLinesAtOnce = 10240; - inst->iPersistStateInterval = 0; - inst->readMode = 0; - inst->escapeLF = 1; - - /* node created, let's add to config */ - if(loadModConf->tail == NULL) { - loadModConf->tail = loadModConf->root = inst; - } else { - loadModConf->tail->next = inst; - loadModConf->tail = inst; - } - - *pinst = inst; -finalize_it: - RETiRet; + BEGINfunc + ENDfunc } -/* this function checks instance parameters and does some required pre-processing - * (e.g. split filename in path and actual name) - * Note: we do NOT use dirname()/basename() as they have portability problems. - */ -static rsRetVal -checkInstance(instanceConf_t *inst) -{ - char dirn[MAXFNAME]; - char basen[MAXFNAME]; - int i; - int lenName; - struct stat sb; - int r; - int eno; - char errStr[512]; - DEFiRet; - - lenName = ustrlen(inst->pszFileName); - for(i = lenName ; i >= 0 ; --i) { - if(inst->pszFileName[i] == '/') { - /* found basename component */ - if(i == lenName) - basen[0] = '\0'; - else { - memcpy(basen, inst->pszFileName+i+1, lenName-i); - /* Note \0 is copied above! */ - //basen[(lenName-i+1)+1] = '\0'; - } - break; - } - } - memcpy(dirn, inst->pszFileName, i); /* do not copy slash */ - dirn[i] = '\0'; - CHKmalloc(inst->pszFileBaseName = ustrdup(basen)); - CHKmalloc(inst->pszDirName = ustrdup(dirn)); - - if(dirn[0] == '\0') { - dirn[0] = '/'; - dirn[1] = '\0'; - } - r = stat(dirn, &sb); - if(r != 0) { - eno = errno; - rs_strerror_r(eno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile warning: directory '%s': %s", - dirn, errStr); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if(!S_ISDIR(sb.st_mode)) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile warning: configured directory " - "'%s' is NOT a directory", dirn); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - -finalize_it: - RETiRet; -} - - -/* add a new monitor */ -static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal) -{ - instanceConf_t *inst; - DEFiRet; - - if(cs.pszFileName == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile error: no file name given, file monitor can not be created"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if(cs.pszFileTag == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile error: no tag value given , file monitor can not be created"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if(cs.pszStateFile == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile error: not state file name given, file monitor can not be created"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - - CHKiRet(createInstance(&inst)); - if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) { - inst->pszBindRuleset = NULL; - } else { - CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset)); - } - inst->pszFileName = (uchar*) strdup((char*) cs.pszFileName); - inst->pszTag = (uchar*) strdup((char*) cs.pszFileTag); - inst->pszStateFile = (uchar*) strdup((char*) cs.pszStateFile); - inst->iSeverity = cs.iSeverity; - inst->iFacility = cs.iFacility; - inst->maxLinesAtOnce = cs.maxLinesAtOnce; - inst->iPersistStateInterval = cs.iPersistStateInterval; - inst->readMode = cs.readMode; - inst->escapeLF = 0; - - CHKiRet(checkInstance(inst)); - - /* reset legacy system */ - cs.iPersistStateInterval = 0; - resetConfigVariables(NULL, NULL); /* values are both dummies */ - -finalize_it: - free(pNewVal); /* we do not need it, but we must free it! */ - RETiRet; -} - - -/* This function is called when a new listener (monitor) shall be added. */ -static inline rsRetVal -addListner(instanceConf_t *inst) -{ - DEFiRet; - int newMax; - fileInfo_t *newFileTab; - fileInfo_t *pThis; - - if(iFilPtr == currMaxFiles) { - newMax = 2 * currMaxFiles; - newFileTab = realloc(files, newMax * sizeof(fileInfo_t)); - if(newFileTab == NULL) { - errmsg.LogError(0, RS_RET_OUT_OF_MEMORY, - "cannot alloc memory to monitor file '%s' - ignoring", - inst->pszFileName); - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - } - files = newFileTab; - currMaxFiles = newMax; - DBGPRINTF("imfile: increased file table to %d entries\n", currMaxFiles); - } - - /* if we reach this point, there is space in the file table for the new entry */ - pThis = &files[iFilPtr]; - pThis->pszFileName = (uchar*) strdup((char*) inst->pszFileName); - pThis->pszTag = (uchar*) strdup((char*) inst->pszTag); - pThis->lenTag = ustrlen(pThis->pszTag); - pThis->pszStateFile = (uchar*) strdup((char*) inst->pszStateFile); - - CHKiRet(ratelimitNew(&pThis->ratelimiter, "imfile", (char*)inst->pszFileName)); - CHKmalloc(pThis->multiSub.ppMsgs = MALLOC(inst->nMultiSub * sizeof(msg_t*))); - pThis->multiSub.maxElem = inst->nMultiSub; - pThis->multiSub.nElem = 0; - pThis->iSeverity = inst->iSeverity; - pThis->iFacility = inst->iFacility; - pThis->maxLinesAtOnce = inst->maxLinesAtOnce; - pThis->iPersistStateInterval = inst->iPersistStateInterval; - pThis->readMode = inst->readMode; - pThis->escapeLF = inst->escapeLF; - pThis->pRuleset = inst->pBindRuleset; - pThis->nRecords = 0; - pThis->pStrm = NULL; - ++iFilPtr; /* we got a new file to monitor */ - - resetConfigVariables(NULL, NULL); /* values are both dummies */ -finalize_it: - RETiRet; -} - - -BEGINnewInpInst - struct cnfparamvals *pvals; - instanceConf_t *inst; - int i; -CODESTARTnewInpInst - DBGPRINTF("newInpInst (imfile)\n"); - - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(pvals == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("input param blk in imfile:\n"); - cnfparamsPrint(&inppblk, pvals); - } - - CHKiRet(createInstance(&inst)); - - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "file")) { - inst->pszFileName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "statefile")) { - inst->pszStateFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tag")) { - inst->pszTag = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ruleset")) { - inst->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "severity")) { - inst->iSeverity = pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "facility")) { - inst->iFacility = pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "readmode")) { - inst->readMode = (uint8_t) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "escapelf")) { - inst->escapeLF = (sbool) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "maxlinesatonce")) { - inst->maxLinesAtOnce = pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "persiststateinterval")) { - inst->iPersistStateInterval = pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "maxsubmitatonce")) { - inst->nMultiSub = pvals[i].val.d.n; - } else { - dbgprintf("imfile: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - } - CHKiRet(checkInstance(inst)); -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - loadModConf->iPollInterval = DFLT_PollInterval; - loadModConf->configSetViaV2Method = 0; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config vars */ - cs.pszFileName = NULL; - cs.pszFileTag = NULL; - cs.pszStateFile = NULL; - cs.iPollInterval = DFLT_PollInterval; - cs.iPersistStateInterval = 0; - cs.iFacility = 128; - cs.iSeverity = 5; - cs.readMode = 0; - cs.maxLinesAtOnce = 10240; - cs.pBindRuleset = NULL; -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "imfile: error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imfile:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "pollinginterval")) { - loadModConf->iPollInterval = (int) pvals[i].val.d.n; - } else { - dbgprintf("imfile: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - /* remove all of our legacy handlers, as they can not used in addition - * the the new-style config method. - */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - loadModConf->iPollInterval = cs.iPollInterval; - } - dbgprintf("imfile: polling interval is %d\n", loadModConf->iPollInterval); - - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.pszFileName); - free(cs.pszFileTag); - free(cs.pszStateFile); -ENDendCnfLoad - - -BEGINcheckCnf - instanceConf_t *inst; -CODESTARTcheckCnf - for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { - std_checkRuleset(pModConf, inst); - } - if(pModConf->root == NULL) { - errmsg.LogError(0, RS_RET_NO_LISTNERS, - "imfile: no files configured to be monitored - " - "no input will be gathered"); - iRet = RS_RET_NO_LISTNERS; - } -ENDcheckCnf - - -/* note: we do access files AFTER we have dropped privileges. This is - * intentional, user must make sure the files have the right permissions. - */ -BEGINactivateCnf - instanceConf_t *inst; -CODESTARTactivateCnf - runModConf = pModConf; - free(files); /* clear any previous instance */ - CHKmalloc(files = (fileInfo_t*) malloc(sizeof(fileInfo_t) * INIT_FILE_TAB_SIZE)); - currMaxFiles = INIT_FILE_TAB_SIZE; - iFilPtr = 0; - - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - addListner(inst); - } - - /* if we could not set up any listeners, there is no point in running... */ - if(iFilPtr == 0) { - errmsg.LogError(0, NO_ERRCODE, "imfile: no file monitors could be started, " - "input not activated.\n"); - ABORT_FINALIZE(RS_RET_NO_RUN); - } -finalize_it: -ENDactivateCnf - - -BEGINfreeCnf - instanceConf_t *inst, *del; -CODESTARTfreeCnf - for(inst = pModConf->root ; inst != NULL ; ) { - free(inst->pszBindRuleset); - free(inst->pszFileName); - free(inst->pszDirName); - free(inst->pszFileBaseName); - free(inst->pszTag); - free(inst->pszStateFile); - del = inst; - inst = inst->next; - free(del); - } - free(files); -ENDfreeCnf - - /* This function is called by the framework to gather the input. The module stays * most of its lifetime inside this function. It MUST NEVER exit this function. Doing * so would end module processing and rsyslog would NOT reschedule the module. If @@ -739,10 +302,12 @@ * On spamming the main queue: keep in mind that it will automatically rate-limit * ourselfes if we begin to overrun it. So we really do not need to care here. */ +#pragma GCC diagnostic ignored "-Wempty-body" BEGINrunInput int i; int bHadFileData; /* were there at least one file with data during this run? */ CODESTARTrunInput + pthread_cleanup_push(inputModuleCleanup, NULL); while(glbl.GetGlobalInputTermState() == 0) { do { bHadFileData = 0; @@ -758,12 +323,16 @@ * other valid scenario. So do not remove. -- rgerhards, 2008-02-14 */ if(glbl.GetGlobalInputTermState() == 0) - srSleep(runModConf->iPollInterval, 10); + srSleep(iPollInterval, 10); } DBGPRINTF("imfile: terminating upon request of rsyslog core\n"); + pthread_cleanup_pop(0); /* just for completeness, but never called... */ RETiRet; /* use it to make sure the housekeeping is done! */ ENDrunInput +#pragma GCC diagnostic warning "-Wempty-body" + /* END no-touch zone * + * ------------------------------------------------------------------------------------------ */ /* The function is called by rsyslog before runInput() is called. It is a last chance @@ -775,6 +344,16 @@ */ BEGINwillRun CODESTARTwillRun + /* free config variables we do no longer needed */ + free(pszFileName); + free(pszFileTag); + free(pszStateFile); + + if(iFilPtr == 0) { + errmsg.LogError(0, RS_RET_NO_RUN, "No files configured to be monitored"); + ABORT_FINALIZE(RS_RET_NO_RUN); + } + /* we need to create the inputName property (only once during our lifetime) */ CHKiRet(prop.Construct(&pInputName)); CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imfile"), sizeof("imfile") - 1)); @@ -810,20 +389,12 @@ CHKiRet(strm.ConstructFinalize(psSF)); CHKiRet(strm.Serialize(pInfo->pStrm, psSF)); - CHKiRet(strm.Flush(psSF)); CHKiRet(strm.Destruct(&psSF)); finalize_it: if(psSF != NULL) strm.Destruct(&psSF); - - if(iRet != RS_RET_OK) { - errmsg.LogError(0, iRet, "imfile: could not persist state " - "file %s - data may be repeated on next " - "startup. Is WorkDirectory set?", - pInfo->pszStateFile); - } RETiRet; } @@ -845,8 +416,6 @@ persistStrmState(&files[i]); strm.Destruct(&(files[i].pStrm)); } - ratelimitDestruct(files[i].ratelimiter); - free(files[i].multiSub.ppMsgs); free(files[i].pszFileName); free(files[i].pszTag); free(files[i].pszStateFile); @@ -883,9 +452,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt @@ -896,44 +462,127 @@ * but in general this is not necessary. Once runInput() has been called, this * function here is never again called. */ -static rsRetVal -resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - free(cs.pszFileName); - cs.pszFileName = NULL; - free(cs.pszFileTag); - cs.pszFileTag = NULL; - free(cs.pszStateFile); - cs.pszStateFile = NULL; + if(pszFileName != NULL) { + free(pszFileName); + pszFileName = NULL; + } + + if(pszFileTag != NULL) { + free(pszFileTag); + pszFileTag = NULL; + } + + if(pszStateFile != NULL) { + free(pszFileTag); + pszFileTag = NULL; + } + /* set defaults... */ - cs.iPollInterval = DFLT_PollInterval; - cs.iFacility = 128; /* local0 */ - cs.iSeverity = 5; /* notice, as of rfc 3164 */ - cs.readMode = 0; - cs.pBindRuleset = NULL; - cs.maxLinesAtOnce = 10240; + iPollInterval = 10; + iFacility = 128; /* local0 */ + iSeverity = 5; /* notice, as of rfc 3164 */ + readMode = 0; + pBindRuleset = NULL; + maxLinesAtOnce = 10240; RETiRet; } -static inline void -std_checkRuleset_genErrMsg(__attribute__((unused)) modConfData_t *modConf, instanceConf_t *inst) + +/* add a new monitor */ +static rsRetVal addMonitor(void __attribute__((unused)) *pVal, uchar *pNewVal) { - errmsg.LogError(0, NO_ERRCODE, "imfile: ruleset '%s' for %s not found - " - "using default ruleset instead", inst->pszBindRuleset, - inst->pszFileName); + DEFiRet; + fileInfo_t *pThis; + + free(pNewVal); /* we do not need it, but we must free it! */ + + if(iFilPtr < MAX_INPUT_FILES) { + pThis = &files[iFilPtr]; + /* TODO: check for strdup() NULL return */ + if(pszFileName == NULL) { + errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile error: no file name given, file monitor can not be created"); + ABORT_FINALIZE(RS_RET_CONFIG_ERROR); + } else { + pThis->pszFileName = (uchar*) strdup((char*) pszFileName); + } + + if(pszFileTag == NULL) { + errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile error: no tag value given , file monitor can not be created"); + ABORT_FINALIZE(RS_RET_CONFIG_ERROR); + } else { + pThis->pszTag = (uchar*) strdup((char*) pszFileTag); + pThis->lenTag = ustrlen(pThis->pszTag); + } + + if(pszStateFile == NULL) { + errmsg.LogError(0, RS_RET_CONFIG_ERROR, "imfile error: not state file name given, file monitor can not be created"); + ABORT_FINALIZE(RS_RET_CONFIG_ERROR); + } else { + pThis->pszStateFile = (uchar*) strdup((char*) pszStateFile); + } + + CHKmalloc(pThis->multiSub.ppMsgs = MALLOC(NUM_MULTISUB * sizeof(msg_t*))); + pThis->multiSub.maxElem = NUM_MULTISUB; + pThis->multiSub.nElem = 0; + pThis->iSeverity = iSeverity; + pThis->iFacility = iFacility; + pThis->maxLinesAtOnce = maxLinesAtOnce; + pThis->iPersistStateInterval = iPersistStateInterval; + pThis->nRecords = 0; + pThis->readMode = readMode; + pThis->pRuleset = pBindRuleset; + iPersistStateInterval = 0; + } else { + errmsg.LogError(0, RS_RET_OUT_OF_DESRIPTORS, "Too many file monitors configured - ignoring this one"); + ABORT_FINALIZE(RS_RET_OUT_OF_DESRIPTORS); + } + + CHKiRet(resetConfigVariables((uchar*) "dummy", (void*) pThis)); /* values are both dummies */ + +finalize_it: + if(iRet == RS_RET_OK) + ++iFilPtr; /* we got a new file to monitor */ + + RETiRet; } + +/* accept a new ruleset to bind. Checks if it exists and complains, if not */ +static rsRetVal +setRuleset(void __attribute__((unused)) *pVal, uchar *pszName) +{ + ruleset_t *pRuleset; + rsRetVal localRet; + DEFiRet; + + localRet = ruleset.GetRuleset(&pRuleset, pszName); + if(localRet == RS_RET_NOT_FOUND) { + errmsg.LogError(0, NO_ERRCODE, "error: ruleset '%s' not found - ignored", pszName); + } + CHKiRet(localRet); + pBindRuleset = pRuleset; + DBGPRINTF("imfile current bind ruleset %p: '%s'\n", pRuleset, pszName); + +finalize_it: + free(pszName); /* no longer needed */ + RETiRet; +} + + /* modInit() is called once the module is loaded. It must perform all module-wide * initialization tasks. There are also a number of housekeeping tasks that the * framework requires. These are handled by the macros. Please note that the * complexity of processing is depending on the actual module. However, only * thing absolutely necessary should be done here. Actual app-level processing * is to be performed in runInput(). A good sample of what to do here may be to - * set some variable defaults. + * set some variable defaults. The most important thing probably is registration + * of config command handlers. */ BEGINmodInit() CODESTARTmodInit @@ -948,31 +597,28 @@ DBGPRINTF("imfile: version %s initializing\n", VERSION); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilename", 0, eCmdHdlrGetWord, - NULL, &cs.pszFileName, STD_LOADABLE_MODULE_ID)); + NULL, &pszFileName, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfiletag", 0, eCmdHdlrGetWord, - NULL, &cs.pszFileTag, STD_LOADABLE_MODULE_ID)); + NULL, &pszFileTag, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilestatefile", 0, eCmdHdlrGetWord, - NULL, &cs.pszStateFile, STD_LOADABLE_MODULE_ID)); + NULL, &pszStateFile, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfileseverity", 0, eCmdHdlrSeverity, - NULL, &cs.iSeverity, STD_LOADABLE_MODULE_ID)); + NULL, &iSeverity, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilefacility", 0, eCmdHdlrFacility, - NULL, &cs.iFacility, STD_LOADABLE_MODULE_ID)); + NULL, &iFacility, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilepollinterval", 0, eCmdHdlrInt, + NULL, &iPollInterval, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilereadmode", 0, eCmdHdlrInt, - NULL, &cs.readMode, STD_LOADABLE_MODULE_ID)); + NULL, &readMode, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilemaxlinesatonce", 0, eCmdHdlrSize, - NULL, &cs.maxLinesAtOnce, STD_LOADABLE_MODULE_ID)); + NULL, &maxLinesAtOnce, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilepersiststateinterval", 0, eCmdHdlrInt, - NULL, &cs.iPersistStateInterval, STD_LOADABLE_MODULE_ID)); + NULL, &iPersistStateInterval, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputfilebindruleset", 0, eCmdHdlrGetWord, - NULL, &cs.pszBindRuleset, STD_LOADABLE_MODULE_ID)); + setRuleset, NULL, STD_LOADABLE_MODULE_ID)); /* that command ads a new file! */ CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputrunfilemonitor", 0, eCmdHdlrGetWord, - addInstance, NULL, STD_LOADABLE_MODULE_ID)); - /* module-global config params - will be disabled in configs that are loaded - * via module(...). - */ - CHKiRet(regCfSysLineHdlr2((uchar *)"inputfilepollinterval", 0, eCmdHdlrInt, - NULL, &cs.iPollInterval, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); + addMonitor, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/imfile/Makefile.in rsyslog-5.10.1/plugins/imfile/Makefile.in --- rsyslog-7.6.0/plugins/imfile/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/imfile/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) imfile_la_DEPENDENCIES = am_imfile_la_OBJECTS = imfile_la-imfile.lo imfile_la_OBJECTS = $(am_imfile_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imfile_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imfile_la_SOURCES) DIST_SOURCES = $(imfile_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imfile.la: $(imfile_la_OBJECTS) $(imfile_la_DEPENDENCIES) $(EXTRA_imfile_la_DEPENDENCIES) +imfile.la: $(imfile_la_OBJECTS) $(imfile_la_DEPENDENCIES) $(AM_V_CCLD)$(imfile_la_LINK) -rpath $(pkglibdir) $(imfile_la_OBJECTS) $(imfile_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imfile_la-imfile.lo: imfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imfile_la-imfile.lo -MD -MP -MF $(DEPDIR)/imfile_la-imfile.Tpo -c -o imfile_la-imfile.lo `test -f 'imfile.c' || echo '$(srcdir)/'`imfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imfile_la-imfile.Tpo $(DEPDIR)/imfile_la-imfile.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imfile.c' object='imfile_la-imfile.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imfile.c' object='imfile_la-imfile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imfile_la-imfile.lo `test -f 'imfile.c' || echo '$(srcdir)/'`imfile.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imfile_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imfile_la-imfile.lo `test -f 'imfile.c' || echo '$(srcdir)/'`imfile.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imgssapi/imgssapi.c rsyslog-5.10.1/plugins/imgssapi/imgssapi.c --- rsyslog-7.6.0/plugins/imgssapi/imgssapi.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imgssapi/imgssapi.c 2012-10-17 14:41:20.000000000 +0000 @@ -63,7 +63,6 @@ MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imgssapi") /* defines */ #define ALLOWEDMETHOD_GSS 2 @@ -72,7 +71,6 @@ /* some forward definitions - they may go away when we no longer include imtcp.c */ static rsRetVal addGSSListener(void __attribute__((unused)) *pVal, uchar *pNewVal); -static rsRetVal actGSSListener(uchar *port); static int TCPSessGSSInit(void); static void TCPSessGSSClose(tcps_sess_t* pSess); static rsRetVal TCPSessGSSRecv(tcps_sess_t *pSess, void *buf, size_t buf_len, ssize_t *); @@ -91,7 +89,6 @@ static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */ static gss_cred_id_t gss_server_creds = GSS_C_NO_CREDENTIAL; -static uchar *srvPort; /* our usr structure for the tcpsrv object */ typedef struct gsssrv_s { @@ -107,10 +104,6 @@ /* config variables */ -struct modConfData_s { - EMPTY_STRUCT; -}; - static int iTCPSessMax = 200; /* max number of sessions */ static char *gss_listen_service_name = NULL; static int bPermitPlainTcp = 0; /* plain tcp syslog allowed on GSSAPI port? */ @@ -319,16 +312,6 @@ addGSSListener(void __attribute__((unused)) *pVal, uchar *pNewVal) { DEFiRet; - - srvPort = pNewVal; - - RETiRet; -} - -static rsRetVal -actGSSListener(uchar *port) -{ - DEFiRet; gsssrv_t *pGSrv; if(pOurTcpsrv == NULL) { @@ -352,7 +335,7 @@ CHKiRet(tcpsrv.SetCBOnRegularClose(pOurTcpsrv, onRegularClose)); CHKiRet(tcpsrv.SetCBOnErrClose(pOurTcpsrv, onErrClose)); CHKiRet(tcpsrv.SetInputName(pOurTcpsrv, UCHAR_CONSTANT("imgssapi"))); - tcpsrv.configureTCPListen(pOurTcpsrv, port, 1); + tcpsrv.configureTCPListen(pOurTcpsrv, pNewVal, 1); CHKiRet(tcpsrv.ConstructFinalize(pOurTcpsrv)); } @@ -657,42 +640,10 @@ RETiRet; } - -#if 0 /* can be used to integrate into new config system */ -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf -#endif - /* This function is called to gather input. */ BEGINrunInput CODESTARTrunInput - /* This will fail if the priviledges are dropped. Should be - * moved to the '*activateCnfPrePrivDrop' section eventually. - */ - actGSSListener(srvPort); - iRet = tcpsrv.Run(pOurTcpsrv); ENDrunInput @@ -700,7 +651,7 @@ /* initialize and return if will run or not */ BEGINwillRun CODESTARTwillRun - if(srvPort == NULL) + if(pOurTcpsrv == NULL) ABORT_FINALIZE(RS_RET_NO_RUN); net.PrintAllowedSenders(2); /* TCP */ diff -Nru rsyslog-7.6.0/plugins/imgssapi/Makefile.in rsyslog-5.10.1/plugins/imgssapi/Makefile.in --- rsyslog-7.6.0/plugins/imgssapi/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/imgssapi/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = imgssapi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_imgssapi_la_OBJECTS = imgssapi_la-imgssapi.lo imgssapi_la_OBJECTS = $(am_imgssapi_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imgssapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imgssapi_la_SOURCES) DIST_SOURCES = $(imgssapi_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imgssapi.la: $(imgssapi_la_OBJECTS) $(imgssapi_la_DEPENDENCIES) $(EXTRA_imgssapi_la_DEPENDENCIES) +imgssapi.la: $(imgssapi_la_OBJECTS) $(imgssapi_la_DEPENDENCIES) $(AM_V_CCLD)$(imgssapi_la_LINK) -rpath $(pkglibdir) $(imgssapi_la_OBJECTS) $(imgssapi_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imgssapi_la-imgssapi.lo: imgssapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imgssapi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imgssapi_la-imgssapi.lo -MD -MP -MF $(DEPDIR)/imgssapi_la-imgssapi.Tpo -c -o imgssapi_la-imgssapi.lo `test -f 'imgssapi.c' || echo '$(srcdir)/'`imgssapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imgssapi_la-imgssapi.Tpo $(DEPDIR)/imgssapi_la-imgssapi.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imgssapi.c' object='imgssapi_la-imgssapi.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imgssapi.c' object='imgssapi_la-imgssapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imgssapi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imgssapi_la-imgssapi.lo `test -f 'imgssapi.c' || echo '$(srcdir)/'`imgssapi.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imgssapi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imgssapi_la-imgssapi.lo `test -f 'imgssapi.c' || echo '$(srcdir)/'`imgssapi.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imjournal/imjournal.c rsyslog-5.10.1/plugins/imjournal/imjournal.c --- rsyslog-7.6.0/plugins/imjournal/imjournal.c 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/plugins/imjournal/imjournal.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,717 +0,0 @@ -/* The systemd journal import module - * - * To test under Linux: - * emmit log message into systemd journal - * - * Copyright (C) 2008-2013 Adiscon GmbH - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dirty.h" -#include "cfsysline.h" -#include "obj.h" -#include "msg.h" -#include "module-template.h" -#include "datetime.h" -#include "imjournal.h" -#include "net.h" -#include "glbl.h" -#include "prop.h" -#include "errmsg.h" -#include "srUtils.h" -#include "unicode-helper.h" -#include "ratelimit.h" - -MODULE_TYPE_INPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imjournal") - -/* Module static data */ -DEF_IMOD_STATIC_DATA -DEFobjCurrIf(datetime) -DEFobjCurrIf(glbl) -DEFobjCurrIf(prop) -DEFobjCurrIf(net) -DEFobjCurrIf(errmsg) - -static struct configSettings_s { - char *stateFile; - int iPersistStateInterval; - int ratelimitInterval; - int ratelimitBurst; - int bIgnorePrevious; -} cs; - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "statefile", eCmdHdlrGetWord, 0 }, - { "ratelimit.interval", eCmdHdlrInt, 0 }, - { "ratelimit.burst", eCmdHdlrInt, 0 }, - { "persiststateinterval", eCmdHdlrInt, 0 }, - { "ignorepreviousmessages", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -#define DFLT_persiststateinterval 10 - -static int bLegacyCnfModGlobalsPermitted = 1;/* are legacy module-global config parameters permitted? */ - -static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ -static prop_t *pLocalHostIP = NULL; /* a pseudo-constant propterty for 127.0.0.1 */ - -static ratelimit_t *ratelimiter = NULL; -static sd_journal *j; - -/* enqueue the the journal message into the message queue. - * The provided msg string is not freed - thus must be done - * by the caller. - */ -static rsRetVal -enqMsg(uchar *msg, uchar *pszTag, int iFacility, int iSeverity, struct timeval *tp, struct json_object *json) -{ - struct syslogTime st; - msg_t *pMsg; - DEFiRet; - - assert(msg != NULL); - assert(pszTag != NULL); - - if(tp == NULL) { - CHKiRet(msgConstruct(&pMsg)); - } else { - datetime.timeval2syslogTime(tp, &st); - CHKiRet(msgConstructWithTime(&pMsg, &st, tp->tv_sec)); - } - MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); - MsgSetInputName(pMsg, pInputName); - MsgSetRawMsgWOSize(pMsg, (char*)msg); - MsgSetMSGoffs(pMsg, 0); /* we do not have a header... */ - MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); - MsgSetRcvFromIP(pMsg, pLocalHostIP); - MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); - MsgSetTAG(pMsg, pszTag, ustrlen(pszTag)); - pMsg->iFacility = iFacility; - pMsg->iSeverity = iSeverity; - - if(json != NULL) { - msgAddJSON(pMsg, (uchar*)"!", json); - } - - CHKiRet(ratelimitAddMsg(ratelimiter, NULL, pMsg)); - -finalize_it: - RETiRet; -} - - -/* Read journal log while data are available, each read() reads one - * record of printk buffer. - */ -static rsRetVal -readjournal() { - DEFiRet; - - struct timeval tv; - uint64_t timestamp; - - struct json_object *json = NULL; - int r; - - /* Information from messages */ - char *message; - char *sys_pid; - char *sys_iden; - char *sys_iden_help; - - const void *get; - const void *pidget; - char *parse; - char *get2; - size_t length; - size_t pidlength; - - const void *equal_sign; - struct json_object *jval; - char *data; - char *name; - size_t l; - - long prefixlen = 0; - - int priority = 0; - int facility = 0; - - /* Get message text */ - if (sd_journal_get_data(j, "MESSAGE", &get, &length) < 0) { - logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar *)"log message from journal doesn't have MESSAGE", 0); - iRet = RS_RET_OK; - goto ret; - } - message = strndup(get+8, length-8); - if (message == NULL) { - iRet = RS_RET_OUT_OF_MEMORY; - goto ret; - } - - /* Get message priority */ - if (sd_journal_get_data(j, "PRIORITY", &get, &length) >= 0) { - get2 = strndup(get, length); - priority = ((char *)get2)[9] - '0'; - free (get2); - } - - /* Get syslog facility */ - if (sd_journal_get_data(j, "SYSLOG_FACILITY", &get, &length) >= 0) { - get2 = strndup(get, length); - char f = ((char *)get2)[16]; - if (f >= '0' && f <= '9') { - facility += f - '0'; - } - f = ((char *)get2)[17]; - if (f >= '0' && f <= '9') { - facility *= 10; - facility += (f - '0'); - } - free (get2); - } else { - /* message is missing facility -> internal systemd journal msg, drop */ - iRet = RS_RET_OK; - goto free_message; - } - - /* Get message identifier, client pid and add ':' */ - if (sd_journal_get_data(j, "SYSLOG_IDENTIFIER", &get, &length) >= 0) { - sys_iden = strndup(get+18, length-18); - } else { - sys_iden = strdup("journal"); - } - if (sys_iden == NULL) { - iRet = RS_RET_OUT_OF_MEMORY; - goto free_message; - } - - if (sd_journal_get_data(j, "SYSLOG_PID", &pidget, &pidlength) >= 0) { - sys_pid = strndup(pidget+11, pidlength-11); - if (sys_pid == NULL) { - iRet = RS_RET_OUT_OF_MEMORY; - free (sys_iden); - goto free_message; - } - } else { - sys_pid = NULL; - } - - if (sys_pid) { - r = asprintf(&sys_iden_help, "%s[%s]:", sys_iden, sys_pid); - } else { - r = asprintf(&sys_iden_help, "%s:", sys_iden); - } - - free (sys_iden); - free (sys_pid); - - if (-1 == r) { - iRet = RS_RET_OUT_OF_MEMORY; - goto finalize_it; - } - - json = json_object_new_object(); - - SD_JOURNAL_FOREACH_DATA(j, get, l) { - /* locate equal sign, this is always present */ - equal_sign = memchr(get, '=', l); - - /* ... but we know better than to trust the specs */ - if (equal_sign == NULL) { - errmsg.LogError(0, RS_RET_ERR, "SD_JOURNAL_FOREACH_DATA()" - "returned a malformed field (has no '='): '%s'", get); - continue; /* skip the entry */ - } - - /* get length of journal data prefix */ - prefixlen = ((char *)equal_sign - (char *)get); - - /* translate name fields to lumberjack names */ - parse = (char *)get; - - switch (*parse) - { - case '_': - ++parse; - if (*parse == 'P') { - if (!strncmp(parse+1, "ID=", 4)) { - name = strdup("pid"); - } else { - name = strndup(get, prefixlen); - } - } else if (*parse == 'G') { - if (!strncmp(parse+1, "ID=", 4)) { - name = strdup("gid"); - } else { - name = strndup(get, prefixlen); - } - } else if (*parse == 'U') { - if (!strncmp(parse+1, "ID=", 4)) { - name = strdup("uid"); - } else { - name = strndup(get, prefixlen); - } - } else if (*parse == 'E') { - if (!strncmp(parse+1, "XE=", 4)) { - name = strdup("exe"); - } else { - name = strndup(get, prefixlen); - } - } else if (*parse == 'C') { - parse++; - if (*parse == 'O') { - if (!strncmp(parse+1, "MM=", 4)) { - name = strdup("appname"); - } else { - name = strndup(get, prefixlen); - } - } else if (*parse == 'M') { - if (!strncmp(parse+1, "DLINE=", 7)) { - name = strdup("cmd"); - } else { - name = strndup(get, prefixlen); - } - } else { - name = strndup(get, prefixlen); - } - } else { - name = strndup(get, prefixlen); - } - break; - - default: - name = strndup(get, prefixlen); - break; - } - - if (name == NULL) { - iRet = RS_RET_OUT_OF_MEMORY; - goto ret; - } - - prefixlen++; /* remove '=' */ - - data = strndup(get + prefixlen, l - prefixlen); - if (data == NULL) { - iRet = RS_RET_OUT_OF_MEMORY; - free (name); - goto ret; - } - - /* and save them to json object */ - jval = json_object_new_string((char *)data); - json_object_object_add(json, name, jval); - free (data); - free (name); - } - - /* calculate timestamp */ - if (sd_journal_get_realtime_usec(j, ×tamp) >= 0) { - tv.tv_sec = timestamp / 1000000; - tv.tv_usec = timestamp % 1000000; - } - - /* submit message */ - enqMsg((uchar *)message, (uchar *) sys_iden_help, facility, priority, &tv, json); - -finalize_it: - free(sys_iden_help); -free_message: - free(message); -ret: - RETiRet; -} - - -/* This function gets journal cursor and saves it into state file - */ -static rsRetVal -persistJournalState () { - DEFiRet; - FILE *sf; /* state file */ - char *cursor; - int ret = 0; - - /* On success, sd_journal_get_cursor() returns 1 in systemd - 197 or older and 0 in systemd 198 or newer */ - if ((ret = sd_journal_get_cursor(j, &cursor)) >= 0) { - if ((sf = fopen(cs.stateFile, "wb")) != NULL) { - if (fprintf(sf, "%s", cursor) < 0) { - iRet = RS_RET_IO_ERROR; - } - fclose(sf); - free(cursor); - } else { - char errStr[256]; - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_FOPEN_FAILURE, "fopen() failed: " - "'%s', path: '%s'\n", errStr, cs.stateFile); - iRet = RS_RET_FOPEN_FAILURE; - } - } else { - char errStr[256]; - rs_strerror_r(-(ret), errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR, "sd_journal_get_cursor() failed: '%s'\n", errStr); - iRet = RS_RET_ERR; - } - RETiRet; -} - - -/* Polls the journal for new messages. Similar to sd_journal_wait() - * except for the special handling of EINTR. - */ -static rsRetVal -pollJournal() -{ - DEFiRet; - struct pollfd pollfd; - int r; - - pollfd.fd = sd_journal_get_fd(j); - pollfd.events = sd_journal_get_events(j); - r = poll(&pollfd, 1, -1); - if (r == -1) { - if (errno == EINTR) { - /* EINTR is also received during termination - * so return now to check the term state. - */ - ABORT_FINALIZE(RS_RET_OK); - } else { - char errStr[256]; - - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR, - "poll() failed: '%s'", errStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } - - assert(r == 1); - - r = sd_journal_process(j); - if (r < 0) { - char errStr[256]; - - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR, - "sd_journal_process() failed: '%s'", errStr); - ABORT_FINALIZE(RS_RET_ERR); - } - -finalize_it: - RETiRet; -} - - -/* This function loads a journal cursor from the state file. - */ -static rsRetVal -loadJournalState() -{ - DEFiRet; - - if (cs.stateFile[0] != '/') { - char *new_stateFile; - - if (-1 == asprintf(&new_stateFile, "%s/%s", (char *)glbl.GetWorkDir(), cs.stateFile)) { - errmsg.LogError(0, RS_RET_OUT_OF_MEMORY, "imjournal: asprintf failed\n"); - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - } - free (cs.stateFile); - cs.stateFile = new_stateFile; - } - - /* if state file exists, set cursor to appropriate position */ - if (access(cs.stateFile, F_OK|R_OK) != -1) { - FILE *r_sf; - - if ((r_sf = fopen(cs.stateFile, "rb")) != NULL) { - char readCursor[128 + 1]; - - if (fscanf(r_sf, "%128s\n", readCursor) != EOF) { - if (sd_journal_seek_cursor(j, readCursor) != 0) { - errmsg.LogError(0, RS_RET_ERR, "imjournal: " - "couldn't seek to cursor `%s'\n", readCursor); - iRet = RS_RET_ERR; - goto finalize_it; - } - sd_journal_next(j); - } else { - errmsg.LogError(0, RS_RET_IO_ERROR, "imjournal: " - "fscanf on state file `%s' failed\n", cs.stateFile); - iRet = RS_RET_IO_ERROR; - goto finalize_it; - } - fclose(r_sf); - } else { - errmsg.LogError(0, RS_RET_FOPEN_FAILURE, "imjournal: " - "open on state file `%s' failed\n", cs.stateFile); - } - } else { - /* when IgnorePrevious, seek to the end of journal */ - if (cs.bIgnorePrevious) { - if (sd_journal_seek_tail(j) < 0) { - char errStr[256]; - - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR, - "sd_journal_seek_tail() failed: '%s'", errStr); - ABORT_FINALIZE(RS_RET_ERR); - } - - if (sd_journal_previous(j) < 0) { - char errStr[256]; - - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR, - "sd_journal_previous() failed: '%s'", errStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } - } - -finalize_it: - RETiRet; -} - -BEGINrunInput -CODESTARTrunInput - CHKiRet(ratelimitNew(&ratelimiter, "imjournal", NULL)); - dbgprintf("imjournal: ratelimiting burst %d, interval %d\n", cs.ratelimitBurst, - cs.ratelimitInterval); - ratelimitSetLinuxLike(ratelimiter, cs.ratelimitInterval, cs.ratelimitBurst); - ratelimitSetNoTimeCache(ratelimiter); - - if (cs.stateFile) { - CHKiRet(loadJournalState()); - } - - /* this is an endless loop - it is terminated when the thread is - * signalled to do so. This, however, is handled by the framework. - */ - while (glbl.GetGlobalInputTermState() == 0) { - int count = 0, r; - - r = sd_journal_next(j); - if (r < 0) { - char errStr[256]; - - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR, - "sd_journal_next() failed: '%s'", errStr); - ABORT_FINALIZE(RS_RET_ERR); - } - - if (r == 0) { - /* No new messages, wait for activity. */ - CHKiRet(pollJournal()); - continue; - } - - CHKiRet(readjournal()); - if (cs.stateFile) { /* can't persist without a state file */ - /* TODO: This could use some finer metric. */ - count++; - if (count == cs.iPersistStateInterval) { - count = 0; - persistJournalState(); - } - } - } - -finalize_it: -ENDrunInput - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - bLegacyCnfModGlobalsPermitted = 1; - - cs.iPersistStateInterval = DFLT_persiststateinterval; - cs.stateFile = NULL; - cs.ratelimitBurst = 20000; - cs.ratelimitInterval = 600; -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - -/* open journal */ -BEGINwillRun -CODESTARTwillRun - int ret; - ret = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); - if (ret < 0) { - iRet = RS_RET_IO_ERROR; - } -ENDwillRun - -/* close journal */ -BEGINafterRun -CODESTARTafterRun - if (cs.stateFile) { /* can't persist without a state file */ - persistJournalState(); - } - sd_journal_close(j); - ratelimitDestruct(ratelimiter); -ENDafterRun - - -BEGINmodExit -CODESTARTmodExit - if(pInputName != NULL) - prop.Destruct(&pInputName); - if(pLocalHostIP != NULL) - prop.Destruct(&pLocalHostIP); - - /* release objects we used */ - objRelease(glbl, CORE_COMPONENT); - objRelease(net, CORE_COMPONENT); - objRelease(datetime, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if (pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if (Debug) { - dbgprintf("module (global) param blk for imjournal:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for (i = 0 ; i < modpblk.nParams ; ++i) { - if (!pvals[i].bUsed) - continue; - if (!strcmp(modpblk.descr[i].name, "persiststateinterval")) { - cs.iPersistStateInterval = (int) pvals[i].val.d.n; - } else if (!strcmp(modpblk.descr[i].name, "statefile")) { - cs.stateFile = (char *)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "ratelimit.burst")) { - cs.ratelimitBurst = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "ratelimit.interval")) { - cs.ratelimitInterval = (int) pvals[i].val.d.n; - } else if (!strcmp(modpblk.descr[i].name, "ignorepreviousmessages")) { - cs.bIgnorePrevious = (int) pvals[i].val.d.n; - } else { - dbgprintf("imjournal: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - -finalize_it: - if (pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - if(eFeat == sFEATURENonCancelInputTermination) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(datetime, CORE_COMPONENT)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); - CHKiRet(objUse(net, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - /* we need to create the inputName property (only once during our lifetime) */ - CHKiRet(prop.CreateStringProp(&pInputName, UCHAR_CONSTANT("imjournal"), sizeof("imjournal") - 1)); - CHKiRet(prop.CreateStringProp(&pLocalHostIP, UCHAR_CONSTANT("127.0.0.1"), sizeof("127.0.0.1") - 1)); - - CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalpersiststateinterval", 0, eCmdHdlrInt, - NULL, &cs.iPersistStateInterval, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalratelimitinterval", 0, eCmdHdlrInt, - NULL, &cs.ratelimitInterval, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalratelimitburst", 0, eCmdHdlrInt, - NULL, &cs.ratelimitBurst, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalstatefile", 0, eCmdHdlrGetWord, - NULL, &cs.stateFile, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalignorepreviousmessages", 0, eCmdHdlrBinary, - NULL, &cs.bIgnorePrevious, STD_LOADABLE_MODULE_ID)); - - -ENDmodInit -/* vim:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/imjournal/imjournal.h rsyslog-5.10.1/plugins/imjournal/imjournal.h --- rsyslog-7.6.0/plugins/imjournal/imjournal.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imjournal/imjournal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* imjournal.h - * These are the definitions for the journal messages import module - * - * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef IMJOURNAL_H_INCLUDED -#define IMJOURNAL_H_INCLUDED 1 - -#include "rsyslog.h" -#include "dirty.h" -#include - -struct modConfData_s { -}; - -rsRetVal Syslog(int priority, uchar *msg, struct timeval *tp, struct json_object *json); - -#endif /* #ifndef IMJOURNAL_H_INCLUDED */ -/* vi:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/imjournal/Makefile.am rsyslog-5.10.1/plugins/imjournal/Makefile.am --- rsyslog-7.6.0/plugins/imjournal/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imjournal/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -pkglib_LTLIBRARIES = imjournal.la -imjournal_la_SOURCES = imjournal.c imjournal.h - -imjournal_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(LIBSYSTEMD_JOURNAL_CFLAGS) -#imjournal_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(LIBSYSTEMD_JOURNAL_CFLAGS) -imjournal_la_LDFLAGS = -module -avoid-version -imjournal_la_LIBADD = $(LIBSYSTEMD_JOURNAL_LIBS) diff -Nru rsyslog-7.6.0/plugins/imjournal/Makefile.in rsyslog-5.10.1/plugins/imjournal/Makefile.in --- rsyslog-7.6.0/plugins/imjournal/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/imjournal/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/imjournal -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -imjournal_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_imjournal_la_OBJECTS = imjournal_la-imjournal.lo -imjournal_la_OBJECTS = $(am_imjournal_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -imjournal_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(imjournal_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(imjournal_la_SOURCES) -DIST_SOURCES = $(imjournal_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = imjournal.la -imjournal_la_SOURCES = imjournal.c imjournal.h -imjournal_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(LIBSYSTEMD_JOURNAL_CFLAGS) -#imjournal_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(LIBSYSTEMD_JOURNAL_CFLAGS) -imjournal_la_LDFLAGS = -module -avoid-version -imjournal_la_LIBADD = $(LIBSYSTEMD_JOURNAL_LIBS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/imjournal/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/imjournal/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -imjournal.la: $(imjournal_la_OBJECTS) $(imjournal_la_DEPENDENCIES) $(EXTRA_imjournal_la_DEPENDENCIES) - $(AM_V_CCLD)$(imjournal_la_LINK) -rpath $(pkglibdir) $(imjournal_la_OBJECTS) $(imjournal_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imjournal_la-imjournal.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -imjournal_la-imjournal.lo: imjournal.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imjournal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imjournal_la-imjournal.lo -MD -MP -MF $(DEPDIR)/imjournal_la-imjournal.Tpo -c -o imjournal_la-imjournal.lo `test -f 'imjournal.c' || echo '$(srcdir)/'`imjournal.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imjournal_la-imjournal.Tpo $(DEPDIR)/imjournal_la-imjournal.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imjournal.c' object='imjournal_la-imjournal.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imjournal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imjournal_la-imjournal.lo `test -f 'imjournal.c' || echo '$(srcdir)/'`imjournal.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/imklog/bsd.c rsyslog-5.10.1/plugins/imklog/bsd.c --- rsyslog-7.6.0/plugins/imklog/bsd.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imklog/bsd.c 2012-10-17 14:41:20.000000000 +0000 @@ -58,6 +58,9 @@ #ifdef OS_LINUX /* submit a message to imklog Syslog() API. In this function, we check if * a kernel timestamp is present and, if so, extract and strip it. + * Note: this is an extra processing step. We should revisit the whole + * idea in v6 and remove all that old stuff that we do not longer need + * (like symbol resolution). <-- TODO * Note that this is heavily Linux specific and thus is not compiled or * used for BSD. * Special thanks to Lennart Poettering for suggesting on how to convert @@ -70,21 +73,18 @@ * rgerhards, 2011-06-24 */ static void -submitSyslog(modConfData_t *pModConf, int pri, uchar *buf) +submitSyslog(int pri, uchar *buf) { long secs; - long usecs; + long nsecs; long secOffs; - long usecOffs; + long nsecOffs; unsigned i; unsigned bufsize; struct timespec monotonic, realtime; struct timeval tv; struct timeval *tp = NULL; - if(!pModConf->bParseKernelStamp) - goto done; - if(buf[3] != '[') goto done; DBGPRINTF("imklog: kernel timestamp detected, extracting it\n"); @@ -106,9 +106,9 @@ } ++i; /* skip dot */ - usecs = 0; + nsecs = 0; while(buf[i] && isdigit(buf[i])) { - usecs = usecs * 10 + buf[i] - '0'; + nsecs = nsecs * 10 + buf[i] - '0'; ++i; } if(buf[i] != ']') { @@ -118,29 +118,27 @@ ++i; /* skip ']' */ /* we have a timestamp */ - DBGPRINTF("kernel timestamp is %ld %ld\n", secs, usecs); - if(!pModConf->bKeepKernelStamp) { - bufsize= strlen((char*)buf); - memmove(buf+3, buf+i, bufsize - i + 1); - } + DBGPRINTF("kernel timestamp is %ld %ld\n", secs, nsecs); + bufsize= strlen((char*)buf); + memmove(buf+3, buf+i, bufsize - i + 1); clock_gettime(CLOCK_MONOTONIC, &monotonic); clock_gettime(CLOCK_REALTIME, &realtime); secOffs = realtime.tv_sec - monotonic.tv_sec; - usecOffs = (realtime.tv_nsec - monotonic.tv_nsec) / 1000; - if(usecOffs < 0) { + nsecOffs = realtime.tv_nsec - monotonic.tv_nsec; + if(nsecOffs < 0) { secOffs--; - usecOffs += 1000000l; + nsecOffs += 1000000000l; } - usecs += usecOffs; - if(usecs > 999999l) { + nsecs +=nsecOffs; + if(nsecs > 999999999l) { secs++; - usecs -= 1000000l; + nsecs -= 1000000000l; } secs += secOffs; tv.tv_sec = secs; - tv.tv_usec = usecs; + tv.tv_usec = nsecs / 1000; tp = &tv; done: @@ -148,44 +146,44 @@ } #else /* now comes the BSD "code" (just a shim) */ static void -submitSyslog(modConfData_t *pModConf, int pri, uchar *buf) +submitSyslog(int pri, uchar *buf) { Syslog(pri, buf, NULL); } #endif /* #ifdef LINUX */ -static uchar *GetPath(modConfData_t *pModConf) +static uchar *GetPath(void) { - return pModConf->pszPath ? pModConf->pszPath : (uchar*) _PATH_KLOG; + return pszPath ? pszPath : (uchar*) _PATH_KLOG; } /* open the kernel log - will be called inside the willRun() imklog * entry point. -- rgerhards, 2008-04-09 */ rsRetVal -klogWillRun(modConfData_t *pModConf) +klogWillRun(void) { char errmsg[2048]; int r; DEFiRet; - fklog = open((char*)GetPath(pModConf), O_RDONLY, 0); + fklog = open((char*)GetPath(), O_RDONLY, 0); if (fklog < 0) { - imklogLogIntMsg(LOG_ERR, "imklog: cannot open kernel log(%s): %s.", - GetPath(pModConf), rs_strerror_r(errno, errmsg, sizeof(errmsg))); + imklogLogIntMsg(RS_RET_ERR_OPEN_KLOG, "imklog: cannot open kernel log(%s): %s.", + GetPath(), rs_strerror_r(errno, errmsg, sizeof(errmsg))); ABORT_FINALIZE(RS_RET_ERR_OPEN_KLOG); } # ifdef OS_LINUX /* Set level of kernel console messaging.. */ - if(pModConf->console_log_level != -1) { - r = klogctl(8, NULL, pModConf->console_log_level); + if(console_log_level != -1) { + r = klogctl(8, NULL, console_log_level); if(r != 0) { imklogLogIntMsg(LOG_WARNING, "imklog: cannot set console log level: %s", rs_strerror_r(errno, errmsg, sizeof(errmsg))); /* make sure we do not try to re-set! */ - pModConf->console_log_level = -1; + console_log_level = -1; } } # endif /* #ifdef OS_LINUX */ @@ -198,7 +196,7 @@ /* Read kernel log while data are available, split into lines. */ static void -readklog(modConfData_t *pModConf) +readklog(void) { char *p, *q; int len, i; @@ -240,18 +238,18 @@ for (p = (char*)pRcv; (q = strchr(p, '\n')) != NULL; p = q + 1) { *q = '\0'; - submitSyslog(pModConf, LOG_INFO, (uchar*) p); + submitSyslog(LOG_INFO, (uchar*) p); } len = strlen(p); if (len >= iMaxLine - 1) { - submitSyslog(pModConf, LOG_INFO, (uchar*)p); + submitSyslog(LOG_INFO, (uchar*)p); len = 0; } if(len > 0) memmove(pRcv, p, len + 1); } if (len > 0) - submitSyslog(pModConf, LOG_INFO, pRcv); + submitSyslog(LOG_INFO, pRcv); if(pRcv != NULL && (size_t) iMaxLine >= sizeof(bufRcv) - 1) free(pRcv); @@ -261,14 +259,14 @@ /* to be called in the module's AfterRun entry point * rgerhards, 2008-04-09 */ -rsRetVal klogAfterRun(modConfData_t *pModConf) +rsRetVal klogAfterRun(void) { DEFiRet; if(fklog != -1) close(fklog); # ifdef OS_LINUX /* Turn on logging of messages to console, but only if a log level was speficied */ - if(pModConf->console_log_level != -1) + if(console_log_level != -1) klogctl(7, NULL, 0); # endif RETiRet; @@ -280,10 +278,10 @@ * "message pull" mechanism. * rgerhards, 2008-04-09 */ -rsRetVal klogLogKMsg(modConfData_t *pModConf) +rsRetVal klogLogKMsg(void) { DEFiRet; - readklog(pModConf); + readklog(); RETiRet; } diff -Nru rsyslog-7.6.0/plugins/imklog/imklog.c rsyslog-5.10.1/plugins/imklog/imklog.c --- rsyslog-7.6.0/plugins/imklog/imklog.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imklog/imklog.c 2012-10-17 14:41:20.000000000 +0000 @@ -59,12 +59,10 @@ #include "net.h" #include "glbl.h" #include "prop.h" -#include "errmsg.h" #include "unicode-helper.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imklog") /* Module static data */ DEF_IMOD_STATIC_DATA @@ -72,52 +70,27 @@ DEFobjCurrIf(glbl) DEFobjCurrIf(prop) DEFobjCurrIf(net) -DEFobjCurrIf(errmsg) -/* config settings */ -typedef struct configSettings_s { - int bPermitNonKernel; /* permit logging of messages not having LOG_KERN facility */ - int bParseKernelStamp; /* if try to parse kernel timestamps for message time */ - int bKeepKernelStamp; /* keep the kernel timestamp in the message */ - int iFacilIntMsg; /* the facility to use for internal messages (set by driver) */ - uchar *pszPath; - int console_log_level; /* still used for BSD */ -} configSettings_t; -static configSettings_t cs; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "logpath", eCmdHdlrGetWord, 0 }, - { "permitnonkernelfacility", eCmdHdlrBinary, 0 }, - { "consoleloglevel", eCmdHdlrInt, 0 }, - { "parsekerneltimestamp", eCmdHdlrBinary, 0 }, - { "keepkerneltimestamp", eCmdHdlrBinary, 0 }, - { "internalmsgfacility", eCmdHdlrFacility, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ -static prop_t *pLocalHostIP = NULL; +/* configuration settings */ +int dbgPrintSymbols = 0; /* this one is extern so the helpers can access it! */ +int symbols_twice = 0; +int use_syscall = 0; +int symbol_lookup = 0; /* on recent kernels > 2.6, the kernel does this */ +int bPermitNonKernel = 0; /* permit logging of messages not having LOG_KERN facility */ +int iFacilIntMsg; /* the facility to use for internal messages (set by driver) */ +uchar *pszPath = NULL; +int console_log_level = -1; +/* TODO: configuration for the following directives must be implemented. It + * was not done yet because we either do not yet have a config handler for + * that type or I thought it was acceptable to push it to a later stage when + * I gained more handson experience with the input module interface (and the + * changes resulting from that). -- rgerhards, 2007-12-20 + */ +char *symfile = NULL; -static inline void -initConfigSettings(void) -{ - cs.bPermitNonKernel = 0; - cs.bParseKernelStamp = 0; - cs.bKeepKernelStamp = 0; - cs.console_log_level = -1; - cs.pszPath = NULL; - cs.iFacilIntMsg = klogFacilIntMsg(); -} +static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ +static prop_t *pLocalHostIP = NULL; /* a pseudo-constant propterty for 127.0.0.1 */ /* enqueue the the kernel message into the message queue. * The provided msg string is not freed - thus must be done @@ -150,8 +123,7 @@ MsgSetTAG(pMsg, pszTag, ustrlen(pszTag)); pMsg->iFacility = iFacility; pMsg->iSeverity = iSeverity; - /* note: we do NOT use rate-limiting, as the kernel itself does rate-limiting */ - CHKiRet(submitMsg2(pMsg)); + CHKiRet(submitMsg(pMsg)); finalize_it: RETiRet; @@ -205,12 +177,15 @@ DEFiRet; va_list ap; uchar msgBuf[2048]; /* we use the same size as sysklogd to remain compatible */ + uchar *pLogMsg; va_start(ap, fmt); vsnprintf((char*)msgBuf, sizeof(msgBuf) / sizeof(char), fmt, ap); + pLogMsg = msgBuf; va_end(ap); - logmsgInternal(NO_ERRCODE ,priority, msgBuf, 0); + iRet = enqMsg((uchar*)pLogMsg, (uchar*) ((iFacilIntMsg == LOG_KERN) ? "kernel:" : "imklog:"), + iFacilIntMsg, LOG_PRI(priority), NULL); RETiRet; } @@ -247,7 +222,7 @@ /* if we don't get the pri, we use whatever we were supplied */ /* ignore non-kernel messages if not permitted */ - if(cs.bPermitNonKernel == 0 && LOG_FAC(priority) != LOG_KERN) + if(bPermitNonKernel == 0 && LOG_FAC(priority) != LOG_KERN) FINALIZE; /* silently ignore */ iRet = enqMsg((uchar*)pMsg, (uchar*) "kernel:", LOG_FAC(priority), LOG_PRI(priority), tp); @@ -279,168 +254,62 @@ * and then submits it to the rsyslog main queue. * rgerhards, 2008-04-09 */ - CHKiRet(klogLogKMsg(runModConf)); + CHKiRet(klogLogKMsg()); } finalize_it: ENDrunInput -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - pModConf->pszPath = NULL; - pModConf->bPermitNonKernel = 0; - pModConf->bParseKernelStamp = 0; - pModConf->bKeepKernelStamp = 0; - pModConf->console_log_level = -1; - pModConf->bKeepKernelStamp = 0; - pModConf->iFacilIntMsg = klogFacilIntMsg(); - loadModConf->configSetViaV2Method = 0; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config vars */ - initConfigSettings(); -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imklog:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "logpath")) { - loadModConf->pszPath = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "permitnonkernelfacility")) { - loadModConf->bPermitNonKernel = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "parsekerneltimestamp")) { - loadModConf->bParseKernelStamp = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "keepkerneltimestamp")) { - loadModConf->bKeepKernelStamp = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "consoleloglevel")) { - loadModConf->console_log_level= (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "internalmsgfacility")) { - loadModConf->iFacilIntMsg = (int) pvals[i].val.d.n; - } else { - dbgprintf("imklog: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - /* disable legacy module-global config directives */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - loadModConf->bPermitNonKernel = cs.bPermitNonKernel; - loadModConf->bParseKernelStamp = cs.bParseKernelStamp; - loadModConf->bKeepKernelStamp = cs.bKeepKernelStamp; - loadModConf->iFacilIntMsg = cs.iFacilIntMsg; - loadModConf->console_log_level = cs.console_log_level; - if((cs.pszPath == NULL) || (cs.pszPath[0] == '\0')) { - loadModConf->pszPath = NULL; - if(cs.pszPath != NULL) - free(cs.pszPath); - } else { - loadModConf->pszPath = cs.pszPath; - } - cs.pszPath = NULL; - } - - loadModConf = NULL; /* done loading */ -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnfPrePrivDrop -CODESTARTactivateCnfPrePrivDrop - runModConf = pModConf; - iRet = klogWillRun(runModConf); -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - BEGINwillRun CODESTARTwillRun + /* we need to create the inputName property (only once during our lifetime) */ + CHKiRet(prop.CreateStringProp(&pInputName, UCHAR_CONSTANT("imklog"), sizeof("imklog") - 1)); + pLocalHostIP = glbl.GetLocalHostIP(); + + iRet = klogWillRun(); +finalize_it: ENDwillRun BEGINafterRun CODESTARTafterRun - iRet = klogAfterRun(runModConf); + iRet = klogAfterRun(); + + if(pInputName != NULL) + prop.Destruct(&pInputName); ENDafterRun BEGINmodExit CODESTARTmodExit - if(pInputName != NULL) - prop.Destruct(&pInputName); - if(pLocalHostIP != NULL) - prop.Destruct(&pLocalHostIP); - /* release objects we used */ objRelease(glbl, CORE_COMPONENT); objRelease(net, CORE_COMPONENT); objRelease(datetime, CORE_COMPONENT); objRelease(prop, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); + if(pszPath != NULL) + free(pszPath); ENDmodExit BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES ENDqueryEtryPt static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - cs.bPermitNonKernel = 0; - cs.bParseKernelStamp = 0; - cs.bKeepKernelStamp = 0; - if(cs.pszPath != NULL) { - free(cs.pszPath); - cs.pszPath = NULL; + dbgPrintSymbols = 0; + symbols_twice = 0; + use_syscall = 0; + symfile = NULL; + symbol_lookup = 0; + bPermitNonKernel = 0; + if(pszPath != NULL) { + free(pszPath); + pszPath = NULL; } - cs.iFacilIntMsg = klogFacilIntMsg(); + iFacilIntMsg = klogFacilIntMsg(); return RS_RET_OK; } @@ -452,37 +321,18 @@ CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(objUse(net, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - /* we need to create the inputName property (only once during our lifetime) */ - CHKiRet(prop.CreateStringProp(&pInputName, UCHAR_CONSTANT("imklog"), sizeof("imklog") - 1)); - CHKiRet(prop.CreateStringProp(&pLocalHostIP, UCHAR_CONSTANT("127.0.0.1"), sizeof("127.0.0.1") - 1)); - /* init legacy config settings */ - initConfigSettings(); + iFacilIntMsg = klogFacilIntMsg(); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"debugprintkernelsymbols", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr2((uchar *)"klogpath", 0, eCmdHdlrGetWord, - NULL, &cs.pszPath, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbollookup", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbolstwice", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogusesyscallinterface", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr2((uchar *)"klogpermitnonkernelfacility", 0, eCmdHdlrBinary, - NULL, &cs.bPermitNonKernel, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"klogconsoleloglevel", 0, eCmdHdlrInt, - NULL, &cs.console_log_level, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"kloginternalmsgfacility", 0, eCmdHdlrFacility, - NULL, &cs.iFacilIntMsg, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"klogparsekerneltimestamp", 0, eCmdHdlrBinary, - NULL, &cs.bParseKernelStamp, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"klogkeepkerneltimestamp", 0, eCmdHdlrBinary, - NULL, &cs.bKeepKernelStamp, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"debugprintkernelsymbols", 0, eCmdHdlrBinary, NULL, &dbgPrintSymbols, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogpath", 0, eCmdHdlrGetWord, NULL, &pszPath, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbollookup", 0, eCmdHdlrBinary, NULL, &symbol_lookup, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbolstwice", 0, eCmdHdlrBinary, NULL, &symbols_twice, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogusesyscallinterface", 0, eCmdHdlrBinary, NULL, &use_syscall, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogpermitnonkernelfacility", 0, eCmdHdlrBinary, NULL, &bPermitNonKernel, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogconsoleloglevel", 0, eCmdHdlrInt, NULL, &console_log_level, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"kloginternalmsgfacility", 0, eCmdHdlrFacility, NULL, &iFacilIntMsg, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* vim:set ai: */ diff -Nru rsyslog-7.6.0/plugins/imklog/imklog.h rsyslog-5.10.1/plugins/imklog/imklog.h --- rsyslog-7.6.0/plugins/imklog/imklog.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imklog/imklog.h 2012-10-17 14:41:20.000000000 +0000 @@ -29,28 +29,29 @@ #include "rsyslog.h" #include "dirty.h" -/* we need to have the modConf type present in all submodules */ -struct modConfData_s { - rsconf_t *pConf; - int iFacilIntMsg; - uchar *pszPath; - int console_log_level; - sbool bParseKernelStamp; - sbool bKeepKernelStamp; - sbool bPermitNonKernel; - sbool configSetViaV2Method; -}; - /* interface to "drivers" * the platform specific drivers must implement these entry points. Only one * driver may be active at any given time, thus we simply rely on the linker * to resolve the addresses. * rgerhards, 2008-04-09 */ -rsRetVal klogLogKMsg(modConfData_t *pModConf); -rsRetVal klogWillRun(modConfData_t *pModConf); -rsRetVal klogAfterRun(modConfData_t *pModConf); -int klogFacilIntMsg(); +rsRetVal klogLogKMsg(void); +rsRetVal klogWillRun(void); +rsRetVal klogAfterRun(void); +int klogFacilIntMsg(void); + +/* the following data members may be accessed by the "drivers" + * I admit this is not the cleanest way to doing things, but I honestly + * believe it is appropriate for the job that needs to be done. + * rgerhards, 2008-04-09 + */ +extern int symbols_twice; +extern int use_syscall; +extern int symbol_lookup; +extern char *symfile; +extern int console_log_level; +extern int dbgPrintSymbols; +extern uchar *pszPath; /* the functions below may be called by the drivers */ rsRetVal imklogLogIntMsg(int priority, char *fmt, ...) __attribute__((format(printf,2, 3))); @@ -58,7 +59,7 @@ /* prototypes */ extern int klog_getMaxLine(void); /* work-around for klog drivers to get configured max line size */ -extern int InitKsyms(modConfData_t*); +extern int InitKsyms(char *); extern void DeinitKsyms(void); extern int InitMsyms(void); extern void DeinitMsyms(void); diff -Nru rsyslog-7.6.0/plugins/imklog/Makefile.in rsyslog-5.10.1/plugins/imklog/Makefile.in --- rsyslog-7.6.0/plugins/imklog/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/imklog/Makefile.in 2012-10-17 14:42:38.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -73,12 +73,6 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) imklog_la_DEPENDENCIES = @@ -88,8 +82,8 @@ am_imklog_la_OBJECTS = imklog_la-imklog.lo $(am__objects_1) \ $(am__objects_2) imklog_la_OBJECTS = $(am_imklog_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imklog_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -104,21 +98,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imklog_la_SOURCES) DIST_SOURCES = $(am__imklog_la_SOURCES_DIST) @@ -141,11 +135,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -159,56 +150,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -216,8 +181,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -237,16 +200,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -258,14 +216,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -299,6 +254,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -386,7 +342,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imklog.la: $(imklog_la_OBJECTS) $(imklog_la_DEPENDENCIES) $(EXTRA_imklog_la_DEPENDENCIES) +imklog.la: $(imklog_la_OBJECTS) $(imklog_la_DEPENDENCIES) $(AM_V_CCLD)$(imklog_la_LINK) -rpath $(pkglibdir) $(imklog_la_OBJECTS) $(imklog_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -401,37 +357,42 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imklog_la-imklog.lo: imklog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imklog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imklog_la-imklog.lo -MD -MP -MF $(DEPDIR)/imklog_la-imklog.Tpo -c -o imklog_la-imklog.lo `test -f 'imklog.c' || echo '$(srcdir)/'`imklog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imklog_la-imklog.Tpo $(DEPDIR)/imklog_la-imklog.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imklog.c' object='imklog_la-imklog.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imklog.c' object='imklog_la-imklog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imklog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imklog_la-imklog.lo `test -f 'imklog.c' || echo '$(srcdir)/'`imklog.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imklog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imklog_la-imklog.lo `test -f 'imklog.c' || echo '$(srcdir)/'`imklog.c imklog_la-bsd.lo: bsd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imklog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imklog_la-bsd.lo -MD -MP -MF $(DEPDIR)/imklog_la-bsd.Tpo -c -o imklog_la-bsd.lo `test -f 'bsd.c' || echo '$(srcdir)/'`bsd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imklog_la-bsd.Tpo $(DEPDIR)/imklog_la-bsd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bsd.c' object='imklog_la-bsd.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bsd.c' object='imklog_la-bsd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imklog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imklog_la-bsd.lo `test -f 'bsd.c' || echo '$(srcdir)/'`bsd.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imklog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imklog_la-bsd.lo `test -f 'bsd.c' || echo '$(srcdir)/'`bsd.c mostlyclean-libtool: -rm -f *.lo @@ -538,15 +499,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imkmsg/imkmsg.c rsyslog-5.10.1/plugins/imkmsg/imkmsg.c --- rsyslog-7.6.0/plugins/imkmsg/imkmsg.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imkmsg/imkmsg.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,295 +0,0 @@ -/* The kernel log module. - * - * This is rsyslog Linux only module for reading structured kernel logs. - * Module is based on imklog module so it retains its structure - * and other part is currently in kmsg.c file instead of this (imkmsg.c) - * For more information see that file. - * - * To test under Linux: - * echo test1 > /dev/kmsg - * - * Copyright (C) 2008-2012 Adiscon GmbH - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include - -#include "dirty.h" -#include "cfsysline.h" -#include "obj.h" -#include "msg.h" -#include "module-template.h" -#include "datetime.h" -#include "imkmsg.h" -#include "net.h" -#include "glbl.h" -#include "prop.h" -#include "errmsg.h" -#include "unicode-helper.h" - -MODULE_TYPE_INPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imkmsg") - -/* Module static data */ -DEF_IMOD_STATIC_DATA -DEFobjCurrIf(datetime) -DEFobjCurrIf(glbl) -DEFobjCurrIf(prop) -DEFobjCurrIf(net) -DEFobjCurrIf(errmsg) - -/* config settings */ -typedef struct configSettings_s { - int iFacilIntMsg; /* the facility to use for internal messages (set by driver) */ -} configSettings_t; -static configSettings_t cs; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ - -static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ -static prop_t *pLocalHostIP = NULL; /* a pseudo-constant propterty for 127.0.0.1 */ - -static inline void -initConfigSettings(void) -{ - cs.iFacilIntMsg = klogFacilIntMsg(); -} - - -/* enqueue the the kernel message into the message queue. - * The provided msg string is not freed - thus must be done - * by the caller. - * rgerhards, 2008-04-12 - */ -static rsRetVal -enqMsg(uchar *msg, uchar* pszTag, int iFacility, int iSeverity, struct timeval *tp, struct json_object *json) -{ - struct syslogTime st; - msg_t *pMsg; - DEFiRet; - - assert(msg != NULL); - assert(pszTag != NULL); - - if(tp == NULL) { - CHKiRet(msgConstruct(&pMsg)); - } else { - datetime.timeval2syslogTime(tp, &st); - CHKiRet(msgConstructWithTime(&pMsg, &st, tp->tv_sec)); - } - MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); - MsgSetInputName(pMsg, pInputName); - MsgSetRawMsgWOSize(pMsg, (char*)msg); - MsgSetMSGoffs(pMsg, 0); /* we do not have a header... */ - MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); - MsgSetRcvFromIP(pMsg, pLocalHostIP); - MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); - MsgSetTAG(pMsg, pszTag, ustrlen(pszTag)); - pMsg->iFacility = iFacility; - pMsg->iSeverity = iSeverity; - pMsg->json = json; - CHKiRet(submitMsg(pMsg)); - -finalize_it: - RETiRet; -} - - -/* log an imkmsg-internal message - * rgerhards, 2008-04-14 - */ -rsRetVal imkmsgLogIntMsg(int priority, char *fmt, ...) -{ - DEFiRet; - va_list ap; - uchar msgBuf[2048]; /* we use the same size as sysklogd to remain compatible */ - - va_start(ap, fmt); - vsnprintf((char*)msgBuf, sizeof(msgBuf) / sizeof(char), fmt, ap); - va_end(ap); - - logmsgInternal(NO_ERRCODE ,priority, msgBuf, 0); - - RETiRet; -} - - -/* log a message from /dev/kmsg - */ -rsRetVal Syslog(int priority, uchar *pMsg, struct timeval *tp, struct json_object *json) -{ - DEFiRet; - iRet = enqMsg((uchar*)pMsg, (uchar*) "kernel:", LOG_FAC(priority), LOG_PRI(priority), tp, json); - RETiRet; -} - - -/* helper for some klog drivers which need to know the MaxLine global setting. They can - * not obtain it themselfs, because they are no modules and can not query the object hander. - * It would probably be a good idea to extend the interface to support it, but so far - * we create a (sufficiently valid) work-around. -- rgerhards, 2008-11-24 - */ -int klog_getMaxLine(void) -{ - return glbl.GetMaxLine(); -} - - -BEGINrunInput -CODESTARTrunInput - /* this is an endless loop - it is terminated when the thread is - * signalled to do so. This, however, is handled by the framework, - * right into the sleep below. - */ - while(!pThrd->bShallStop) { - /* klogLogKMsg() waits for the next kernel message, obtains it - * and then submits it to the rsyslog main queue. - * rgerhards, 2008-04-09 - */ - CHKiRet(klogLogKMsg(runModConf)); - } -finalize_it: -ENDrunInput - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - pModConf->iFacilIntMsg = klogFacilIntMsg(); - loadModConf->configSetViaV2Method = 0; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config vars */ - initConfigSettings(); -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - loadModConf->iFacilIntMsg = cs.iFacilIntMsg; - } - - loadModConf = NULL; /* done loading */ -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnfPrePrivDrop -CODESTARTactivateCnfPrePrivDrop - runModConf = pModConf; - iRet = klogWillRun(runModConf); -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINwillRun -CODESTARTwillRun -ENDwillRun - - -BEGINafterRun -CODESTARTafterRun - iRet = klogAfterRun(runModConf); -ENDafterRun - - -BEGINmodExit -CODESTARTmodExit - if(pInputName != NULL) - prop.Destruct(&pInputName); - if(pLocalHostIP != NULL) - prop.Destruct(&pLocalHostIP); - - /* release objects we used */ - objRelease(glbl, CORE_COMPONENT); - objRelease(net, CORE_COMPONENT); - objRelease(datetime, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -ENDqueryEtryPt - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - cs.iFacilIntMsg = klogFacilIntMsg(); - return RS_RET_OK; -} - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(datetime, CORE_COMPONENT)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); - CHKiRet(objUse(net, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - /* we need to create the inputName property (only once during our lifetime) */ - CHKiRet(prop.CreateStringProp(&pInputName, UCHAR_CONSTANT("imkmsg"), sizeof("imkmsg") - 1)); - CHKiRet(prop.CreateStringProp(&pLocalHostIP, UCHAR_CONSTANT("127.0.0.1"), sizeof("127.0.0.1") - 1)); - - /* init legacy config settings */ - initConfigSettings(); - - CHKiRet(omsdRegCFSLineHdlr((uchar *)"debugprintkernelsymbols", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbollookup", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogsymbolstwice", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"klogusesyscallinterface", 0, eCmdHdlrGoneAway, - NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -ENDmodInit -/* vim:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/imkmsg/imkmsg.h rsyslog-5.10.1/plugins/imkmsg/imkmsg.h --- rsyslog-7.6.0/plugins/imkmsg/imkmsg.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imkmsg/imkmsg.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* imkmsg.h - * These are the definitions for the kmsg message generation module. - * - * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef IMKLOG_H_INCLUDED -#define IMKLOG_H_INCLUDED 1 - -#include "rsyslog.h" -#include "dirty.h" - -/* we need to have the modConf type present in all submodules */ -struct modConfData_s { - rsconf_t *pConf; - int iFacilIntMsg; - uchar *pszPath; - int console_log_level; - sbool bPermitNonKernel; - sbool configSetViaV2Method; -}; - -/* interface to "drivers" - * the platform specific drivers must implement these entry points. Only one - * driver may be active at any given time, thus we simply rely on the linker - * to resolve the addresses. - * rgerhards, 2008-04-09 - */ -rsRetVal klogLogKMsg(modConfData_t *pModConf); -rsRetVal klogWillRun(modConfData_t *pModConf); -rsRetVal klogAfterRun(modConfData_t *pModConf); -int klogFacilIntMsg(); - -/* the functions below may be called by the drivers */ -rsRetVal imkmsgLogIntMsg(int priority, char *fmt, ...) __attribute__((format(printf,2, 3))); -rsRetVal Syslog(int priority, uchar *msg, struct timeval *tp, struct json_object *json); - -/* prototypes */ -extern int klog_getMaxLine(void); /* work-around for klog drivers to get configured max line size */ -extern int InitKsyms(modConfData_t*); -extern void DeinitKsyms(void); -extern int InitMsyms(void); -extern void DeinitMsyms(void); -extern char * ExpandKadds(char *, char *); -extern void SetParanoiaLevel(int); - -#endif /* #ifndef IMKLOG_H_INCLUDED */ -/* vi:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/imkmsg/kmsg.c rsyslog-5.10.1/plugins/imkmsg/kmsg.c --- rsyslog-7.6.0/plugins/imkmsg/kmsg.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imkmsg/kmsg.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,249 +0,0 @@ -/* imkmsg driver for Linux /dev/kmsg structured logging - * - * This contains Linux-specific functionality to read /dev/kmsg - * For a general overview, see head comment in imkmsg.c. - * This is heavily based on imklog bsd.c file. - * - * Copyright 2008-2012 Adiscon GmbH - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" -#include "srUtils.h" -#include "debug.h" -#include "imkmsg.h" - -/* globals */ -static int fklog = -1; /* kernel log fd */ - -#ifndef _PATH_KLOG -# define _PATH_KLOG "/dev/kmsg" -#endif - -/* submit a message to imkmsg Syslog() API. In this function, we parse - * necessary information from kernel log line, and make json string - * from the rest. - */ -static void -submitSyslog(uchar *buf) -{ - long offs = 0; - struct timeval tv; - struct sysinfo info; - unsigned long int timestamp = 0; - char name[1024]; - char value[1024]; - char msg[1024]; - int priority = 0; - long int sequnum = 0; - struct json_object *json = NULL, *jval; - - /* create new json object */ - json = json_object_new_object(); - - /* get priority */ - for (; isdigit(*buf); buf++) { - priority += (priority * 10) + (*buf - '0'); - } - buf++; - - /* get messages sequence number and add it to json */ - for (; isdigit(*buf); buf++) { - sequnum = (sequnum * 10) + (*buf - '0'); - } - buf++; /* skip , */ - jval = json_object_new_int(sequnum); - json_object_object_add(json, "sequnum", jval); - - /* get timestamp */ - for (; isdigit(*buf); buf++) { - timestamp = (timestamp * 10) + (*buf - '0'); - } - - while (*buf != ';') { - buf++; /* skip everything till the first ; */ - } - buf++; /* skip ; */ - - /* get message */ - offs = 0; - for (; *buf != '\n' && *buf != '\0'; buf++, offs++) { - msg[offs] = *buf; - } - msg[offs] = '\0'; - jval = json_object_new_string((char*)msg); - json_object_object_add(json, "msg", jval); - - if (*buf != '\0') /* message has appended properties, skip \n */ - buf++; - - while (*buf) { - /* get name of the property */ - buf++; /* skip ' ' */ - offs = 0; - for (; *buf != '=' && *buf != ' '; buf++, offs++) { - name[offs] = *buf; - } - name[offs] = '\0'; - buf++; /* skip = or ' ' */; - - offs = 0; - for (; *buf != '\n' && *buf != '\0'; buf++, offs++) { - value[offs] = *buf; - } - value[offs] = '\0'; - if (*buf != '\0') { - buf++; /* another property, skip \n */ - } - - jval = json_object_new_string((char*)value); - json_object_object_add(json, name, jval); - } - - /* calculate timestamp */ - sysinfo(&info); - gettimeofday(&tv, NULL); - - /* get boot time */ - tv.tv_sec -= info.uptime; - - tv.tv_sec += timestamp / 1000000; - tv.tv_usec += timestamp % 1000000; - - while (tv.tv_usec < 0) { - tv.tv_sec--; - tv.tv_usec += 1000000; - } - - while (tv.tv_usec >= 1000000) { - tv.tv_sec++; - tv.tv_usec -= 1000000; - } - - Syslog(priority, (uchar *)msg, &tv, json); -} - - -/* open the kernel log - will be called inside the willRun() imkmsg entry point - */ -rsRetVal -klogWillRun(modConfData_t *pModConf) -{ - char errmsg[2048]; - DEFiRet; - - fklog = open(_PATH_KLOG, O_RDONLY, 0); - if (fklog < 0) { - imkmsgLogIntMsg(RS_RET_ERR_OPEN_KLOG, "imkmsg: cannot open kernel log(%s): %s.", - _PATH_KLOG, rs_strerror_r(errno, errmsg, sizeof(errmsg))); - ABORT_FINALIZE(RS_RET_ERR_OPEN_KLOG); - } - -finalize_it: - RETiRet; -} - -/* Read kernel log while data are available, each read() reads one - * record of printk buffer. - */ -static void -readkmsg(void) -{ - int i; - uchar pRcv[8192+1]; - char errmsg[2048]; - - for (;;) { - dbgprintf("imkmsg waiting for kernel log line\n"); - - /* every read() from the opened device node receives one record of the printk buffer */ - i = read(fklog, pRcv, 8192); - - if (i > 0) { - /* successful read of message of nonzero length */ - pRcv[i] = '\0'; - } else if (i == -EPIPE) { - imkmsgLogIntMsg(LOG_WARNING, - "imkmsg: some messages in circular buffer got overwritten"); - continue; - } else { - /* something went wrong - error or zero length message */ - if (i < 0 && errno != EINTR && errno != EAGAIN) { - /* error occured */ - imkmsgLogIntMsg(LOG_ERR, - "imkmsg: error reading kernel log - shutting down: %s", - rs_strerror_r(errno, errmsg, sizeof(errmsg))); - fklog = -1; - } - break; - } - - submitSyslog(pRcv); - } -} - - -/* to be called in the module's AfterRun entry point - * rgerhards, 2008-04-09 - */ -rsRetVal klogAfterRun(modConfData_t *pModConf) -{ - DEFiRet; - if(fklog != -1) - close(fklog); - /* Turn on logging of messages to console, but only if a log level was speficied */ - if(pModConf->console_log_level != -1) - klogctl(7, NULL, 0); - RETiRet; -} - - -/* to be called in the module's WillRun entry point, this is the main - * "message pull" mechanism. - * rgerhards, 2008-04-09 - */ -rsRetVal klogLogKMsg(modConfData_t __attribute__((unused)) *pModConf) -{ - DEFiRet; - readkmsg(); - RETiRet; -} - - -/* provide the (system-specific) default facility for internal messages - * rgerhards, 2008-04-14 - */ -int -klogFacilIntMsg(void) -{ - return LOG_SYSLOG; -} - diff -Nru rsyslog-7.6.0/plugins/imkmsg/Makefile.am rsyslog-5.10.1/plugins/imkmsg/Makefile.am --- rsyslog-7.6.0/plugins/imkmsg/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imkmsg/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = imkmsg.la -imkmsg_la_SOURCES = imkmsg.c imkmsg.h - -imkmsg_la_SOURCES += kmsg.c - -imkmsg_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -imkmsg_la_LDFLAGS = -module -avoid-version -imkmsg_la_LIBADD = diff -Nru rsyslog-7.6.0/plugins/imkmsg/Makefile.in rsyslog-5.10.1/plugins/imkmsg/Makefile.in --- rsyslog-7.6.0/plugins/imkmsg/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/imkmsg/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,643 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/imkmsg -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -imkmsg_la_DEPENDENCIES = -am_imkmsg_la_OBJECTS = imkmsg_la-imkmsg.lo imkmsg_la-kmsg.lo -imkmsg_la_OBJECTS = $(am_imkmsg_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -imkmsg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(imkmsg_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(imkmsg_la_SOURCES) -DIST_SOURCES = $(imkmsg_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = imkmsg.la -imkmsg_la_SOURCES = imkmsg.c imkmsg.h kmsg.c -imkmsg_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -imkmsg_la_LDFLAGS = -module -avoid-version -imkmsg_la_LIBADD = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/imkmsg/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/imkmsg/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -imkmsg.la: $(imkmsg_la_OBJECTS) $(imkmsg_la_DEPENDENCIES) $(EXTRA_imkmsg_la_DEPENDENCIES) - $(AM_V_CCLD)$(imkmsg_la_LINK) -rpath $(pkglibdir) $(imkmsg_la_OBJECTS) $(imkmsg_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imkmsg_la-imkmsg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imkmsg_la-kmsg.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -imkmsg_la-imkmsg.lo: imkmsg.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imkmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imkmsg_la-imkmsg.lo -MD -MP -MF $(DEPDIR)/imkmsg_la-imkmsg.Tpo -c -o imkmsg_la-imkmsg.lo `test -f 'imkmsg.c' || echo '$(srcdir)/'`imkmsg.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imkmsg_la-imkmsg.Tpo $(DEPDIR)/imkmsg_la-imkmsg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imkmsg.c' object='imkmsg_la-imkmsg.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imkmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imkmsg_la-imkmsg.lo `test -f 'imkmsg.c' || echo '$(srcdir)/'`imkmsg.c - -imkmsg_la-kmsg.lo: kmsg.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imkmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imkmsg_la-kmsg.lo -MD -MP -MF $(DEPDIR)/imkmsg_la-kmsg.Tpo -c -o imkmsg_la-kmsg.lo `test -f 'kmsg.c' || echo '$(srcdir)/'`kmsg.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imkmsg_la-kmsg.Tpo $(DEPDIR)/imkmsg_la-kmsg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kmsg.c' object='imkmsg_la-kmsg.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imkmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imkmsg_la-kmsg.lo `test -f 'kmsg.c' || echo '$(srcdir)/'`kmsg.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/immark/immark.c rsyslog-5.10.1/plugins/immark/immark.c --- rsyslog-7.6.0/plugins/immark/immark.c 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/plugins/immark/immark.c 2012-10-17 14:41:20.000000000 +0000 @@ -46,7 +46,6 @@ MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("immark") /* defines */ #define DEFAULT_MARK_PERIOD (20 * 60) @@ -54,29 +53,7 @@ /* Module static data */ DEF_IMOD_STATIC_DATA DEFobjCurrIf(glbl) -DEFobjCurrIf(errmsg) - static int iMarkMessagePeriod = DEFAULT_MARK_PERIOD; -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - int iMarkMessagePeriod; - sbool configSetViaV2Method; -}; - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "interval", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ - BEGINisCompatibleWithFeature CODESTARTisCompatibleWithFeature @@ -85,89 +62,6 @@ ENDisCompatibleWithFeature -BEGINafterRun -CODESTARTafterRun -ENDafterRun - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - pModConf->iMarkMessagePeriod = DEFAULT_MARK_PERIOD; - loadModConf->configSetViaV2Method = 0; - bLegacyCnfModGlobalsPermitted = 1; -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imuxsock:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "interval")) { - loadModConf->iMarkMessagePeriod = (int) pvals[i].val.d.n; - } else { - dbgprintf("imuxsock: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - /* disable legacy module-global config directives */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - pModConf->iMarkMessagePeriod = iMarkMessagePeriod; - } -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf - if(pModConf->iMarkMessagePeriod == 0) { - errmsg.LogError(0, NO_ERRCODE, "immark: mark message period must not be 0, can not run"); - ABORT_FINALIZE(RS_RET_NO_RUN); /* we can not run with this error */ - } -finalize_it: -ENDcheckCnf - - -BEGINactivateCnf -CODESTARTactivateCnf - MarkInterval = pModConf->iMarkMessagePeriod; - DBGPRINTF("immark set MarkInterval to %d\n", MarkInterval); -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - /* This function is called to gather input. It must terminate only * a) on failure (iRet set accordingly) * b) on termination of the input module (as part of the unload process) @@ -187,39 +81,46 @@ * right into the sleep below. */ while(1) { - srSleep(MarkInterval, 0); /* seconds, micro seconds */ + srSleep(iMarkMessagePeriod, 0); /* seconds, micro seconds */ if(glbl.GetGlobalInputTermState() == 1) break; /* terminate input! */ dbgprintf("immark: injecting mark message\n"); - logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)"-- MARK --", MARK); + logmsgInternal(NO_ERRCODE, LOG_INFO, (uchar*)"-- MARK --", MARK); } ENDrunInput BEGINwillRun CODESTARTwillRun + /* We set the global MarkInterval to what is configured here -- rgerhards, 2008-07-15 */ + MarkInterval = iMarkMessagePeriod; + if(iMarkMessagePeriod == 0) + iRet = RS_RET_NO_RUN; ENDwillRun +BEGINafterRun +CODESTARTafterRun +ENDafterRun + + BEGINmodExit CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); ENDmodExit BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { iMarkMessagePeriod = DEFAULT_MARK_PERIOD; + return RS_RET_OK; } @@ -228,13 +129,8 @@ *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - /* legacy config handlers */ - CHKiRet(regCfSysLineHdlr2((uchar *)"markmessageperiod", 0, eCmdHdlrInt, NULL, - &iMarkMessagePeriod, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"markmessageperiod", 0, eCmdHdlrInt, NULL, &iMarkMessagePeriod, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* vi:set ai: */ diff -Nru rsyslog-7.6.0/plugins/immark/Makefile.in rsyslog-5.10.1/plugins/immark/Makefile.in --- rsyslog-7.6.0/plugins/immark/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/immark/Makefile.in 2012-10-17 14:42:39.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) immark_la_DEPENDENCIES = am_immark_la_OBJECTS = immark_la-immark.lo immark_la_OBJECTS = $(am_immark_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent immark_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(immark_la_SOURCES) DIST_SOURCES = $(immark_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -immark.la: $(immark_la_OBJECTS) $(immark_la_DEPENDENCIES) $(EXTRA_immark_la_DEPENDENCIES) +immark.la: $(immark_la_OBJECTS) $(immark_la_DEPENDENCIES) $(AM_V_CCLD)$(immark_la_LINK) -rpath $(pkglibdir) $(immark_la_OBJECTS) $(immark_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< immark_la-immark.lo: immark.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(immark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT immark_la-immark.lo -MD -MP -MF $(DEPDIR)/immark_la-immark.Tpo -c -o immark_la-immark.lo `test -f 'immark.c' || echo '$(srcdir)/'`immark.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/immark_la-immark.Tpo $(DEPDIR)/immark_la-immark.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='immark.c' object='immark_la-immark.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='immark.c' object='immark_la-immark.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(immark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o immark_la-immark.lo `test -f 'immark.c' || echo '$(srcdir)/'`immark.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(immark_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o immark_la-immark.lo `test -f 'immark.c' || echo '$(srcdir)/'`immark.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/impstats/impstats.c rsyslog-5.10.1/plugins/impstats/impstats.c --- rsyslog-7.6.0/plugins/impstats/impstats.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/impstats/impstats.c 2012-10-17 14:41:20.000000000 +0000 @@ -1,7 +1,7 @@ /* impstats.c * A module to periodically output statistics gathered by rsyslog. * - * Copyright 2010-2013 Adiscon GmbH. + * Copyright 2010-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -27,15 +27,6 @@ #include #include #include -#include -#include -#if defined(__FreeBSD__) -#include -#endif -#include -#include -#include - #include "dirty.h" #include "cfsysline.h" #include "module-template.h" @@ -46,11 +37,9 @@ #include "glbl.h" #include "statsobj.h" #include "prop.h" -#include "ruleset.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("impstats") /* defines */ #define DEFAULT_STATS_PERIOD (5 * 60) @@ -63,78 +52,16 @@ DEFobjCurrIf(prop) DEFobjCurrIf(statsobj) DEFobjCurrIf(errmsg) -DEFobjCurrIf(ruleset) typedef struct configSettings_s { int iStatsInterval; int iFacility; int iSeverity; - int bJSON; - int bCEE; } configSettings_t; -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - int iStatsInterval; - int iFacility; - int iSeverity; - int logfd; /* fd if logging to file, or -1 if closed */ - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - statsFmtType_t statsFmt; - sbool bLogToSyslog; - sbool bResetCtrs; - char *logfile; - sbool configSetViaV2Method; - uchar *pszBindRuleset; /* name of ruleset to bind to */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ - static configSettings_t cs; -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ -static prop_t *pInputName = NULL; - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "interval", eCmdHdlrInt, 0 }, - { "facility", eCmdHdlrInt, 0 }, - { "severity", eCmdHdlrInt, 0 }, - { "log.syslog", eCmdHdlrBinary, 0 }, - { "resetcounters", eCmdHdlrBinary, 0 }, - { "log.file", eCmdHdlrGetWord, 0 }, - { "format", eCmdHdlrGetWord, 0 }, - { "ruleset", eCmdHdlrString, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - - -/* resource use stats counters */ -static intctr_t st_ru_utime; -static intctr_t st_ru_stime; -static int st_ru_maxrss; -static int st_ru_minflt; -static int st_ru_majflt; -static int st_ru_inblock; -static int st_ru_oublock; -static int st_ru_nvcsw; -static int st_ru_nivcsw; -static statsobj_t *statsobj_resources; - -BEGINmodExit -CODESTARTmodExit - prop.Destruct(&pInputName); - /* release objects we used */ - objRelease(glbl, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); - objRelease(statsobj, CORE_COMPONENT); - objRelease(ruleset, CORE_COMPONENT); -ENDmodExit +static prop_t *pInputName = NULL; BEGINisCompatibleWithFeature CODESTARTisCompatibleWithFeature @@ -148,81 +75,34 @@ cs.iStatsInterval = DEFAULT_STATS_PERIOD; cs.iFacility = DEFAULT_FACILITY; cs.iSeverity = DEFAULT_SEVERITY; - cs.bJSON = 0; - cs.bCEE = 0; } /* actually submit a message to the rsyslog core */ -static inline void +static inline rsRetVal doSubmitMsg(uchar *line) { msg_t *pMsg; + DEFiRet; - if(msgConstruct(&pMsg) != RS_RET_OK) - goto finalize_it; + CHKiRet(msgConstruct(&pMsg)); MsgSetInputName(pMsg, pInputName); MsgSetRawMsgWOSize(pMsg, (char*)line); MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); MsgSetRcvFromIP(pMsg, glbl.GetLocalHostIP()); MsgSetMSGoffs(pMsg, 0); - MsgSetRuleset(pMsg, runModConf->pBindRuleset); MsgSetTAG(pMsg, UCHAR_CONSTANT("rsyslogd-pstats:"), sizeof("rsyslogd-pstats:") - 1); - pMsg->iFacility = runModConf->iFacility; - pMsg->iSeverity = runModConf->iSeverity; + pMsg->iFacility = cs.iFacility; + pMsg->iSeverity = cs.iSeverity; pMsg->msgFlags = 0; - /* we do not use rate-limiting, as the stats message always need to be emitted */ - submitMsg2(pMsg); - DBGPRINTF("impstats: submit [%d,%d] msg '%s'\n", runModConf->iFacility, - runModConf->iSeverity, line); + submitMsg(pMsg); finalize_it: - return; -} - - -/* log stats message to file; limited error handling done */ -static inline void -doLogToFile(cstr_t *cstr) -{ - struct iovec iov[4]; - ssize_t nwritten; - ssize_t nexpect; - time_t t; - char timebuf[32]; - - if(cstrLen(cstr) == 0) - goto done; - if(runModConf->logfd == -1) { - runModConf->logfd = open(runModConf->logfile, O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, S_IRUSR|S_IWUSR); - if(runModConf->logfd == -1) { - dbgprintf("error opening stats file %s\n", runModConf->logfile); - goto done; - } - } + RETiRet; - time(&t); - iov[0].iov_base = ctime_r(&t, timebuf); - iov[0].iov_len = nexpect = strlen(iov[0].iov_base) - 1; /* -1: strip \n */ - iov[1].iov_base = ": "; - iov[1].iov_len = 2; - nexpect += 2; - iov[2].iov_base = rsCStrGetSzStrNoNULL(cstr); - iov[2].iov_len = (size_t) cstrLen(cstr); - nexpect += cstrLen(cstr); - iov[3].iov_base = "\n"; - iov[3].iov_len = 1; - nexpect++; - nwritten = writev(runModConf->logfd, iov, 4); - - if(nwritten != nexpect) { - dbgprintf("error writing stats file %s, nwritten %lld, expected %lld\n", - runModConf->logfile, (long long) nwritten, (long long) nexpect); - } -done: return; } @@ -233,10 +113,7 @@ doStatsLine(void __attribute__((unused)) *usrptr, cstr_t *cstr) { DEFiRet; - if(runModConf->bLogToSyslog) - doSubmitMsg(rsCStrGetSzStrNoNULL(cstr)); - if(runModConf->logfile != NULL) - doLogToFile(cstr); + doSubmitMsg(rsCStrGetSzStrNoNULL(cstr)); RETiRet; } @@ -247,232 +124,39 @@ static inline void generateStatsMsgs(void) { - struct rusage ru; - int r; - r = getrusage(RUSAGE_SELF, &ru); - if(r != 0) { - dbgprintf("impstats: getrusage() failed with error %d, zeroing out\n", errno); - memset(&ru, 0, sizeof(ru)); - } - st_ru_utime = ru.ru_utime.tv_sec * 1000000 + ru.ru_utime.tv_usec; - st_ru_stime = ru.ru_stime.tv_sec * 1000000 + ru.ru_stime.tv_usec; - st_ru_maxrss = ru.ru_maxrss; - st_ru_minflt = ru.ru_minflt; - st_ru_majflt = ru.ru_majflt; - st_ru_inblock = ru.ru_inblock; - st_ru_oublock = ru.ru_oublock; - st_ru_nvcsw = ru.ru_nvcsw; - st_ru_nivcsw = ru.ru_nivcsw; - statsobj.GetAllStatsLines(doStatsLine, NULL, runModConf->statsFmt, runModConf->bResetCtrs); + statsobj.GetAllStatsLines(doStatsLine, NULL); } -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - loadModConf->configSetViaV2Method = 0; - loadModConf->iStatsInterval = DEFAULT_STATS_PERIOD; - loadModConf->iFacility = DEFAULT_FACILITY; - loadModConf->iSeverity = DEFAULT_SEVERITY; - loadModConf->statsFmt = statsFmt_Legacy; - loadModConf->logfd = -1; - loadModConf->logfile = NULL; - loadModConf->pszBindRuleset = NULL; - loadModConf->bLogToSyslog = 1; - loadModConf->bResetCtrs = 0; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config vars */ - initConfigSettings(); -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - char *mode; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for impstats:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "interval")) { - loadModConf->iStatsInterval = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "facility")) { - loadModConf->iFacility = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "severity")) { - loadModConf->iSeverity = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "log.syslog")) { - loadModConf->bLogToSyslog = (sbool) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "resetcounters")) { - loadModConf->bResetCtrs = (sbool) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "log.file")) { - loadModConf->logfile = es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "format")) { - mode = es_str2cstr(pvals[i].val.d.estr, NULL); - if(!strcasecmp(mode, "json")) { - loadModConf->statsFmt = statsFmt_JSON; - } else if(!strcasecmp(mode, "cee")) { - loadModConf->statsFmt = statsFmt_CEE; - } else if(!strcasecmp(mode, "legacy")) { - loadModConf->statsFmt = statsFmt_Legacy; - } else { - errmsg.LogError(0, RS_RET_ERR, "impstats: invalid format %s", - mode); - } - free(mode); - } else if(!strcmp(modpblk.descr[i].name, "ruleset")) { - loadModConf->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("impstats: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - loadModConf->configSetViaV2Method = 1; - bLegacyCnfModGlobalsPermitted = 0; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - loadModConf->iStatsInterval = cs.iStatsInterval; - loadModConf->iFacility = cs.iFacility; - loadModConf->iSeverity = cs.iSeverity; - if (cs.bCEE == 1) { - loadModConf->statsFmt = statsFmt_CEE; - } else if (cs.bJSON == 1) { - loadModConf->statsFmt = statsFmt_JSON; - } else { - loadModConf->statsFmt = statsFmt_Legacy; - } - } -ENDendCnfLoad - - -/* we need our special version of checkRuleset(), as we do not have any instances */ -static inline rsRetVal -checkRuleset(modConfData_t *modConf) -{ - ruleset_t *pRuleset; - rsRetVal localRet; - DEFiRet; - - modConf->pBindRuleset = NULL; /* assume default ruleset */ -dbgprintf("DDDD: impstats ruleset %s\n", modConf->pszBindRuleset); - - if(modConf->pszBindRuleset == NULL) - FINALIZE; - - localRet = ruleset.GetRuleset(modConf->pConf, &pRuleset, modConf->pszBindRuleset); - if(localRet == RS_RET_NOT_FOUND) { - errmsg.LogError(0, NO_ERRCODE, "impstats: ruleset '%s' not found - " - "using default ruleset instead", modConf->pszBindRuleset); - } - CHKiRet(localRet); - modConf->pBindRuleset = pRuleset; -finalize_it: -dbgprintf("DDDD: impstats ruleset ptr %p\n", modConf->pBindRuleset); - RETiRet; -} - -BEGINcheckCnf -CODESTARTcheckCnf - if(pModConf->iStatsInterval == 0) { - errmsg.LogError(0, NO_ERRCODE, "impstats: stats interval zero not permitted, using " - "default of %d seconds", DEFAULT_STATS_PERIOD); - pModConf->iStatsInterval = DEFAULT_STATS_PERIOD; - } - iRet = checkRuleset(pModConf); -ENDcheckCnf - - -BEGINactivateCnf - rsRetVal localRet; -CODESTARTactivateCnf - runModConf = pModConf; - DBGPRINTF("impstats: stats interval %d seconds, reset %d, logToSyslog %d, logFile %s\n", - runModConf->iStatsInterval, runModConf->bResetCtrs, runModConf->bLogToSyslog, - runModConf->logfile == NULL ? "deactivated" : (char*)runModConf->logfile); - localRet = statsobj.EnableStats(); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, "impstats: error enabling statistics gathering"); - ABORT_FINALIZE(RS_RET_NO_RUN); - } - /* initialize our own counters */ - CHKiRet(statsobj.Construct(&statsobj_resources)); - CHKiRet(statsobj.SetName(statsobj_resources, (uchar*)"resource-usage")); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("utime"), - ctrType_IntCtr, CTR_FLAG_NONE, &st_ru_utime)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("stime"), - ctrType_IntCtr, CTR_FLAG_NONE, &st_ru_stime)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("maxrss"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_maxrss)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("minflt"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_minflt)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("majflt"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_majflt)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("inblock"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_inblock)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("oublock"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_oublock)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("nvcsw"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_nvcsw)); - CHKiRet(statsobj.AddCounter(statsobj_resources, UCHAR_CONSTANT("nivcsw"), - ctrType_Int, CTR_FLAG_NONE, &st_ru_nivcsw)); - CHKiRet(statsobj.ConstructFinalize(statsobj_resources)); -finalize_it: - if(iRet != RS_RET_OK) { - errmsg.LogError(0, iRet, "impstats: error activating module"); - iRet = RS_RET_NO_RUN; - } -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf - if(runModConf->logfd != -1) - close(runModConf->logfd); - free(runModConf->logfile); -ENDfreeCnf - - BEGINrunInput CODESTARTrunInput /* this is an endless loop - it is terminated when the thread is * signalled to do so. This, however, is handled by the framework, - * right into the sleep below. Note that we DELIBERATLY output - * final set of stats counters on termination request. Depending - * on configuration, they may not make it to the final destination... + * right into the sleep below. */ - while(glbl.GetGlobalInputTermState() == 0) { - srSleep(runModConf->iStatsInterval, 0); /* seconds, micro seconds */ - DBGPRINTF("impstats: woke up, generating messages\n"); + while(1) { + srSleep(cs.iStatsInterval, 0); /* seconds, micro seconds */ + + if(glbl.GetGlobalInputTermState() == 1) + break; /* terminate input! */ + generateStatsMsgs(); } ENDrunInput BEGINwillRun + rsRetVal localRet; CODESTARTwillRun + DBGPRINTF("impstats: stats interval %d seconds\n", cs.iStatsInterval); + if(cs.iStatsInterval == 0) + ABORT_FINALIZE(RS_RET_NO_RUN); + localRet = statsobj.EnableStats(); + if(localRet != RS_RET_OK) { + errmsg.LogError(0, localRet, "impstat: error enabling statistics gathering"); + ABORT_FINALIZE(RS_RET_NO_RUN); + } +finalize_it: ENDwillRun @@ -481,11 +165,21 @@ ENDafterRun +BEGINmodExit +CODESTARTmodExit + prop.Destruct(&pInputName); + /* release objects we used */ + objRelease(glbl, CORE_COMPONENT); + objRelease(prop, CORE_COMPONENT); + objRelease(errmsg, CORE_COMPONENT); + objRelease(statsobj, CORE_COMPONENT); +ENDmodExit + + + BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt @@ -506,14 +200,11 @@ CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(statsobj, CORE_COMPONENT)); - CHKiRet(objUse(ruleset, CORE_COMPONENT)); /* the pstatsinverval is an alias to support a previous screwed-up syntax... */ - CHKiRet(regCfSysLineHdlr2((uchar *)"pstatsinterval", 0, eCmdHdlrInt, NULL, &cs.iStatsInterval, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"pstatinterval", 0, eCmdHdlrInt, NULL, &cs.iStatsInterval, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"pstatfacility", 0, eCmdHdlrInt, NULL, &cs.iFacility, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"pstatseverity", 0, eCmdHdlrInt, NULL, &cs.iSeverity, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"pstatjson", 0, eCmdHdlrBinary, NULL, &cs.bJSON, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"pstatcee", 0, eCmdHdlrBinary, NULL, &cs.bCEE, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatsinterval", 0, eCmdHdlrInt, NULL, &cs.iStatsInterval, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatinterval", 0, eCmdHdlrInt, NULL, &cs.iStatsInterval, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatfacility", 0, eCmdHdlrInt, NULL, &cs.iFacility, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"pstatseverity", 0, eCmdHdlrInt, NULL, &cs.iSeverity, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(prop.Construct(&pInputName)); diff -Nru rsyslog-7.6.0/plugins/impstats/Makefile.in rsyslog-5.10.1/plugins/impstats/Makefile.in --- rsyslog-7.6.0/plugins/impstats/Makefile.in 2014-02-12 12:06:32.000000000 +0000 +++ rsyslog-5.10.1/plugins/impstats/Makefile.in 2012-10-17 14:42:39.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) impstats_la_DEPENDENCIES = am_impstats_la_OBJECTS = impstats_la-impstats.lo impstats_la_OBJECTS = $(am_impstats_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent impstats_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(impstats_la_SOURCES) DIST_SOURCES = $(impstats_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -impstats.la: $(impstats_la_OBJECTS) $(impstats_la_DEPENDENCIES) $(EXTRA_impstats_la_DEPENDENCIES) +impstats.la: $(impstats_la_OBJECTS) $(impstats_la_DEPENDENCIES) $(AM_V_CCLD)$(impstats_la_LINK) -rpath $(pkglibdir) $(impstats_la_OBJECTS) $(impstats_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< impstats_la-impstats.lo: impstats.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(impstats_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT impstats_la-impstats.lo -MD -MP -MF $(DEPDIR)/impstats_la-impstats.Tpo -c -o impstats_la-impstats.lo `test -f 'impstats.c' || echo '$(srcdir)/'`impstats.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/impstats_la-impstats.Tpo $(DEPDIR)/impstats_la-impstats.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='impstats.c' object='impstats_la-impstats.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='impstats.c' object='impstats_la-impstats.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(impstats_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o impstats_la-impstats.lo `test -f 'impstats.c' || echo '$(srcdir)/'`impstats.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(impstats_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o impstats_la-impstats.lo `test -f 'impstats.c' || echo '$(srcdir)/'`impstats.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imptcp/imptcp.c rsyslog-5.10.1/plugins/imptcp/imptcp.c --- rsyslog-7.6.0/plugins/imptcp/imptcp.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/imptcp/imptcp.c 2012-10-17 14:41:20.000000000 +0000 @@ -10,7 +10,7 @@ * * File begun on 2010-08-10 by RGerhards * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -50,8 +50,6 @@ #include #include #include -#include -#include #if HAVE_FCNTL_H #include #endif @@ -69,7 +67,6 @@ #include "ruleset.h" #include "msg.h" #include "statsobj.h" -#include "ratelimit.h" #include "net.h" /* for permittedPeers, may be removed when this is removed */ /* the define is from tcpsrv.h, we need to find a new (but easier!!!) abstraction layer some time ... */ @@ -78,7 +75,6 @@ MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imptcp") /* static data */ DEF_IMOD_STATIC_DATA @@ -90,15 +86,6 @@ DEFobjCurrIf(ruleset) DEFobjCurrIf(statsobj) -/* forward references */ -static void * wrkr(void *myself); - -#define DFLT_wrkrMax 2 - -#define COMPRESS_NEVER 0 -#define COMPRESS_SINGLE_MSG 1 /* old, single-message compression */ -/* all other settings are for stream-compression */ -#define COMPRESS_STREAM_ALWAYS 2 /* config settings */ typedef struct configSettings_s { @@ -111,78 +98,10 @@ int iAddtlFrameDelim; /* addtl frame delimiter, e.g. for netscreen, default none */ uchar *pszInputName; /* value for inputname property, NULL is OK and handled by core engine */ uchar *lstnIP; /* which IP we should listen on? */ - uchar *pszBindRuleset; - int wrkrMax; /* max number of workers (actually "helper workers") */ + ruleset_t *pRuleset; /* ruleset to bind listener to (use system default if unspecified) */ } configSettings_t; -static configSettings_t cs; - -struct instanceConf_s { - int bKeepAlive; /* support keep-alive packets */ - int iKeepAliveIntvl; - int iKeepAliveProbes; - int iKeepAliveTime; - int bEmitMsgOnClose; - int bSuppOctetFram; /* support octet-counted framing? */ - int iAddtlFrameDelim; - uint8_t compressionMode; - uchar *pszBindPort; /* port to bind to */ - uchar *pszBindAddr; /* IP to bind socket to */ - uchar *pszBindRuleset; /* name of ruleset to bind to */ - uchar *pszInputName; /* value for inputname property, NULL is OK and handled by core engine */ - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - uchar *dfltTZ; - int ratelimitInterval; - int ratelimitBurst; - struct instanceConf_s *next; -}; - - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - instanceConf_t *root, *tail; - int wrkrMax; - sbool configSetViaV2Method; -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "threads", eCmdHdlrPositiveInt, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* input instance parameters */ -static struct cnfparamdescr inppdescr[] = { - { "port", eCmdHdlrString, CNFPARAM_REQUIRED }, /* legacy: InputTCPServerRun */ - { "address", eCmdHdlrString, 0 }, - { "name", eCmdHdlrString, 0 }, - { "ruleset", eCmdHdlrString, 0 }, - { "defaulttz", eCmdHdlrString, 0 }, - { "supportoctetcountedframing", eCmdHdlrBinary, 0 }, - { "notifyonconnectionclose", eCmdHdlrBinary, 0 }, - { "compression.mode", eCmdHdlrGetWord, 0 }, - { "keepalive", eCmdHdlrBinary, 0 }, - { "keepalive.probes", eCmdHdlrInt, 0 }, - { "keepalive.time", eCmdHdlrInt, 0 }, - { "keepalive.interval", eCmdHdlrInt, 0 }, - { "addtlframedelimiter", eCmdHdlrInt, 0 }, - { "ratelimit.interval", eCmdHdlrInt, 0 }, - { "ratelimit.burst", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; - -#include "im-helper.h" /* must be included AFTER the type definitions! */ -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ +static configSettings_t cs; /* data elements describing our running config */ typedef struct ptcpsrv_s ptcpsrv_t; @@ -202,31 +121,25 @@ int iKeepAliveIntvl; int iKeepAliveProbes; int iKeepAliveTime; - uint8_t compressionMode; uchar *pszInputName; - uchar *dfltTZ; prop_t *pInputName; /* InputName in (fast to process) property format */ ruleset_t *pRuleset; ptcplstn_t *pLstn; /* root of our listeners */ ptcpsess_t *pSess; /* root of our sessions */ - pthread_mutex_t mutSessLst; sbool bKeepAlive; /* support keep-alive packets */ sbool bEmitMsgOnClose; sbool bSuppOctetFram; - ratelimit_t *ratelimiter; }; /* the ptcp session object. Describes a single active session. * includes support for doubly-linked list. */ struct ptcpsess_s { +// ptcpsrv_t *pSrv; /* our server TODO: check remove! */ ptcplstn_t *pLstn; /* our listener */ ptcpsess_t *prev, *next; int sock; epolld_t *epd; - sbool bzInitDone; /* did we do an init of zstrm already? */ - z_stream zstrm; /* zip stream to use for tcp compression */ - uint8_t compressionMode; //--- from tcps_sess.h int iMsg; /* index of next char to store in msg */ int bAtStrtOfFram; /* are we at the very beginning of a new frame? */ @@ -254,26 +167,10 @@ sbool bSuppOctetFram; epolld_t *epd; statsobj_t *stats; /* listener stats */ - intctr_t rcvdBytes; - intctr_t rcvdDecompressed; STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit) }; -/* The following structure controls the worker threads. Global data is - * needed for their access. - */ -static struct wrkrInfo_s { - pthread_t tid; /* the worker's thread ID */ - pthread_cond_t run; - struct epoll_event *event; /* event == NULL -> idle */ - long long unsigned numCalled; /* how often was this called */ -} wrkrInfo[16]; -static pthread_mutex_t wrkrMut; -static pthread_cond_t wrkrIdle; -static int wrkrRunning; - - /* type of object stored in epoll descriptor */ typedef enum { epolld_lstn, @@ -291,10 +188,20 @@ /* global data */ -pthread_attr_t wrkrThrdAttr; /* Attribute for session threads; read only after startup */ +//static permittedPeers_t *pPermPeersRoot = NULL; static ptcpsrv_t *pSrvRoot = NULL; static int epollfd = -1; /* (sole) descriptor for epoll */ static int iMaxLine; /* maximum size of a single message */ +/* we use a single static receive buffer, as this module is not multi-threaded. Keeping + * the buffer in the data segment is probably a little bit more efficient than on the stack + * (but at least I can't believe it will ever be less efficient ;) -- rgerhards, 2010-08-10 + * Note that we do NOT (yet?) provide a config setting to set the buffer size. For usual + * syslog traffic, it should be large enough. Also keep in mind that we run under a virtual + * memory system, so if we do not use large parts of the buffer, that's no issue at + * all -- it'll just use up address space. On the other hand, it would be silly to page in + * or page out some data just to get space for the IO buffer. + */ +static char rcvBuf[128*1024]; /* forward definitions */ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); @@ -318,10 +225,7 @@ static void destructSrv(ptcpsrv_t *pSrv) { - ratelimitDestruct(pSrv->ratelimiter); prop.Destruct(&pSrv->pInputName); - pthread_mutex_destroy(&pSrv->mutSessLst); - free(pSrv->pszInputName); free(pSrv->port); free(pSrv); } @@ -350,7 +254,7 @@ lstnIP = pSrv->lstnIP == NULL ? UCHAR_CONSTANT("") : pSrv->lstnIP; - DBGPRINTF("imptcp: creating listen socket on server '%s', port %s\n", lstnIP, pSrv->port); + DBGPRINTF("imptcp creating listen socket on server '%s', port %s\n", lstnIP, pSrv->port); memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_PASSIVE; @@ -438,9 +342,7 @@ #endif ) { /* TODO: check if *we* bound the socket - else we *have* an error! */ - char errStr[1024]; - rs_strerror_r(errno, errStr, sizeof(errStr)); - dbgprintf("error %d while binding tcp socket: %s\n", errno, errStr); + DBGPRINTF("error %d while binding tcp socket", errno); close(sock); sock = -1; continue; @@ -697,15 +599,20 @@ MsgSetRawMsg(pMsg, (char*)pThis->pMsg, pThis->iMsg); MsgSetInputName(pMsg, pSrv->pInputName); MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); - if(pSrv->dfltTZ != NULL) - MsgSetDfltTZ(pMsg, (char*) pSrv->dfltTZ); pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME; MsgSetRcvFrom(pMsg, pThis->peerName); CHKiRet(MsgSetRcvFromIP(pMsg, pThis->peerIP)); MsgSetRuleset(pMsg, pSrv->pRuleset); STATSCOUNTER_INC(pThis->pLstn->ctrSubmit, pThis->pLstn->mutCtrSubmit); - ratelimitAddMsg(pSrv->ratelimiter, pMultiSub, pMsg); + if(pMultiSub == NULL) { + CHKiRet(submitMsg(pMsg)); + } else { + pMultiSub->ppMsgs[pMultiSub->nElem++] = pMsg; + if(pMultiSub->nElem == pMultiSub->maxElem) + CHKiRet(multiSubmitMsg(pMultiSub)); + } + finalize_it: /* reset status variables */ @@ -746,13 +653,13 @@ DBGPRINTF("TCP Message with octet-counter, size %d.\n", pThis->iOctetsRemain); if(c != ' ') { errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: " - "delimiter is not SP but has ASCII value %d.", c); + "delimiter is not SP but has ASCII value %d.\n", c); } if(pThis->iOctetsRemain < 1) { /* TODO: handle the case where the octet count is 0! */ DBGPRINTF("Framing Error: invalid octet count\n"); errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: " - "invalid octet count %d.", pThis->iOctetsRemain); + "invalid octet count %d.\n", pThis->iOctetsRemain); } else if(pThis->iOctetsRemain > iMaxLine) { /* while we can not do anything against it, we can at least log an indication * that something went wrong) -- rgerhards, 2008-03-14 @@ -760,7 +667,7 @@ DBGPRINTF("truncating message with %d octets - max msg size is %d\n", pThis->iOctetsRemain, iMaxLine); errmsg.LogError(0, NO_ERRCODE, "received oversize message: size is %d bytes, " - "max msg size is %d, truncating...", pThis->iOctetsRemain, iMaxLine); + "max msg size is %d, truncating...\n", pThis->iOctetsRemain, iMaxLine); } pThis->inputState = eInMsg; } @@ -824,100 +731,41 @@ * we have just received a bunch of data! -- rgerhards, 2009-06-16 * EXTRACT from tcps_sess.c */ +#define NUM_MULTISUB 1024 static rsRetVal -DataRcvdUncompressed(ptcpsess_t *pThis, char *pData, size_t iLen, struct syslogTime *stTime, time_t ttGenTime) +DataRcvd(ptcpsess_t *pThis, char *pData, size_t iLen) { multi_submit_t multiSub; - msg_t *pMsgs[CONF_NUM_MULTISUB]; + msg_t *pMsgs[NUM_MULTISUB]; + struct syslogTime stTime; + time_t ttGenTime; char *pEnd; DEFiRet; assert(pData != NULL); assert(iLen > 0); - if(ttGenTime == 0) - datetime.getCurrTime(stTime, &ttGenTime); + datetime.getCurrTime(&stTime, &ttGenTime); multiSub.ppMsgs = pMsgs; - multiSub.maxElem = CONF_NUM_MULTISUB; + multiSub.maxElem = NUM_MULTISUB; multiSub.nElem = 0; /* We now copy the message to the session buffer. */ pEnd = pData + iLen; /* this is one off, which is intensional */ while(pData < pEnd) { - CHKiRet(processDataRcvd(pThis, *pData++, stTime, ttGenTime, &multiSub)); + CHKiRet(processDataRcvd(pThis, *pData++, &stTime, ttGenTime, &multiSub)); } - iRet = multiSubmitFlush(&multiSub); - -finalize_it: - RETiRet; -} - -static rsRetVal -DataRcvdCompressed(ptcpsess_t *pThis, char *buf, size_t len) -{ - struct syslogTime stTime; - time_t ttGenTime; - int zRet; /* zlib return state */ - unsigned outavail; - uchar zipBuf[64*1024]; // TODO: alloc on heap, and much larger (512KiB? batch size!) - DEFiRet; - // TODO: can we do stats counters? Even if they are not 100% correct under all cases, - // by simply updating the input and output sizes? - uint64_t outtotal; - - datetime.getCurrTime(&stTime, &ttGenTime); - outtotal = 0; - - if(!pThis->bzInitDone) { - /* allocate deflate state */ - pThis->zstrm.zalloc = Z_NULL; - pThis->zstrm.zfree = Z_NULL; - pThis->zstrm.opaque = Z_NULL; - zRet = inflateInit(&pThis->zstrm); - if(zRet != Z_OK) { - DBGPRINTF("imptcp: error %d returned from zlib/inflateInit()\n", zRet); - ABORT_FINALIZE(RS_RET_ZLIB_ERR); - } - pThis->bzInitDone = RSTRUE; + if(multiSub.nElem > 0) { + /* submit anything that was not yet submitted */ + CHKiRet(multiSubmitMsg(&multiSub)); } - pThis->zstrm.next_in = (Bytef*) buf; - pThis->zstrm.avail_in = len; - /* run inflate() on buffer until everything has been uncompressed */ - do { - DBGPRINTF("imptcp: in inflate() loop, avail_in %d, total_in %ld\n", pThis->zstrm.avail_in, pThis->zstrm.total_in); - pThis->zstrm.avail_out = sizeof(zipBuf); - pThis->zstrm.next_out = zipBuf; - zRet = inflate(&pThis->zstrm, Z_SYNC_FLUSH); /* no bad return value */ - //zRet = inflate(&pThis->zstrm, Z_NO_FLUSH); /* no bad return value */ - DBGPRINTF("after inflate, ret %d, avail_out %d\n", zRet, pThis->zstrm.avail_out); - outavail = sizeof(zipBuf) - pThis->zstrm.avail_out; - if(outavail != 0) { - outtotal += outavail; - pThis->pLstn->rcvdDecompressed += outavail; - CHKiRet(DataRcvdUncompressed(pThis, (char*)zipBuf, outavail, &stTime, ttGenTime)); - } - } while (pThis->zstrm.avail_out == 0); - - dbgprintf("end of DataRcvCompress, sizes: in %lld, out %llu\n", (long long) len, outtotal); finalize_it: RETiRet; } - -static rsRetVal -DataRcvd(ptcpsess_t *pThis, char *pData, size_t iLen) -{ - struct syslogTime stTime; - DEFiRet; - pThis->pLstn->rcvdBytes += iLen; - if(pThis->compressionMode >= COMPRESS_STREAM_ALWAYS) - iRet = DataRcvdCompressed(pThis, pData, iLen); - else - iRet = DataRcvdUncompressed(pThis, pData, iLen, &stTime, 0); - RETiRet; -} +#undef NUM_MULTISUB /****************************************** --END-- TCP SUPPORT FUNCTIONS ***********************************/ @@ -927,12 +775,10 @@ initConfigSettings(void) { cs.bEmitMsgOnClose = 0; - cs.wrkrMax = DFLT_wrkrMax; cs.bSuppOctetFram = 1; cs.iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; cs.pszInputName = NULL; - cs.pszBindRuleset = NULL; - cs.pszInputName = NULL; + cs.pRuleset = NULL; cs.lstnIP = NULL; } @@ -1018,15 +864,7 @@ CHKiRet(statsobj.SetName(pLstn->stats, statname)); STATSCOUNTER_INIT(pLstn->ctrSubmit, pLstn->mutCtrSubmit); CHKiRet(statsobj.AddCounter(pLstn->stats, UCHAR_CONSTANT("submitted"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pLstn->ctrSubmit))); - /* the following counters are not protected by mutexes; we accept - * that they may not be 100% correct */ - pLstn->rcvdBytes = 0, - pLstn->rcvdDecompressed = 0; - CHKiRet(statsobj.AddCounter(pLstn->stats, UCHAR_CONSTANT("bytes.received"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pLstn->rcvdBytes))); - CHKiRet(statsobj.AddCounter(pLstn->stats, UCHAR_CONSTANT("bytes.decompressed"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pLstn->rcvdDecompressed))); + ctrType_IntCtr, &(pLstn->ctrSubmit))); CHKiRet(statsobj.ConstructFinalize(pLstn->stats)); /* add to start of server's listener list */ @@ -1059,20 +897,16 @@ pSess->bSuppOctetFram = pLstn->bSuppOctetFram; pSess->inputState = eAtStrtFram; pSess->iMsg = 0; - pSess->bzInitDone = 0; pSess->bAtStrtOfFram = 1; pSess->peerName = peerName; pSess->peerIP = peerIP; - pSess->compressionMode = pLstn->pSrv->compressionMode; /* add to start of server's listener list */ pSess->prev = NULL; - pthread_mutex_lock(&pSrv->mutSessLst); pSess->next = pSrv->pSess; if(pSrv->pSess != NULL) pSrv->pSess->prev = pSess; pSrv->pSess = pSess; - pthread_mutex_unlock(&pSrv->mutSessLst); iRet = addEPollSock(epolld_sess, pSess, sock, &pSess->epd); @@ -1081,45 +915,6 @@ } -/* finish zlib buffer, to be called before closing the session. - */ -static rsRetVal -doZipFinish(ptcpsess_t *pSess) -{ - int zRet; /* zlib return state */ - DEFiRet; - unsigned outavail; - struct syslogTime stTime; - uchar zipBuf[32*1024]; // TODO: use "global" one from pSess - - if(!pSess->bzInitDone) - goto done; - - pSess->zstrm.avail_in = 0; - /* run inflate() on buffer until everything has been compressed */ - do { - DBGPRINTF("doZipFinish: in inflate() loop, avail_in %d, total_in %ld\n", pSess->zstrm.avail_in, pSess->zstrm.total_in); - pSess->zstrm.avail_out = sizeof(zipBuf); - pSess->zstrm.next_out = zipBuf; - zRet = inflate(&pSess->zstrm, Z_FINISH); /* no bad return value */ - DBGPRINTF("after inflate, ret %d, avail_out %d\n", zRet, pSess->zstrm.avail_out); - outavail = sizeof(zipBuf) - pSess->zstrm.avail_out; - if(outavail != 0) { - pSess->pLstn->rcvdDecompressed += outavail; - CHKiRet(DataRcvdUncompressed(pSess, (char*)zipBuf, outavail, &stTime, 0)); // TODO: query time! - } - } while (pSess->zstrm.avail_out == 0); - -finalize_it: - zRet = inflateEnd(&pSess->zstrm); - if(zRet != Z_OK) { - DBGPRINTF("imptcp: error %d returned from zlib/inflateEnd()\n", zRet); - } - - pSess->bzInitDone = 0; -done: RETiRet; -} - /* close/remove a session * NOTE: we must first remove the fd from the epoll set and then close it -- else we * get an error "bad file descriptor" from epoll. @@ -1130,15 +925,14 @@ int sock; DEFiRet; - if(pSess->compressionMode >= COMPRESS_STREAM_ALWAYS) - doZipFinish(pSess); - sock = pSess->sock; CHKiRet(removeEPollSock(sock, pSess->epd)); close(sock); - pthread_mutex_lock(&pSess->pLstn->pSrv->mutSessLst); /* finally unlink session from structures */ +//fprintf(stderr, "closing session %d next %p, prev %p\n", pSess->sock, pSess->next, pSess->prev); +//DBGPRINTF("imptcp: pSess->next %p\n", pSess->next); +//DBGPRINTF("imptcp: pSess->prev %p\n", pSess->prev); if(pSess->next != NULL) pSess->next->prev = pSess->prev; if(pSess->prev == NULL) { @@ -1147,140 +941,76 @@ } else { pSess->prev->next = pSess->next; } - pthread_mutex_unlock(&pSess->pLstn->pSrv->mutSessLst); /* unlinked, now remove structure */ destructSess(pSess); finalize_it: - DBGPRINTF("imptcp: session on socket %d closed with iRet %d.\n", sock, iRet); + DBGPRINTF("imtcp: session on socket %d closed with iRet %d.\n", sock, iRet); RETiRet; } -/* create input instance, set default paramters, and - * add it to the list of instances. +#if 0 +/* set permitted peer -- rgerhards, 2008-05-19 */ static rsRetVal -createInstance(instanceConf_t **pinst) +setPermittedPeer(void __attribute__((unused)) *pVal, uchar *pszID) { - instanceConf_t *inst; DEFiRet; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - inst->next = NULL; - - inst->pszBindPort = NULL; - inst->pszBindAddr = NULL; - inst->pszBindRuleset = NULL; - inst->pszInputName = NULL; - inst->bSuppOctetFram = 1; - inst->bKeepAlive = 0; - inst->iKeepAliveIntvl = 0; - inst->iKeepAliveProbes = 0; - inst->iKeepAliveTime = 0; - inst->bEmitMsgOnClose = 0; - inst->dfltTZ = NULL; - inst->iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; - inst->pBindRuleset = NULL; - inst->ratelimitBurst = 10000; /* arbitrary high limit */ - inst->ratelimitInterval = 0; /* off */ - inst->compressionMode = COMPRESS_SINGLE_MSG; - - /* node created, let's add to config */ - if(loadModConf->tail == NULL) { - loadModConf->tail = loadModConf->root = inst; - } else { - loadModConf->tail->next = inst; - loadModConf->tail = inst; - } - - *pinst = inst; + CHKiRet(net.AddPermittedPeer(&pPermPeersRoot, pszID)); + free(pszID); /* no longer needed, but we need to free as of interface def */ finalize_it: RETiRet; } +#endif -/* This function is called when a new listener instace shall be added to - * the current config object via the legacy config system. It just shuffles - * all parameters to the listener in-memory instance. - */ -static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal) +/* accept a new ruleset to bind. Checks if it exists and complains, if not */ +static rsRetVal setRuleset(void __attribute__((unused)) *pVal, uchar *pszName) { - instanceConf_t *inst; + ruleset_t *pRuleset; + rsRetVal localRet; DEFiRet; - CHKiRet(createInstance(&inst)); - if(pNewVal == NULL || *pNewVal == '\0') { - errmsg.LogError(0, NO_ERRCODE, "imptcp: port number must be specified, listener ignored"); - } - if((pNewVal == NULL) || (pNewVal == '\0')) { - inst->pszBindPort = NULL; - } else { - CHKmalloc(inst->pszBindPort = ustrdup(pNewVal)); - } - if((cs.lstnIP == NULL) || (cs.lstnIP[0] == '\0')) { - inst->pszBindAddr = NULL; - } else { - CHKmalloc(inst->pszBindAddr = ustrdup(cs.lstnIP)); - } - if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) { - inst->pszBindRuleset = NULL; - } else { - CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset)); + localRet = ruleset.GetRuleset(&pRuleset, pszName); + if(localRet == RS_RET_NOT_FOUND) { + errmsg.LogError(0, NO_ERRCODE, "error: ruleset '%s' not found - ignored", pszName); } - if((cs.pszInputName == NULL) || (cs.pszInputName[0] == '\0')) { - inst->pszInputName = NULL; - } else { - CHKmalloc(inst->pszInputName = ustrdup(cs.pszInputName)); - } - inst->pBindRuleset = NULL; - inst->bSuppOctetFram = cs.bSuppOctetFram; - inst->bKeepAlive = cs.bKeepAlive; - inst->iKeepAliveIntvl = cs.iKeepAliveTime; - inst->iKeepAliveProbes = cs.iKeepAliveProbes; - inst->iKeepAliveTime = cs.iKeepAliveTime; - inst->bEmitMsgOnClose = cs.bEmitMsgOnClose; - inst->iAddtlFrameDelim = cs.iAddtlFrameDelim; + CHKiRet(localRet); + cs.pRuleset = pRuleset; + DBGPRINTF("imptcp current bind ruleset %p: '%s'\n", pRuleset, pszName); finalize_it: - free(pNewVal); + free(pszName); /* no longer needed */ RETiRet; } -static inline rsRetVal -addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) +static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVal) { DEFiRet; ptcpsrv_t *pSrv; - CHKmalloc(pSrv = MALLOC(sizeof(ptcpsrv_t))); - pthread_mutex_init(&pSrv->mutSessLst, NULL); + CHKmalloc(pSrv = malloc(sizeof(ptcpsrv_t))); pSrv->pSess = NULL; pSrv->pLstn = NULL; - pSrv->bSuppOctetFram = inst->bSuppOctetFram; - pSrv->bKeepAlive = inst->bKeepAlive; - pSrv->iKeepAliveIntvl = inst->iKeepAliveTime; - pSrv->iKeepAliveProbes = inst->iKeepAliveProbes; - pSrv->iKeepAliveTime = inst->iKeepAliveTime; - pSrv->bEmitMsgOnClose = inst->bEmitMsgOnClose; - pSrv->compressionMode = inst->compressionMode; - pSrv->dfltTZ = inst->dfltTZ; - CHKiRet(ratelimitNew(&pSrv->ratelimiter, "imtcp", (char*)inst->pszBindPort)); - ratelimitSetLinuxLike(pSrv->ratelimiter, inst->ratelimitInterval, inst->ratelimitBurst); - ratelimitSetThreadSafe(pSrv->ratelimiter); - CHKmalloc(pSrv->port = ustrdup(inst->pszBindPort)); - pSrv->iAddtlFrameDelim = inst->iAddtlFrameDelim; - if(inst->pszBindAddr == NULL) - pSrv->lstnIP = NULL; - else { - CHKmalloc(pSrv->lstnIP = ustrdup(inst->pszBindAddr)); - } - pSrv->pRuleset = inst->pBindRuleset; - pSrv->pszInputName = ustrdup((inst->pszInputName == NULL) ? UCHAR_CONSTANT("imptcp") : inst->pszInputName); + pSrv->bKeepAlive = cs.bKeepAlive; + pSrv->iKeepAliveIntvl = cs.iKeepAliveTime; + pSrv->iKeepAliveProbes = cs.iKeepAliveProbes; + pSrv->iKeepAliveTime = cs.iKeepAliveTime; + pSrv->bSuppOctetFram = cs.bSuppOctetFram; + pSrv->bEmitMsgOnClose = cs.bEmitMsgOnClose; + pSrv->port = pNewVal; + pSrv->iAddtlFrameDelim = cs.iAddtlFrameDelim; + pSrv->lstnIP = cs.lstnIP; + pSrv->pRuleset = cs.pRuleset; + pSrv->pszInputName = (cs.pszInputName == NULL) ? UCHAR_CONSTANT("imptcp") : cs.pszInputName; CHKiRet(prop.Construct(&pSrv->pInputName)); CHKiRet(prop.SetString(pSrv->pInputName, pSrv->pszInputName, ustrlen(pSrv->pszInputName))); CHKiRet(prop.ConstructFinalize(pSrv->pInputName)); + cs.pszInputName = NULL; /* moved over to pSrv, we do not own */ + cs.lstnIP = NULL; /* moved over to pSrv, we do not own */ /* add to linked list */ pSrv->pNext = pSrvRoot; @@ -1299,47 +1029,6 @@ } -/* destroy worker pool structures and wait for workers to terminate - */ -static inline void -startWorkerPool(void) -{ - int i; - wrkrRunning = 0; - if(runModConf->wrkrMax > 16) - runModConf->wrkrMax = 16; /* TODO: make dynamic? */ - DBGPRINTF("imptcp: starting worker pool, %d workers\n", runModConf->wrkrMax); - pthread_mutex_init(&wrkrMut, NULL); - pthread_cond_init(&wrkrIdle, NULL); - for(i = 0 ; i < runModConf->wrkrMax ; ++i) { - /* init worker info structure! */ - pthread_cond_init(&wrkrInfo[i].run, NULL); - wrkrInfo[i].event = NULL; - wrkrInfo[i].numCalled = 0; - pthread_create(&wrkrInfo[i].tid, &wrkrThrdAttr, wrkr, &(wrkrInfo[i])); - } - -} - -/* destroy worker pool structures and wait for workers to terminate - */ -static inline void -stopWorkerPool(void) -{ - int i; - DBGPRINTF("imptcp: stoping worker pool\n"); - for(i = 0 ; i < runModConf->wrkrMax ; ++i) { - pthread_cond_signal(&wrkrInfo[i].run); /* awake wrkr if not running */ - pthread_join(wrkrInfo[i].tid, NULL); - DBGPRINTF("imptcp: info: worker %d was called %llu times\n", i, wrkrInfo[i].numCalled); - pthread_cond_destroy(&wrkrInfo[i].run); - } - pthread_cond_destroy(&wrkrIdle); - pthread_mutex_destroy(&wrkrMut); -} - - - /* start up all listeners * This is a one-time stop once the module is set to start. */ @@ -1347,29 +1036,15 @@ startupServers() { DEFiRet; - rsRetVal localRet, lastErr; - int iOK; - int iAll; ptcpsrv_t *pSrv; - iAll = iOK = 0; - lastErr = RS_RET_ERR; pSrv = pSrvRoot; while(pSrv != NULL) { - DBGPRINTF("imptcp: starting up server for port %s, name '%s'\n", pSrv->port, pSrv->pszInputName); - localRet = startupSrv(pSrv); - if(localRet == RS_RET_OK) - iOK++; - else - lastErr = localRet; - ++iAll; + DBGPRINTF("Starting up ptcp server for port %s, name '%s'\n", pSrv->port, pSrv->pszInputName); + startupSrv(pSrv); pSrv = pSrv->pNext; } - DBGPRINTF("imptcp: %d out of %d servers started successfully\n", iOK, iAll); - if(iOK == 0) /* iff all fails, we report an error */ - iRet = lastErr; - RETiRet; } @@ -1387,9 +1062,9 @@ DEFiRet; DBGPRINTF("imptcp: new connection on listen socket %d\n", pLstn->sock); - while(glbl.GetGlobalInputTermState() == 0) { + while(1) { localRet = AcceptConnReq(pLstn, &newSock, &peerName, &peerIP); - if(localRet == RS_RET_NO_MORE_DATA || glbl.GetGlobalInputTermState() == 1) + if(localRet == RS_RET_NO_MORE_DATA) break; CHKiRet(localRet); CHKiRet(addSess(pLstn, newSock, peerName, peerIP)); @@ -1408,11 +1083,6 @@ { int lenRcv; int lenBuf; - uchar *peerName; - int lenPeer; - int remsock = 0; /* init just to keep compiler happy... :-( */ - sbool bEmitOnClose = 0; - char rcvBuf[128*1024]; DEFiRet; DBGPRINTF("imptcp: new activity on session socket %d\n", pSess->sock); @@ -1423,25 +1093,23 @@ if(lenRcv > 0) { /* have data, process it */ - DBGPRINTF("imptcp: data(%d) on socket %d: %s\n", lenBuf, pSess->sock, rcvBuf); + DBGPRINTF("imtcp: data(%d) on socket %d: %s\n", lenBuf, pSess->sock, rcvBuf); CHKiRet(DataRcvd(pSess, rcvBuf, lenRcv)); } else if (lenRcv == 0) { /* session was closed, do clean-up */ if(pSess->pLstn->pSrv->bEmitMsgOnClose) { - prop.GetString(pSess->peerName, &peerName, &lenPeer), - remsock = pSess->sock; - bEmitOnClose = 1; - } - CHKiRet(closeSess(pSess)); /* close may emit more messages in strmzip mode! */ - if(bEmitOnClose) { - errmsg.LogError(0, RS_RET_PEER_CLOSED_CONN, "imptcp session %d closed by " - "remote peer %s.", remsock, peerName); + uchar *peerName; + int lenPeer; + prop.GetString(pSess->peerName, &peerName, &lenPeer); + errmsg.LogError(0, RS_RET_PEER_CLOSED_CONN, "imptcp session %d closed by remote peer %s.\n", + pSess->sock, peerName); } + CHKiRet(closeSess(pSess)); break; } else { if(errno == EAGAIN || errno == EWOULDBLOCK) break; - DBGPRINTF("imptcp: error on session socket %d - closed.\n", pSess->sock); + DBGPRINTF("imtcp: error on session socket %d - closed.\n", pSess->sock); closeSess(pSess); /* try clean-up by dropping session */ break; } @@ -1452,281 +1120,47 @@ } -/* This function is called to process a single request. This may - * be carried out by the main worker or a helper. It can be run - * concurrently. - */ -static inline void -processWorkItem(struct epoll_event *event) -{ - epolld_t *epd; - - epd = (epolld_t*) event->data.ptr; - switch(epd->typ) { - case epolld_lstn: - lstnActivity((ptcplstn_t *) epd->ptr); - break; - case epolld_sess: - sessActivity((ptcpsess_t *) epd->ptr); - break; - default: - errmsg.LogError(0, RS_RET_INTERNAL_ERROR, - "error: invalid epolld_type_t %d after epoll", epd->typ); - break; - } -} - - -/* This function is called to process a complete workset, that - * is a set of events returned from epoll. +/* This function is called to gather input. */ -static inline void -processWorkSet(int nEvents, struct epoll_event events[]) -{ - int iEvt; +BEGINrunInput int i; - int remainEvents; - - remainEvents = nEvents; - for(iEvt = 0 ; (iEvt < nEvents) && (glbl.GetGlobalInputTermState() == 0) ; ++iEvt) { - if(remainEvents == 1) { - /* process self, save context switch */ - processWorkItem(events+iEvt); - } else { - pthread_mutex_lock(&wrkrMut); - /* check if there is a free worker */ - for(i = 0 ; (i < runModConf->wrkrMax) && (wrkrInfo[i].event != NULL) ; ++i) - /*do search*/; - if(i < runModConf->wrkrMax) { - /* worker free -> use it! */ - wrkrInfo[i].event = events+iEvt; - ++wrkrRunning; - pthread_cond_signal(&wrkrInfo[i].run); - pthread_mutex_unlock(&wrkrMut); - } else { - pthread_mutex_unlock(&wrkrMut); - /* no free worker, so we process this one ourselfs */ - processWorkItem(events+iEvt); - } - } - --remainEvents; - } - - if(nEvents > 1) { - /* we now need to wait until all workers finish. This is because the - * rest of this module can not handle the concurrency introduced - * by workers running during the epoll call. - */ - pthread_mutex_lock(&wrkrMut); - while(wrkrRunning > 0) { - pthread_cond_wait(&wrkrIdle, &wrkrMut); - } - pthread_mutex_unlock(&wrkrMut); - } - -} - - -/* worker to process incoming requests - */ -static void * -wrkr(void *myself) -{ - struct wrkrInfo_s *me = (struct wrkrInfo_s*) myself; - - pthread_mutex_lock(&wrkrMut); + int nfds; + struct epoll_event events[1]; + epolld_t *epd; +CODESTARTrunInput + DBGPRINTF("imptcp now beginning to process input data\n"); + /* v5 TODO: consentual termination mode */ while(1) { - while(me->event == NULL && glbl.GetGlobalInputTermState() == 0) { - pthread_cond_wait(&me->run, &wrkrMut); - } - if(glbl.GetGlobalInputTermState() == 1) - break; - pthread_mutex_unlock(&wrkrMut); - - ++me->numCalled; - processWorkItem(me->event); - - pthread_mutex_lock(&wrkrMut); - me->event = NULL; /* indicate we are free again */ - --wrkrRunning; - pthread_cond_signal(&wrkrIdle); - } - pthread_mutex_unlock(&wrkrMut); - - return NULL; -} - - -BEGINnewInpInst - struct cnfparamvals *pvals; - instanceConf_t *inst; - char *cstr; - int i; -CODESTARTnewInpInst - DBGPRINTF("newInpInst (imptcp)\n"); - - if((pvals = nvlstGetParams(lst, &inppblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("input param blk in imptcp:\n"); - cnfparamsPrint(&inppblk, pvals); - } - - CHKiRet(createInstance(&inst)); - - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "port")) { - inst->pszBindPort = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "address")) { - inst->pszBindAddr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "name")) { - inst->pszInputName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ruleset")) { - inst->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "supportoctetcountedframing")) { - inst->bSuppOctetFram = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "compression.mode")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - if(!strcasecmp(cstr, "stream:always")) { - inst->compressionMode = COMPRESS_STREAM_ALWAYS; - } else if(!strcasecmp(cstr, "none")) { - inst->compressionMode = COMPRESS_NEVER; - } else { - errmsg.LogError(0, RS_RET_PARAM_ERROR, "omfwd: invalid value for 'compression.mode' " - "parameter (given is '%s')", cstr); - free(cstr); - ABORT_FINALIZE(RS_RET_PARAM_ERROR); + DBGPRINTF("imptcp going on epoll_wait\n"); + nfds = epoll_wait(epollfd, events, sizeof(events)/sizeof(struct epoll_event), -1); + for(i = 0 ; i < nfds ; ++i) { /* support for larger batches (later, TODO) */ + epd = (epolld_t*) events[i].data.ptr; + switch(epd->typ) { + case epolld_lstn: + lstnActivity((ptcplstn_t *) epd->ptr); + break; + case epolld_sess: + sessActivity((ptcpsess_t *) epd->ptr); + break; + default: + errmsg.LogError(0, RS_RET_INTERNAL_ERROR, + "error: invalid epolld_type_t %d after epoll", epd->typ); + break; } - free(cstr); - } else if(!strcmp(inppblk.descr[i].name, "keepalive")) { - inst->bKeepAlive = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "keepalive.probes")) { - inst->iKeepAliveProbes = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "keepalive.time")) { - inst->iKeepAliveTime = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "keepalive.interval")) { - inst->iKeepAliveIntvl = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "addtlframedelimiter")) { - inst->iAddtlFrameDelim = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "notifyonconnectionclose")) { - inst->bEmitMsgOnClose = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "defaulttz")) { - inst->dfltTZ = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.burst")) { - inst->ratelimitBurst = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.interval")) { - inst->ratelimitInterval = (int) pvals[i].val.d.n; - } else { - dbgprintf("imptcp: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - } -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - loadModConf->wrkrMax = DFLT_wrkrMax; - loadModConf->configSetViaV2Method = 0; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config vars */ - initConfigSettings(); -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "imptcp: error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imptcp:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "threads")) { - loadModConf->wrkrMax = (int) pvals[i].val.d.n; - } else { - dbgprintf("imptcp: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); } } - - /* remove all of our legacy handlers, as they can not used in addition - * the the new-style config method. - */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - loadModConf->wrkrMax = cs.wrkrMax; - } - - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.pszInputName); - free(cs.lstnIP); - cs.pszInputName = NULL; - cs.lstnIP = NULL; -ENDendCnfLoad - - -/* function to generate error message if framework does not find requested ruleset */ -static inline void -std_checkRuleset_genErrMsg(__attribute__((unused)) modConfData_t *modConf, instanceConf_t *inst) -{ - errmsg.LogError(0, NO_ERRCODE, "imptcp: ruleset '%s' for port %s not found - " - "using default ruleset instead", inst->pszBindRuleset, - inst->pszBindPort); -} -BEGINcheckCnf - instanceConf_t *inst; -CODESTARTcheckCnf - for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { - std_checkRuleset(pModConf, inst); - } -ENDcheckCnf +ENDrunInput -BEGINactivateCnfPrePrivDrop - instanceConf_t *inst; -CODESTARTactivateCnfPrePrivDrop +/* initialize and return if will run or not */ +BEGINwillRun +CODESTARTwillRun + /* first apply some config settings */ + //net.PrintAllowedSenders(2); /* TCP */ iMaxLine = glbl.GetMaxLine(); /* get maximum size we currently support */ - runModConf = pModConf; - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - addListner(pModConf, inst); - } if(pSrvRoot == NULL) { - errmsg.LogError(0, RS_RET_NO_LSTN_DEFINED, "imptcp: no ptcp server defined, module can not run."); + errmsg.LogError(0, RS_RET_NO_LSTN_DEFINED, "error: no ptcp server defined, module can not run."); ABORT_FINALIZE(RS_RET_NO_RUN); } @@ -1753,53 +1187,6 @@ CHKiRet(startupServers()); DBGPRINTF("imptcp started up, but not yet receiving data\n"); finalize_it: -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf -CODESTARTactivateCnf - /* nothing to do, all done pre priv drop */ -ENDactivateCnf - - -BEGINfreeCnf - instanceConf_t *inst, *del; -CODESTARTfreeCnf - for(inst = pModConf->root ; inst != NULL ; ) { - free(inst->pszBindPort); - free(inst->pszBindAddr); - free(inst->pszBindRuleset); - free(inst->pszInputName); - free(inst->dfltTZ); - del = inst; - inst = inst->next; - free(del); - } -ENDfreeCnf - - -/* This function is called to gather input. - */ -BEGINrunInput - int nEvents; - struct epoll_event events[128]; -CODESTARTrunInput - startWorkerPool(); - DBGPRINTF("imptcp: now beginning to process input data\n"); - while(glbl.GetGlobalInputTermState() == 0) { - DBGPRINTF("imptcp going on epoll_wait\n"); - nEvents = epoll_wait(epollfd, events, sizeof(events)/sizeof(struct epoll_event), -1); - DBGPRINTF("imptcp: epoll returned %d events\n", nEvents); - processWorkSet(nEvents, events); - } - DBGPRINTF("imptcp: successfully terminated\n"); - /* we stop the worker pool in AfterRun, in case we get cancelled for some reason (old Interface) */ -ENDrunInput - - -/* initialize and return if will run or not */ -BEGINwillRun -CODESTARTwillRun ENDwillRun @@ -1820,9 +1207,7 @@ /* now unlink listner */ lstnDel = pLstn; pLstn = pLstn->next; - DBGPRINTF("imptcp shutdown listen socket %d (rcvd %lld bytes, " - "decompressed %lld)\n", lstnDel->sock, lstnDel->rcvdBytes, - lstnDel->rcvdDecompressed); + DBGPRINTF("imptcp shutdown listen socket %d\n", lstnDel->sock); free(lstnDel->epd); free(lstnDel); } @@ -1842,8 +1227,8 @@ BEGINafterRun ptcpsrv_t *pSrv, *srvDel; CODESTARTafterRun - stopWorkerPool(); - + /* do cleanup here */ + //net.clearAllowedSenders(UCHAR_CONSTANT("TCP")); /* we need to close everything that is still open */ pSrv = pSrvRoot; while(pSrv != NULL) { @@ -1859,7 +1244,12 @@ BEGINmodExit CODESTARTmodExit - pthread_attr_destroy(&wrkrThrdAttr); +#if 0 + if(pPermPeersRoot != NULL) { + net.DestructPermittedPeers(&pPermPeersRoot); + } +#endif + /* release objects we used */ objRelease(glbl, CORE_COMPONENT); objRelease(statsobj, CORE_COMPONENT); @@ -1875,7 +1265,6 @@ resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { cs.bEmitMsgOnClose = 0; - cs.wrkrMax = DFLT_wrkrMax; cs.bKeepAlive = 0; cs.iKeepAliveProbes = 0; cs.iKeepAliveTime = 0; @@ -1890,21 +1279,10 @@ } -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - if(eFeat == sFEATURENonCancelInputTermination) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES -CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt @@ -1912,6 +1290,7 @@ CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr + initConfigSettings(); /* request objects we use */ CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(statsobj, CORE_COMPONENT)); @@ -1921,16 +1300,9 @@ CHKiRet(objUse(datetime, CORE_COMPONENT)); CHKiRet(objUse(ruleset, CORE_COMPONENT)); - /* initialize "read-only" thread attributes */ - pthread_attr_init(&wrkrThrdAttr); - pthread_attr_setstacksize(&wrkrThrdAttr, 4096*1024); - - /* init legacy config settings */ - initConfigSettings(); - /* register config file handlers */ CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserverrun"), 0, eCmdHdlrGetWord, - addInstance, NULL, STD_LOADABLE_MODULE_ID)); + addTCPListener, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserverkeepalive"), 0, eCmdHdlrBinary, NULL, &cs.bKeepAlive, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserverkeepalive_probes"), 0, eCmdHdlrInt, @@ -1950,10 +1322,7 @@ CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserverlistenip"), 0, eCmdHdlrGetWord, NULL, &cs.lstnIP, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputptcpserverbindruleset"), 0, - eCmdHdlrGetWord, NULL, &cs.pszBindRuleset, STD_LOADABLE_MODULE_ID)); - /* module-global parameters */ - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputptcpserverhelperthreads"), 0, eCmdHdlrInt, - NULL, &cs.wrkrMax, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); + eCmdHdlrGetWord, setRuleset, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("resetconfigvariables"), 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/imptcp/Makefile.in rsyslog-5.10.1/plugins/imptcp/Makefile.in --- rsyslog-7.6.0/plugins/imptcp/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imptcp/Makefile.in 2012-10-17 14:42:39.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) imptcp_la_DEPENDENCIES = am_imptcp_la_OBJECTS = imptcp_la-imptcp.lo imptcp_la_OBJECTS = $(am_imptcp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imptcp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imptcp_la_SOURCES) DIST_SOURCES = $(imptcp_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imptcp.la: $(imptcp_la_OBJECTS) $(imptcp_la_DEPENDENCIES) $(EXTRA_imptcp_la_DEPENDENCIES) +imptcp.la: $(imptcp_la_OBJECTS) $(imptcp_la_DEPENDENCIES) $(AM_V_CCLD)$(imptcp_la_LINK) -rpath $(pkglibdir) $(imptcp_la_OBJECTS) $(imptcp_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imptcp_la-imptcp.lo: imptcp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imptcp_la-imptcp.lo -MD -MP -MF $(DEPDIR)/imptcp_la-imptcp.Tpo -c -o imptcp_la-imptcp.lo `test -f 'imptcp.c' || echo '$(srcdir)/'`imptcp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imptcp_la-imptcp.Tpo $(DEPDIR)/imptcp_la-imptcp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imptcp.c' object='imptcp_la-imptcp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imptcp.c' object='imptcp_la-imptcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imptcp_la-imptcp.lo `test -f 'imptcp.c' || echo '$(srcdir)/'`imptcp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imptcp_la-imptcp.lo `test -f 'imptcp.c' || echo '$(srcdir)/'`imptcp.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imrelp/imrelp.c rsyslog-5.10.1/plugins/imrelp/imrelp.c --- rsyslog-7.6.0/plugins/imrelp/imrelp.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/imrelp/imrelp.c 2012-10-17 14:41:20.000000000 +0000 @@ -4,7 +4,7 @@ * * File begun on 2008-03-13 by RGerhards * - * Copyright 2008-2013 Adiscon GmbH. + * Copyright 2008-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -22,6 +22,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #include "config.h" #include #include @@ -34,142 +35,44 @@ #include #include #include -#include #include #include "rsyslog.h" #include "dirty.h" -#include "errmsg.h" #include "cfsysline.h" #include "module-template.h" #include "net.h" #include "msg.h" #include "unicode-helper.h" #include "prop.h" -#include "ruleset.h" #include "glbl.h" -#include "statsobj.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imrelp") /* static data */ DEF_IMOD_STATIC_DATA DEFobjCurrIf(net) DEFobjCurrIf(prop) -DEFobjCurrIf(errmsg) -DEFobjCurrIf(ruleset) DEFobjCurrIf(glbl) -DEFobjCurrIf(statsobj) - -/* forward definitions */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - /* Module static data */ -/* config vars for legacy config system */ static relpEngine_t *pRelpEngine; /* our relp engine */ static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ -static struct configSettings_s { - uchar *pszBindRuleset; /* name of Ruleset to bind to */ -} cs; - -struct instanceConf_s { - uchar *pszBindPort; /* port to bind to */ - sbool bEnableTLS; - sbool bEnableTLSZip; - int dhBits; - uchar *pristring; /* GnuTLS priority string (NULL if not to be provided) */ - uchar *authmode; /* TLS auth mode */ - uchar *caCertFile; - uchar *myCertFile; - uchar *myPrivKeyFile; - struct { - int nmemb; - uchar **name; - } permittedPeers; - - struct instanceConf_s *next; - /* with librelp, this module does not have any own specific session - * or listener active data item. As a "work-around", we keep some - * data items inside the configuration object. To keep things - * decently clean, we put them all into their dedicated struct. So - * it is easy to judge what is actual configuration and what is - * dynamic runtime data. -- rgerhards, 2013-06-18 - */ - struct { - statsobj_t *stats; /* listener stats */ - STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit) - } data; -}; - - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - instanceConf_t *root, *tail; - uchar *pszBindRuleset; /* name of Ruleset to bind to */ - ruleset_t *pBindRuleset; /* due to librelp limitation, we need to bind all listerns to the same set */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "ruleset", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* input instance parameters */ -static struct cnfparamdescr inppdescr[] = { - { "port", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "tls", eCmdHdlrBinary, 0 }, - { "tls.permittedpeer", eCmdHdlrArray, 0 }, - { "tls.authmode", eCmdHdlrString, 0 }, - { "tls.dhbits", eCmdHdlrInt, 0 }, - { "tls.prioritystring", eCmdHdlrString, 0 }, - { "tls.cacert", eCmdHdlrString, 0 }, - { "tls.mycert", eCmdHdlrString, 0 }, - { "tls.myprivkey", eCmdHdlrString, 0 }, - { "tls.compression", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; +/* config settings */ /* ------------------------------ callbacks ------------------------------ */ - -static void -onErr(void *pUsr, char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) -{ - instanceConf_t *inst = (instanceConf_t*) pUsr; - errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "imrelp[%s]: error '%s', object " - " '%s' - input may not work as intended", - inst->pszBindPort, errmesg, objinfo); -} - -static void -onGenericErr(char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) +#if 0 +/* this shall go into a specific ACL module! */ +static int +isPermittedHost(struct sockaddr *addr, char *fromHostFQDN, void __attribute__((unused)) *pUsrSrv, + void __attribute__((unused)) *pUsrSess) { - errmsg.LogError(0, RS_RET_RELP_ERR, "imrelp: librelp error '%s', object " - " '%s' - input may not work as intended", errmesg, objinfo); + return net.isAllowedSender(net.pAllowedSenders_TCP, addr, fromHostFQDN); } -static void -onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) -{ - instanceConf_t *inst = (instanceConf_t*) pUsr; - errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "imrelp[%s]: authentication error '%s', peer " - "is '%s'", inst->pszBindPort, errmesg, authinfo); -} +#endif // #if 0 /* callback for receiving syslog messages. This function is invoked from the * RELP engine when a syslog message arrived. It must return a relpRetVal, @@ -182,31 +85,11 @@ * we will only see the hostname (twice). -- rgerhards, 2009-10-14 */ static relpRetVal -onSyslogRcv(void *pUsr, uchar *pHostname, uchar *pIP, uchar *msg, size_t lenMsg) +onSyslogRcv(uchar *pHostname, uchar *pIP, uchar *pMsg, size_t lenMsg) { - prop_t *pProp = NULL; - msg_t *pMsg; - instanceConf_t *inst = (instanceConf_t*) pUsr; DEFiRet; - - CHKiRet(msgConstruct(&pMsg)); - MsgSetInputName(pMsg, pInputName); - MsgSetRawMsg(pMsg, (char*)msg, lenMsg); - MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); - MsgSetRuleset(pMsg, runModConf->pBindRuleset); - pMsg->msgFlags = PARSE_HOSTNAME | NEEDS_PARSING; - - /* TODO: optimize this, we can store it inside the session, requires - * changes to librelp --> next librelp iteration?. rgerhards, 2012-10-29 - */ - MsgSetRcvFromStr(pMsg, pHostname, ustrlen(pHostname), &pProp); - CHKiRet(prop.Destruct(&pProp)); - CHKiRet(MsgSetRcvFromIPStr(pMsg, pIP, ustrlen(pIP), &pProp)); - CHKiRet(prop.Destruct(&pProp)); - CHKiRet(submitMsg2(pMsg)); - STATSCOUNTER_INC(inst->data.ctrSubmit, inst->data.mutCtrSubmit); - -finalize_it: + parseAndSubmitMessage(pHostname, pIP, pMsg, lenMsg, PARSE_HOSTNAME, + eFLOWCTL_LIGHT_DELAY, pInputName, NULL, 0); RETiRet; } @@ -214,364 +97,67 @@ /* ------------------------------ end callbacks ------------------------------ */ -/* create input instance, set default paramters, and - * add it to the list of instances. - */ -static rsRetVal -createInstance(instanceConf_t **pinst) -{ - instanceConf_t *inst; - DEFiRet; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - inst->next = NULL; - - inst->pszBindPort = NULL; - inst->bEnableTLS = 0; - inst->bEnableTLSZip = 0; - inst->dhBits = 0; - inst->pristring = NULL; - inst->authmode = NULL; - inst->permittedPeers.nmemb = 0; - inst->caCertFile = NULL; - inst->myCertFile = NULL; - inst->myPrivKeyFile = NULL; - - /* node created, let's add to config */ - if(loadModConf->tail == NULL) { - loadModConf->tail = loadModConf->root = inst; - } else { - loadModConf->tail->next = inst; - loadModConf->tail = inst; - } - - *pinst = inst; -finalize_it: - RETiRet; -} - - -/* modified to work for module, not instance (as usual) */ -static inline void -std_checkRuleset_genErrMsg(modConfData_t *modConf, __attribute__((unused)) instanceConf_t *inst) -{ - errmsg.LogError(0, NO_ERRCODE, "imrelp: ruleset '%s' not found - " - "using default ruleset instead", modConf->pszBindRuleset); -} - - -/* This function is called when a new listener instance shall be added to - * the current config object via the legacy config system. It just shuffles - * all parameters to the listener in-memory instance. - * rgerhards, 2011-05-04 - */ -static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal) -{ - instanceConf_t *inst; - DEFiRet; - - CHKiRet(createInstance(&inst)); - - if(pNewVal == NULL || *pNewVal == '\0') { - errmsg.LogError(0, NO_ERRCODE, "imrelp: port number must be specified, listener ignored"); - } - inst->pszBindPort = pNewVal; - -finalize_it: - RETiRet; -} - -static rsRetVal -addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) +static rsRetVal addListener(void __attribute__((unused)) *pVal, uchar *pNewVal) { - relpSrv_t *pSrv; - uchar statname[64]; - int i; DEFiRet; if(pRelpEngine == NULL) { CHKiRet(relpEngineConstruct(&pRelpEngine)); CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf)); - CHKiRet(relpEngineSetFamily(pRelpEngine, glbl.GetDefPFFamily())); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); - CHKiRet(relpEngineSetSyslogRcv2(pRelpEngine, onSyslogRcv)); - CHKiRet(relpEngineSetOnErr(pRelpEngine, onErr)); - CHKiRet(relpEngineSetOnGenericErr(pRelpEngine, onGenericErr)); - CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); + CHKiRet(relpEngineSetSyslogRcv(pRelpEngine, onSyslogRcv)); if (!glbl.GetDisableDNS()) { CHKiRet(relpEngineSetDnsLookupMode(pRelpEngine, 1)); } } - CHKiRet(relpEngineListnerConstruct(pRelpEngine, &pSrv)); - CHKiRet(relpSrvSetLstnPort(pSrv, inst->pszBindPort)); - /* support statistics gathering */ - CHKiRet(statsobj.Construct(&(inst->data.stats))); - snprintf((char*)statname, sizeof(statname), "imrelp(%s)", - inst->pszBindPort); - statname[sizeof(statname)-1] = '\0'; /* just to be on the save side... */ - CHKiRet(statsobj.SetName(inst->data.stats, statname)); - STATSCOUNTER_INIT(inst->data.ctrSubmit, inst->data.mutCtrSubmit); - CHKiRet(statsobj.AddCounter(inst->data.stats, UCHAR_CONSTANT("submitted"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(inst->data.ctrSubmit))); - CHKiRet(statsobj.ConstructFinalize(inst->data.stats)); - /* end stats counters */ - relpSrvSetUsrPtr(pSrv, inst); - if(inst->bEnableTLS) { - relpSrvEnableTLS(pSrv); - if(inst->bEnableTLSZip) { - relpSrvEnableTLSZip(pSrv); - } - if(inst->dhBits) { - relpSrvSetDHBits(pSrv, inst->dhBits); - } - relpSrvSetGnuTLSPriString(pSrv, (char*)inst->pristring); - if(relpSrvSetAuthMode(pSrv, (char*)inst->authmode) != RELP_RET_OK) { - errmsg.LogError(0, RS_RET_RELP_ERR, - "imrelp: invalid auth mode '%s'\n", inst->authmode); - ABORT_FINALIZE(RS_RET_RELP_ERR); - } - if(relpSrvSetCACert(pSrv, (char*) inst->caCertFile) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpSrvSetOwnCert(pSrv, (char*) inst->myCertFile) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpSrvSetPrivKey(pSrv, (char*) inst->myPrivKeyFile) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - for(i = 0 ; i < inst->permittedPeers.nmemb ; ++i) { - relpSrvAddPermittedPeer(pSrv, (char*)inst->permittedPeers.name[i]); - } - } - CHKiRet(relpEngineListnerConstructFinalize(pRelpEngine, pSrv)); - -finalize_it: - RETiRet; -} - - -BEGINnewInpInst - struct cnfparamvals *pvals; - instanceConf_t *inst; - int i,j; -CODESTARTnewInpInst - DBGPRINTF("newInpInst (imrelp)\n"); - - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imrelp: required parameter are missing\n"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("input param blk in imrelp:\n"); - cnfparamsPrint(&inppblk, pvals); - } - - CHKiRet(createInstance(&inst)); - - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "port")) { - inst->pszBindPort = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tls")) { - inst->bEnableTLS = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "tls.dhbits")) { - inst->dhBits = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "tls.prioritystring")) { - inst->pristring = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tls.authmode")) { - inst->authmode = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tls.compression")) { - inst->bEnableTLSZip = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "tls.cacert")) { - inst->caCertFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tls.mycert")) { - inst->myCertFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tls.myprivkey")) { - inst->myPrivKeyFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "tls.permittedpeer")) { - inst->permittedPeers.nmemb = pvals[i].val.d.ar->nmemb; - CHKmalloc(inst->permittedPeers.name = - malloc(sizeof(uchar*) * inst->permittedPeers.nmemb)); - for(j = 0 ; j < pvals[i].val.d.ar->nmemb ; ++j) { - inst->permittedPeers.name[j] = (uchar*)es_str2cstr(pvals[i].val.d.ar->arr[j], NULL); - } - } else { - dbgprintf("imrelp: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - } -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->pszBindRuleset = NULL; - pModConf->pBindRuleset = NULL; - /* init legacy config variables */ - cs.pszBindRuleset = NULL; -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imrelp:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "ruleset")) { - loadModConf->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("imrelp: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(loadModConf->pszBindRuleset == NULL) { - if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) { - loadModConf->pszBindRuleset = NULL; - } else { - CHKmalloc(loadModConf->pszBindRuleset = ustrdup(cs.pszBindRuleset)); - } - } else { - if((cs.pszBindRuleset != NULL) && (cs.pszBindRuleset[0] != '\0')) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "imrelp: warning: ruleset " - "set via legacy directive ignored"); - } - } -finalize_it: - free(cs.pszBindRuleset); - loadModConf = NULL; /* done loading */ -ENDendCnfLoad - - -BEGINcheckCnf - rsRetVal localRet; - ruleset_t *pRuleset; -CODESTARTcheckCnf - /* we emulate the standard "ruleset query" code provided by the framework - * for *instances* (which we can currently not support due to librelp). - */ - if(pModConf->pszBindRuleset == NULL) { - pModConf->pBindRuleset = NULL; - } else { - DBGPRINTF("imrelp: using ruleset '%s'\n", pModConf->pszBindRuleset); - localRet = ruleset.GetRuleset(pModConf->pConf, &pRuleset, pModConf->pszBindRuleset); - if(localRet == RS_RET_NOT_FOUND) { - std_checkRuleset_genErrMsg(pModConf, NULL); - } - CHKiRet(localRet); - pModConf->pBindRuleset = pRuleset; - } -finalize_it: -ENDcheckCnf + CHKiRet(relpEngineAddListner(pRelpEngine, pNewVal)); + free(pNewVal); /* we do no longer need it */ -BEGINactivateCnfPrePrivDrop - instanceConf_t *inst; -CODESTARTactivateCnfPrePrivDrop - runModConf = pModConf; - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - addListner(pModConf, inst); - } - if(pRelpEngine == NULL) - ABORT_FINALIZE(RS_RET_NO_RUN); finalize_it: -ENDactivateCnfPrePrivDrop - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf - instanceConf_t *inst, *del; - int i; -CODESTARTfreeCnf - for(inst = pModConf->root ; inst != NULL ; ) { - free(inst->pszBindPort); - free(inst->pristring); - free(inst->authmode); - statsobj.Destruct(&(inst->data.stats)); - for(i = 0 ; i < inst->permittedPeers.nmemb ; ++i) { - free(inst->permittedPeers.name[i]); - } - del = inst; - inst = inst->next; - free(del); - } - free(pModConf->pszBindRuleset); -ENDfreeCnf - -/* This is used to terminate the plugin. Note that the signal handler blocks - * other activity on the thread. As such, it is safe to request the stop. When - * we terminate, relpEngine is called, and it's select() loop interrupted. But - * only *after this function is done*. So we do not have a race! - */ -static void -doSIGTTIN(int __attribute__((unused)) sig) -{ - DBGPRINTF("imrelp: termination requested via SIGTTIN - telling RELP engine\n"); - relpEngineSetStop(pRelpEngine); + RETiRet; } - /* This function is called to gather input. */ BEGINrunInput - sigset_t sigSet; - struct sigaction sigAct; CODESTARTrunInput - /* we want to support non-cancel input termination. To do so, we must signal librelp - * when to stop. As we run on the same thread, we need to register as SIGTTIN handler, - * which will be used to put the terminating condition into librelp. + /* TODO: we must be careful to start the listener here. Currently, tcpsrv.c seems to + * do that in ConstructFinalize */ - sigfillset(&sigSet); - pthread_sigmask(SIG_BLOCK, &sigSet, NULL); - sigemptyset(&sigSet); - sigaddset(&sigSet, SIGTTIN); - pthread_sigmask(SIG_UNBLOCK, &sigSet, NULL); - memset(&sigAct, 0, sizeof (sigAct)); - sigemptyset(&sigAct.sa_mask); - sigAct.sa_handler = doSIGTTIN; - sigaction(SIGTTIN, &sigAct, NULL); - iRet = relpEngineRun(pRelpEngine); ENDrunInput +/* initialize and return if will run or not */ BEGINwillRun CODESTARTwillRun + /* first apply some config settings */ + //net.PrintAllowedSenders(2); /* TCP */ + if(pRelpEngine == NULL) + ABORT_FINALIZE(RS_RET_NO_RUN); + + /* we need to create the inputName property (only once during our lifetime) */ + CHKiRet(prop.Construct(&pInputName)); + CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imrelp"), sizeof("imrelp") - 1)); + CHKiRet(prop.ConstructFinalize(pInputName)); +finalize_it: ENDwillRun BEGINafterRun CODESTARTafterRun /* do cleanup here */ +#if 0 + if(net.pAllowedSenders_TCP != NULL) { + net.clearAllowedSenders(net.pAllowedSenders_TCP); + net.pAllowedSenders_TCP = NULL; + } +#endif + + if(pInputName != NULL) + prop.Destruct(&pInputName); ENDafterRun @@ -580,44 +166,24 @@ if(pRelpEngine != NULL) iRet = relpEngineDestruct(&pRelpEngine); - /* global variable cleanup */ - if(pInputName != NULL) - prop.Destruct(&pInputName); - /* release objects we used */ - objRelease(statsobj, CORE_COMPONENT); - objRelease(ruleset, CORE_COMPONENT); objRelease(glbl, CORE_COMPONENT); objRelease(prop, CORE_COMPONENT); objRelease(net, LM_NET_FILENAME); - objRelease(errmsg, CORE_COMPONENT); ENDmodExit static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - free(cs.pszBindRuleset); - cs.pszBindRuleset = NULL; return RS_RET_OK; } -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - if(eFeat == sFEATURENonCancelInputTermination) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt @@ -629,23 +195,13 @@ /* request objects we use */ CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(prop, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net, LM_NET_FILENAME)); - CHKiRet(objUse(ruleset, CORE_COMPONENT)); - CHKiRet(objUse(statsobj, CORE_COMPONENT)); /* register config file handlers */ - CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputrelpserverbindruleset", 0, eCmdHdlrGetWord, - NULL, &cs.pszBindRuleset, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputrelpserverrun", 0, eCmdHdlrGetWord, - addInstance, NULL, STD_LOADABLE_MODULE_ID)); + addListener, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); - - /* we need to create the inputName property (only once during our lifetime) */ - CHKiRet(prop.Construct(&pInputName)); - CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imrelp"), sizeof("imrelp") - 1)); - CHKiRet(prop.ConstructFinalize(pInputName)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/imrelp/Makefile.in rsyslog-5.10.1/plugins/imrelp/Makefile.in --- rsyslog-7.6.0/plugins/imrelp/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imrelp/Makefile.in 2012-10-17 14:42:39.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = imrelp_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_imrelp_la_OBJECTS = imrelp_la-imrelp.lo imrelp_la_OBJECTS = $(am_imrelp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imrelp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imrelp_la_SOURCES) DIST_SOURCES = $(imrelp_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imrelp.la: $(imrelp_la_OBJECTS) $(imrelp_la_DEPENDENCIES) $(EXTRA_imrelp_la_DEPENDENCIES) +imrelp.la: $(imrelp_la_OBJECTS) $(imrelp_la_DEPENDENCIES) $(AM_V_CCLD)$(imrelp_la_LINK) -rpath $(pkglibdir) $(imrelp_la_OBJECTS) $(imrelp_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imrelp_la-imrelp.lo: imrelp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imrelp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imrelp_la-imrelp.lo -MD -MP -MF $(DEPDIR)/imrelp_la-imrelp.Tpo -c -o imrelp_la-imrelp.lo `test -f 'imrelp.c' || echo '$(srcdir)/'`imrelp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imrelp_la-imrelp.Tpo $(DEPDIR)/imrelp_la-imrelp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imrelp.c' object='imrelp_la-imrelp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imrelp.c' object='imrelp_la-imrelp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imrelp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imrelp_la-imrelp.lo `test -f 'imrelp.c' || echo '$(srcdir)/'`imrelp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imrelp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imrelp_la-imrelp.lo `test -f 'imrelp.c' || echo '$(srcdir)/'`imrelp.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imsolaris/imsolaris.c rsyslog-5.10.1/plugins/imsolaris/imsolaris.c --- rsyslog-7.6.0/plugins/imsolaris/imsolaris.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imsolaris/imsolaris.c 2012-10-17 14:41:20.000000000 +0000 @@ -86,7 +86,6 @@ MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imsolaris") /* defines */ #define PATH_LOG "/dev/log" @@ -100,10 +99,6 @@ /* config settings */ -struct modConfData_s { - EMPTY_STRUCT; -}; - static prop_t *pInputName = NULL; /* our inputName currently is always "imuxsock", and this will hold it */ static char *LogName = NULL; /* the log socket name TODO: make configurable! */ @@ -307,31 +302,6 @@ } -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - /* This function is called to gather input. */ BEGINrunInput CODESTARTrunInput diff -Nru rsyslog-7.6.0/plugins/imsolaris/Makefile.in rsyslog-5.10.1/plugins/imsolaris/Makefile.in --- rsyslog-7.6.0/plugins/imsolaris/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imsolaris/Makefile.in 2012-10-17 14:42:39.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) imsolaris_la_DEPENDENCIES = am_imsolaris_la_OBJECTS = imsolaris_la-imsolaris.lo \ imsolaris_la-sun_cddl.lo imsolaris_la_OBJECTS = $(am_imsolaris_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imsolaris_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imsolaris_la_SOURCES) DIST_SOURCES = $(imsolaris_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imsolaris.la: $(imsolaris_la_OBJECTS) $(imsolaris_la_DEPENDENCIES) $(EXTRA_imsolaris_la_DEPENDENCIES) +imsolaris.la: $(imsolaris_la_OBJECTS) $(imsolaris_la_DEPENDENCIES) $(AM_V_CCLD)$(imsolaris_la_LINK) -rpath $(pkglibdir) $(imsolaris_la_OBJECTS) $(imsolaris_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,37 +350,42 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imsolaris_la-imsolaris.lo: imsolaris.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imsolaris_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imsolaris_la-imsolaris.lo -MD -MP -MF $(DEPDIR)/imsolaris_la-imsolaris.Tpo -c -o imsolaris_la-imsolaris.lo `test -f 'imsolaris.c' || echo '$(srcdir)/'`imsolaris.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imsolaris_la-imsolaris.Tpo $(DEPDIR)/imsolaris_la-imsolaris.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imsolaris.c' object='imsolaris_la-imsolaris.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imsolaris.c' object='imsolaris_la-imsolaris.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imsolaris_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imsolaris_la-imsolaris.lo `test -f 'imsolaris.c' || echo '$(srcdir)/'`imsolaris.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imsolaris_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imsolaris_la-imsolaris.lo `test -f 'imsolaris.c' || echo '$(srcdir)/'`imsolaris.c imsolaris_la-sun_cddl.lo: sun_cddl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imsolaris_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imsolaris_la-sun_cddl.lo -MD -MP -MF $(DEPDIR)/imsolaris_la-sun_cddl.Tpo -c -o imsolaris_la-sun_cddl.lo `test -f 'sun_cddl.c' || echo '$(srcdir)/'`sun_cddl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imsolaris_la-sun_cddl.Tpo $(DEPDIR)/imsolaris_la-sun_cddl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sun_cddl.c' object='imsolaris_la-sun_cddl.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sun_cddl.c' object='imsolaris_la-sun_cddl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imsolaris_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imsolaris_la-sun_cddl.lo `test -f 'sun_cddl.c' || echo '$(srcdir)/'`sun_cddl.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imsolaris_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imsolaris_la-sun_cddl.lo `test -f 'sun_cddl.c' || echo '$(srcdir)/'`sun_cddl.c mostlyclean-libtool: -rm -f *.lo @@ -531,15 +492,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imtcp/imtcp.c rsyslog-5.10.1/plugins/imtcp/imtcp.c --- rsyslog-7.6.0/plugins/imtcp/imtcp.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/imtcp/imtcp.c 2012-10-17 14:41:20.000000000 +0000 @@ -4,7 +4,7 @@ * File begun on 2007-12-21 by RGerhards (extracted from syslogd.c, * which at the time of the rsyslog fork was BSD-licensed) * - * Copyright 2007-2013 Adiscon GmbH. + * Copyright 2007-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -36,6 +36,7 @@ * * rgerhards, 2008-05-19 */ + #include "config.h" #include #include @@ -61,12 +62,10 @@ #include "errmsg.h" #include "tcpsrv.h" #include "ruleset.h" -#include "rainerscript.h" #include "net.h" /* for permittedPeers, may be removed when this is removed */ MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imtcp") /* static data */ DEF_IMOD_STATIC_DATA @@ -77,104 +76,25 @@ DEFobjCurrIf(errmsg) DEFobjCurrIf(ruleset) -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - /* Module static data */ static tcpsrv_t *pOurTcpsrv = NULL; /* our TCP server(listener) TODO: change for multiple instances */ static permittedPeers_t *pPermPeersRoot = NULL; /* config settings */ -static struct configSettings_s { - int iTCPSessMax; - int iTCPLstnMax; - int bSuppOctetFram; - int iStrmDrvrMode; - int bKeepAlive; - int bEmitMsgOnClose; - int iAddtlFrameDelim; - int bDisableLFDelim; - int bUseFlowControl; - uchar *pszStrmDrvrAuthMode; - uchar *pszInputName; - uchar *pszBindRuleset; -} cs; - -struct instanceConf_s { - uchar *pszBindPort; /* port to bind to */ - uchar *pszBindRuleset; /* name of ruleset to bind to */ - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - uchar *pszInputName; /* value for inputname property, NULL is OK and handled by core engine */ - uchar *dfltTZ; - int ratelimitInterval; - int ratelimitBurst; - int bSuppOctetFram; - struct instanceConf_s *next; -}; - - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - instanceConf_t *root, *tail; - int iTCPSessMax; /* max number of sessions */ - int iTCPLstnMax; /* max number of sessions */ - int iStrmDrvrMode; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */ - int iAddtlFrameDelim; /* addtl frame delimiter, e.g. for netscreen, default none */ - int bSuppOctetFram; - sbool bDisableLFDelim; /* disable standard LF delimiter */ - sbool bUseFlowControl; /* use flow control, what means indicate ourselfs a "light delayable" */ - sbool bKeepAlive; - sbool bEmitMsgOnClose; /* emit an informational message on close by remote peer */ - uchar *pszStrmDrvrName; /* stream driver to use */ - uchar *pszStrmDrvrAuthMode; /* authentication mode to use */ - struct cnfarray *permittedPeers; - sbool configSetViaV2Method; -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "flowcontrol", eCmdHdlrBinary, 0 }, - { "disablelfdelimiter", eCmdHdlrBinary, 0 }, - { "octetcountedframing", eCmdHdlrBinary, 0 }, - { "notifyonconnectionclose", eCmdHdlrBinary, 0 }, - { "addtlframedelimiter", eCmdHdlrNonNegInt, 0 }, - { "maxsessions", eCmdHdlrPositiveInt, 0 }, - { "maxlistners", eCmdHdlrPositiveInt, 0 }, - { "maxlisteners", eCmdHdlrPositiveInt, 0 }, - { "streamdriver.mode", eCmdHdlrPositiveInt, 0 }, - { "streamdriver.authmode", eCmdHdlrString, 0 }, - { "streamdriver.name", eCmdHdlrString, 0 }, - { "permittedpeer", eCmdHdlrArray, 0 }, - { "keepalive", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* input instance parameters */ -static struct cnfparamdescr inppdescr[] = { - { "port", eCmdHdlrString, CNFPARAM_REQUIRED }, /* legacy: InputTCPServerRun */ - { "name", eCmdHdlrString, 0 }, - { "defaulttz", eCmdHdlrString, 0 }, - { "ruleset", eCmdHdlrString, 0 }, - { "supportOctetCountedFraming", eCmdHdlrBinary, 0 }, - { "ratelimit.interval", eCmdHdlrInt, 0 }, - { "ratelimit.burst", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; - -#include "im-helper.h" /* must be included AFTER the type definitions! */ +static int bKeepAlive = 0; /* support keep-alive packets */ +static int iTCPSessMax = 200; /* max number of sessions */ +static int bSuppOctetFram = 1; /* octet counted TCP framing supported? */ +static int iTCPLstnMax = 20; /* max number of sessions */ +static int iStrmDrvrMode = 0; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */ +static int bEmitMsgOnClose = 0; /* emit an informational message on close by remote peer */ +static int iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; /* addtl frame delimiter, e.g. for netscreen, default none */ +static int bDisableLFDelim = 0; /* disbale standard LF delimiter */ +static int bUseFlowControl = 1; /* use flow control, what means indicate ourselfs a "light delayable" */ +static uchar *pszStrmDrvrAuthMode = NULL; /* authentication mode to use */ +static uchar *pszInputName = NULL; /* value for inputname property, NULL is OK and handled by core engine */ +static ruleset_t *pBindRuleset = NULL; /* ruleset to bind listener to (use system default if unspecified) */ -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ /* callbacks */ /* this shall go into a specific ACL module! */ @@ -247,97 +167,49 @@ } -/* create input instance, set default paramters, and - * add it to the list of instances. - */ -static rsRetVal -createInstance(instanceConf_t **pinst) -{ - instanceConf_t *inst; - DEFiRet; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - inst->next = NULL; - inst->pszBindRuleset = NULL; - inst->pszInputName = NULL; - inst->dfltTZ = NULL; - inst->bSuppOctetFram = 1; - inst->ratelimitInterval = 0; - inst->ratelimitBurst = 10000; - - /* node created, let's add to config */ - if(loadModConf->tail == NULL) { - loadModConf->tail = loadModConf->root = inst; - } else { - loadModConf->tail->next = inst; - loadModConf->tail = inst; - } - - *pinst = inst; -finalize_it: - RETiRet; -} - - -/* This function is called when a new listener instace shall be added to - * the current config object via the legacy config system. It just shuffles - * all parameters to the listener in-memory instance. - * rgerhards, 2011-05-04 - */ -static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal) +/* accept a new ruleset to bind. Checks if it exists and complains, if not */ +static rsRetVal setRuleset(void __attribute__((unused)) *pVal, uchar *pszName) { - instanceConf_t *inst; + ruleset_t *pRuleset; + rsRetVal localRet; DEFiRet; - CHKiRet(createInstance(&inst)); - - CHKmalloc(inst->pszBindPort = ustrdup((pNewVal == NULL || *pNewVal == '\0') - ? (uchar*) "10514" : pNewVal)); - if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) { - inst->pszBindRuleset = NULL; - } else { - CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset)); - } - if((cs.pszInputName == NULL) || (cs.pszInputName[0] == '\0')) { - inst->pszInputName = NULL; - } else { - CHKmalloc(inst->pszInputName = ustrdup(cs.pszInputName)); - } - inst->bSuppOctetFram = cs.bSuppOctetFram; + localRet = ruleset.GetRuleset(&pRuleset, pszName); + if(localRet == RS_RET_NOT_FOUND) { + errmsg.LogError(0, RS_RET_RULESET_NOT_FOUND, "error: ruleset '%s' not found - ignored", pszName); + } + CHKiRet(localRet); + pBindRuleset = pRuleset; + DBGPRINTF("imtcp current bind ruleset %p: '%s'\n", pRuleset, pszName); finalize_it: - free(pNewVal); + free(pszName); /* no longer needed */ RETiRet; } -static rsRetVal -addListner(modConfData_t *modConf, instanceConf_t *inst) +static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVal) { DEFiRet; if(pOurTcpsrv == NULL) { CHKiRet(tcpsrv.Construct(&pOurTcpsrv)); - /* callbacks */ + CHKiRet(tcpsrv.SetKeepAlive(pOurTcpsrv, bKeepAlive)); + CHKiRet(tcpsrv.SetSessMax(pOurTcpsrv, iTCPSessMax)); + CHKiRet(tcpsrv.SetLstnMax(pOurTcpsrv, iTCPLstnMax)); CHKiRet(tcpsrv.SetCBIsPermittedHost(pOurTcpsrv, isPermittedHost)); CHKiRet(tcpsrv.SetCBRcvData(pOurTcpsrv, doRcvData)); CHKiRet(tcpsrv.SetCBOpenLstnSocks(pOurTcpsrv, doOpenLstnSocks)); CHKiRet(tcpsrv.SetCBOnRegularClose(pOurTcpsrv, onRegularClose)); CHKiRet(tcpsrv.SetCBOnErrClose(pOurTcpsrv, onErrClose)); - /* params */ - CHKiRet(tcpsrv.SetKeepAlive(pOurTcpsrv, modConf->bKeepAlive)); - CHKiRet(tcpsrv.SetSessMax(pOurTcpsrv, modConf->iTCPSessMax)); - CHKiRet(tcpsrv.SetLstnMax(pOurTcpsrv, modConf->iTCPLstnMax)); - CHKiRet(tcpsrv.SetDrvrMode(pOurTcpsrv, modConf->iStrmDrvrMode)); - CHKiRet(tcpsrv.SetUseFlowControl(pOurTcpsrv, modConf->bUseFlowControl)); - CHKiRet(tcpsrv.SetAddtlFrameDelim(pOurTcpsrv, modConf->iAddtlFrameDelim)); - CHKiRet(tcpsrv.SetbDisableLFDelim(pOurTcpsrv, modConf->bDisableLFDelim)); - CHKiRet(tcpsrv.SetNotificationOnRemoteClose(pOurTcpsrv, modConf->bEmitMsgOnClose)); + CHKiRet(tcpsrv.SetDrvrMode(pOurTcpsrv, iStrmDrvrMode)); + CHKiRet(tcpsrv.SetUseFlowControl(pOurTcpsrv, bUseFlowControl)); + CHKiRet(tcpsrv.SetAddtlFrameDelim(pOurTcpsrv, iAddtlFrameDelim)); + CHKiRet(tcpsrv.SetbDisableLFDelim(pOurTcpsrv, bDisableLFDelim)); + CHKiRet(tcpsrv.SetNotificationOnRemoteClose(pOurTcpsrv, bEmitMsgOnClose)); /* now set optional params, but only if they were actually configured */ - if(modConf->pszStrmDrvrName != NULL) { - CHKiRet(tcpsrv.SetDrvrName(pOurTcpsrv, modConf->pszStrmDrvrName)); - } - if(modConf->pszStrmDrvrAuthMode != NULL) { - CHKiRet(tcpsrv.SetDrvrAuthMode(pOurTcpsrv, modConf->pszStrmDrvrAuthMode)); + if(pszStrmDrvrAuthMode != NULL) { + CHKiRet(tcpsrv.SetDrvrAuthMode(pOurTcpsrv, pszStrmDrvrAuthMode)); } if(pPermPeersRoot != NULL) { CHKiRet(tcpsrv.SetDrvrPermPeers(pOurTcpsrv, pPermPeersRoot)); @@ -345,274 +217,47 @@ } /* initialized, now add socket and listener params */ - DBGPRINTF("imtcp: trying to add port *:%s\n", inst->pszBindPort); - CHKiRet(tcpsrv.SetRuleset(pOurTcpsrv, inst->pBindRuleset)); - CHKiRet(tcpsrv.SetInputName(pOurTcpsrv, inst->pszInputName == NULL ? - UCHAR_CONSTANT("imtcp") : inst->pszInputName)); - CHKiRet(tcpsrv.SetDfltTZ(pOurTcpsrv, (inst->dfltTZ == NULL) ? (uchar*)"" : inst->dfltTZ)); - CHKiRet(tcpsrv.SetLinuxLikeRatelimiters(pOurTcpsrv, inst->ratelimitInterval, inst->ratelimitBurst)); - tcpsrv.configureTCPListen(pOurTcpsrv, inst->pszBindPort, inst->bSuppOctetFram); + CHKiRet(tcpsrv.SetRuleset(pOurTcpsrv, pBindRuleset)); + CHKiRet(tcpsrv.SetInputName(pOurTcpsrv, pszInputName == NULL ? + UCHAR_CONSTANT("imtcp") : pszInputName)); + tcpsrv.configureTCPListen(pOurTcpsrv, pNewVal, bSuppOctetFram); finalize_it: if(iRet != RS_RET_OK) { - errmsg.LogError(0, NO_ERRCODE, "imtcp: error %d trying to add listener", iRet); + errmsg.LogError(0, NO_ERRCODE, "error %d trying to add listener", iRet); + if(pOurTcpsrv != NULL) + tcpsrv.Destruct(&pOurTcpsrv); } RETiRet; } - -BEGINnewInpInst - struct cnfparamvals *pvals; - instanceConf_t *inst; - int i; -CODESTARTnewInpInst - DBGPRINTF("newInpInst (imtcp)\n"); - - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imtcp: required parameter are missing\n"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("input param blk in imtcp:\n"); - cnfparamsPrint(&inppblk, pvals); - } - - CHKiRet(createInstance(&inst)); - - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "port")) { - inst->pszBindPort = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "name")) { - inst->pszInputName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "defaulttz")) { - inst->dfltTZ = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ruleset")) { - inst->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "supportOctetCountedFraming")) { - inst->bSuppOctetFram = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.burst")) { - inst->ratelimitBurst = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.interval")) { - inst->ratelimitInterval = (int) pvals[i].val.d.n; - } else { - dbgprintf("imtcp: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - } -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - loadModConf->iTCPSessMax = 200; - loadModConf->iTCPLstnMax = 20; - loadModConf->bSuppOctetFram = 1; - loadModConf->iStrmDrvrMode = 0; - loadModConf->bUseFlowControl = 1; - loadModConf->bKeepAlive = 0; - loadModConf->bEmitMsgOnClose = 0; - loadModConf->iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; - loadModConf->bDisableLFDelim = 0; - loadModConf->pszStrmDrvrName = NULL; - loadModConf->pszStrmDrvrAuthMode = NULL; - loadModConf->permittedPeers = NULL; - loadModConf->configSetViaV2Method = 0; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config variables */ - cs.pszStrmDrvrAuthMode = NULL; - resetConfigVariables(NULL, NULL); /* dummy parameters just to fulfill interface def */ -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "imtcp: error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imtcp:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "flowcontrol")) { - loadModConf->bUseFlowControl = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "disablelfdelimiter")) { - loadModConf->bDisableLFDelim = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "octetcountedframing")) { - loadModConf->bSuppOctetFram = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "notifyonconnectionclose")) { - loadModConf->bEmitMsgOnClose = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "addtlframedelimiter")) { - loadModConf->iAddtlFrameDelim = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "maxsessions")) { - loadModConf->iTCPSessMax = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "maxlisteners") || - !strcmp(modpblk.descr[i].name, "maxlistners")) { /* keep old name for a while */ - loadModConf->iTCPLstnMax = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "keepalive")) { - loadModConf->bKeepAlive = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "streamdriver.mode")) { - loadModConf->iStrmDrvrMode = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "streamdriver.authmode")) { - loadModConf->pszStrmDrvrAuthMode = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "streamdriver.name")) { - loadModConf->pszStrmDrvrName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "permittedpeer")) { - loadModConf->permittedPeers = cnfarrayDup(pvals[i].val.d.ar); - } else { - dbgprintf("imtcp: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - /* remove all of our legacy handlers, as they can not used in addition - * the the new-style config method. - */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - pModConf->iTCPSessMax = cs.iTCPSessMax; - pModConf->iTCPLstnMax = cs.iTCPLstnMax; - pModConf->iStrmDrvrMode = cs.iStrmDrvrMode; - pModConf->bEmitMsgOnClose = cs.bEmitMsgOnClose; - pModConf->bSuppOctetFram = cs.bSuppOctetFram; - pModConf->iAddtlFrameDelim = cs.iAddtlFrameDelim; - pModConf->bDisableLFDelim = cs.bDisableLFDelim; - pModConf->bUseFlowControl = cs.bUseFlowControl; - pModConf->bKeepAlive = cs.bKeepAlive; - if((cs.pszStrmDrvrAuthMode == NULL) || (cs.pszStrmDrvrAuthMode[0] == '\0')) { - loadModConf->pszStrmDrvrAuthMode = NULL; - } else { - loadModConf->pszStrmDrvrAuthMode = cs.pszStrmDrvrAuthMode; - cs.pszStrmDrvrAuthMode = NULL; - } - } - free(cs.pszStrmDrvrAuthMode); - cs.pszStrmDrvrAuthMode = NULL; - - loadModConf = NULL; /* done loading */ -ENDendCnfLoad - - -/* function to generate error message if framework does not find requested ruleset */ -static inline void -std_checkRuleset_genErrMsg(__attribute__((unused)) modConfData_t *modConf, instanceConf_t *inst) -{ - errmsg.LogError(0, NO_ERRCODE, "imtcp: ruleset '%s' for port %s not found - " - "using default ruleset instead", inst->pszBindRuleset, - inst->pszBindPort); -} - -BEGINcheckCnf - instanceConf_t *inst; -CODESTARTcheckCnf - for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { - std_checkRuleset(pModConf, inst); - } - if(pModConf->root == NULL) { - errmsg.LogError(0, RS_RET_NO_LISTNERS , "imtcp: module loaded, but " - "no listeners defined - no input will be gathered"); - iRet = RS_RET_NO_LISTNERS; - } -ENDcheckCnf - - -BEGINactivateCnfPrePrivDrop - instanceConf_t *inst; - int i; -CODESTARTactivateCnfPrePrivDrop - runModConf = pModConf; - if(runModConf->permittedPeers != NULL) { - for(i = 0 ; i < runModConf->permittedPeers->nmemb ; ++i) { - setPermittedPeer(NULL, (uchar*) - es_str2cstr(runModConf->permittedPeers->arr[i], NULL)); - } - } - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - addListner(pModConf, inst); - } - if(pOurTcpsrv == NULL) - ABORT_FINALIZE(RS_RET_NO_RUN); - CHKiRet(tcpsrv.ConstructFinalize(pOurTcpsrv)); -finalize_it: -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf -CODESTARTactivateCnf - /* sorry, nothing to do here... */ -ENDactivateCnf - - -BEGINfreeCnf - instanceConf_t *inst, *del; -CODESTARTfreeCnf - free(pModConf->pszStrmDrvrName); - free(pModConf->pszStrmDrvrAuthMode); - if(pModConf->permittedPeers != NULL) { - cnfarrayContentDestruct(pModConf->permittedPeers); - free(pModConf->permittedPeers); - } - for(inst = pModConf->root ; inst != NULL ; ) { - free(inst->pszBindPort); - free(inst->pszInputName); - free(inst->dfltTZ); - del = inst; - inst = inst->next; - free(del); - } -ENDfreeCnf - /* This function is called to gather input. */ BEGINrunInput CODESTARTrunInput + /* TODO: we must be careful to start the listener here. Currently, tcpsrv.c seems to + * do that in ConstructFinalize + */ + CHKiRet(tcpsrv.ConstructFinalize(pOurTcpsrv)); iRet = tcpsrv.Run(pOurTcpsrv); +finalize_it: ENDrunInput /* initialize and return if will run or not */ BEGINwillRun CODESTARTwillRun + /* first apply some config settings */ net.PrintAllowedSenders(2); /* TCP */ + if(pOurTcpsrv == NULL) + ABORT_FINALIZE(RS_RET_NO_RUN); +finalize_it: ENDwillRun BEGINafterRun CODESTARTafterRun - if(pOurTcpsrv != NULL) - iRet = tcpsrv.Destruct(&pOurTcpsrv); - + /* do cleanup here */ net.clearAllowedSenders(UCHAR_CONSTANT("TCP")); ENDafterRun @@ -626,6 +271,9 @@ BEGINmodExit CODESTARTmodExit + if(pOurTcpsrv != NULL) + iRet = tcpsrv.Destruct(&pOurTcpsrv); + if(pPermPeersRoot != NULL) { net.DestructPermittedPeers(&pPermPeersRoot); } @@ -643,19 +291,19 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - cs.iTCPSessMax = 200; - cs.iTCPLstnMax = 20; - cs.bSuppOctetFram = 1; - cs.iStrmDrvrMode = 0; - cs.bUseFlowControl = 1; - cs.bKeepAlive = 0; - cs.bEmitMsgOnClose = 0; - cs.iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; - cs.bDisableLFDelim = 0; - free(cs.pszInputName); - cs.pszInputName = NULL; - free(cs.pszStrmDrvrAuthMode); - cs.pszStrmDrvrAuthMode = NULL; + iTCPSessMax = 200; + bKeepAlive = 0; + bSuppOctetFram = 1; + iTCPLstnMax = 20; + iStrmDrvrMode = 0; + bUseFlowControl = 0; + bEmitMsgOnClose = 0; + iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; + bDisableLFDelim = 0; + free(pszInputName); + pszInputName = NULL; + free(pszStrmDrvrAuthMode); + pszStrmDrvrAuthMode = NULL; return RS_RET_OK; } @@ -664,10 +312,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt @@ -687,40 +331,37 @@ /* register config file handlers */ CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverrun"), 0, eCmdHdlrGetWord, - addInstance, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverinputname"), 0, eCmdHdlrGetWord, - NULL, &cs.pszInputName, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverbindruleset"), 0, eCmdHdlrGetWord, - NULL, &cs.pszBindRuleset, STD_LOADABLE_MODULE_ID)); - /* module-global config params - will be disabled in configs that are loaded - * via module(...). - */ - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserverstreamdriverpermittedpeer"), 0, eCmdHdlrGetWord, - setPermittedPeer, NULL, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserverstreamdriverauthmode"), 0, eCmdHdlrGetWord, - NULL, &cs.pszStrmDrvrAuthMode, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserverkeepalive"), 0, eCmdHdlrBinary, - NULL, &cs.bKeepAlive, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpflowcontrol"), 0, eCmdHdlrBinary, - NULL, &cs.bUseFlowControl, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserverdisablelfdelimiter"), 0, eCmdHdlrBinary, - NULL, &cs.bDisableLFDelim, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserveraddtlframedelimiter"), 0, eCmdHdlrInt, - NULL, &cs.iAddtlFrameDelim, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserversupportoctetcountedframing"), 0, eCmdHdlrBinary, - NULL, &cs.bSuppOctetFram, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpmaxsessions"), 0, eCmdHdlrInt, - NULL, &cs.iTCPSessMax, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpmaxlisteners"), 0, eCmdHdlrInt, - NULL, &cs.iTCPLstnMax, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpservernotifyonconnectionclose"), 0, eCmdHdlrBinary, - NULL, &cs.bEmitMsgOnClose, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2(UCHAR_CONSTANT("inputtcpserverstreamdrivermode"), 0, eCmdHdlrInt, - NULL, &cs.iStrmDrvrMode, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - + addTCPListener, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverkeepalive"), 0, eCmdHdlrBinary, + NULL, &bKeepAlive, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserversupportoctetcountedframing"), 0, eCmdHdlrBinary, + NULL, &bSuppOctetFram, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpmaxsessions"), 0, eCmdHdlrInt, + NULL, &iTCPSessMax, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpmaxlisteners"), 0, eCmdHdlrInt, + NULL, &iTCPLstnMax, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpservernotifyonconnectionclose"), 0, + eCmdHdlrBinary, NULL, &bEmitMsgOnClose, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverstreamdrivermode"), 0, + eCmdHdlrInt, NULL, &iStrmDrvrMode, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverstreamdriverauthmode"), 0, + eCmdHdlrGetWord, NULL, &pszStrmDrvrAuthMode, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverstreamdriverpermittedpeer"), 0, + eCmdHdlrGetWord, setPermittedPeer, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserveraddtlframedelimiter"), 0, eCmdHdlrInt, + NULL, &iAddtlFrameDelim, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverdisablelfdelimiter"), 0, eCmdHdlrBinary, + NULL, &bDisableLFDelim, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverinputname"), 0, + eCmdHdlrGetWord, NULL, &pszInputName, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpserverbindruleset"), 0, + eCmdHdlrGetWord, setRuleset, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputtcpflowcontrol"), 0, + eCmdHdlrBinary, NULL, &bUseFlowControl, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("resetconfigvariables"), 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit + /* vim:set ai: */ diff -Nru rsyslog-7.6.0/plugins/imtcp/Makefile.in rsyslog-5.10.1/plugins/imtcp/Makefile.in --- rsyslog-7.6.0/plugins/imtcp/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imtcp/Makefile.in 2012-10-17 14:42:39.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) imtcp_la_DEPENDENCIES = am_imtcp_la_OBJECTS = imtcp_la-imtcp.lo imtcp_la_OBJECTS = $(am_imtcp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imtcp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imtcp_la_SOURCES) DIST_SOURCES = $(imtcp_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imtcp.la: $(imtcp_la_OBJECTS) $(imtcp_la_DEPENDENCIES) $(EXTRA_imtcp_la_DEPENDENCIES) +imtcp.la: $(imtcp_la_OBJECTS) $(imtcp_la_DEPENDENCIES) $(AM_V_CCLD)$(imtcp_la_LINK) -rpath $(pkglibdir) $(imtcp_la_OBJECTS) $(imtcp_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imtcp_la-imtcp.lo: imtcp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imtcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imtcp_la-imtcp.lo -MD -MP -MF $(DEPDIR)/imtcp_la-imtcp.Tpo -c -o imtcp_la-imtcp.lo `test -f 'imtcp.c' || echo '$(srcdir)/'`imtcp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imtcp_la-imtcp.Tpo $(DEPDIR)/imtcp_la-imtcp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imtcp.c' object='imtcp_la-imtcp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imtcp.c' object='imtcp_la-imtcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imtcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imtcp_la-imtcp.lo `test -f 'imtcp.c' || echo '$(srcdir)/'`imtcp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imtcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imtcp_la-imtcp.lo `test -f 'imtcp.c' || echo '$(srcdir)/'`imtcp.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imtemplate/imtemplate.c rsyslog-5.10.1/plugins/imtemplate/imtemplate.c --- rsyslog-7.6.0/plugins/imtemplate/imtemplate.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/imtemplate/imtemplate.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,436 @@ +/* imtemplate.c + * + * This is NOT a real input module but a (copy)-template to create one. Please + * do NOT edit this file directly. Rather, copy it, together with the rest of + * the directory, to a new location ./plugins/im, then replace + * all references to imtemplate in Makefile.am to im. Be sure to + * fix the copyright notices to gain proper credit ;) Any derived version, + * however, needs to be placed under GPLv3 (see GPLv3 for details). If you + * do not like that policy, do not use this template or any of the header + * files. The rsyslog project greatly appreciates module contributions, so + * please consider contributing your work - even if you may think it only + * server a single very special purpose. It has turned out that at least some + * folks have similiar special purposes ;) + * + * IMPORTANT + * The comments in this file are actually the interface specification. I decided + * not to put it into a separate file as it is much simpler to keep it up to + * date when it is part of the actual template module. + * + * NAMING + * All input modules shall be named im. While this is not a hard + * requirement, it helps keeping track of things. + * + * Global variables and functions should have a prefix - use as somewhat + * longer one to prevent conflicts with rsyslog itself and other modules + * (OK, hopefully I'll have some more precise advise in the future...). + * + * INCLUDE MODULE IN THE MAIN MAKE SCRIPT + * If the module shall be provided as part of rsyslog (or simply as a build aid, + * you need to add it to the main autoconf files). To do so, you need to edit + * Makefile.am and configure.ac in the main directory. Search for imtemplate + * and copy/modify the relevant code for your plugin. + * + * DEBUGGING + * While you develop your code, you may want to add + * --enable-debug --enable-rtinst + * to your ./configure settings. These enable extra run-time checks, which cost + * a lot of performance but can help detect some of the most frequently made + * bugs. These settings will also provide you with a nice stack dump if something + * goes really wrong. + * + * MORE SAMPLES + * Remember that rsyslog ships with a number of input modules (./plugins/im*). It + * is always a good idea to have a look at them before starting your own. imudp + * may be a good, relatively trivial, sample. + * + * -------------------------------------------------------------------------------- + * + * This template was cretead on 2008-02-01 by Rainer Gerhards. + * + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" /* this is for autotools and always must be the first include */ +#include +#include +#include +#include +#include /* do NOT remove: will soon be done by the module generation macros */ +#include "rsyslog.h" /* error codes etc... */ +#include "cfsysline.h" /* access to config file objects */ +#include "module-template.h" /* generic module interface code - very important, read it! */ +#include "srUtils.h" /* some utility functions */ +#include "debug.h" /* some debug helper functions */ + +MODULE_TYPE_INPUT /* must be present for input modules, do not remove */ +MODULE_TYPE_NOKEEP + +/* defines */ + +/* Module static data */ +DEF_IMOD_STATIC_DATA /* must be present, starts static data */ + +/* Here, define whatever static data is needed. Is it suggested that static variables only are + * used (not externally visible). If you need externally visible variables, make sure you use a + * prefix in order not to conflict with other modules or rsyslogd itself (also see comment + * at file header). + */ +/* static int imtemplateWhateverVar = 0; */ + +/* config settings */ + + +/* You may add any functions that you feel are useful for your needs. No specific restrictions + * apply, but we suggest that you use the "iRet" call order, which enables you to use debug + * support for your own functions and which also makes it easy to communicate exceptions back + * to the upstream caller (rsyslog framework, for example. + * + * The function below is a sample of how one of your functions may look like. Again, the sample + * below is *not* needed to be present in order to meet the interface requirements. + * + * Be sure to use static functions (suggested) or prefixes to prevent name conflicts -- see file + * header for more information. + */ +static rsRetVal /* rsRetVal is our generic error-reporting return type */ +imtemplateMyFunc(int iMyParam) +{ + DEFiRet; /* define iRet, the return code and other plumbing */ + /* define your local variables here */ + + /* code whatever you need to code here. The "iRet" system can be helpful: + * + * CHKiRet(function(param1, param2, ...)); + * calls a function and checks if it returns RS_RET_OK. If so, work + * proceeds. If some other code is returned, the function is aborted + * and control transferred to finalize_it (which you need to define) + * + * CHKiRet_Hdlr(function(param1, param2, ...)) + * much like CHKiRet, but allows you to specify your own code that is + * executed if the function does not return RS_RET_OK, e.g.: + * CHKiRet_Hdlr(function(a, b)) { + * ... some error handling here ... + * } + * control is not transferred to finalize_it, except if you use one + * of the relevant macros (described below) + * + * FINALIZE + * immediately transfers control to finalize_it, using the current + * value of iRet, e.g. + * if(bDone) + * FINALIZE; + * + * ABORT_FINALIZE(retcode) + * just like FINALIZE, except that iRet is set to the provided error + * code before control is transferred, e.g. + * if((ptr = MALLOC(20)) == NULL) + * ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + * + * In order for all this to work, you need to define finalize_it, e.g. + * + * finalize_it: + * RETiRet; + * + * RETiRet does some housekeeping and then does a "return iRet" to transfer + * control back to the caller. There shall only be one function exit and + * it shall be via RETiRet, preferrably at the end of the function code. + * + */ + +finalize_it: + /* clean up anything that needs to be cleaned up if processing did not + * go well, for example: + */ + if(iRet != RS_RET_OK) { + /* cleanup, e.g. + * free(somePtr); + */ + } + + RETiRet; +} + + +/* This function is the cancel cleanup handler. It is called when rsyslog decides the + * module must be stopped, what most probably happens during shutdown of rsyslogd. When + * this function is called, the runInput() function (below) is already terminated - somewhere + * in the middle of what it was doing. The cancel cleanup handler below should take + * care of any locked mutexes and such, things that really need to be cleaned up + * before processing continues. In general, many plugins do not need to provide + * any code at all here. + * + * IMPORTANT: the calling interface of this function can NOT be modified. It actually is + * called by pthreads. The provided argument is currently not being used. + */ +/* ------------------------------------------------------------------------------------------ * + * DO NOT TOUCH the following code - it will soon be part of the module generation macros! */ +static void +inputModuleCleanup(void *arg) +{ + BEGINfunc +/* END no-touch zone * + * ------------------------------------------------------------------------------------------ */ + + + + /* your code here */ + + + +/* ------------------------------------------------------------------------------------------ * + * DO NOT TOUCH the following code - it will soon be part of the module generation macros! */ + ENDfunc +} +/* END no-touch zone * + * ------------------------------------------------------------------------------------------ */ + + +/* This function is called by the framework to gather the input. The module stays + * most of its lifetime inside this function. It MUST NEVER exit this function. Doing + * so would end module processing and rsyslog would NOT reschedule the module. If + * you exit from this function, you violate the interface specification! + * + * So how is it terminated? When it is time to terminate, rsyslog actually cancels + * the threads. This may sound scary, but is not. There is a cancel cleanup handler + * defined (the function directly above). See comments there for specifics. + * + * runInput is always called on a single thread. If the module neees multiple threads, + * it is free to create them. HOWEVER, it must make sure that any threads created + * are killed and joined in the cancel cleanup handler. + */ +BEGINrunInput + /* define any local variables you need here */ +CODESTARTrunInput + /* ------------------------------------------------------------------------------------------ * + * DO NOT TOUCH the following code - it will soon be part of the module generation macros! */ + pthread_cleanup_push(inputModuleCleanup, NULL); + while(1) { /* endless loop - do NOT break; out of it! */ + /* END no-touch zone * + * ------------------------------------------------------------------------------------------ */ + + /* your code here */ + + /* All rsyslog objects (see other modules, e.g. msg.c) are available + * to your here. Some useful things are: + * + * errmsg.LogError(NO_ERRCODE, format-string, ... params ...); + * logs an error message as syslogd, just as printf, e.g. + * errmsg.LogError(NO_ERRCODE, "Error %d occured during %s", 1, "test"); + * + * To submit the message to the queue engine, we must create the message + * object and fill it with data. If it contains a syslog message that must + * be parsed, we can add a flag that requests parsing. Otherwise, we must + * fill the properties ourselves. That is appropriate if the message + * does not need to be parsed, for example when reading text (log) files. In that way, + * we can set the message properties as of our liking. This is how it works: + * + msg_t *pMsg; + CHKiRet(msgConstruct(&pMsg)); + MsgSetRawMsg(pMsg, msg); + MsgSetHOSTNAME(pMsg, LocalHostName); + MsgSetTAG(pMsg, "rsyslogd:"); + pMsg->iFacility = LOG_FAC(pri); + pMsg->iSeverity = LOG_PRI(pri); + flags |= INTERNAL_MSG; + logmsg(pMsg, flags); / * some time, CHKiRet() will work here, too [today NOT!] * / + * + * NOTE: for up-to-date usage samples, see the other provided input modules. + * A good starting point is probably imuxsock. + * + * This example probably does not set all message properties (but the ones + * that are of practical importance). If you need all, check msg.h. Use + * method access functions whereever possible, unfortunately not all structure + * members are currently exposed in that clean way - so you sometimes need + * to access them directly (it goes without saying that we will fix that + * over time ;)). + */ + + /* ------------------------------------------------------------------------------------------ * + * DO NOT TOUCH the following code - it will soon be part of the module generation macros! */ + } + /*NOTREACHED*/ + + pthread_cleanup_pop(0); /* just for completeness, but never called... */ + RETiRet; /* use it to make sure the housekeeping is done! */ +ENDrunInput + /* END no-touch zone * + * ------------------------------------------------------------------------------------------ */ + + +/* The function is called by rsyslog before runInput() is called. It is a last chance + * to set up anything specific. Most importantly, it can be used to tell rsyslog if the + * input shall run or not. The idea is that if some config settings (or similiar things) + * are not OK, the input can tell rsyslog it will not execute. To do so, return + * RS_RET_NO_RUN or a specific error code. If RS_RET_OK is returned, rsyslog will + * proceed and call the runInput() entry point. If you do not return anything + * specific, RS_RET_OK is automatically returned (as in all functions). + */ +BEGINwillRun + /* place any variables needed here */ +CODESTARTwillRun + + /* ... your code here ... */ + + /* Just to give you an idea, here are some samples (from the actual imudp module: + * + if(udpLstnSocks == NULL) + ABORT_FINALIZE(RS_RET_NO_RUN); + + if((pRcvBuf = MALLOC(glbl.GetMaxLine * sizeof(char))) == NULL) { + ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + } + * + */ +finalize_it: +ENDwillRun + + +/* This function is called by the framework after runInput() has been terminated. It + * shall free any resources and prepare the module for unload. + * + * So it is important that runInput() keeps track of what needs to be cleaned up. + * Objects to think about are files (must be closed), network connections, threads (must + * be stopped and joined) and memory (must be freed). Of course, there are a myriad + * of other things, so use your own judgement what you need to do. + * + * Another important chore of this function is to persist whatever state the module + * needs to persist. Unfortunately, there is currently no standard way of doing that. + * Future version of the module interface will probably support it, but that doesn't + * help you right at the moment. In general, it is suggested that anything that needs + * to be persisted is saved in a file, whose name and location is passed in by a + * module-specific config directive. + */ +BEGINafterRun + /* place any variables needed here */ +CODESTARTafterRun + + /* ... do cleanup here ... */ + + /* if you have a string config variable, remember to free its content: + * + if(pszStr != NULL) { + free(pszStr); + pszStr = NULL; + } + */ +ENDafterRun + + +/* The following entry points are defined in module-template.h. + * In general, they need to be present, but you do NOT need to provide + * any code here. + */ +BEGINmodExit +CODESTARTmodExit +ENDmodExit + + +BEGINqueryEtryPt +CODESTARTqueryEtryPt +CODEqueryEtryPt_STD_IMOD_QUERIES +ENDqueryEtryPt + + +/* The following function shall reset all configuration variables to their + * default values. The code provided in modInit() below registers it to be + * called on "$ResetConfigVariables". You may also call it from other places, + * but in general this is not necessary. Once runInput() has been called, this + * function here is never again called. + */ +static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +{ + DEFiRet; + + /* if you have string variables in you config settings, you need to do this: + if(pszStr != NULL) { + free(pszStr); + pszStr = NULL; + } + * Note that it is vitally important that the pointer is set to NULL, because + * otherwise the framework handler will try to free it a second time when + * a new value is set! + */ + + + /* ... your code here ... */ + + + RETiRet; +} + + +/* modInit() is called once the module is loaded. It must perform all module-wide + * initialization tasks. There are also a number of housekeeping tasks that the + * framework requires. These are handled by the macros. Please note that the + * complexity of processing is depending on the actual module. However, only + * thing absolutely necessary should be done here. Actual app-level processing + * is to be performed in runInput(). A good sample of what to do here may be to + * set some variable defaults. The most important thing probably is registration + * of config command handlers. + */ +BEGINmodInit() +CODESTARTmodInit + *ipIFVersProvided = 1; /* interface spec version this module is written to (currently always 1) */ +CODEmodInit_QueryRegCFSLineHdlr + /* register config file handlers + * For details, see cfsysline.c/.h. The config file is automatically handled. In general, + * a pointer to a variable receiving the value and the config directive is to be supplied. + * A custom function pointer can only be provided, which then is called when the config + * directive appears. Limit this to cases where it is absolutely necessary. The + * STD_LOADABLE_MODULE_ID is a value that identifies the module. It is use to automatically + * unregister the module's config file handlers upon module unload. Do NOT use any other + * value for this parameter! Available Syntaxes (supported types) can be seen in cfsysline.h, + * the ecslCmdHdrlType enum has all that are currently defined. + * + * Config file directives should always be along the lines of + * + * $InputObjObjName + * + * An example would be $InputImtemplateRetriesMax. This is currently not enforced, + * but when we get to our new config file format and reader, this becomes quite + * important. + * + * Please note that config directives must be provided in lower case. The engine + * makes the mapping (what currently means case-insensitive comparison). The dollar + * sign is NOT part of the directive and thus not specified. + * + * Some samples: + * + * A hypothetical integer variable: + * CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputimtemplatemessagenumber", 0, eCmdHdlrInt, + NULL, &intVariable, STD_LOADABLE_MODULE_ID)); + * + * and a hypothetical string variable: + * CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputimtemplatemessagetext", 0, eCmdHdlrGetWord, + * NULL, &pszBindAddr, STD_LOADABLE_MODULE_ID)); + */ + + /* whenever config variables exist, they should be resettable via $ResetConfigVariables. + * The following line adds our handler for that. Note that if you do not have any config + * variables at all (unlikely, I think...), you can remove this handler. + */ + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, + resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + + /* ... do whatever else you need to do, but keep it brief ... */ + +ENDmodInit +/* + * vim:set ai: + */ diff -Nru rsyslog-7.6.0/plugins/imtemplate/Makefile.am rsyslog-5.10.1/plugins/imtemplate/Makefile.am --- rsyslog-7.6.0/plugins/imtemplate/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/imtemplate/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,6 @@ +pkglib_LTLIBRARIES = imtemplate.la + +imtemplate_la_SOURCES = imtemplate.c +imtemplate_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +imtemplate_la_LDFLAGS = -module -avoid-version +imtemplate_la_LIBADD = diff -Nru rsyslog-7.6.0/plugins/imtemplate/Makefile.in rsyslog-5.10.1/plugins/imtemplate/Makefile.in --- rsyslog-7.6.0/plugins/imtemplate/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/imtemplate/Makefile.in 2012-10-17 14:42:40.000000000 +0000 @@ -0,0 +1,590 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/imtemplate +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ + $(top_srcdir)/m4/atomic_operations_64bit.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +imtemplate_la_DEPENDENCIES = +am_imtemplate_la_OBJECTS = imtemplate_la-imtemplate.lo +imtemplate_la_OBJECTS = $(am_imtemplate_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +imtemplate_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(imtemplate_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(imtemplate_la_SOURCES) +DIST_SOURCES = $(imtemplate_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_LIBS = @CURL_LIBS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIBS = @DL_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GSS_LIBS = @GSS_LIBS@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ +HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ +HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ +HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ +IMUDP_LIBS = @IMUDP_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ +LIBDBI_LIBS = @LIBDBI_LIBS@ +LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ +LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORACLE_CFLAGS = @ORACLE_CFLAGS@ +ORACLE_LIBS = @ORACLE_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ +PTHREADS_LIBS = @PTHREADS_LIBS@ +RANLIB = @RANLIB@ +RELP_CFLAGS = @RELP_CFLAGS@ +RELP_LIBS = @RELP_LIBS@ +RSRT_CFLAGS = @RSRT_CFLAGS@ +RSRT_LIBS = @RSRT_LIBS@ +RT_LIBS = @RT_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ +SOL_LIBS = @SOL_LIBS@ +STRIP = @STRIP@ +UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ +UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ +VERSION = @VERSION@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_valgrind = @have_valgrind@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moddirs = @moddirs@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkglib_LTLIBRARIES = imtemplate.la +imtemplate_la_SOURCES = imtemplate.c +imtemplate_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +imtemplate_la_LDFLAGS = -module -avoid-version +imtemplate_la_LIBADD = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/imtemplate/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/imtemplate/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +imtemplate.la: $(imtemplate_la_OBJECTS) $(imtemplate_la_DEPENDENCIES) + $(AM_V_CCLD)$(imtemplate_la_LINK) -rpath $(pkglibdir) $(imtemplate_la_OBJECTS) $(imtemplate_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imtemplate_la-imtemplate.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +imtemplate_la-imtemplate.lo: imtemplate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imtemplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imtemplate_la-imtemplate.lo -MD -MP -MF $(DEPDIR)/imtemplate_la-imtemplate.Tpo -c -o imtemplate_la-imtemplate.lo `test -f 'imtemplate.c' || echo '$(srcdir)/'`imtemplate.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imtemplate_la-imtemplate.Tpo $(DEPDIR)/imtemplate_la-imtemplate.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imtemplate.c' object='imtemplate_la-imtemplate.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imtemplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imtemplate_la-imtemplate.lo `test -f 'imtemplate.c' || echo '$(srcdir)/'`imtemplate.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/imttcp/imttcp.c rsyslog-5.10.1/plugins/imttcp/imttcp.c --- rsyslog-7.6.0/plugins/imttcp/imttcp.c 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/plugins/imttcp/imttcp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1153 +0,0 @@ -/* imttcp.c - * This is an experimental plain tcp input module which follows the - * multiple thread paradigm. - * - * WARNING - * This module is unfinished. It seems to work, but there also seems to be a problem - * if it is under large stress (e.g. tcpflood with more than 500 to 1000 concurrent - * connections). I quickly put together this module after I worked on a larger paper - * and read [1], which claims that using massively threaded applications is - * preferrable to an event driven approach. So I put this to test, especially as - * that would also lead to a much simpler programming paradigm. Unfortuantely, the - * performance results are devastive: while there is a very slight speedup with - * a low connection number (close to the number of cores on the system), there - * is a dramatic negative speedup if running with many threads. Even at only 50 - * connections, rsyslog is dramatically slower (80 seconds for the same workload - * which was processed in 60 seconds with traditional imtcp or when running on - * a single connection). At 1,000 connections, the run was *extremely* slow. So - * this is definitely a dead-end. To be honest, Behren, condit and Brewer claim - * that the problem lies in the current implementation of thread libraries. - * As one cure, they propose user-level threads. However, as far as I could - * find out, User-Level threads seem not to be much faster under Linux than - * Kernel-Level threads (which I used in my approach). - * - * Even more convincing is, from the rsyslog PoV, that there are clear reasons - * why the highly threaded input must be slower: - * o batch sizes are smaller, leading to much more overhead - * o many more context switches are needed to switch between the various - * i/o handlers - * o more OS API calls are required because in this model we get more - * frequent wakeups on new incoming data, so we have less data available - * to read at each instant - * o more lock contention because many more threads compete on the - * main queue mutex - * - * All in all, this means that the approach is not the right one, at least - * not for rsyslog (it may work better if the input can be processed - * totally independent, but I have note evaluated this). So I will look into - * an enhanced event-based model with a small set of input workers pulling - * off data (I assume this is useful for e.g. TLS, as TLS transport is much - * more computebound than other inputs, and this computation becomes a - * limiting factor for the overall processing speed under some - * circumstances - see [2]). - * - * For obvious reasons, I will not try to finish imttcp. However, I have - * decided to leave it included in the source tree, so that - * a) someone else can build on it, if he sees value in that - * b) I may use it for some other tests in the future - * - * But if you intend to actually use this module unmodified, be prepared - * for problems. - * - * [1] R. Von Behren, J. Condit, and E. Brewer. Why events are a bad idea - * (for high-concurrency servers). In Proceedings of the 9th conference on Hot - * Topics in Operating Systems-Volume 9, page 4. USENIX Association, 2003. - * - * [2] http://kb.monitorware.com/tls-limited-17800-messages-per-second-t10598.html - * - * File begun on 2011-01-24 by RGerhards - * - * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Rsyslog 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. - * - * Rsyslog 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 Rsyslog. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - */ -#include "config.h" -#if !defined(HAVE_EPOLL_CREATE) -# error imttcp requires OS support for epoll - can not build - /* imttcp gains speed by using modern Linux capabilities. As such, - * it can only be build on platforms supporting the epoll API. - */ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if HAVE_FCNTL_H -#include -#endif -#include "rsyslog.h" -#include "cfsysline.h" -#include "prop.h" -#include "dirty.h" -#include "module-template.h" -#include "unicode-helper.h" -#include "glbl.h" -#include "prop.h" -#include "errmsg.h" -#include "srUtils.h" -#include "datetime.h" -#include "ruleset.h" -#include "msg.h" -#include "net.h" /* for permittedPeers, may be removed when this is removed */ - -/* the define is from tcpsrv.h, we need to find a new (but easier!!!) abstraction layer some time ... */ -#define TCPSRV_NO_ADDTL_DELIMITER -1 /* specifies that no additional delimiter is to be used in TCP framing */ - - -MODULE_TYPE_INPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imttcp") - -/* static data */ -DEF_IMOD_STATIC_DATA -DEFobjCurrIf(glbl) -DEFobjCurrIf(net) -DEFobjCurrIf(prop) -DEFobjCurrIf(datetime) -DEFobjCurrIf(errmsg) -DEFobjCurrIf(ruleset) - - - -/* config settings */ -struct modConfData_s { - EMPTY_STRUCT; -}; - -typedef struct configSettings_s { - int bEmitMsgOnClose; /* emit an informational message on close by remote peer */ - int iAddtlFrameDelim; /* addtl frame delimiter, e.g. for netscreen, default none */ - uchar *pszInputName; /* value for inputname property, NULL is OK and handled by core engine */ - uchar *lstnIP; /* which IP we should listen on? */ - ruleset_t *pRuleset; /* ruleset to bind listener to (use system default if unspecified) */ -} configSettings_t; - -static configSettings_t cs; - -/* data elements describing our running config */ -typedef struct ttcpsrv_s ttcpsrv_t; -typedef struct ttcplstn_s ttcplstn_t; -typedef struct ttcpsess_s ttcpsess_t; -typedef struct epolld_s epolld_t; - -/* the ttcp server (listener) object - * Note that the object contains support for forming a linked list - * of them. It does not make sense to do this seperately. - */ -struct ttcpsrv_s { - ttcpsrv_t *pNext; /* linked list maintenance */ - uchar *port; /* Port to listen to */ - uchar *lstnIP; /* which IP we should listen on? */ - int bEmitMsgOnClose; - int iAddtlFrameDelim; - uchar *pszInputName; - prop_t *pInputName; /* InputName in (fast to process) property format */ - ruleset_t *pRuleset; - ttcplstn_t *pLstn; /* root of our listeners */ - ttcpsess_t *pSess; /* root of our sessions */ - pthread_mutex_t mutSess; /* mutex for session list updates */ -}; - -/* the ttcp session object. Describes a single active session. - * includes support for doubly-linked list. - */ -struct ttcpsess_s { - ttcpsrv_t *pSrv; /* our server */ - ttcpsess_t *prev, *next; - int sock; - pthread_t tid; -//--- from tcps_sess.h - int iMsg; /* index of next char to store in msg */ - int bAtStrtOfFram; /* are we at the very beginning of a new frame? */ - enum { - eAtStrtFram, - eInOctetCnt, - eInMsg - } inputState; /* our current state */ - int iOctetsRemain; /* Number of Octets remaining in message */ - TCPFRAMINGMODE eFraming; - uchar *pMsg; /* message (fragment) received */ - prop_t *peerName; /* host name we received messages from */ - prop_t *peerIP; -//--- END from tcps_sess.h -}; - - -/* the ttcp listener object. Describes a single active listener. - */ -struct ttcplstn_s { - ttcpsrv_t *pSrv; /* our server */ - ttcplstn_t *prev, *next; - int sock; - pthread_t tid; /* ID of our listener thread */ -}; - - -/* type of object stored in epoll descriptor */ -typedef enum { - epolld_lstn, - epolld_sess -} epolld_type_t; - -/* an epoll descriptor. contains all information necessary to process - * the result of epoll. - */ -struct epolld_s { - epolld_type_t typ; - void *ptr; - struct epoll_event ev; -}; - - -/* global data */ -static ttcpsrv_t *pSrvRoot = NULL; -static int iMaxLine; /* maximum size of a single message */ -pthread_attr_t sessThrdAttr; /* Attribute for session threads; read only after startup */ - -/* forward definitions */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); -static rsRetVal addLstn(ttcpsrv_t *pSrv, int sock); -static void * sessThrd(void *arg); - - -/* some simple constructors/destructors */ -static void -destructSess(ttcpsess_t *pSess) -{ - free(pSess->pMsg); - prop.Destruct(&pSess->peerName); - prop.Destruct(&pSess->peerIP); - /* TODO: make these inits compile-time switch depending: */ - pSess->pMsg = NULL; - free(pSess); -} - -static void -destructSrv(ttcpsrv_t *pSrv) -{ - prop.Destruct(&pSrv->pInputName); - free(pSrv->port); - free(pSrv); -} - - -/* common initialisation for new threads */ -static inline void -initThrd(void) -{ - /* block all signals */ - sigset_t sigSet; - sigfillset(&sigSet); - pthread_sigmask(SIG_BLOCK, &sigSet, NULL); - - /* but ignore SIGTTN, which we (ab)use to signal the thread to shutdown -- rgerhards, 2009-07-20 */ - sigemptyset(&sigSet); - sigaddset(&sigSet, SIGTTIN); - pthread_sigmask(SIG_UNBLOCK, &sigSet, NULL); - -} - - - -/****************************************** TCP SUPPORT FUNCTIONS ***********************************/ -/* We may later think about moving this into a helper library again. But the whole point - * so far was to keep everything related close togehter. -- rgerhards, 2010-08-10 - */ - - -/* Start up a server. That means all of its listeners are created. - * Does NOT yet accept/process any incoming data (but binds ports). Hint: this - * code is to be executed before dropping privileges. - */ -static rsRetVal -createSrv(ttcpsrv_t *pSrv) -{ - DEFiRet; - int error, maxs, on = 1; - int sock = -1; - int numSocks; - struct addrinfo hints, *res = NULL, *r; - uchar *lstnIP; - - lstnIP = pSrv->lstnIP == NULL ? UCHAR_CONSTANT("") : pSrv->lstnIP; - - DBGPRINTF("imttcp creating listen socket on server '%s', port %s\n", lstnIP, pSrv->port); - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_PASSIVE; - hints.ai_family = glbl.GetDefPFFamily(); - hints.ai_socktype = SOCK_STREAM; - - error = getaddrinfo((char*)pSrv->lstnIP, (char*) pSrv->port, &hints, &res); - if(error) { - DBGPRINTF("error %d querying server '%s', port '%s'\n", error, pSrv->lstnIP, pSrv->port); - ABORT_FINALIZE(RS_RET_INVALID_PORT); - } - - /* Count max number of sockets we may open */ - for(maxs = 0, r = res; r != NULL ; r = r->ai_next, maxs++) - /* EMPTY */; - - numSocks = 0; /* num of sockets counter at start of array */ - for(r = res; r != NULL ; r = r->ai_next) { - sock = socket(r->ai_family, r->ai_socktype, r->ai_protocol); - if(sock < 0) { - if(!(r->ai_family == PF_INET6 && errno == EAFNOSUPPORT)) - DBGPRINTF("error %d creating tcp listen socket", errno); - /* it is debatable if PF_INET with EAFNOSUPPORT should - * also be ignored... - */ - continue; - } - -#ifdef IPV6_V6ONLY - if(r->ai_family == AF_INET6) { - int iOn = 1; - if(setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, - (char *)&iOn, sizeof (iOn)) < 0) { - close(sock); - sock = -1; - continue; - } - } -#endif - if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on)) < 0 ) { - DBGPRINTF("error %d setting tcp socket option\n", errno); - close(sock); - sock = -1; - continue; - } - - /* We need to enable BSD compatibility. Otherwise an attacker - * could flood our log files by sending us tons of ICMP errors. - */ -#ifndef BSD - if(net.should_use_so_bsdcompat()) { - if (setsockopt(sock, SOL_SOCKET, SO_BSDCOMPAT, - (char *) &on, sizeof(on)) < 0) { - errmsg.LogError(errno, NO_ERRCODE, "TCP setsockopt(BSDCOMPAT)"); - close(sock); - sock = -1; - continue; - } - } -#endif - - if( (bind(sock, r->ai_addr, r->ai_addrlen) < 0) -#ifndef IPV6_V6ONLY - && (errno != EADDRINUSE) -#endif - ) { - /* TODO: check if *we* bound the socket - else we *have* an error! */ - char errStr[1024]; - rs_strerror_r(errno, errStr, sizeof(errStr)); - dbgprintf("error %d while binding tcp socket: %s\n", errno, errStr); - close(sock); - sock = -1; - continue; - } - - if(listen(sock, 511) < 0) { - DBGPRINTF("tcp listen error %d, suspending\n", errno); - close(sock); - sock = -1; - continue; - } - - /* if we reach this point, we were able to obtain a valid socket, so we can - * create our listener object. -- rgerhards, 2010-08-10 - */ - CHKiRet(addLstn(pSrv, sock)); - ++numSocks; - } - - if(numSocks != maxs) - DBGPRINTF("We could initialize %d TCP listen sockets out of %d we received " - "- this may or may not be an error indication.\n", numSocks, maxs); - - if(numSocks == 0) { - DBGPRINTF("No TCP listen sockets could successfully be initialized"); - ABORT_FINALIZE(RS_RET_COULD_NOT_BIND); - } - -finalize_it: - if(res != NULL) - freeaddrinfo(res); - - if(iRet != RS_RET_OK) { - if(sock != -1) - close(sock); - } - - RETiRet; -} - - -/* Set pRemHost based on the address provided. This is to be called upon accept()ing - * a connection request. It must be provided by the socket we received the - * message on as well as a NI_MAXHOST size large character buffer for the FQDN. - * Please see http://www.hmug.org/man/3/getnameinfo.php (under Caveats) - * for some explanation of the code found below. If we detect a malicious - * hostname, we return RS_RET_MALICIOUS_HNAME and let the caller decide - * on how to deal with that. - * rgerhards, 2008-03-31 - */ -static rsRetVal -getPeerNames(prop_t **peerName, prop_t **peerIP, struct sockaddr *pAddr) -{ - int error; - uchar szIP[NI_MAXHOST] = ""; - uchar szHname[NI_MAXHOST] = ""; - struct addrinfo hints, *res; - - DEFiRet; - - error = getnameinfo(pAddr, SALEN(pAddr), (char*)szIP, sizeof(szIP), NULL, 0, NI_NUMERICHOST); - - if(error) { - DBGPRINTF("Malformed from address %s\n", gai_strerror(error)); - strcpy((char*)szHname, "???"); - strcpy((char*)szIP, "???"); - ABORT_FINALIZE(RS_RET_INVALID_HNAME); - } - - if(!glbl.GetDisableDNS()) { - error = getnameinfo(pAddr, SALEN(pAddr), (char*)szHname, NI_MAXHOST, NULL, 0, NI_NAMEREQD); - if(error == 0) { - memset (&hints, 0, sizeof (struct addrinfo)); - hints.ai_flags = AI_NUMERICHOST; - hints.ai_socktype = SOCK_STREAM; - /* we now do a lookup once again. This one should fail, - * because we should not have obtained a non-numeric address. If - * we got a numeric one, someone messed with DNS! - */ - if(getaddrinfo((char*)szHname, NULL, &hints, &res) == 0) { - freeaddrinfo (res); - /* OK, we know we have evil, so let's indicate this to our caller */ - snprintf((char*)szHname, NI_MAXHOST, "[MALICIOUS:IP=%s]", szIP); - DBGPRINTF("Malicious PTR record, IP = \"%s\" HOST = \"%s\"", szIP, szHname); - iRet = RS_RET_MALICIOUS_HNAME; - } - } else { - strcpy((char*)szHname, (char*)szIP); - } - } else { - strcpy((char*)szHname, (char*)szIP); - } - - /* We now have the names, so now let's allocate memory and store them permanently. */ - CHKiRet(prop.Construct(peerName)); - CHKiRet(prop.SetString(*peerName, szHname, ustrlen(szHname))); - CHKiRet(prop.ConstructFinalize(*peerName)); - CHKiRet(prop.Construct(peerIP)); - CHKiRet(prop.SetString(*peerIP, szIP, ustrlen(szIP))); - CHKiRet(prop.ConstructFinalize(*peerIP)); - -finalize_it: - RETiRet; -} - - - -/* accept an incoming connection request - * rgerhards, 2008-04-22 - */ -static rsRetVal -AcceptConnReq(int sock, int *newSock, prop_t **peerName, prop_t **peerIP) -{ - struct sockaddr_storage addr; - socklen_t addrlen = sizeof(addr); - int iNewSock = -1; - - DEFiRet; - - iNewSock = accept(sock, (struct sockaddr*) &addr, &addrlen); - if(iNewSock < 0) { - if(errno == EAGAIN || errno == EWOULDBLOCK) - ABORT_FINALIZE(RS_RET_NO_MORE_DATA); - ABORT_FINALIZE(RS_RET_ACCEPT_ERR); - } - - CHKiRet(getPeerNames(peerName, peerIP, (struct sockaddr*) &addr)); - - *newSock = iNewSock; - -finalize_it: - if(iRet != RS_RET_OK) { - /* the close may be redundant, but that doesn't hurt... */ - if(iNewSock != -1) - close(iNewSock); - } - - RETiRet; -} - - -/* This is a helper for submitting the message to the rsyslog core. - * It does some common processing, including resetting the various - * state variables to a "processed" state. - * Note that this function is also called if we had a buffer overflow - * due to a too-long message. So far, there is no indication this - * happened and it may be worth thinking about different handling - * of this case (what obviously would require a change to this - * function or some related code). - * rgerhards, 2009-04-23 - * EXTRACT from tcps_sess.c - */ -static rsRetVal -doSubmitMsg(ttcpsess_t *pThis, struct syslogTime *stTime, time_t ttGenTime, multi_submit_t *pMultiSub) -{ - msg_t *pMsg; - DEFiRet; - - if(pThis->iMsg == 0) { - DBGPRINTF("discarding zero-sized message\n"); - FINALIZE; - } - - /* we now create our own message object and submit it to the queue */ - CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime)); - MsgSetRawMsg(pMsg, (char*)pThis->pMsg, pThis->iMsg); - MsgSetInputName(pMsg, pThis->pSrv->pInputName); - MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); - pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME; - MsgSetRcvFrom(pMsg, pThis->peerName); - CHKiRet(MsgSetRcvFromIP(pMsg, pThis->peerIP)); - MsgSetRuleset(pMsg, pThis->pSrv->pRuleset); - - if(pMultiSub == NULL) { - CHKiRet(submitMsg(pMsg)); - } else { - pMultiSub->ppMsgs[pMultiSub->nElem++] = pMsg; - if(pMultiSub->nElem == pMultiSub->maxElem) - CHKiRet(multiSubmitMsg(pMultiSub)); - } - - -finalize_it: - /* reset status variables */ - pThis->bAtStrtOfFram = 1; - pThis->iMsg = 0; - - RETiRet; -} - - -/* process the data received. As TCP is stream based, we need to process the - * data inside a state machine. The actual data received is passed in byte-by-byte - * from DataRcvd, and this function here compiles messages from them and submits - * the end result to the queue. Introducing this function fixes a long-term bug ;) - * rgerhards, 2008-03-14 - * EXTRACT from tcps_sess.c - */ -static inline rsRetVal -processDataRcvd(ttcpsess_t *pThis, char c, struct syslogTime *stTime, time_t ttGenTime, multi_submit_t *pMultiSub) -{ - DEFiRet; - - if(pThis->inputState == eAtStrtFram) { - if(isdigit((int) c)) { - pThis->inputState = eInOctetCnt; - pThis->iOctetsRemain = 0; - pThis->eFraming = TCP_FRAMING_OCTET_COUNTING; - } else { - pThis->inputState = eInMsg; - pThis->eFraming = TCP_FRAMING_OCTET_STUFFING; - } - } - - if(pThis->inputState == eInOctetCnt) { - if(isdigit(c)) { - pThis->iOctetsRemain = pThis->iOctetsRemain * 10 + c - '0'; - } else { /* done with the octet count, so this must be the SP terminator */ - DBGPRINTF("TCP Message with octet-counter, size %d.\n", pThis->iOctetsRemain); - if(c != ' ') { - errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: " - "delimiter is not SP but has ASCII value %d.", c); - } - if(pThis->iOctetsRemain < 1) { - /* TODO: handle the case where the octet count is 0! */ - DBGPRINTF("Framing Error: invalid octet count\n"); - errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: " - "invalid octet count %d.", pThis->iOctetsRemain); - } else if(pThis->iOctetsRemain > iMaxLine) { - /* while we can not do anything against it, we can at least log an indication - * that something went wrong) -- rgerhards, 2008-03-14 - */ - DBGPRINTF("truncating message with %d octets - max msg size is %d\n", - pThis->iOctetsRemain, iMaxLine); - errmsg.LogError(0, NO_ERRCODE, "received oversize message: size is %d bytes, " - "max msg size is %d, truncating...", pThis->iOctetsRemain, iMaxLine); - } - pThis->inputState = eInMsg; - } - } else { - assert(pThis->inputState == eInMsg); - if(pThis->iMsg >= iMaxLine) { - /* emergency, we now need to flush, no matter if we are at end of message or not... */ - DBGPRINTF("error: message received is larger than max msg size, we split it\n"); - doSubmitMsg(pThis, stTime, ttGenTime, pMultiSub); - /* we might think if it is better to ignore the rest of the - * message than to treat it as a new one. Maybe this is a good - * candidate for a configuration parameter... - * rgerhards, 2006-12-04 - */ - } - - if(( (c == '\n') - || ((pThis->pSrv->iAddtlFrameDelim != TCPSRV_NO_ADDTL_DELIMITER) && (c == pThis->pSrv->iAddtlFrameDelim)) - ) && pThis->eFraming == TCP_FRAMING_OCTET_STUFFING) { /* record delimiter? */ - doSubmitMsg(pThis, stTime, ttGenTime, pMultiSub); - pThis->inputState = eAtStrtFram; - } else { - /* IMPORTANT: here we copy the actual frame content to the message - for BOTH framing modes! - * If we have a message that is larger than the max msg size, we truncate it. This is the best - * we can do in light of what the engine supports. -- rgerhards, 2008-03-14 - */ - if(pThis->iMsg < iMaxLine) { - *(pThis->pMsg + pThis->iMsg++) = c; - } - } - - if(pThis->eFraming == TCP_FRAMING_OCTET_COUNTING) { - /* do we need to find end-of-frame via octet counting? */ - pThis->iOctetsRemain--; - if(pThis->iOctetsRemain < 1) { - /* we have end of frame! */ - doSubmitMsg(pThis, stTime, ttGenTime, pMultiSub); - pThis->inputState = eAtStrtFram; - } - } - } - - RETiRet; -} - - -/* Processes the data received via a TCP session. If there - * is no other way to handle it, data is discarded. - * Input parameter data is the data received, iLen is its - * len as returned from recv(). iLen must be 1 or more (that - * is errors must be handled by caller!). iTCPSess must be - * the index of the TCP session that received the data. - * rgerhards 2005-07-04 - * And another change while generalizing. We now return either - * RS_RET_OK, which means the session should be kept open - * or anything else, which means it must be closed. - * rgerhards, 2008-03-01 - * As a performance optimization, we pick up the timestamp here. Acutally, - * this *is* the *correct* reception step for all the data we received, because - * we have just received a bunch of data! -- rgerhards, 2009-06-16 - * EXTRACT from tcps_sess.c - */ -#define NUM_MULTISUB 1024 -static rsRetVal -DataRcvd(ttcpsess_t *pThis, char *pData, size_t iLen) -{ - multi_submit_t multiSub; - msg_t *pMsgs[NUM_MULTISUB]; - struct syslogTime stTime; - time_t ttGenTime; - char *pEnd; - DEFiRet; - - assert(pData != NULL); - assert(iLen > 0); - - datetime.getCurrTime(&stTime, &ttGenTime); - multiSub.ppMsgs = pMsgs; - multiSub.maxElem = NUM_MULTISUB; - multiSub.nElem = 0; - - /* We now copy the message to the session buffer. */ - pEnd = pData + iLen; /* this is one off, which is intensional */ - - while(pData < pEnd) { - CHKiRet(processDataRcvd(pThis, *pData++, &stTime, ttGenTime, &multiSub)); - } - - if(multiSub.nElem > 0) { - /* submit anything that was not yet submitted */ - CHKiRet(multiSubmitMsg(&multiSub)); - } - -finalize_it: - RETiRet; -} -#undef NUM_MULTISUB - - -/****************************************** --END-- TCP SUPPORT FUNCTIONS ***********************************/ - - -static inline void -initConfigSettings(void) -{ - cs.bEmitMsgOnClose = 0; - cs.iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; - cs.pszInputName = NULL; - cs.pRuleset = NULL; - cs.lstnIP = NULL; -} - - -/* add a listener to the server - */ -static rsRetVal -addLstn(ttcpsrv_t *pSrv, int sock) -{ - DEFiRet; - ttcplstn_t *pLstn; - - CHKmalloc(pLstn = malloc(sizeof(ttcplstn_t))); - pLstn->pSrv = pSrv; - pLstn->sock = sock; - - /* add to start of server's listener list */ - pLstn->prev = NULL; - pLstn->next = pSrv->pLstn; - if(pSrv->pLstn != NULL) - pSrv->pLstn->prev = pLstn; - pSrv->pLstn = pLstn; - -finalize_it: - RETiRet; -} - - -/* add a session to the server - */ -static rsRetVal -addSess(ttcpsrv_t *pSrv, int sock, prop_t *peerName, prop_t *peerIP) -{ - DEFiRet; - ttcpsess_t *pSess = NULL; - - CHKmalloc(pSess = malloc(sizeof(ttcpsess_t))); - CHKmalloc(pSess->pMsg = malloc(iMaxLine * sizeof(uchar))); - pSess->pSrv = pSrv; - pSess->sock = sock; - pSess->inputState = eAtStrtFram; - pSess->iMsg = 0; - pSess->bAtStrtOfFram = 1; - pSess->peerName = peerName; - pSess->peerIP = peerIP; - - /* add to start of server's listener list */ - pSess->prev = NULL; - pthread_mutex_lock(&pSrv->mutSess); - pSess->next = pSrv->pSess; - if(pSrv->pSess != NULL) - pSrv->pSess->prev = pSess; - pSrv->pSess = pSess; - pthread_mutex_unlock(&pSrv->mutSess); - - /* finally run session handler */ - pthread_create(&pSess->tid, &sessThrdAttr, sessThrd, (void*) pSess); - -finalize_it: - RETiRet; -} - - -/* close/remove a session - * NOTE: we must first remove the fd from the epoll set and then close it -- else we - * get an error "bad file descriptor" from epoll. - */ -static inline rsRetVal -closeSess(ttcpsess_t *pSess) -{ - int sock; - DEFiRet; - - sock = pSess->sock; - close(sock); - - /* finally unlink session from structures */ - pthread_mutex_lock(&pSess->pSrv->mutSess); - if(pSess->next != NULL) - pSess->next->prev = pSess->prev; - if(pSess->prev == NULL) { - /* need to update root! */ - pSess->pSrv->pSess = pSess->next; - } else { - pSess->prev->next = pSess->next; - } - pthread_mutex_unlock(&pSess->pSrv->mutSess); - - /* unlinked, now remove structure */ - destructSess(pSess); - - RETiRet; -} - - -/* accept a new ruleset to bind. Checks if it exists and complains, if not */ -static rsRetVal setRuleset(void __attribute__((unused)) *pVal, uchar *pszName) -{ - ruleset_t *pRuleset; - rsRetVal localRet; - DEFiRet; - - localRet = ruleset.GetRuleset(ourConf, &pRuleset, pszName); - if(localRet == RS_RET_NOT_FOUND) { - errmsg.LogError(0, NO_ERRCODE, "error: ruleset '%s' not found - ignored", pszName); - } - CHKiRet(localRet); - cs.pRuleset = pRuleset; - DBGPRINTF("imttcp current bind ruleset %p: '%s'\n", pRuleset, pszName); - -finalize_it: - free(pszName); /* no longer needed */ - RETiRet; -} - - -static rsRetVal addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVal) -{ - DEFiRet; - ttcpsrv_t *pSrv; - - CHKmalloc(pSrv = malloc(sizeof(ttcpsrv_t))); - pthread_mutex_init(&pSrv->mutSess, NULL); - pSrv->pSess = NULL; - pSrv->pLstn = NULL; - pSrv->bEmitMsgOnClose = cs.bEmitMsgOnClose; - pSrv->port = pNewVal; - pSrv->iAddtlFrameDelim = cs.iAddtlFrameDelim; - cs.pszInputName = NULL; /* moved over to pSrv, we do not own */ - pSrv->lstnIP = cs.lstnIP; - cs.lstnIP = NULL; /* moved over to pSrv, we do not own */ - pSrv->pRuleset = cs.pRuleset; - pSrv->pszInputName = (cs.pszInputName == NULL) ? UCHAR_CONSTANT("imttcp") : cs.pszInputName; - CHKiRet(prop.Construct(&pSrv->pInputName)); - CHKiRet(prop.SetString(pSrv->pInputName, pSrv->pszInputName, ustrlen(pSrv->pszInputName))); - CHKiRet(prop.ConstructFinalize(pSrv->pInputName)); - - /* add to linked list */ - pSrv->pNext = pSrvRoot; - pSrvRoot = pSrv; - - /* all config vars are auto-reset -- this also is very useful with the - * new config format effort (v6). - */ - resetConfigVariables(NULL, NULL); - -finalize_it: - if(iRet != RS_RET_OK) { - errmsg.LogError(0, NO_ERRCODE, "error %d trying to add listener", iRet); - } - RETiRet; -} - - -/* create up all listeners - * This is a one-time stop once the module is set to start. - */ -static inline rsRetVal -createServers() -{ - DEFiRet; - ttcpsrv_t *pSrv; - - pSrv = pSrvRoot; - while(pSrv != NULL) { - DBGPRINTF("Starting up ttcp server for port %s, name '%s'\n", pSrv->port, pSrv->pszInputName); - createSrv(pSrv); - pSrv = pSrv->pNext; - } - - RETiRet; -} - - -/* This function implements the thread to be used for listeners. - * The function terminates if shutdown is required. - */ -static void * -lstnThrd(void *arg) -{ - ttcplstn_t *pLstn = (ttcplstn_t *) arg; - rsRetVal iRet = RS_RET_OK; - int newSock; - prop_t *peerName; - prop_t *peerIP; - rsRetVal localRet; - - initThrd(); - - while(glbl.GetGlobalInputTermState() == 0) { - localRet = AcceptConnReq(pLstn->sock, &newSock, &peerName, &peerIP); - if(glbl.GetGlobalInputTermState() == 1) - break; /* terminate input! */ - CHKiRet(localRet); - DBGPRINTF("imttcp: new connection %d on listen socket %d\n", newSock, pLstn->sock); - CHKiRet(addSess(pLstn->pSrv, newSock, peerName, peerIP)); - } - -finalize_it: - close(pLstn->sock); - DBGPRINTF("imttcp shutdown listen socket %d\n", pLstn->sock); - /* Note: we do NOT unlink the deleted session. While this sounds not 100% clean, - * it is fine with the current implementation as we will never reuse these elements. - * However, it make sense (and not cost notable performance) to do it "right"... - */ - return NULL; -} - - -/* This function implements the thread to be used for a session - * The function terminates if shutdown is required. - */ -static void * -sessThrd(void *arg) -{ - ttcpsess_t *pSess = (ttcpsess_t*) arg; - rsRetVal iRet = RS_RET_OK; - int lenRcv; - int lenBuf; - char rcvBuf[64*1024]; - - initThrd(); - - while(glbl.GetGlobalInputTermState() == 0) { - lenBuf = sizeof(rcvBuf); - lenRcv = recv(pSess->sock, rcvBuf, lenBuf, 0); - - if(glbl.GetGlobalInputTermState() == 1) - ABORT_FINALIZE(RS_RET_FORCE_TERM); - - if(lenRcv > 0) { - /* have data, process it */ - DBGPRINTF("imttcp: data(%d) on socket %d: %s\n", lenRcv, pSess->sock, rcvBuf); - CHKiRet(DataRcvd(pSess, rcvBuf, lenRcv)); - } else if (lenRcv == 0) { - /* session was closed, do clean-up */ - if(pSess->pSrv->bEmitMsgOnClose) { - uchar *peerName; - int lenPeer; - prop.GetString(pSess->peerName, &peerName, &lenPeer); - errmsg.LogError(0, RS_RET_PEER_CLOSED_CONN, "imttcp session %d closed by remote peer %s.", - pSess->sock, peerName); - } - break; - } else { - if(errno == EAGAIN) - break; - DBGPRINTF("imttcp: error on session socket %d - closing.\n", pSess->sock); - break; - } - } - -finalize_it: - DBGPRINTF("imttcp: session thread terminates, socket %d\n", pSess->sock); - closeSess(pSess); /* try clean-up by dropping session */ - return NULL; -} - -/* startup all listeners - */ -static inline rsRetVal -startupListeners() -{ - DEFiRet; - ttcpsrv_t *pSrv; - ttcplstn_t *pLstn; - - pSrv = pSrvRoot; - while(pSrv != NULL) { - for(pLstn = pSrv->pLstn ; pLstn != NULL ; pLstn = pLstn->next) { - pthread_create(&pLstn->tid, NULL, lstnThrd, (void*) pLstn); - } - pSrv = pSrv->pNext; - } - - RETiRet; -} - - -/* This function is called to gather input. - */ -BEGINrunInput - struct timeval tvSelectTimeout; -CODESTARTrunInput - DBGPRINTF("imttcp: now beginning to process input data\n"); - CHKiRet(startupListeners()); - - // TODO: this loop is a quick hack, do it right! - while(glbl.GetGlobalInputTermState() == 0) { - tvSelectTimeout.tv_sec = 86400 /*1 day*/; - tvSelectTimeout.tv_usec = 0; - select(1, NULL, NULL, NULL, &tvSelectTimeout); - } -finalize_it: ; -ENDrunInput - - -/* initialize and return if will run or not */ -BEGINwillRun -CODESTARTwillRun - /* first apply some config settings */ - iMaxLine = glbl.GetMaxLine(); /* get maximum size we currently support */ - - if(pSrvRoot == NULL) { - errmsg.LogError(0, RS_RET_NO_LSTN_DEFINED, "error: no ttcp server defined, module can not run."); - ABORT_FINALIZE(RS_RET_NO_RUN); - } - - /* start up servers, but do not yet read input data */ - CHKiRet(createServers()); - DBGPRINTF("imttcp started up, but not yet receiving data\n"); -finalize_it: -ENDwillRun - - -/* completely shut down a server. All we need to do is unblock the - * various session and listerner threads as they then check the termination - * praedicate themselves. - */ -static inline void -shutdownSrv(ttcpsrv_t *pSrv) -{ - ttcplstn_t *pLstn; - ttcplstn_t *pLstnDel; - ttcpsess_t *pSess; - pthread_t tid; - - pLstn = pSrv->pLstn; - while(pLstn != NULL) { - tid = pLstn->tid; /* pSess will be destructed! */ - pthread_kill(tid, SIGTTIN); - DBGPRINTF("imttcp: termination request for listen thread %x\n", (unsigned) tid); - pthread_join(tid, NULL); - DBGPRINTF("imttcp: listen thread %x terminated \n", (unsigned) tid); - pLstnDel = pLstn; - pLstn = pLstn->next; - free(pLstnDel); - } - - pSess = pSrv->pSess; - while(pSess != NULL) { - tid = pSess->tid; /* pSess will be destructed! */ - pSess = pSess->next; - pthread_kill(tid, SIGTTIN); - DBGPRINTF("imttcp: termination request for session thread %x\n", (unsigned) tid); - //pthread_join(tid, NULL); - DBGPRINTF("imttcp: session thread %x terminated \n", (unsigned) tid); - } -} - - -BEGINafterRun - ttcpsrv_t *pSrv, *srvDel; -CODESTARTafterRun - /* do cleanup here */ - /* we need to close everything that is still open */ - pSrv = pSrvRoot; - while(pSrv != NULL) { - srvDel = pSrv; - pSrv = pSrv->pNext; - shutdownSrv(srvDel); - destructSrv(srvDel); - } -ENDafterRun - - -BEGINmodExit -CODESTARTmodExit - pthread_attr_destroy(&sessThrdAttr); - - /* release objects we used */ - objRelease(glbl, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); - objRelease(net, LM_NET_FILENAME); - objRelease(datetime, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); - objRelease(ruleset, CORE_COMPONENT); -ENDmodExit - - -static rsRetVal -resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - cs.bEmitMsgOnClose = 0; - cs.iAddtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; - free(cs.pszInputName); - cs.pszInputName = NULL; - free(cs.lstnIP); - cs.lstnIP = NULL; - return RS_RET_OK; -} - - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_IMOD_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - initConfigSettings(); - /* request objects we use */ - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); - CHKiRet(objUse(net, LM_NET_FILENAME)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(datetime, CORE_COMPONENT)); - CHKiRet(objUse(ruleset, CORE_COMPONENT)); - - /* initialize "read-only" thread attributes */ - pthread_attr_init(&sessThrdAttr); - pthread_attr_setdetachstate(&sessThrdAttr, PTHREAD_CREATE_DETACHED); - pthread_attr_setstacksize(&sessThrdAttr, 4096*1024); - - /* register config file handlers */ - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputttcpserverrun"), 0, eCmdHdlrGetWord, - addTCPListener, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputttcpservernotifyonconnectionclose"), 0, - eCmdHdlrBinary, NULL, &cs.bEmitMsgOnClose, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputttcpserveraddtlframedelimiter"), 0, eCmdHdlrInt, - NULL, &cs.iAddtlFrameDelim, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputttcpserverinputname"), 0, - eCmdHdlrGetWord, NULL, &cs.pszInputName, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputttcpserverlistenip"), 0, - eCmdHdlrGetWord, NULL, &cs.lstnIP, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("inputttcpserverbindruleset"), 0, - eCmdHdlrGetWord, setRuleset, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr(UCHAR_CONSTANT("resetconfigvariables"), 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -ENDmodInit - - -/* vim:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/imttcp/Makefile.am rsyslog-5.10.1/plugins/imttcp/Makefile.am --- rsyslog-7.6.0/plugins/imttcp/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imttcp/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -pkglib_LTLIBRARIES = imttcp.la - -imttcp_la_SOURCES = imttcp.c -imttcp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -imttcp_la_LDFLAGS = -module -avoid-version -imttcp_la_LIBADD = diff -Nru rsyslog-7.6.0/plugins/imttcp/Makefile.in rsyslog-5.10.1/plugins/imttcp/Makefile.in --- rsyslog-7.6.0/plugins/imttcp/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imttcp/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,635 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/imttcp -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -imttcp_la_DEPENDENCIES = -am_imttcp_la_OBJECTS = imttcp_la-imttcp.lo -imttcp_la_OBJECTS = $(am_imttcp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -imttcp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(imttcp_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(imttcp_la_SOURCES) -DIST_SOURCES = $(imttcp_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = imttcp.la -imttcp_la_SOURCES = imttcp.c -imttcp_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -imttcp_la_LDFLAGS = -module -avoid-version -imttcp_la_LIBADD = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/imttcp/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/imttcp/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -imttcp.la: $(imttcp_la_OBJECTS) $(imttcp_la_DEPENDENCIES) $(EXTRA_imttcp_la_DEPENDENCIES) - $(AM_V_CCLD)$(imttcp_la_LINK) -rpath $(pkglibdir) $(imttcp_la_OBJECTS) $(imttcp_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imttcp_la-imttcp.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -imttcp_la-imttcp.lo: imttcp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imttcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imttcp_la-imttcp.lo -MD -MP -MF $(DEPDIR)/imttcp_la-imttcp.Tpo -c -o imttcp_la-imttcp.lo `test -f 'imttcp.c' || echo '$(srcdir)/'`imttcp.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imttcp_la-imttcp.Tpo $(DEPDIR)/imttcp_la-imttcp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imttcp.c' object='imttcp_la-imttcp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imttcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imttcp_la-imttcp.lo `test -f 'imttcp.c' || echo '$(srcdir)/'`imttcp.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/imudp/imudp.c rsyslog-5.10.1/plugins/imudp/imudp.c --- rsyslog-7.6.0/plugins/imudp/imudp.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/imudp/imudp.c 2012-10-17 14:41:20.000000000 +0000 @@ -4,7 +4,9 @@ * NOTE: read comments in module-template.h to understand how this file * works! * - * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. + * File begun on 2007-12-21 by RGerhards (extracted from syslogd.c) + * + * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -31,8 +33,6 @@ #include #include #include -#include -#include #if HAVE_SYS_EPOLL_H # include #endif @@ -53,15 +53,12 @@ #include "prop.h" #include "ruleset.h" #include "statsobj.h" -#include "ratelimit.h" #include "unicode-helper.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imudp") /* defines */ -#define MAX_WRKR_THREADS 32 /* Module static data */ DEF_IMOD_STATIC_DATA @@ -78,185 +75,127 @@ struct lstn_s *next; int sock; /* socket */ ruleset_t *pRuleset; /* bound ruleset */ - prop_t *pInputName; statsobj_t *stats; /* listener stats */ - ratelimit_t *ratelimiter; - uchar *dfltTZ; STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit) } *lcnfRoot = NULL, *lcnfLast = NULL; - -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ static int bDoACLCheck; /* are ACL checks neeed? Cached once immediately before listener startup */ static int iMaxLine; /* maximum UDP message size supported */ static time_t ttLastDiscard = 0; /* timestamp when a message from a non-permitted sender was last discarded * This shall prevent remote DoS when the "discard on disallowed sender" * message is configured to be logged on occurance of such a case. */ -#define BATCH_SIZE_DFLT 32 /* do not overdo, has heavy toll on memory, especially with large msgs */ + +static uchar *pszBindAddr = NULL; /* IP to bind socket to */ +static uchar *pRcvBuf = NULL; /* receive buffer (for a single packet). We use a global and alloc + * it so that we can check available memory in willRun() and request + * termination if we can not get it. -- rgerhards, 2007-12-27 + */ +static prop_t *pInputName = NULL; /* our inputName currently is always "imudp", and this will hold it */ +static uchar *pszSchedPolicy = NULL; /* scheduling policy string */ +static int iSchedPolicy; /* scheduling policy as SCHED_xxx */ +static int iSchedPrio; /* scheduling priority */ +static int seen_iSchedPrio = 0; /* have we seen scheduling priority in the config file? */ +static ruleset_t *pBindRuleset = NULL; /* ruleset to bind listener to (use system default if unspecified) */ #define TIME_REQUERY_DFLT 2 -#define SCHED_PRIO_UNSET -12345678 /* a value that indicates that the scheduling priority has not been set */ -/* config vars for legacy config system */ -static struct configSettings_s { - uchar *pszBindAddr; /* IP to bind socket to */ - uchar *pszSchedPolicy; /* scheduling policy string */ - uchar *pszBindRuleset; /* name of Ruleset to bind to */ - int iSchedPrio; /* scheduling priority */ - int iTimeRequery; /* how often is time to be queried inside tight recv loop? 0=always */ -} cs; - -struct instanceConf_s { - uchar *pszBindAddr; /* IP to bind socket to */ - uchar *pszBindPort; /* Port to bind socket to */ - uchar *pszBindRuleset; /* name of ruleset to bind to */ - uchar *inputname; - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - uchar *dfltTZ; - int ratelimitInterval; - int ratelimitBurst; - int rcvbuf; /* 0 means: do not set, keep OS default */ - struct instanceConf_s *next; - sbool bAppendPortToInpname; -}; +static int iTimeRequery = TIME_REQUERY_DFLT;/* how often is time to be queried inside tight recv loop? 0=always */ -/* The following structure controls the worker threads. Global data is - * needed for their access. - */ -static struct wrkrInfo_s { - pthread_t tid; /* the worker's thread ID */ - int id; - thrdInfo_t *pThrd; - statsobj_t *stats; /* worker thread stats */ - STATSCOUNTER_DEF(ctrCall_recvmmsg, mutCtrCall_recvmmsg) - STATSCOUNTER_DEF(ctrCall_recvmsg, mutCtrCall_recvmsg) - STATSCOUNTER_DEF(ctrMsgsRcvd, mutCtrMsgsRcvd) - uchar *pRcvBuf; /* receive buffer (for a single packet) */ -# ifdef HAVE_RECVMMSG - struct sockaddr_storage *frominet; - struct mmsghdr *recvmsg_mmh; - struct iovec *recvmsg_iov; -# endif -} wrkrInfo[MAX_WRKR_THREADS]; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - instanceConf_t *root, *tail; - uchar *pszSchedPolicy; /* scheduling policy string */ - int iSchedPolicy; /* scheduling policy as SCHED_xxx */ - int iSchedPrio; /* scheduling priority */ - int iTimeRequery; /* how often is time to be queried inside tight recv loop? 0=always */ - int batchSize; /* max nbr of input batch --> also recvmmsg() max count */ - int8_t wrkrMax; /* max nbr of worker threads */ - sbool configSetViaV2Method; -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "schedulingpolicy", eCmdHdlrGetWord, 0 }, - { "schedulingpriority", eCmdHdlrInt, 0 }, - { "batchsize", eCmdHdlrInt, 0 }, - { "threads", eCmdHdlrPositiveInt, 0 }, - { "timerequery", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* input instance parameters */ -static struct cnfparamdescr inppdescr[] = { - { "port", eCmdHdlrArray, CNFPARAM_REQUIRED }, /* legacy: InputTCPServerRun */ - { "defaulttz", eCmdHdlrString, 0 }, - { "inputname", eCmdHdlrGetWord, 0 }, - { "inputname.appendport", eCmdHdlrBinary, 0 }, - { "address", eCmdHdlrString, 0 }, - { "ratelimit.interval", eCmdHdlrInt, 0 }, - { "ratelimit.burst", eCmdHdlrInt, 0 }, - { "rcvbufsize", eCmdHdlrSize, 0 }, - { "ruleset", eCmdHdlrString, 0 } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; +/* config settings */ + +static rsRetVal check_scheduling_priority(int report_error) +{ + DEFiRet; -#include "im-helper.h" /* must be included AFTER the type definitions! */ +#ifdef HAVE_SCHED_GET_PRIORITY_MAX + if (iSchedPrio < sched_get_priority_min(iSchedPolicy) || + iSchedPrio > sched_get_priority_max(iSchedPolicy)) { + if (report_error) + errmsg.LogError(errno, NO_ERRCODE, + "imudp: scheduling priority %d out of range (%d - %d)" + " for scheduling policy '%s' - ignoring settings", + iSchedPrio, + sched_get_priority_min(iSchedPolicy), + sched_get_priority_max(iSchedPolicy), + pszSchedPolicy); + ABORT_FINALIZE(RS_RET_VALIDATION_RUN); + } +#endif + +finalize_it: + RETiRet; +} -/* create input instance, set default paramters, and - * add it to the list of instances. +/* Set scheduling priority in the supplied variable (will be iSchedPrio) + * and record that we have seen the directive (in seen_iSchedPrio). */ -static rsRetVal -createInstance(instanceConf_t **pinst) +static rsRetVal set_scheduling_priority(void *pVal, int value) { - instanceConf_t *inst; DEFiRet; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - inst->next = NULL; - inst->pBindRuleset = NULL; - - inst->pszBindPort = NULL; - inst->pszBindAddr = NULL; - inst->pszBindRuleset = NULL; - inst->inputname = NULL; - inst->bAppendPortToInpname = 0; - inst->ratelimitBurst = 10000; /* arbitrary high limit */ - inst->ratelimitInterval = 0; /* off */ - inst->rcvbuf = 0; - inst->dfltTZ = NULL; - - /* node created, let's add to config */ - if(loadModConf->tail == NULL) { - loadModConf->tail = loadModConf->root = inst; - } else { - loadModConf->tail->next = inst; - loadModConf->tail = inst; + + if (seen_iSchedPrio) { + errmsg.LogError(0, NO_ERRCODE, "directive already seen"); + ABORT_FINALIZE(RS_RET_VALIDATION_RUN); } + *(int *)pVal = value; + seen_iSchedPrio = 1; + if (pszSchedPolicy != NULL) + CHKiRet(check_scheduling_priority(1)); - *pinst = inst; finalize_it: RETiRet; } -/* This function is called when a new listener instace shall be added to - * the current config object via the legacy config system. It just shuffles - * all parameters to the listener in-memory instance. - * rgerhards, 2011-05-04 - */ -static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal) +/* Set scheduling policy in iSchedPolicy */ +static rsRetVal set_scheduling_policy(void *pVal, uchar *pNewVal) { - instanceConf_t *inst; + int have_sched_policy = 0; DEFiRet; - CHKiRet(createInstance(&inst)); - CHKmalloc(inst->pszBindPort = ustrdup((pNewVal == NULL || *pNewVal == '\0') - ? (uchar*) "514" : pNewVal)); - if((cs.pszBindAddr == NULL) || (cs.pszBindAddr[0] == '\0')) { - inst->pszBindAddr = NULL; - } else { - CHKmalloc(inst->pszBindAddr = ustrdup(cs.pszBindAddr)); + if (pszSchedPolicy != NULL) { + errmsg.LogError(0, NO_ERRCODE, "directive already seen"); + ABORT_FINALIZE(RS_RET_VALIDATION_RUN); } - if((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0')) { - inst->pszBindRuleset = NULL; + *((uchar**)pVal) = pNewVal; /* pVal is pszSchedPolicy */ + if (0) { /* trick to use conditional compilation */ +#ifdef SCHED_FIFO + } else if (!strcasecmp((char*)pszSchedPolicy, "fifo")) { + iSchedPolicy = SCHED_FIFO; + have_sched_policy = 1; +#endif +#ifdef SCHED_RR + } else if (!strcasecmp((char*)pszSchedPolicy, "rr")) { + iSchedPolicy = SCHED_RR; + have_sched_policy = 1; +#endif +#ifdef SCHED_OTHER + } else if (!strcasecmp((char*)pszSchedPolicy, "other")) { + iSchedPolicy = SCHED_OTHER; + have_sched_policy = 1; +#endif } else { - CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset)); + errmsg.LogError(errno, NO_ERRCODE, + "imudp: invalid scheduling policy '%s' " + "- ignoring setting", pszSchedPolicy); } + if (have_sched_policy == 0) { + free(pszSchedPolicy); + pszSchedPolicy = NULL; + ABORT_FINALIZE(RS_RET_VALIDATION_RUN); + } + if (seen_iSchedPrio) + CHKiRet(check_scheduling_priority(1)); finalize_it: - free(pNewVal); RETiRet; } /* This function is called when a new listener shall be added. It takes - * the instance config description, tries to bind the socket and, if that + * the configured parameters, tries to bind the socket and, if that * succeeds, adds it to the list of existing listen sockets. + * rgerhards, 2007-12-27 */ -static inline rsRetVal -addListner(instanceConf_t *inst) +static rsRetVal addListner(void __attribute__((unused)) *pVal, uchar *pNewVal) { DEFiRet; uchar *bindAddr; @@ -265,24 +204,23 @@ struct lstn_s *newlcnfinfo; uchar *bindName; uchar *port; - uchar dispname[64], inpnameBuf[128]; - uchar *inputname; + uchar statname[64]; /* check which address to bind to. We could do this more compact, but have not * done so in order to make the code more readable. -- rgerhards, 2007-12-27 */ - if(inst->pszBindAddr == NULL) + if(pszBindAddr == NULL) bindAddr = NULL; - else if(inst->pszBindAddr[0] == '*' && inst->pszBindAddr[1] == '\0') + else if(pszBindAddr[0] == '*' && pszBindAddr[1] == '\0') bindAddr = NULL; else - bindAddr = inst->pszBindAddr; + bindAddr = pszBindAddr; bindName = (bindAddr == NULL) ? (uchar*)"*" : bindAddr; - port = (inst->pszBindPort == NULL || *inst->pszBindPort == '\0') ? (uchar*) "514" : inst->pszBindPort; - DBGPRINTF("Trying to open syslog UDP ports at %s:%s.\n", bindName, inst->pszBindPort); + DBGPRINTF("Trying to open syslog UDP ports at %s:%s.\n", bindName, pNewVal); - newSocks = net.create_udp_socket(bindAddr, port, 1, inst->rcvbuf); + port = (pNewVal == NULL || *pNewVal == '\0') ? (uchar*) "514" : pNewVal; + newSocks = net.create_udp_socket(bindAddr, port, 1); if(newSocks != NULL) { /* we now need to add the new sockets to the existing set */ /* ready to copy */ @@ -290,34 +228,15 @@ CHKmalloc(newlcnfinfo = (struct lstn_s*) MALLOC(sizeof(struct lstn_s))); newlcnfinfo->next = NULL; newlcnfinfo->sock = newSocks[iSrc]; - newlcnfinfo->pRuleset = inst->pBindRuleset; - newlcnfinfo->dfltTZ = inst->dfltTZ; - if(inst->inputname == NULL) { - inputname = (uchar*)"imudp"; - } else { - inputname = inst->inputname; - } - snprintf((char*)dispname, sizeof(dispname), "%s(%s:%s)", inputname, bindName, port); - dispname[sizeof(dispname)-1] = '\0'; /* just to be on the save side... */ - CHKiRet(ratelimitNew(&newlcnfinfo->ratelimiter, (char*)dispname, NULL)); - if(inst->bAppendPortToInpname) { - snprintf((char*)inpnameBuf, sizeof(inpnameBuf), "%s%s", - inputname, port); - inpnameBuf[sizeof(inpnameBuf)-1] = '\0'; - inputname = inpnameBuf; - } - CHKiRet(prop.Construct(&newlcnfinfo->pInputName)); - CHKiRet(prop.SetString(newlcnfinfo->pInputName, - inputname, ustrlen(inputname))); - CHKiRet(prop.ConstructFinalize(newlcnfinfo->pInputName)); - ratelimitSetLinuxLike(newlcnfinfo->ratelimiter, inst->ratelimitInterval, - inst->ratelimitBurst); + newlcnfinfo->pRuleset = pBindRuleset; /* support statistics gathering */ CHKiRet(statsobj.Construct(&(newlcnfinfo->stats))); - CHKiRet(statsobj.SetName(newlcnfinfo->stats, dispname)); + snprintf((char*)statname, sizeof(statname), "imudp(%s:%s)", bindName, port); + statname[sizeof(statname)-1] = '\0'; /* just to be on the save side... */ + CHKiRet(statsobj.SetName(newlcnfinfo->stats, statname)); STATSCOUNTER_INIT(newlcnfinfo->ctrSubmit, newlcnfinfo->mutCtrSubmit); CHKiRet(statsobj.AddCounter(newlcnfinfo->stats, UCHAR_CONSTANT("submitted"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(newlcnfinfo->ctrSubmit))); + ctrType_IntCtr, &(newlcnfinfo->ctrSubmit))); CHKiRet(statsobj.ConstructFinalize(newlcnfinfo->stats)); /* link to list. Order must be preserved to take care for * conflicting matches. @@ -334,170 +253,35 @@ } finalize_it: + free(pNewVal); /* in any case, this is no longer needed */ free(newSocks); - RETiRet; -} - -static inline void -std_checkRuleset_genErrMsg(__attribute__((unused)) modConfData_t *modConf, instanceConf_t *inst) -{ - errmsg.LogError(0, NO_ERRCODE, "imudp: ruleset '%s' for %s:%s not found - " - "using default ruleset instead", inst->pszBindRuleset, - inst->pszBindAddr == NULL ? "*" : (char*) inst->pszBindAddr, - inst->pszBindPort); + RETiRet; } -/* This function processes received data. It provides unified handling - * in cases where recvmmsg() is available and not. - */ -static inline rsRetVal -processPacket(thrdInfo_t *pThrd, struct lstn_s *lstn, struct sockaddr_storage *frominetPrev, int *pbIsPermitted, - uchar *rcvBuf, ssize_t lenRcvBuf, struct syslogTime *stTime, time_t ttGenTime, - struct sockaddr_storage *frominet, socklen_t socklen, multi_submit_t *multiSub) +/* accept a new ruleset to bind. Checks if it exists and complains, if not */ +static rsRetVal +setRuleset(void __attribute__((unused)) *pVal, uchar *pszName) { + ruleset_t *pRuleset; + rsRetVal localRet; DEFiRet; - msg_t *pMsg; - - assert(pThrd != NULL); - if(lenRcvBuf == 0) - FINALIZE; /* this looks a bit strange, but practice shows it happens... */ - - /* if we reach this point, we had a good receive and can process the packet received */ - /* check if we have a different sender than before, if so, we need to query some new values */ - if(bDoACLCheck) { - socklen = sizeof(struct sockaddr_storage); - if(net.CmpHost(frominet, frominetPrev, socklen) != 0) { - memcpy(frominetPrev, frominet, socklen); /* update cache indicator */ - /* Here we check if a host is permitted to send us syslog messages. If it isn't, - * we do not further process the message but log a warning (if we are - * configured to do this). However, if the check would require name resolution, - * it is postponed to the main queue. See also my blog post at - * http://blog.gerhards.net/2009/11/acls-imudp-and-accepting-messages.html - * rgerhards, 2009-11-16 - */ - *pbIsPermitted = net.isAllowedSender2((uchar*)"UDP", - (struct sockaddr *)frominet, "", 0); - - if(*pbIsPermitted == 0) { - DBGPRINTF("msg is not from an allowed sender\n"); - if(glbl.GetOption_DisallowWarning) { - time_t tt; - datetime.GetTime(&tt); - if(tt > ttLastDiscard + 60) { - ttLastDiscard = tt; - errmsg.LogError(0, NO_ERRCODE, - "UDP message from disallowed sender discarded"); - } - } - } - } - } else { - *pbIsPermitted = 1; /* no check -> everything permitted */ - } - - DBGPRINTF("recv(%d,%d),acl:%d,msg:%.128s\n", lstn->sock, (int) lenRcvBuf, *pbIsPermitted, rcvBuf); - - if(*pbIsPermitted != 0) { - /* we now create our own message object and submit it to the queue */ - CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime)); - MsgSetRawMsg(pMsg, (char*)rcvBuf, lenRcvBuf); - MsgSetInputName(pMsg, lstn->pInputName); - MsgSetRuleset(pMsg, lstn->pRuleset); - MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY); - if(lstn->dfltTZ != NULL) - MsgSetDfltTZ(pMsg, (char*) lstn->dfltTZ); - pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME | NEEDS_DNSRESOL; - if(*pbIsPermitted == 2) - pMsg->msgFlags |= NEEDS_ACLCHK_U; /* request ACL check after resolution */ - CHKiRet(msgSetFromSockinfo(pMsg, frominet)); - CHKiRet(ratelimitAddMsg(lstn->ratelimiter, multiSub, pMsg)); - STATSCOUNTER_INC(lstn->ctrSubmit, lstn->mutCtrSubmit); + localRet = ruleset.GetRuleset(&pRuleset, pszName); + if(localRet == RS_RET_NOT_FOUND) { + errmsg.LogError(0, NO_ERRCODE, "error: ruleset '%s' not found - ignored", pszName); } + CHKiRet(localRet); + pBindRuleset = pRuleset; + DBGPRINTF("imudp current bind ruleset %p: '%s'\n", pRuleset, pszName); finalize_it: + free(pszName); /* no longer needed */ RETiRet; } - - -/* The following "two" functions are helpers to runInput. Actually, it is - * just one function. Depending on whether or not we have recvmmsg(), - * an appropriate version is compiled (as such we need to maintain both!). - */ -#ifdef HAVE_RECVMMSG -static inline rsRetVal -processSocket(struct wrkrInfo_s *pWrkr, struct lstn_s *lstn, struct sockaddr_storage *frominetPrev, int *pbIsPermitted) -{ - DEFiRet; - int iNbrTimeUsed; - time_t ttGenTime; - struct syslogTime stTime; - char errStr[1024]; - msg_t *pMsgs[CONF_NUM_MULTISUB]; - multi_submit_t multiSub; - int nelem; - int i; - - multiSub.ppMsgs = pMsgs; - multiSub.maxElem = CONF_NUM_MULTISUB; - multiSub.nElem = 0; - iNbrTimeUsed = 0; - while(1) { /* loop is terminated if we have a "bad" receive, done below in the body */ - if(pWrkr->pThrd->bShallStop == RSTRUE) - ABORT_FINALIZE(RS_RET_FORCE_TERM); - memset(pWrkr->recvmsg_iov, 0, runModConf->batchSize * sizeof(struct iovec)); - memset(pWrkr->recvmsg_mmh, 0, runModConf->batchSize * sizeof(struct mmsghdr)); - for(i = 0 ; i < runModConf->batchSize ; ++i) { - pWrkr->recvmsg_iov[i].iov_base = pWrkr->pRcvBuf+(i*(iMaxLine+1)); - pWrkr->recvmsg_iov[i].iov_len = iMaxLine; - pWrkr->recvmsg_mmh[i].msg_hdr.msg_namelen = sizeof(struct sockaddr_storage); - pWrkr->recvmsg_mmh[i].msg_hdr.msg_name = &(pWrkr->frominet[i]); - pWrkr->recvmsg_mmh[i].msg_hdr.msg_iov = &(pWrkr->recvmsg_iov[i]); - pWrkr->recvmsg_mmh[i].msg_hdr.msg_iovlen = 1; - } - nelem = recvmmsg(lstn->sock, pWrkr->recvmsg_mmh, runModConf->batchSize, 0, NULL); - STATSCOUNTER_INC(pWrkr->ctrCall_recvmmsg, pWrkr->mutCtrCall_recvmmsg); - DBGPRINTF("imudp: recvmmsg returned %d\n", nelem); - if(nelem < 0 && errno == ENOSYS) { - /* be careful: some versions of valgrind do not support recvmmsg()! */ - DBGPRINTF("imudp: error ENOSYS on call to recvmmsg() - fall back to recvmsg\n"); - nelem = recvmsg(lstn->sock, &(pWrkr->recvmsg_mmh[0].msg_hdr), 0); - STATSCOUNTER_INC(pWrkr->ctrCall_recvmsg, pWrkr->mutCtrCall_recvmsg); - if(nelem >= 0) { - pWrkr->recvmsg_mmh[0].msg_len = nelem; - nelem = 1; - } - } - if(nelem < 0) { - if(errno != EINTR && errno != EAGAIN) { - rs_strerror_r(errno, errStr, sizeof(errStr)); - DBGPRINTF("INET socket error: %d = %s.\n", errno, errStr); - errmsg.LogError(errno, NO_ERRCODE, "imudp: error receiving on socket: %s", errStr); - } - ABORT_FINALIZE(RS_RET_ERR); // this most often is NOT an error, state is not checked by caller! - } - - if((runModConf->iTimeRequery == 0) || (iNbrTimeUsed++ % runModConf->iTimeRequery) == 0) { - datetime.getCurrTime(&stTime, &ttGenTime); - } - - pWrkr->ctrMsgsRcvd += nelem; - for(i = 0 ; i < nelem ; ++i) { - processPacket(pWrkr->pThrd, lstn, frominetPrev, pbIsPermitted, pWrkr->recvmsg_mmh[i].msg_hdr.msg_iov->iov_base, - pWrkr->recvmsg_mmh[i].msg_len, &stTime, ttGenTime, &(pWrkr->frominet[i]), - pWrkr->recvmsg_mmh[i].msg_hdr.msg_namelen, &multiSub); - } - } - -finalize_it: - multiSubmitFlush(&multiSub); - RETiRet; -} -#else /* we do not have recvmmsg() */ /* This function is a helper to runInput. I have extracted it * from the main loop just so that we do not have that large amount of code * in a single place. This function takes a socket and pulls messages from @@ -513,184 +297,137 @@ * on scheduling order. -- rgerhards, 2008-10-02 */ static inline rsRetVal -processSocket(struct wrkrInfo_s *pWrkr, struct lstn_s *lstn, struct sockaddr_storage *frominetPrev, int *pbIsPermitted) +processSocket(thrdInfo_t *pThrd, struct lstn_s *lstn, struct sockaddr_storage *frominetPrev, int *pbIsPermitted) { + DEFiRet; int iNbrTimeUsed; time_t ttGenTime; struct syslogTime stTime; + socklen_t socklen; ssize_t lenRcvBuf; struct sockaddr_storage frominet; - multi_submit_t multiSub; - msg_t *pMsgs[CONF_NUM_MULTISUB]; + msg_t *pMsg; + prop_t *propFromHost = NULL; + prop_t *propFromHostIP = NULL; char errStr[1024]; - struct msghdr mh; - struct iovec iov[1]; - DEFiRet; - multiSub.ppMsgs = pMsgs; - multiSub.maxElem = CONF_NUM_MULTISUB; - multiSub.nElem = 0; + assert(pThrd != NULL); iNbrTimeUsed = 0; while(1) { /* loop is terminated if we have a bad receive, done below in the body */ - if(pWrkr->pThrd->bShallStop == RSTRUE) + if(pThrd->bShallStop == RSTRUE) ABORT_FINALIZE(RS_RET_FORCE_TERM); - memset(iov, 0, sizeof(iov)); - iov[0].iov_base = pWrkr->pRcvBuf; - iov[0].iov_len = iMaxLine; - memset(&mh, 0, sizeof(mh)); - mh.msg_name = &frominet; - mh.msg_namelen = sizeof(struct sockaddr_storage); - mh.msg_iov = iov; - mh.msg_iovlen = 1; - lenRcvBuf = recvmsg(lstn->sock, &mh, 0); - STATSCOUNTER_INC(pWrkr->ctrCall_recvmsg, pWrkr->mutCtrCall_recvmsg); + socklen = sizeof(struct sockaddr_storage); + lenRcvBuf = recvfrom(lstn->sock, (char*) pRcvBuf, iMaxLine, 0, (struct sockaddr *)&frominet, &socklen); if(lenRcvBuf < 0) { if(errno != EINTR && errno != EAGAIN) { rs_strerror_r(errno, errStr, sizeof(errStr)); DBGPRINTF("INET socket error: %d = %s.\n", errno, errStr); - errmsg.LogError(errno, NO_ERRCODE, "imudp: error receiving on socket: %s", errStr); + errmsg.LogError(errno, NO_ERRCODE, "recvfrom inet"); } ABORT_FINALIZE(RS_RET_ERR); // this most often is NOT an error, state is not checked by caller! } - ++pWrkr->ctrMsgsRcvd; - if((runModConf->iTimeRequery == 0) || (iNbrTimeUsed++ % runModConf->iTimeRequery) == 0) { - datetime.getCurrTime(&stTime, &ttGenTime); - } - - CHKiRet(processPacket(pWrkr->pThrd, lstn, frominetPrev, pbIsPermitted, pWrkr->pRcvBuf, lenRcvBuf, &stTime, - ttGenTime, &frominet, mh.msg_namelen, &multiSub)); - } - - -finalize_it: - multiSubmitFlush(&multiSub); - RETiRet; -} -#endif /* #ifdef HAVE_RECVMMSG */ + if(lenRcvBuf == 0) + continue; /* this looks a bit strange, but practice shows it happens... */ + /* if we reach this point, we had a good receive and can process the packet received */ + /* check if we have a different sender than before, if so, we need to query some new values */ + if(bDoACLCheck) { + if(net.CmpHost(&frominet, frominetPrev, socklen) != 0) { + memcpy(frominetPrev, &frominet, socklen); /* update cache indicator */ + /* Here we check if a host is permitted to send us syslog messages. If it isn't, + * we do not further process the message but log a warning (if we are + * configured to do this). However, if the check would require name resolution, + * it is postponed to the main queue. See also my blog post at + * http://blog.gerhards.net/2009/11/acls-imudp-and-accepting-messages.html + * rgerhards, 2009-11-16 + */ + *pbIsPermitted = net.isAllowedSender2((uchar*)"UDP", + (struct sockaddr *)&frominet, "", 0); + + if(*pbIsPermitted == 0) { + DBGPRINTF("msg is not from an allowed sender\n"); + if(glbl.GetOption_DisallowWarning) { + time_t tt; + datetime.GetTime(&tt); + if(tt > ttLastDiscard + 60) { + ttLastDiscard = tt; + errmsg.LogError(0, NO_ERRCODE, + "UDP message from disallowed sender discarded"); + } + } + } + } + } else { + *pbIsPermitted = 1; /* no check -> everything permitted */ + } -/* check configured scheduling priority. - * Precondition: iSchedPolicy must have been set - */ -static inline rsRetVal -checkSchedulingPriority(modConfData_t *modConf) -{ - DEFiRet; + DBGPRINTF("recv(%d,%d),acl:%d,msg:%s\n", lstn->sock, (int) lenRcvBuf, *pbIsPermitted, pRcvBuf); -#ifdef HAVE_SCHED_GET_PRIORITY_MAX - if( modConf->iSchedPrio < sched_get_priority_min(modConf->iSchedPolicy) - || modConf->iSchedPrio > sched_get_priority_max(modConf->iSchedPolicy)) { - errmsg.LogError(0, NO_ERRCODE, - "imudp: scheduling priority %d out of range (%d - %d)" - " for scheduling policy '%s' - ignoring settings", - modConf->iSchedPrio, - sched_get_priority_min(modConf->iSchedPolicy), - sched_get_priority_max(modConf->iSchedPolicy), - modConf->pszSchedPolicy); - ABORT_FINALIZE(RS_RET_VALIDATION_RUN); + if(*pbIsPermitted != 0) { + if((iTimeRequery == 0) || (iNbrTimeUsed++ % iTimeRequery) == 0) { + datetime.getCurrTime(&stTime, &ttGenTime); + } + /* we now create our own message object and submit it to the queue */ + CHKiRet(msgConstructWithTime(&pMsg, &stTime, ttGenTime)); + MsgSetRawMsg(pMsg, (char*)pRcvBuf, lenRcvBuf); + MsgSetInputName(pMsg, pInputName); + MsgSetRuleset(pMsg, lstn->pRuleset); + MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY); + pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME | NEEDS_DNSRESOL; + if(*pbIsPermitted == 2) + pMsg->msgFlags |= NEEDS_ACLCHK_U; /* request ACL check after resolution */ + CHKiRet(msgSetFromSockinfo(pMsg, &frominet)); + CHKiRet(submitMsg(pMsg)); + STATSCOUNTER_INC(lstn->ctrSubmit, lstn->mutCtrSubmit); + } } -#endif finalize_it: - RETiRet; -} - - -/* check scheduling policy string and, if valid, set its - * numeric equivalent in current load config - */ -static rsRetVal -checkSchedulingPolicy(modConfData_t *modConf) -{ - DEFiRet; + if(propFromHost != NULL) + prop.Destruct(&propFromHost); + if(propFromHostIP != NULL) + prop.Destruct(&propFromHostIP); - if (0) { /* trick to use conditional compilation */ -#ifdef SCHED_FIFO - } else if (!strcasecmp((char*)modConf->pszSchedPolicy, "fifo")) { - modConf->iSchedPolicy = SCHED_FIFO; -#endif -#ifdef SCHED_RR - } else if (!strcasecmp((char*)modConf->pszSchedPolicy, "rr")) { - modConf->iSchedPolicy = SCHED_RR; -#endif -#ifdef SCHED_OTHER - } else if (!strcasecmp((char*)modConf->pszSchedPolicy, "other")) { - modConf->iSchedPolicy = SCHED_OTHER; -#endif - } else { - errmsg.LogError(errno, NO_ERRCODE, - "imudp: invalid scheduling policy '%s' " - "- ignoring setting", modConf->pszSchedPolicy); - ABORT_FINALIZE(RS_RET_ERR_SCHED_PARAMS); - } -finalize_it: RETiRet; } -/* checks scheduling parameters during config check phase */ -static rsRetVal -checkSchedParam(modConfData_t *modConf) +static void set_thread_schedparam(void) { - DEFiRet; + struct sched_param sparam; - if(modConf->pszSchedPolicy != NULL && modConf->iSchedPrio == SCHED_PRIO_UNSET) { - errmsg.LogError(0, RS_RET_ERR_SCHED_PARAMS, + if (pszSchedPolicy != NULL && seen_iSchedPrio == 0) { + errmsg.LogError(0, NO_ERRCODE, "imudp: scheduling policy set, but without priority - ignoring settings"); - ABORT_FINALIZE(RS_RET_ERR_SCHED_PARAMS); - } else if(modConf->pszSchedPolicy == NULL && modConf->iSchedPrio != SCHED_PRIO_UNSET) { - errmsg.LogError(0, RS_RET_ERR_SCHED_PARAMS, + } else if (pszSchedPolicy == NULL && seen_iSchedPrio != 0) { + errmsg.LogError(0, NO_ERRCODE, "imudp: scheduling priority set, but without policy - ignoring settings"); - ABORT_FINALIZE(RS_RET_ERR_SCHED_PARAMS); - } else if(modConf->pszSchedPolicy != NULL && modConf->iSchedPrio != SCHED_PRIO_UNSET) { - /* we have parameters set, so check them */ - CHKiRet(checkSchedulingPolicy(modConf)); - CHKiRet(checkSchedulingPriority(modConf)); - } else { /* nothing set */ - modConf->iSchedPrio = SCHED_PRIO_UNSET; /* prevents doing the activation call */ - } + } else if (pszSchedPolicy != NULL && seen_iSchedPrio != 0 && + check_scheduling_priority(0) == 0) { #ifndef HAVE_PTHREAD_SETSCHEDPARAM - errmsg.LogError(0, NO_ERRCODE, - "imudp: cannot set thread scheduling policy, " - "pthread_setschedparam() not available"); - ABORT_FINALIZE(RS_RET_ERR_SCHED_PARAMS); + errmsg.LogError(0, NO_ERRCODE, + "imudp: cannot set thread scheduling policy, " + "pthread_setschedparam() not available"); +#else + int err; + + memset(&sparam, 0, sizeof sparam); + sparam.sched_priority = iSchedPrio; + dbgprintf("imudp trying to set sched policy to '%s', prio %d\n", + pszSchedPolicy, iSchedPrio); + err = pthread_setschedparam(pthread_self(), iSchedPolicy, &sparam); + if (err != 0) { + errmsg.LogError(err, NO_ERRCODE, "imudp: pthread_setschedparam() failed"); + } #endif - -finalize_it: - if(iRet != RS_RET_OK) - modConf->iSchedPrio = SCHED_PRIO_UNSET; /* prevents doing the activation call */ - - RETiRet; -} - -/* set the configured scheduling policy (if possible) */ -static rsRetVal -setSchedParams(modConfData_t *modConf) -{ - DEFiRet; - -# ifdef HAVE_PTHREAD_SETSCHEDPARAM - int err; - struct sched_param sparam; - - if(modConf->iSchedPrio == SCHED_PRIO_UNSET) - FINALIZE; - - memset(&sparam, 0, sizeof sparam); - sparam.sched_priority = modConf->iSchedPrio; - dbgprintf("imudp trying to set sched policy to '%s', prio %d\n", - modConf->pszSchedPolicy, modConf->iSchedPrio); - err = pthread_setschedparam(pthread_self(), modConf->iSchedPolicy, &sparam); - if(err != 0) { - errmsg.LogError(err, NO_ERRCODE, "imudp: pthread_setschedparam() failed - ignoring"); } -# endif -finalize_it: - RETiRet; + if (pszSchedPolicy != NULL) { + free(pszSchedPolicy); + pszSchedPolicy = NULL; + } } - /* This function implements the main reception loop. Depending on the environment, * we either use the traditional (but slower) select() or the Linux-specific epoll() * interface. ./configure settings control which one is used. @@ -698,7 +435,7 @@ */ #if defined(HAVE_EPOLL_CREATE1) || defined(HAVE_EPOLL_CREATE) #define NUM_EPOLL_EVENTS 10 -rsRetVal rcvMainLoop(struct wrkrInfo_s *pWrkr) +rsRetVal rcvMainLoop(thrdInfo_t *pThrd) { DEFiRet; int nfds; @@ -715,6 +452,7 @@ /* start "name caching" algo by making sure the previous system indicator * is invalidated. */ + set_thread_schedparam(); bIsPermitted = 0; memset(&frominetPrev, 0, sizeof(frominetPrev)); @@ -746,7 +484,7 @@ for(lstn = lcnfRoot ; lstn != NULL ; lstn = lstn->next) { if(lstn->sock != -1) { udpEPollEvt[i].events = EPOLLIN | EPOLLET; - udpEPollEvt[i].data.ptr = lstn; + udpEPollEvt[i].data.u64 = (long long unsigned) lstn; if(epoll_ctl(efd, EPOLL_CTL_ADD, lstn->sock, &(udpEPollEvt[i])) < 0) { rs_strerror_r(errno, errStr, sizeof(errStr)); errmsg.LogError(errno, NO_ERRCODE, "epoll_ctrl failed on fd %d with %s\n", @@ -761,11 +499,11 @@ nfds = epoll_wait(efd, currEvt, NUM_EPOLL_EVENTS, -1); DBGPRINTF("imudp: epoll_wait() returned with %d fds\n", nfds); - if(pWrkr->pThrd->bShallStop == RSTRUE) + if(pThrd->bShallStop == RSTRUE) break; /* terminate input! */ for(i = 0 ; i < nfds ; ++i) { - processSocket(pWrkr, currEvt[i].data.ptr, &frominetPrev, &bIsPermitted); + processSocket(pThrd, (struct lstn_s*)currEvt[i].data.u64, &frominetPrev, &bIsPermitted); } } @@ -777,7 +515,7 @@ } #else /* #if HAVE_EPOLL_CREATE1 */ /* this is the code for the select() interface */ -rsRetVal rcvMainLoop(thrdInfo_t *pWrkr) +rsRetVal rcvMainLoop(thrdInfo_t *pThrd) { DEFiRet; int maxfds; @@ -790,6 +528,7 @@ /* start "name caching" algo by making sure the previous system indicator * is invalidated. */ + set_thread_schedparam(); bIsPermitted = 0; memset(&frominetPrev, 0, sizeof(frominetPrev)); DBGPRINTF("imudp uses select()\n"); @@ -824,7 +563,7 @@ for(lstn = lcnfRoot ; nfds && lstn != NULL ; lstn = lstn->next) { if(FD_ISSET(lstn->sock, &readfds)) { - processSocket(pWrkr, lstn, &frominetPrev, &bIsPermitted); + processSocket(pThrd, lstn, &frominetPrev, &bIsPermitted); --nfds; /* indicate we have processed one descriptor */ } } @@ -835,348 +574,59 @@ } #endif /* #if HAVE_EPOLL_CREATE1 */ - -static inline rsRetVal -createListner(es_str_t *port, struct cnfparamvals *pvals) -{ - instanceConf_t *inst; - int i; - DEFiRet; - - CHKiRet(createInstance(&inst)); - inst->pszBindPort = (uchar*)es_str2cstr(port, NULL); - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "port")) { - continue; /* array, handled by caller */ - } else if(!strcmp(inppblk.descr[i].name, "inputname")) { - inst->inputname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "inputname.appendport")) { - inst->bAppendPortToInpname = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "defaulttz")) { - inst->dfltTZ = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "address")) { - inst->pszBindAddr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ruleset")) { - inst->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.burst")) { - inst->ratelimitBurst = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.interval")) { - inst->ratelimitInterval = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "rcvbufsize")) { - inst->rcvbuf = (int) pvals[i].val.d.n; - } else { - dbgprintf("imudp: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - } -finalize_it: - RETiRet; -} - - -BEGINnewInpInst - struct cnfparamvals *pvals; - int i; - int portIdx; -CODESTARTnewInpInst - DBGPRINTF("newInpInst (imudp)\n"); - - if((pvals = nvlstGetParams(lst, &inppblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - if(Debug) { - dbgprintf("input param blk in imudp:\n"); - cnfparamsPrint(&inppblk, pvals); - } - - portIdx = cnfparamGetIdx(&inppblk, "port"); - assert(portIdx != -1); - for(i = 0 ; i < pvals[portIdx].val.d.ar->nmemb ; ++i) { - createListner(pvals[portIdx].val.d.ar->arr[i], pvals); - } - -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - loadModConf->configSetViaV2Method = 0; - loadModConf->wrkrMax = 1; /* conservative, but least msg reordering */ - loadModConf->batchSize = BATCH_SIZE_DFLT; - loadModConf->iTimeRequery = TIME_REQUERY_DFLT; - loadModConf->iSchedPrio = SCHED_PRIO_UNSET; - loadModConf->pszSchedPolicy = NULL; - bLegacyCnfModGlobalsPermitted = 1; - /* init legacy config vars */ - cs.pszBindRuleset = NULL; - cs.pszSchedPolicy = NULL; - cs.pszBindAddr = NULL; - cs.iSchedPrio = SCHED_PRIO_UNSET; - cs.iTimeRequery = TIME_REQUERY_DFLT; -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; - int wrkrMax; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "imudp: error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imudp:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "timerequery")) { - loadModConf->iTimeRequery = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "batchsize")) { - loadModConf->batchSize = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "schedulingpriority")) { - loadModConf->iSchedPrio = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "schedulingpolicy")) { - loadModConf->pszSchedPolicy = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "threads")) { - wrkrMax = (int) pvals[i].val.d.n; - if(wrkrMax > MAX_WRKR_THREADS) { - errmsg.LogError(0, RS_RET_PARAM_ERROR, "imudp: configured for %d" - "worker threads, but maximum permitted is %d", - wrkrMax, MAX_WRKR_THREADS); - loadModConf->wrkrMax = MAX_WRKR_THREADS; - } else { - loadModConf->wrkrMax = wrkrMax; - } - } else { - dbgprintf("imudp: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - /* remove all of our legacy handlers, as they can not used in addition - * the the new-style config method. - */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - loadModConf->iSchedPrio = cs.iSchedPrio; - loadModConf->iTimeRequery = cs.iTimeRequery; - if((cs.pszSchedPolicy != NULL) && (cs.pszSchedPolicy[0] != '\0')) { - CHKmalloc(loadModConf->pszSchedPolicy = ustrdup(cs.pszSchedPolicy)); - } - } - -finalize_it: - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.pszBindRuleset); - free(cs.pszSchedPolicy); - free(cs.pszBindAddr); -ENDendCnfLoad - - -BEGINcheckCnf - instanceConf_t *inst; -CODESTARTcheckCnf - checkSchedParam(pModConf); /* this can not cause fatal errors */ - for(inst = pModConf->root ; inst != NULL ; inst = inst->next) { - std_checkRuleset(pModConf, inst); - } - if(pModConf->root == NULL) { - errmsg.LogError(0, RS_RET_NO_LISTNERS , "imudp: module loaded, but " - "no listeners defined - no input will be gathered"); - iRet = RS_RET_NO_LISTNERS; - } -ENDcheckCnf - - -BEGINactivateCnfPrePrivDrop - instanceConf_t *inst; -CODESTARTactivateCnfPrePrivDrop - runModConf = pModConf; - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - addListner(inst); - } - /* if we could not set up any listeners, there is no point in running... */ - if(lcnfRoot == NULL) { - errmsg.LogError(0, NO_ERRCODE, "imudp: no listeners could be started, " - "input not activated.\n"); - ABORT_FINALIZE(RS_RET_NO_RUN); - } - -finalize_it: -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf - int i; - int lenRcvBuf; -CODESTARTactivateCnf - /* caching various settings */ - iMaxLine = glbl.GetMaxLine(); - lenRcvBuf = (iMaxLine + 1) * sizeof(char); -# ifdef HAVE_RECVMMSG - lenRcvBuf *= runModConf->batchSize; -# endif - for(i = 0 ; i < runModConf->wrkrMax ; ++i) { -# ifdef HAVE_RECVMMSG - CHKmalloc(wrkrInfo[i].recvmsg_iov = MALLOC(runModConf->batchSize * sizeof(struct iovec))); - CHKmalloc(wrkrInfo[i].recvmsg_mmh = MALLOC(runModConf->batchSize * sizeof(struct mmsghdr))); - CHKmalloc(wrkrInfo[i].frominet = MALLOC(runModConf->batchSize * sizeof(struct sockaddr_storage))); -# endif - CHKmalloc(wrkrInfo[i].pRcvBuf = MALLOC(lenRcvBuf)); - wrkrInfo[i].id = i; - } -finalize_it: -ENDactivateCnf - - -BEGINfreeCnf - instanceConf_t *inst, *del; -CODESTARTfreeCnf - for(inst = pModConf->root ; inst != NULL ; ) { - free(inst->pszBindPort); - free(inst->pszBindAddr); - free(inst->inputname); - free(inst->dfltTZ); - del = inst; - inst = inst->next; - free(del); - } -ENDfreeCnf - - -static void * -wrkr(void *myself) -{ - struct wrkrInfo_s *pWrkr = (struct wrkrInfo_s*) myself; -# if HAVE_PRCTL && defined PR_SET_NAME - uchar *pszDbgHdr; -# endif - uchar thrdName[32]; - - snprintf((char*)thrdName, sizeof(thrdName), "imudp(w%d)", pWrkr->id); -# if HAVE_PRCTL && defined PR_SET_NAME - /* set thread name - we ignore if the call fails, has no harsh consequences... */ - if(prctl(PR_SET_NAME, thrdName, 0, 0, 0) != 0) { - DBGPRINTF("prctl failed, not setting thread name for '%s'\n", thrdName); - } -# endif - dbgOutputTID((char*)thrdName); - - /* Note well: the setting of scheduling parameters will not work - * when we dropped privileges (if the user is not sufficiently - * privileged, of course). Howerver, we can't change the - * scheduling params in PrePrivDrop(), as at that point our thread - * is not yet created. So at least as an interim solution, we do - * NOT support both setting sched parameters and dropping - * privileges within the same instance. - */ - setSchedParams(runModConf); - - /* support statistics gathering */ - statsobj.Construct(&(pWrkr->stats)); - statsobj.SetName(pWrkr->stats, thrdName); - STATSCOUNTER_INIT(pWrkr->ctrCall_recvmmsg, pWrkr->mutCtrCall_recvmmsg); - statsobj.AddCounter(pWrkr->stats, UCHAR_CONSTANT("called.recvmmsg"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pWrkr->ctrCall_recvmmsg)); - STATSCOUNTER_INIT(pWrkr->ctrCall_recvmsg, pWrkr->mutCtrCall_recvmsg); - statsobj.AddCounter(pWrkr->stats, UCHAR_CONSTANT("called.recvmsg"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pWrkr->ctrCall_recvmsg)); - STATSCOUNTER_INIT(pWrkr->ctrMsgsRcvd, pWrkr->mutCtrMsgsRcvd); - statsobj.AddCounter(pWrkr->stats, UCHAR_CONSTANT("msgs.received"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pWrkr->ctrMsgsRcvd)); - statsobj.ConstructFinalize(pWrkr->stats); - - rcvMainLoop(pWrkr); - - /* cleanup */ - return NULL; -} - /* This function is called to gather input. - * In essence, it just starts the pool of workers. To save resources, - * we run one of the workers on our own thread -- otherwise that thread would - * just idle around and wait for the workers to finish. + * Note that sock must be non-NULL because otherwise we would not have + * indicated that we want to run (or we have a programming error ;)). -- rgerhards, 2008-10-02 */ BEGINrunInput - int i; - pthread_attr_t wrkrThrdAttr; CODESTARTrunInput - pthread_attr_init(&wrkrThrdAttr); - pthread_attr_setstacksize(&wrkrThrdAttr, 4096*1024); - for(i = 0 ; i < runModConf->wrkrMax - 1 ; ++i) { - wrkrInfo[i].pThrd = pThrd; - pthread_create(&wrkrInfo[i].tid, &wrkrThrdAttr, wrkr, &(wrkrInfo[i])); - } - pthread_attr_destroy(&wrkrThrdAttr); - - wrkrInfo[i].pThrd = pThrd; - wrkrInfo[i].id = i; - wrkr(&wrkrInfo[i]); - - for(i = 0 ; i < runModConf->wrkrMax - 1 ; ++i) { - pthread_join(wrkrInfo[i].tid, NULL); - } + iRet = rcvMainLoop(pThrd); ENDrunInput /* initialize and return if will run or not */ BEGINwillRun CODESTARTwillRun + /* we need to create the inputName property (only once during our lifetime) */ + CHKiRet(prop.Construct(&pInputName)); + CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imudp"), sizeof("imudp") - 1)); + CHKiRet(prop.ConstructFinalize(pInputName)); + net.PrintAllowedSenders(1); /* UDP */ net.HasRestrictions(UCHAR_CONSTANT("UDP"), &bDoACLCheck); /* UDP */ + + /* if we could not set up any listners, there is no point in running... */ + if(lcnfRoot == NULL) { + DBGPRINTF("imudp: no listeners configured, will not run\n"); + ABORT_FINALIZE(RS_RET_NO_RUN); + } + + iMaxLine = glbl.GetMaxLine(); + + CHKmalloc(pRcvBuf = MALLOC((iMaxLine + 1) * sizeof(char))); +finalize_it: ENDwillRun BEGINafterRun struct lstn_s *lstn, *lstnDel; - int i; CODESTARTafterRun /* do cleanup here */ net.clearAllowedSenders((uchar*)"UDP"); for(lstn = lcnfRoot ; lstn != NULL ; ) { statsobj.Destruct(&(lstn->stats)); - ratelimitDestruct(lstn->ratelimiter); close(lstn->sock); - prop.Destruct(&lstn->pInputName); lstnDel = lstn; lstn = lstn->next; free(lstnDel); } lcnfRoot = lcnfLast = NULL; - for(i = 0 ; i < runModConf->wrkrMax ; ++i) { -# ifdef HAVE_RECVMMSG - free(wrkrInfo[i].recvmsg_iov); - free(wrkrInfo[i].recvmsg_mmh); - free(wrkrInfo[i].frominet); -# endif - free(wrkrInfo[i].pRcvBuf); + if(pRcvBuf != NULL) { + free(pRcvBuf); + pRcvBuf = NULL; } + if(pInputName != NULL) + prop.Destruct(&pInputName); ENDafterRun @@ -1203,23 +653,16 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - free(cs.pszBindAddr); - cs.pszBindAddr = NULL; - free(cs.pszSchedPolicy); - cs.pszSchedPolicy = NULL; - free(cs.pszBindRuleset); - cs.pszBindRuleset = NULL; - cs.iSchedPrio = SCHED_PRIO_UNSET; - cs.iTimeRequery = TIME_REQUERY_DFLT;/* the default is to query only every second time */ + if(pszBindAddr != NULL) { + free(pszBindAddr); + pszBindAddr = NULL; + } + iTimeRequery = TIME_REQUERY_DFLT;/* the default is to query only every second time */ return RS_RET_OK; } @@ -1236,28 +679,19 @@ CHKiRet(objUse(ruleset, CORE_COMPONENT)); CHKiRet(objUse(net, LM_NET_FILENAME)); - DBGPRINTF("imudp: version %s initializing\n", VERSION); -# ifdef HAVE_RECVMMSG - DBGPRINTF("imdup: support for recvmmsg() present\n"); -# endif - /* register config file handlers */ CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputudpserverbindruleset", 0, eCmdHdlrGetWord, - NULL, &cs.pszBindRuleset, STD_LOADABLE_MODULE_ID)); + setRuleset, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"udpserverrun", 0, eCmdHdlrGetWord, - addInstance, NULL, STD_LOADABLE_MODULE_ID)); + addListner, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"udpserveraddress", 0, eCmdHdlrGetWord, - NULL, &cs.pszBindAddr, STD_LOADABLE_MODULE_ID)); - /* module-global config params - will be disabled in configs that are loaded - * via module(...). - */ - CHKiRet(regCfSysLineHdlr2((uchar *)"imudpschedulingpolicy", 0, eCmdHdlrGetWord, - NULL, &cs.pszSchedPolicy, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"imudpschedulingpriority", 0, eCmdHdlrInt, - NULL, &cs.iSchedPrio, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"udpservertimerequery", 0, eCmdHdlrInt, - NULL, &cs.iTimeRequery, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - + NULL, &pszBindAddr, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"imudpschedulingpolicy", 0, eCmdHdlrGetWord, + &set_scheduling_policy, &pszSchedPolicy, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"imudpschedulingpriority", 0, eCmdHdlrInt, + &set_scheduling_priority, &iSchedPrio, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"udpservertimerequery", 0, eCmdHdlrInt, + NULL, &iTimeRequery, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/imudp/Makefile.in rsyslog-5.10.1/plugins/imudp/Makefile.in --- rsyslog-7.6.0/plugins/imudp/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imudp/Makefile.in 2012-10-17 14:42:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = imudp_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_imudp_la_OBJECTS = imudp_la-imudp.lo imudp_la_OBJECTS = $(am_imudp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imudp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imudp_la_SOURCES) DIST_SOURCES = $(imudp_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imudp.la: $(imudp_la_OBJECTS) $(imudp_la_DEPENDENCIES) $(EXTRA_imudp_la_DEPENDENCIES) +imudp.la: $(imudp_la_OBJECTS) $(imudp_la_DEPENDENCIES) $(AM_V_CCLD)$(imudp_la_LINK) -rpath $(pkglibdir) $(imudp_la_OBJECTS) $(imudp_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imudp_la-imudp.lo: imudp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imudp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imudp_la-imudp.lo -MD -MP -MF $(DEPDIR)/imudp_la-imudp.Tpo -c -o imudp_la-imudp.lo `test -f 'imudp.c' || echo '$(srcdir)/'`imudp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imudp_la-imudp.Tpo $(DEPDIR)/imudp_la-imudp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imudp.c' object='imudp_la-imudp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imudp.c' object='imudp_la-imudp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imudp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imudp_la-imudp.lo `test -f 'imudp.c' || echo '$(srcdir)/'`imudp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imudp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imudp_la-imudp.lo `test -f 'imudp.c' || echo '$(srcdir)/'`imudp.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imuxsock/imuxsock.c rsyslog-5.10.1/plugins/imuxsock/imuxsock.c --- rsyslog-7.6.0/plugins/imuxsock/imuxsock.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/imuxsock/imuxsock.c 2012-10-17 14:41:20.000000000 +0000 @@ -6,7 +6,7 @@ * * File begun on 2007-12-20 by RGerhards (extracted from syslogd.c) * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -55,13 +55,12 @@ #include "statsobj.h" #include "datetime.h" #include "hashtable.h" -#include "ratelimit.h" MODULE_TYPE_INPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imuxsock") /* defines */ +#define MAXFUNIX 50 #ifndef _PATH_LOG #ifdef BSD #define _PATH_LOG "/var/run/log" @@ -76,9 +75,6 @@ #define SYSTEMD_PATH_LOG SYSTEMD_JOURNAL "/syslog" #endif -/* forward definitions */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - /* emulate struct ucred for platforms that do not have it */ #ifndef HAVE_SCM_CREDENTIALS struct ucred { int pid; uid_t uid; gid_t gid; }; @@ -99,12 +95,20 @@ DEFobjCurrIf(datetime) DEFobjCurrIf(statsobj) - statsobj_t *modStats; STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit) STATSCOUNTER_DEF(ctrLostRatelimit, mutCtrLostRatelimit) STATSCOUNTER_DEF(ctrNumRatelimiters, mutCtrNumRatelimiters) +struct rs_ratelimit_state { + unsigned short interval; + unsigned short burst; + unsigned done; + unsigned missed; + time_t begin; +}; +typedef struct rs_ratelimit_state rs_ratelimit_state_t; + /* a very simple "hash function" for process IDs - we simply use the * pid itself: it is quite expected that all pids may log some time, but @@ -134,20 +138,16 @@ int flowCtl; /* flow control settings for this socket */ int ratelimitInterval; int ratelimitBurst; - ratelimit_t *dflt_ratelimiter;/*ratelimiter to apply if none else is to be used */ intTiny ratelimitSev; /* severity level (and below) for which rate-limiting shall apply */ struct hashtable *ht; /* our hashtable for rate-limiting */ sbool bParseHost; /* should parser parse host name? read-only after startup */ sbool bCreatePath; /* auto-creation of socket directory? */ sbool bUseCreds; /* pull original creator credentials from socket */ sbool bAnnotate; /* annotate events with trusted properties */ - sbool bParseTrusted; /* parse trusted properties */ sbool bWritePid; /* write original PID into tag */ - sbool bDiscardOwnMsgs; /* discard messages that originated from ourselves */ sbool bUseSysTimeStamp; /* use timestamp from system (instead of from message) */ - sbool bUnlink; /* unlink&re-create socket at start and end of processing */ } lstn_t; -static lstn_t *listeners; +static lstn_t listeners[MAXFUNIX]; static prop_t *pLocalHostIP = NULL; /* there is only one global IP for all internally-generated messages */ static prop_t *pInputName = NULL; /* our inputName currently is always "imudp", and this will hold it */ @@ -155,270 +155,181 @@ * suppress local logging. rgerhards 2005-08-01 * read-only after startup */ -static int nfd = 1; /* number of active unix sockets (socket 0 is always reserved for the system - socket, even if it is not enabled. */ +static int nfd = 1; /* number of Unix sockets open / read-only after startup */ static int sd_fds = 0; /* number of systemd activated sockets */ +/* config settings */ +static int bOmitLocalLogging = 0; +static uchar *pLogSockName = NULL; +static uchar *pLogHostName = NULL; /* host name to use with this socket */ +static int bUseFlowCtl = 0; /* use flow control or not (if yes, only LIGHT is used! */ +static int bIgnoreTimestamp = 1; /* ignore timestamps present in the incoming message? */ +static int bWritePid = 0; /* use credentials from recvmsg() and fixup PID in TAG */ +static int bWritePidSysSock = 0; /* use credentials from recvmsg() and fixup PID in TAG */ +static int bUseSysTimeStamp = 1; /* use timestamp from system (rather than from message) */ +static int bUseSysTimeStampSysSock = 1; /* same, for system log socket */ +static int bAnnotate = 0; /* annotate trusted properties */ +static int bAnnotateSysSock = 0; /* same, for system log socket */ #define DFLT_bCreatePath 0 +static int bCreatePath = DFLT_bCreatePath; /* auto-create socket path? */ #define DFLT_ratelimitInterval 0 +static int ratelimitInterval = DFLT_ratelimitInterval; /* interval in seconds, 0 = off */ +static int ratelimitIntervalSysSock = DFLT_ratelimitInterval; #define DFLT_ratelimitBurst 200 +static int ratelimitBurst = DFLT_ratelimitBurst; /* max nbr of messages in interval */ +static int ratelimitBurstSysSock = DFLT_ratelimitBurst; /* max nbr of messages in interval */ #define DFLT_ratelimitSeverity 1 /* do not rate-limit emergency messages */ -/* config vars for the legacy config system */ -static struct configSettings_s { - int bOmitLocalLogging; - uchar *pLogSockName; - uchar *pLogHostName; /* host name to use with this socket */ - int bUseFlowCtl; /* use flow control or not (if yes, only LIGHT is used!) */ - int bUseFlowCtlSysSock; - int bIgnoreTimestamp; /* ignore timestamps present in the incoming message? */ - int bIgnoreTimestampSysSock; - int bUseSysTimeStamp; /* use timestamp from system (rather than from message) */ - int bUseSysTimeStampSysSock; /* same, for system log socket */ - int bWritePid; /* use credentials from recvmsg() and fixup PID in TAG */ - int bWritePidSysSock; /* use credentials from recvmsg() and fixup PID in TAG */ - int bCreatePath; /* auto-create socket path? */ - int ratelimitInterval; /* interval in seconds, 0 = off */ - int ratelimitIntervalSysSock; - int ratelimitBurst; /* max nbr of messages in interval */ - int ratelimitBurstSysSock; - int ratelimitSeverity; - int ratelimitSeveritySysSock; - int bAnnotate; /* annotate trusted properties */ - int bAnnotateSysSock; /* same, for system log socket */ - int bParseTrusted; /* parse trusted properties */ -} cs; - -/* config vars for the v2 config system (rsyslog v6+) */ -struct instanceConf_s { - uchar *sockName; - uchar *pLogHostName; /* host name to use with this socket */ - sbool bUseFlowCtl; /* use flow control or not (if yes, only LIGHT is used! */ - sbool bIgnoreTimestamp; /* ignore timestamps present in the incoming message? */ - sbool bWritePid; /* use credentials from recvmsg() and fixup PID in TAG */ - sbool bUseSysTimeStamp; /* use timestamp from system (instead of from message) */ - int bCreatePath; /* auto-create socket path? */ - int ratelimitInterval; /* interval in seconds, 0 = off */ - int ratelimitBurst; /* max nbr of messages in interval */ - int ratelimitSeverity; - int bAnnotate; /* annotate trusted properties */ - int bParseTrusted; /* parse trusted properties */ - sbool bDiscardOwnMsgs; /* discard messages that originated from our own pid? */ - sbool bUnlink; - struct instanceConf_s *next; -}; +static int ratelimitSeverity = DFLT_ratelimitSeverity; +static int ratelimitSeveritySysSock = DFLT_ratelimitSeverity; -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - instanceConf_t *root, *tail; - uchar *pLogSockName; - int ratelimitIntervalSysSock; - int ratelimitBurstSysSock; - int ratelimitSeveritySysSock; - int bAnnotateSysSock; - int bParseTrusted; - sbool bIgnoreTimestamp; /* ignore timestamps present in the incoming message? */ - sbool bUseFlowCtl; /* use flow control or not (if yes, only LIGHT is used! */ - sbool bOmitLocalLogging; - sbool bWritePidSysSock; - sbool bUseSysTimeStamp; - sbool bDiscardOwnMsgs; - sbool configSetViaV2Method; - sbool bUnlink; -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current load process */ -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "syssock.use", eCmdHdlrBinary, 0 }, - { "syssock.name", eCmdHdlrGetWord, 0 }, - { "syssock.unlink", eCmdHdlrBinary, 0 }, - { "syssock.ignoretimestamp", eCmdHdlrBinary, 0 }, - { "syssock.ignoreownmessages", eCmdHdlrBinary, 0 }, - { "syssock.flowcontrol", eCmdHdlrBinary, 0 }, - { "syssock.usesystimestamp", eCmdHdlrBinary, 0 }, - { "syssock.annotate", eCmdHdlrBinary, 0 }, - { "syssock.parsetrusted", eCmdHdlrBinary, 0 }, - { "syssock.usepidfromsystem", eCmdHdlrBinary, 0 }, - { "syssock.ratelimit.interval", eCmdHdlrInt, 0 }, - { "syssock.ratelimit.burst", eCmdHdlrInt, 0 }, - { "syssock.ratelimit.severity", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* input instance parameters */ -static struct cnfparamdescr inppdescr[] = { - { "socket", eCmdHdlrString, CNFPARAM_REQUIRED }, /* legacy: addunixlistensocket */ - { "unlink", eCmdHdlrBinary, 0 }, - { "createpath", eCmdHdlrBinary, 0 }, - { "parsetrusted", eCmdHdlrBinary, 0 }, - { "ignoreownmessages", eCmdHdlrBinary, 0 }, - { "hostname", eCmdHdlrString, 0 }, - { "ignoretimestamp", eCmdHdlrBinary, 0 }, - { "flowcontrol", eCmdHdlrBinary, 0 }, - { "usesystimestamp", eCmdHdlrBinary, 0 }, - { "annotate", eCmdHdlrBinary, 0 }, - { "usepidfromsystem", eCmdHdlrBinary, 0 }, - { "ratelimit.interval", eCmdHdlrInt, 0 }, - { "ratelimit.burst", eCmdHdlrInt, 0 }, - { "ratelimit.severity", eCmdHdlrInt, 0 } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; -/* we do not use this, because we do not bind to a ruleset so far - * enable when this is changed: #include "im-helper.h" */ /* must be included AFTER the type definitions! */ - -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ +static void +initRatelimitState(struct rs_ratelimit_state *rs, unsigned short interval, unsigned short burst) +{ + rs->interval = interval; + rs->burst = burst; + rs->done = 0; + rs->missed = 0; + rs->begin = 0; +} -/* create input instance, set default paramters, and - * add it to the list of instances. +/* ratelimiting support, modelled after the linux kernel + * returns 1 if message is within rate limit and shall be + * processed, 0 otherwise. + * This implementation is NOT THREAD-SAFE and must not + * be called concurrently. */ -static rsRetVal -createInstance(instanceConf_t **pinst) +static inline int +withinRatelimit(struct rs_ratelimit_state *rs, time_t tt, pid_t pid) { - instanceConf_t *inst; - DEFiRet; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - inst->sockName = NULL; - inst->pLogHostName = NULL; - inst->ratelimitInterval = DFLT_ratelimitInterval; - inst->ratelimitBurst = DFLT_ratelimitBurst; - inst->ratelimitSeverity = DFLT_ratelimitSeverity; - inst->bUseFlowCtl = 0; - inst->bIgnoreTimestamp = 1; - inst->bCreatePath = DFLT_bCreatePath; - inst->bUseSysTimeStamp = 1; - inst->bWritePid = 0; - inst->bAnnotate = 0; - inst->bParseTrusted = 0; - inst->bDiscardOwnMsgs = 1; - inst->bUnlink = 1; - inst->next = NULL; - - /* node created, let's add to config */ - if(loadModConf->tail == NULL) { - loadModConf->tail = loadModConf->root = inst; + int ret; + uchar msgbuf[1024]; + + if(rs->interval == 0) { + ret = 1; + goto finalize_it; + } + + assert(rs->burst != 0); + + if(rs->begin == 0) + rs->begin = tt; + + /* resume if we go out of out time window */ + if(tt > rs->begin + rs->interval) { + if(rs->missed) { + snprintf((char*)msgbuf, sizeof(msgbuf), + "imuxsock lost %u messages from pid %lu due to rate-limiting", + rs->missed, (unsigned long) pid); + logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0); + rs->missed = 0; + } + rs->begin = 0; + rs->done = 0; + } + + /* do actual limit check */ + if(rs->burst > rs->done) { + rs->done++; + ret = 1; } else { - loadModConf->tail->next = inst; - loadModConf->tail = inst; + if(rs->missed == 0) { + snprintf((char*)msgbuf, sizeof(msgbuf), + "imuxsock begins to drop messages from pid %lu due to rate-limiting", + (unsigned long) pid); + logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0); + } + rs->missed++; + ret = 0; } - *pinst = inst; finalize_it: - RETiRet; + return ret; } -/* This function is called when a new listen socket instace shall be added to - * the current config object via the legacy config system. It just shuffles - * all parameters to the listener in-memory instance. - * rgerhards, 2011-05-12 +/* set the timestamp ignore / not ignore option for the system + * log socket. This must be done separtely, as it is not added via a command + * but present by default. -- rgerhards, 2008-03-06 */ -static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal) +static rsRetVal setSystemLogTimestampIgnore(void __attribute__((unused)) *pVal, int iNewVal) { - instanceConf_t *inst; DEFiRet; - - if(pNewVal == NULL || pNewVal[0] == '\0') { - errmsg.LogError(0, RS_RET_SOCKNAME_MISSING , "imuxsock: socket name must be specified, " - "but is not - listener not created\n"); - if(pNewVal != NULL) - free(pNewVal); - ABORT_FINALIZE(RS_RET_SOCKNAME_MISSING); - } - - CHKiRet(createInstance(&inst)); - inst->sockName = pNewVal; - inst->ratelimitInterval = cs.ratelimitInterval; - inst->pLogHostName = cs.pLogHostName; - inst->ratelimitBurst = cs.ratelimitBurst; - inst->ratelimitSeverity = cs.ratelimitSeverity; - inst->bUseFlowCtl = cs.bUseFlowCtl; - inst->bIgnoreTimestamp = cs.bIgnoreTimestamp; - inst->bCreatePath = cs.bCreatePath; - inst->bUseSysTimeStamp = cs.bUseSysTimeStamp; - inst->bWritePid = cs.bWritePid; - inst->bAnnotate = cs.bAnnotate; - inst->bParseTrusted = cs.bParseTrusted; - inst->next = NULL; - - /* some legacy conf processing */ - free(cs.pLogHostName); /* reset hostname for next socket */ - cs.pLogHostName = NULL; - -finalize_it: + listeners[0].flags = iNewVal ? IGNDATE : NOFLAG; RETiRet; } +/* set flowcontrol for the system log socket + */ +static rsRetVal setSystemLogFlowControl(void __attribute__((unused)) *pVal, int iNewVal) +{ + DEFiRet; + listeners[0].flowCtl = iNewVal ? eFLOWCTL_LIGHT_DELAY : eFLOWCTL_NO_DELAY; + RETiRet; +} -/* add an additional listen socket. +/* add an additional listen socket. Socket names are added + * until the array is filled up. It is never reset, only at + * module unload. + * TODO: we should change the array to a list so that we + * can support any number of listen socket names. + * rgerhards, 2007-12-20 * added capability to specify hostname for socket -- rgerhards, 2008-08-01 */ static rsRetVal -addListner(instanceConf_t *inst) +addLstnSocketName(void __attribute__((unused)) *pVal, uchar *pNewVal) { DEFiRet; - if(*inst->sockName == ':') { - listeners[nfd].bParseHost = 1; - } else { - listeners[nfd].bParseHost = 0; - } - if(inst->pLogHostName == NULL) { - listeners[nfd].hostName = NULL; - } else { - CHKiRet(prop.Construct(&(listeners[nfd].hostName))); - CHKiRet(prop.SetString(listeners[nfd].hostName, inst->pLogHostName, ustrlen(inst->pLogHostName))); - CHKiRet(prop.ConstructFinalize(listeners[nfd].hostName)); - } - if(inst->ratelimitInterval > 0) { - if((listeners[nfd].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, - (void(*)(void*))ratelimitDestruct)) == NULL) { - /* in this case, we simply turn off rate-limiting */ - DBGPRINTF("imuxsock: turning off rate limiting because we could not " - "create hash table\n"); - inst->ratelimitInterval = 0; + if(nfd < MAXFUNIX) { + if(*pNewVal == ':') { + listeners[nfd].bParseHost = 1; + } else { + listeners[nfd].bParseHost = 0; + } + if(pLogHostName == NULL) { + listeners[nfd].hostName = NULL; + } else { + CHKiRet(prop.Construct(&(listeners[nfd].hostName))); + CHKiRet(prop.SetString(listeners[nfd].hostName, pLogHostName, ustrlen(pLogHostName))); + CHKiRet(prop.ConstructFinalize(listeners[nfd].hostName)); + /* reset hostname for next socket */ + free(pLogHostName); + pLogHostName = NULL; + } + if(ratelimitInterval > 0) { + if((listeners[nfd].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) { + /* in this case, we simply turn of rate-limiting */ + dbgprintf("imuxsock: turning off rate limiting because we could not " + "create hash table\n"); + ratelimitInterval = 0; + } } + listeners[nfd].ratelimitInterval = ratelimitInterval; + listeners[nfd].ratelimitBurst = ratelimitBurst; + listeners[nfd].ratelimitSev = ratelimitSeverity; + listeners[nfd].flowCtl = bUseFlowCtl ? eFLOWCTL_LIGHT_DELAY : eFLOWCTL_NO_DELAY; + listeners[nfd].flags = bIgnoreTimestamp ? IGNDATE : NOFLAG; + listeners[nfd].bCreatePath = bCreatePath; + listeners[nfd].sockName = pNewVal; + listeners[nfd].bUseCreds = (bWritePid || ratelimitInterval || bAnnotate) ? 1 : 0; + listeners[nfd].bAnnotate = bAnnotate; + listeners[nfd].bWritePid = bWritePid; + listeners[nfd].bUseSysTimeStamp = bUseSysTimeStamp; + nfd++; } else { - listeners[nfd].ht = NULL; + errmsg.LogError(0, NO_ERRCODE, "Out of unix socket name descriptors, ignoring %s\n", + pNewVal); } - listeners[nfd].ratelimitInterval = inst->ratelimitInterval; - listeners[nfd].ratelimitBurst = inst->ratelimitBurst; - listeners[nfd].ratelimitSev = inst->ratelimitSeverity; - listeners[nfd].flowCtl = inst->bUseFlowCtl ? eFLOWCTL_LIGHT_DELAY : eFLOWCTL_NO_DELAY; - listeners[nfd].flags = inst->bIgnoreTimestamp ? IGNDATE : NOFLAG; - listeners[nfd].bCreatePath = inst->bCreatePath; - listeners[nfd].sockName = ustrdup(inst->sockName); - listeners[nfd].bUseCreds = (inst->bDiscardOwnMsgs || inst->bWritePid || inst->ratelimitInterval || inst->bAnnotate) ? 1 : 0; - listeners[nfd].bAnnotate = inst->bAnnotate; - listeners[nfd].bParseTrusted = inst->bParseTrusted; - listeners[nfd].bDiscardOwnMsgs = inst->bDiscardOwnMsgs; - listeners[nfd].bUnlink = inst->bUnlink; - listeners[nfd].bWritePid = inst->bWritePid; - listeners[nfd].bUseSysTimeStamp = inst->bUseSysTimeStamp; - CHKiRet(ratelimitNew(&listeners[nfd].dflt_ratelimiter, "imuxsock", NULL)); - ratelimitSetLinuxLike(listeners[nfd].dflt_ratelimiter, - listeners[nfd].ratelimitInterval, - listeners[nfd].ratelimitBurst); - ratelimitSetSeverity(listeners[nfd].dflt_ratelimiter, - listeners[nfd].ratelimitSev); - nfd++; finalize_it: RETiRet; } -/* discard/Destruct all log sockets except for "socket" 0. Data for it comes from +/* discard all log sockets except for "socket" 0. Data for it comes from * the constant memory pool - and if not, it is freeed via some other pointer. */ static rsRetVal discardLogSockets(void) @@ -436,7 +347,6 @@ if(listeners[i].ht != NULL) { hashtable_destroy(listeners[i].ht, 1); /* 1 => free all values automatically */ } - ratelimitDestruct(listeners[i].dflt_ratelimiter); } return RS_RET_OK; @@ -451,8 +361,7 @@ struct sockaddr_un sunx; DEFiRet; - if(pLstn->bUnlink) - unlink((char*)pLstn->sockName); + unlink((char*)pLstn->sockName); memset(&sunx, 0, sizeof(sunx)); sunx.sun_family = AF_UNIX; if(pLstn->bCreatePath) { @@ -463,9 +372,8 @@ if(pLstn->fd < 0 || bind(pLstn->fd, (struct sockaddr *) &sunx, SUN_LEN(&sunx)) < 0 || chmod((char*)pLstn->sockName, 0666) < 0) { errmsg.LogError(errno, NO_ERRCODE, "cannot create '%s'", pLstn->sockName); - DBGPRINTF("cannot create %s (%d).\n", pLstn->sockName, errno); - if(pLstn->fd != -1) - close(pLstn->fd); + dbgprintf("cannot create %s (%d).\n", pLstn->sockName, errno); + close(pLstn->fd); pLstn->fd = -1; ABORT_FINALIZE(RS_RET_ERR_CRE_AFUX); } @@ -498,7 +406,7 @@ /* ok, it matches -- just use as is */ pLstn->fd = fd; - DBGPRINTF("imuxsock: Acquired UNIX socket '%s' (fd %d) from systemd.\n", + dbgprintf("imuxsock: Acquired UNIX socket '%s' (fd %d) from systemd.\n", pLstn->sockName, pLstn->fd); break; } @@ -533,10 +441,8 @@ finalize_it: if(iRet != RS_RET_OK) { - if(pLstn->fd != -1) { - close(pLstn->fd); - pLstn->fd = -1; - } + close(pLstn->fd); + pLstn->fd = -1; } RETiRet; @@ -549,41 +455,30 @@ * listener (the latter being a performance enhancement). */ static inline rsRetVal -findRatelimiter(lstn_t *pLstn, struct ucred *cred, ratelimit_t **prl) +findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl) { - ratelimit_t *rl; + rs_ratelimit_state_t *rl; int r; pid_t *keybuf; - char pidbuf[256]; DEFiRet; if(cred == NULL) FINALIZE; -#if 0 // TODO: check deactivated? if(pLstn->ratelimitInterval == 0) { *prl = NULL; FINALIZE; } -#endif - if(pLstn->ht == NULL) { - *prl = NULL; - FINALIZE; - } rl = hashtable_search(pLstn->ht, &cred->pid); if(rl == NULL) { /* we need to add a new ratelimiter, process not seen before! */ - DBGPRINTF("imuxsock: no ratelimiter for pid %lu, creating one\n", + dbgprintf("imuxsock: no ratelimiter for pid %lu, creating one\n", (unsigned long) cred->pid); STATSCOUNTER_INC(ctrNumRatelimiters, mutCtrNumRatelimiters); - snprintf(pidbuf, sizeof(pidbuf), "pid %lu", - (unsigned long) cred->pid); - pidbuf[sizeof(pidbuf)-1] = '\0'; /* to be on safe side */ - CHKiRet(ratelimitNew(&rl, "imuxsock", pidbuf)); - ratelimitSetLinuxLike(rl, pLstn->ratelimitInterval, pLstn->ratelimitBurst); - ratelimitSetSeverity(rl, pLstn->ratelimitSev); + CHKmalloc(rl = malloc(sizeof(rs_ratelimit_state_t))); CHKmalloc(keybuf = malloc(sizeof(pid_t))); *keybuf = cred->pid; + initRatelimitState(rl, pLstn->ratelimitInterval, pLstn->ratelimitBurst); r = hashtable_insert(pLstn->ht, keybuf, rl); if(r == 0) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); @@ -592,8 +487,6 @@ *prl = rl; finalize_it: - if(*prl == NULL) - *prl = pLstn->dflt_ratelimiter; RETiRet; } @@ -646,12 +539,14 @@ if((fd = open(namebuf, O_RDONLY)) == -1) { DBGPRINTF("error reading '%s'\n", namebuf); - ABORT_FINALIZE(RS_RET_ERR); + *lenProp = 0; + FINALIZE; } if((lenRead = read(fd, buf, lenBuf - 1)) == -1) { DBGPRINTF("error reading file data for '%s'\n", namebuf); + *lenProp = 0; close(fd); - ABORT_FINALIZE(RS_RET_ERR); + FINALIZE; } /* we strip after the first \n */ @@ -687,7 +582,8 @@ if((lenRead = readlink(namebuf, (char*)buf, lenBuf - 1)) == -1) { DBGPRINTF("error reading link '%s'\n", namebuf); - ABORT_FINALIZE(RS_RET_ERR); + *lenProp = 0; + FINALIZE; } buf[lenRead] = '\0'; @@ -738,21 +634,15 @@ uchar bufParseTAG[CONF_TAG_MAXSIZE]; struct syslogTime st; time_t tt; + rs_ratelimit_state_t *ratelimiter = NULL; int lenProp; - ratelimit_t *ratelimiter = NULL; uchar propBuf[1024]; uchar msgbuf[8192]; uchar *pmsgbuf; int toffs; /* offset for trusted properties */ struct syslogTime dummyTS; - struct json_object *json = NULL, *jval; DEFiRet; - if(pLstn->bDiscardOwnMsgs && cred != NULL && cred->pid == glblGetOurPid()) { - DBGPRINTF("imuxsock: discarding message from our own pid\n"); - FINALIZE; - } - /* TODO: handle format errors?? */ /* we need to parse the pri first, because we need the severity for * rate-limiting as well. @@ -771,7 +661,10 @@ facil = LOG_FAC(pri); sever = LOG_PRI(pri); - findRatelimiter(pLstn, cred, &ratelimiter); /* ignore error, better so than others... */ + if(sever >= pLstn->ratelimitSev) { + /* note: if cred == NULL, then ratelimiter == NULL as well! */ + findRatelimiter(pLstn, cred, &ratelimiter); /* ignore error, better so than others... */ + } if(ts == NULL) { datetime.getCurrTime(&st, &tt); @@ -780,12 +673,10 @@ tt = ts->tv_sec; } -#if 0 // TODO: think about stats counters (or wait for request...?) if(ratelimiter != NULL && !withinRatelimit(ratelimiter, tt, cred->pid)) { STATSCOUNTER_INC(ctrLostRatelimit, mutCtrLostRatelimit); FINALIZE; } -#endif /* created trusted properties */ if(cred != NULL && pLstn->bAnnotate) { @@ -794,61 +685,37 @@ } else { CHKmalloc(pmsgbuf = malloc(lenRcv+4096)); } - - if (pLstn->bParseTrusted) { - json = json_object_new_object(); - /* create value string, create field, and add it */ - jval = json_object_new_int(cred->pid); - json_object_object_add(json, "pid", jval); - jval = json_object_new_int(cred->uid); - json_object_object_add(json, "uid", jval); - jval = json_object_new_int(cred->gid); - json_object_object_add(json, "gid", jval); - if(getTrustedProp(cred, "comm", propBuf, sizeof(propBuf), &lenProp) == RS_RET_OK) { - jval = json_object_new_string((char*)propBuf); - json_object_object_add(json, "appname", jval); - } - if(getTrustedExe(cred, propBuf, sizeof(propBuf), &lenProp) == RS_RET_OK) { - jval = json_object_new_string((char*)propBuf); - json_object_object_add(json, "exe", jval); - } - if(getTrustedProp(cred, "cmdline", propBuf, sizeof(propBuf), &lenProp) == RS_RET_OK) { - jval = json_object_new_string((char*)propBuf); - json_object_object_add(json, "cmd", jval); - } - } else { - memcpy(pmsgbuf, pRcv, lenRcv); - memcpy(pmsgbuf+lenRcv, " @[", 3); - toffs = lenRcv + 3; /* next free location */ - lenProp = snprintf((char*)propBuf, sizeof(propBuf), "_PID=%lu _UID=%lu _GID=%lu", - (long unsigned) cred->pid, (long unsigned) cred->uid, - (long unsigned) cred->gid); - memcpy(pmsgbuf+toffs, propBuf, lenProp); - toffs = toffs + lenProp; - - if(getTrustedProp(cred, "comm", propBuf, sizeof(propBuf), &lenProp) == RS_RET_OK) { - memcpy(pmsgbuf+toffs, " _COMM=", 7); - memcpy(pmsgbuf+toffs+7, propBuf, lenProp); - toffs = toffs + 7 + lenProp; - } - if(getTrustedExe(cred, propBuf, sizeof(propBuf), &lenProp) == RS_RET_OK) { - memcpy(pmsgbuf+toffs, " _EXE=", 6); - memcpy(pmsgbuf+toffs+6, propBuf, lenProp); - toffs = toffs + 6 + lenProp; - } - if(getTrustedProp(cred, "cmdline", propBuf, sizeof(propBuf), &lenProp) == RS_RET_OK) { - memcpy(pmsgbuf+toffs, " _CMDLINE=", 10); - toffs = toffs + 10 + - copyescaped(pmsgbuf+toffs+10, propBuf, lenProp); - } - - /* finalize string */ - pmsgbuf[toffs] = ']'; - pmsgbuf[toffs+1] = '\0'; - - pRcv = pmsgbuf; - lenRcv = toffs + 1; - } + memcpy(pmsgbuf, pRcv, lenRcv); + memcpy(pmsgbuf+lenRcv, " @[", 3); + toffs = lenRcv + 3; /* next free location */ + lenProp = snprintf((char*)propBuf, sizeof(propBuf), "_PID=%lu _UID=%lu _GID=%lu", + (long unsigned) cred->pid, (long unsigned) cred->uid, + (long unsigned) cred->gid); + memcpy(pmsgbuf+toffs, propBuf, lenProp); + toffs = toffs + lenProp; + getTrustedProp(cred, "comm", propBuf, sizeof(propBuf), &lenProp); + if(lenProp) { + memcpy(pmsgbuf+toffs, " _COMM=", 7); + memcpy(pmsgbuf+toffs+7, propBuf, lenProp); + toffs = toffs + 7 + lenProp; + } + getTrustedExe(cred, propBuf, sizeof(propBuf), &lenProp); + if(lenProp) { + memcpy(pmsgbuf+toffs, " _EXE=", 6); + memcpy(pmsgbuf+toffs+6, propBuf, lenProp); + toffs = toffs + 6 + lenProp; + } + getTrustedProp(cred, "cmdline", propBuf, sizeof(propBuf), &lenProp); + if(lenProp) { + memcpy(pmsgbuf+toffs, " _CMDLINE=", 10); + toffs = toffs + 10 + + copyescaped(pmsgbuf+toffs+10, propBuf, lenProp); + } + /* finalize string */ + pmsgbuf[toffs] = ']'; + pmsgbuf[toffs+1] = '\0'; + pRcv = pmsgbuf; + lenRcv = toffs + 1; } /* we now create our own message object and submit it to the queue */ @@ -865,31 +732,20 @@ parse++; lenMsg--; /* '>' */ - if(json != NULL) { - /* as per lumberjack spec, these properties need to go into - * the CEE root. - */ - msgAddJSON(pMsg, (uchar*)"!", json); - } - if(ts == NULL) { if((pLstn->flags & IGNDATE)) { /* in this case, we still need to find out if we have a valid * datestamp or not .. and advance the parse pointer accordingly. */ - if (datetime.ParseTIMESTAMP3339(&dummyTS, &parse, &lenMsg) != RS_RET_OK) { - datetime.ParseTIMESTAMP3164(&dummyTS, &parse, &lenMsg); - } + datetime.ParseTIMESTAMP3164(&dummyTS, &parse, &lenMsg); } else { - if(datetime.ParseTIMESTAMP3339(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK && - datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) { + if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) { DBGPRINTF("we have a problem, invalid timestamp in msg!\n"); } } } else { /* if we pulled the time from the system, we need to update the message text */ uchar *tmpParse = parse; /* just to check correctness of TS */ - if(datetime.ParseTIMESTAMP3339(&dummyTS, &tmpParse, &lenMsg) == RS_RET_OK || - datetime.ParseTIMESTAMP3164(&dummyTS, &tmpParse, &lenMsg) == RS_RET_OK) { + if(datetime.ParseTIMESTAMP3164(&dummyTS, &tmpParse, &lenMsg) == RS_RET_OK) { /* We modify the message only if it contained a valid timestamp, * otherwise we do not touch it at all. */ datetime.formatTimestamp3164(&st, (char*)parse, 0); @@ -920,7 +776,8 @@ MsgSetRcvFrom(pMsg, pLstn->hostName == NULL ? glbl.GetLocalHostNameProp() : pLstn->hostName); CHKiRet(MsgSetRcvFromIP(pMsg, pLocalHostIP)); - ratelimitAddMsg(ratelimiter, NULL, pMsg); + CHKiRet(submitMsg(pMsg)); + STATSCOUNTER_INC(ctrSubmit, mutCtrSubmit); finalize_it: RETiRet; @@ -981,31 +838,35 @@ msgh.msg_iovlen = 1; iRcvd = recvmsg(pLstn->fd, &msgh, MSG_DONTWAIT); - DBGPRINTF("Message from UNIX socket: #%d\n", pLstn->fd); + dbgprintf("Message from UNIX socket: #%d\n", pLstn->fd); if(iRcvd > 0) { cred = NULL; ts = NULL; - if(pLstn->bUseCreds) { + if(pLstn->bUseCreds || pLstn->bUseSysTimeStamp) { for(cm = CMSG_FIRSTHDR(&msgh); cm; cm = CMSG_NXTHDR(&msgh, cm)) { # if HAVE_SCM_CREDENTIALS if( pLstn->bUseCreds && cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_CREDENTIALS) { cred = (struct ucred*) CMSG_DATA(cm); + break; } # endif /* HAVE_SCM_CREDENTIALS */ # if HAVE_SO_TIMESTAMP if( pLstn->bUseSysTimeStamp && cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP) { ts = (struct timeval *)CMSG_DATA(cm); + dbgprintf("XXX: got timestamp %ld.%ld\n", + (long) ts->tv_sec, (long) ts->tv_usec); + break; } # endif /* HAVE_SO_TIMESTAMP */ } } CHKiRet(SubmitMsg(pRcv, iRcvd, pLstn, cred, ts)); - } else if(iRcvd < 0 && errno != EINTR && errno != EAGAIN) { + } else if(iRcvd < 0 && errno != EINTR) { char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); - DBGPRINTF("UNIX socket error: %d = %s.\n", errno, errStr); + dbgprintf("UNIX socket error: %d = %s.\n", errno, errStr); errmsg.LogError(errno, NO_ERRCODE, "imuxsock: recvfrom UNIX"); } @@ -1017,314 +878,6 @@ } -/* activate current listeners */ -static inline rsRetVal -activateListeners() -{ - register int i; - int actSocks; - DEFiRet; - - /* first apply some config settings */ -# ifdef OS_SOLARIS - /* under solaris, we must NEVER process the local log socket, because - * it is implemented there differently. If we used it, we would actually - * delete it and render the system partly unusable. So don't do that. - * rgerhards, 2010-03-26 - */ - startIndexUxLocalSockets = 1; -# else - startIndexUxLocalSockets = runModConf->bOmitLocalLogging ? 1 : 0; -# endif - if(runModConf->pLogSockName != NULL) - listeners[0].sockName = runModConf->pLogSockName; - else if(sd_booted()) { - struct stat st; - if(stat(SYSTEMD_PATH_LOG, &st) != -1 && S_ISSOCK(st.st_mode)) { - listeners[0].sockName = (uchar*) SYSTEMD_PATH_LOG; - } - } - if(runModConf->ratelimitIntervalSysSock > 0) { - if((listeners[0].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) { - /* in this case, we simply turn of rate-limiting */ - errmsg.LogError(0, NO_ERRCODE, "imuxsock: turning off rate limiting because we could not " - "create hash table\n"); - runModConf->ratelimitIntervalSysSock = 0; - } - } - listeners[0].ratelimitInterval = runModConf->ratelimitIntervalSysSock; - listeners[0].ratelimitBurst = runModConf->ratelimitBurstSysSock; - listeners[0].ratelimitSev = runModConf->ratelimitSeveritySysSock; - listeners[0].bUseCreds = (runModConf->bWritePidSysSock || runModConf->ratelimitIntervalSysSock || runModConf->bAnnotateSysSock || runModConf->bDiscardOwnMsgs || runModConf->bUseSysTimeStamp) ? 1 : 0; - listeners[0].bWritePid = runModConf->bWritePidSysSock; - listeners[0].bAnnotate = runModConf->bAnnotateSysSock; - listeners[0].bParseTrusted = runModConf->bParseTrusted; - listeners[0].bDiscardOwnMsgs = runModConf->bDiscardOwnMsgs; - listeners[0].bUnlink = runModConf->bUnlink; - listeners[0].bUseSysTimeStamp = runModConf->bUseSysTimeStamp; - listeners[0].flags = runModConf->bIgnoreTimestamp ? IGNDATE : NOFLAG; - listeners[0].flowCtl = runModConf->bUseFlowCtl ? eFLOWCTL_LIGHT_DELAY : eFLOWCTL_NO_DELAY; - CHKiRet(ratelimitNew(&listeners[0].dflt_ratelimiter, "imuxsock", NULL)); - ratelimitSetLinuxLike(listeners[0].dflt_ratelimiter, - listeners[0].ratelimitInterval, - listeners[0].ratelimitBurst); - ratelimitSetSeverity(listeners[0].dflt_ratelimiter,listeners[0].ratelimitSev); - - sd_fds = sd_listen_fds(0); - if(sd_fds < 0) { - errmsg.LogError(-sd_fds, NO_ERRCODE, "imuxsock: Failed to acquire systemd socket"); - ABORT_FINALIZE(RS_RET_ERR_CRE_AFUX); - } - - /* initialize and return if will run or not */ - actSocks = 0; - for (i = startIndexUxLocalSockets ; i < nfd ; i++) { - if(openLogSocket(&(listeners[i])) == RS_RET_OK) { - ++actSocks; - DBGPRINTF("imuxsock: Opened UNIX socket '%s' (fd %d).\n", - listeners[i].sockName, listeners[i].fd); - } - } - - if(actSocks == 0) { - errmsg.LogError(0, NO_ERRCODE, "imuxsock does not run because we could not aquire any socket\n"); - ABORT_FINALIZE(RS_RET_ERR); - } - -finalize_it: - RETiRet; -} - - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - /* init our settings */ - pModConf->pLogSockName = NULL; - pModConf->bOmitLocalLogging = 0; - pModConf->bIgnoreTimestamp = 1; - pModConf->bUseFlowCtl = 0; - pModConf->bUseSysTimeStamp = 1; - pModConf->bWritePidSysSock = 0; - pModConf->bAnnotateSysSock = 0; - pModConf->bParseTrusted = 0; - pModConf->bDiscardOwnMsgs = 1; - pModConf->bUnlink = 1; - pModConf->ratelimitIntervalSysSock = DFLT_ratelimitInterval; - pModConf->ratelimitBurstSysSock = DFLT_ratelimitBurst; - pModConf->ratelimitSeveritySysSock = DFLT_ratelimitSeverity; - bLegacyCnfModGlobalsPermitted = 1; - /* reset legacy config vars */ - resetConfigVariables(NULL, NULL); -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for imuxsock:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "syssock.use")) { - loadModConf->bOmitLocalLogging = ((int) pvals[i].val.d.n) ? 0 : 1; - } else if(!strcmp(modpblk.descr[i].name, "syssock.name")) { - loadModConf->pLogSockName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(modpblk.descr[i].name, "syssock.ignoretimestamp")) { - loadModConf->bIgnoreTimestamp = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.ignoreownmessages")) { - loadModConf->bDiscardOwnMsgs = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.unlink")) { - loadModConf->bUnlink = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.flowcontrol")) { - loadModConf->bUseFlowCtl = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.usesystimestamp")) { - loadModConf->bUseSysTimeStamp = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.annotate")) { - loadModConf->bAnnotateSysSock = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.parsetrusted")) { - loadModConf->bParseTrusted = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.usepidfromsystem")) { - loadModConf->bWritePidSysSock = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.ratelimit.interval")) { - loadModConf->ratelimitIntervalSysSock = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.ratelimit.burst")) { - loadModConf->ratelimitBurstSysSock = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "syssock.ratelimit.severity")) { - loadModConf->ratelimitSeveritySysSock = (int) pvals[i].val.d.n; - } else { - dbgprintf("imuxsock: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - - /* disable legacy module-global config directives */ - bLegacyCnfModGlobalsPermitted = 0; - loadModConf->configSetViaV2Method = 1; - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINnewInpInst - struct cnfparamvals *pvals; - instanceConf_t *inst; - int i; -CODESTARTnewInpInst - DBGPRINTF("newInpInst (imuxsock)\n"); - - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imuxsock: required parameter are missing\n"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("input param blk in imuxsock:\n"); - cnfparamsPrint(&inppblk, pvals); - } - - CHKiRet(createInstance(&inst)); - - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "socket")) { - inst->sockName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "createpath")) { - inst->bCreatePath = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "parsetrusted")) { - inst->bParseTrusted = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ignoreownmessages")) { - inst->bDiscardOwnMsgs = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "unlink")) { - inst->bUnlink = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "hostname")) { - inst->pLogHostName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "ignoretimestamp")) { - inst->bIgnoreTimestamp = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "flowcontrol")) { - inst->bUseFlowCtl = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "usesystimestamp")) { - inst->bUseSysTimeStamp = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "annotate")) { - inst->bAnnotate = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "usepidfromsystem")) { - inst->bWritePid = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.interval")) { - inst->ratelimitInterval = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.burst")) { - inst->ratelimitBurst = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ratelimit.severity")) { - inst->ratelimitSeverity = (int) pvals[i].val.d.n; - } else { - dbgprintf("imuxsock: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - } -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - - -BEGINendCnfLoad -CODESTARTendCnfLoad - if(!loadModConf->configSetViaV2Method) { - /* persist module-specific settings from legacy config system */ - /* these are used to initialize the system log socket (listeners[0]) */ - loadModConf->bOmitLocalLogging = cs.bOmitLocalLogging; - loadModConf->pLogSockName = cs.pLogSockName; - loadModConf->bIgnoreTimestamp = cs.bIgnoreTimestampSysSock; - loadModConf->bUseSysTimeStamp = cs.bUseSysTimeStampSysSock; - loadModConf->bUseFlowCtl = cs.bUseFlowCtlSysSock; - loadModConf->bAnnotateSysSock = cs.bAnnotateSysSock; - loadModConf->bWritePidSysSock = cs.bWritePidSysSock; - loadModConf->bParseTrusted = cs.bParseTrusted; - loadModConf->ratelimitIntervalSysSock = cs.ratelimitIntervalSysSock; - loadModConf->ratelimitBurstSysSock = cs.ratelimitBurstSysSock; - loadModConf->ratelimitSeveritySysSock = cs.ratelimitSeveritySysSock; - } - - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.pLogHostName); - cs.pLogSockName = NULL; - cs.pLogHostName = NULL; -ENDendCnfLoad - - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - - -BEGINactivateCnfPrePrivDrop - instanceConf_t *inst; - int nLstn; - int i; -CODESTARTactivateCnfPrePrivDrop - runModConf = pModConf; - /* we first calculate the number of listeners so that we can - * appropriately size the listener array. Note that we will - * always allocate memory for the system log socket. - */ - nLstn = 0; - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - ++nLstn; - } - if(nLstn > 0) { - DBGPRINTF("imuxsock: allocating memory for %d addtl listeners\n", nLstn); - CHKmalloc(listeners = realloc(listeners, (1+nLstn)*sizeof(lstn_t))); - for(i = 1 ; i < nLstn ; ++i) { - listeners[i].sockName = NULL; - listeners[i].fd = -1; - } - for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { - addListner(inst); - } - } - CHKiRet(activateListeners()); -finalize_it: -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf -CODESTARTactivateCnf -ENDactivateCnf - - -BEGINfreeCnf - instanceConf_t *inst, *del; -CODESTARTfreeCnf - free(pModConf->pLogSockName); - for(inst = pModConf->root ; inst != NULL ; ) { - free(inst->sockName); - free(inst->pLogHostName); - del = inst; - inst = inst->next; - free(del); - } -ENDfreeCnf - - /* This function is called to gather input. */ BEGINrunInput int maxfds; @@ -1339,8 +892,6 @@ #endif CODESTARTrunInput - if(runModConf->bOmitLocalLogging && nfd == 1) - ABORT_FINALIZE(RS_RET_OK); /* this is an endless loop - it is terminated when the thread is * signalled to do so. This, however, is handled by the framework, * right into the sleep below. @@ -1394,12 +945,78 @@ BEGINwillRun CODESTARTwillRun + register int i; + int actSocks; + + /* first apply some config settings */ +# ifdef OS_SOLARIS + /* under solaris, we must NEVER process the local log socket, because + * it is implemented there differently. If we used it, we would actually + * delete it and render the system partly unusable. So don't do that. + * rgerhards, 2010-03-26 + */ + startIndexUxLocalSockets = 1; +# else + startIndexUxLocalSockets = bOmitLocalLogging ? 1 : 0; +# endif + if(pLogSockName != NULL) + listeners[0].sockName = pLogSockName; + else if(sd_booted()) { + struct stat st; + if(stat(SYSTEMD_JOURNAL, &st) != -1 && S_ISDIR(st.st_mode)) { + listeners[0].sockName = (uchar*)SYSTEMD_PATH_LOG; + } + } + if(ratelimitIntervalSysSock > 0) { + if((listeners[0].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL)) == NULL) { + /* in this case, we simply turn of rate-limiting */ + dbgprintf("imuxsock: turning off rate limiting because we could not " + "create hash table\n"); + ratelimitIntervalSysSock = 0; + } + } + listeners[0].ratelimitInterval = ratelimitIntervalSysSock; + listeners[0].ratelimitBurst = ratelimitBurstSysSock; + listeners[0].ratelimitSev = ratelimitSeveritySysSock; + listeners[0].bUseCreds = (bWritePidSysSock || ratelimitIntervalSysSock || bAnnotateSysSock) ? 1 : 0; + listeners[0].bWritePid = bWritePidSysSock; + listeners[0].bAnnotate = bAnnotateSysSock; + listeners[0].bUseSysTimeStamp = bUseSysTimeStampSysSock; + + sd_fds = sd_listen_fds(0); + if (sd_fds < 0) { + errmsg.LogError(-sd_fds, NO_ERRCODE, "imuxsock: Failed to acquire systemd socket"); + ABORT_FINALIZE(RS_RET_ERR_CRE_AFUX); + } + + /* initialize and return if will run or not */ + actSocks = 0; + for (i = startIndexUxLocalSockets ; i < nfd ; i++) { + if(openLogSocket(&(listeners[i])) == RS_RET_OK) { + ++actSocks; + dbgprintf("imuxsock: Opened UNIX socket '%s' (fd %d).\n", listeners[i].sockName, listeners[i].fd); + } + } + + if(actSocks == 0) { + errmsg.LogError(0, NO_ERRCODE, "imuxsock does not run because we could not aquire any socket\n"); + ABORT_FINALIZE(RS_RET_ERR); + } + + /* we need to create the inputName property (only once during our lifetime) */ + CHKiRet(prop.Construct(&pInputName)); + CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imuxsock"), sizeof("imuxsock") - 1)); + CHKiRet(prop.ConstructFinalize(pInputName)); + + pLocalHostIP = glbl.GetLocalHostIP(); + +finalize_it: ENDwillRun BEGINafterRun - int i; CODESTARTafterRun + int i; /* do cleanup here */ /* Close the UNIX sockets. */ for (i = 0; i < nfd; i++) @@ -1418,23 +1035,23 @@ listeners[i].fd < SD_LISTEN_FDS_START + sd_fds) continue; - if(listeners[i].bUnlink) { - DBGPRINTF("imuxsock: unlinking unix socket file[%d] %s\n", i, listeners[i].sockName); - unlink((char*) listeners[i].sockName); - } + DBGPRINTF("imuxsock: unlinking unix socket file[%d] %s\n", i, listeners[i].sockName); + unlink((char*) listeners[i].sockName); } + /* free no longer needed string */ + free(pLogSockName); + free(pLogHostName); discardLogSockets(); nfd = 1; + + if(pInputName != NULL) + prop.Destruct(&pInputName); ENDafterRun BEGINmodExit CODESTARTmodExit - free(listeners); - if(pInputName != NULL) - prop.Destruct(&pInputName); - statsobj.Destruct(&modStats); objRelease(parser, CORE_COMPONENT); @@ -1456,44 +1073,43 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES ENDqueryEtryPt static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - free(cs.pLogSockName); - cs.pLogSockName = NULL; - free(cs.pLogHostName); - cs.bOmitLocalLogging = 0; - cs.pLogHostName = NULL; - cs.bIgnoreTimestamp = 1; - cs.bIgnoreTimestampSysSock = 1; - cs.bUseFlowCtl = 0; - cs.bUseFlowCtlSysSock = 0; - cs.bUseSysTimeStamp = 1; - cs.bUseSysTimeStampSysSock = 1; - cs.bWritePid = 0; - cs.bWritePidSysSock = 0; - cs.bAnnotate = 0; - cs.bAnnotateSysSock = 0; - cs.bParseTrusted = 0; - cs.bCreatePath = DFLT_bCreatePath; - cs.ratelimitInterval = DFLT_ratelimitInterval; - cs.ratelimitIntervalSysSock = DFLT_ratelimitInterval; - cs.ratelimitBurst = DFLT_ratelimitBurst; - cs.ratelimitBurstSysSock = DFLT_ratelimitBurst; - cs.ratelimitSeverity = DFLT_ratelimitSeverity; - cs.ratelimitSeveritySysSock = DFLT_ratelimitSeverity; + bOmitLocalLogging = 0; + if(pLogSockName != NULL) { + free(pLogSockName); + pLogSockName = NULL; + } + if(pLogHostName != NULL) { + free(pLogHostName); + pLogHostName = NULL; + } + + discardLogSockets(); + nfd = 1; + bIgnoreTimestamp = 1; + bUseFlowCtl = 0; + bWritePid = 0; + bWritePidSysSock = 0; + bUseSysTimeStamp = 1; + bUseSysTimeStampSysSock = 1; + bCreatePath = DFLT_bCreatePath; + ratelimitInterval = DFLT_ratelimitInterval; + ratelimitIntervalSysSock = DFLT_ratelimitInterval; + ratelimitBurst = DFLT_ratelimitBurst; + ratelimitBurstSysSock = DFLT_ratelimitBurst; + ratelimitSeverity = DFLT_ratelimitSeverity; + ratelimitSeveritySysSock = DFLT_ratelimitSeverity; return RS_RET_OK; } BEGINmodInit() + int i; CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr @@ -1505,26 +1121,9 @@ CHKiRet(objUse(datetime, CORE_COMPONENT)); CHKiRet(objUse(parser, CORE_COMPONENT)); - DBGPRINTF("imuxsock version %s initializing\n", PACKAGE_VERSION); - - /* init legacy config vars */ - cs.pLogSockName = NULL; - cs.pLogHostName = NULL; /* host name to use with this socket */ - - /* we need to create the inputName property (only once during our lifetime) */ - CHKiRet(prop.Construct(&pInputName)); - CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imuxsock"), sizeof("imuxsock") - 1)); - CHKiRet(prop.ConstructFinalize(pInputName)); - - /* right now, glbl does not permit per-instance IP address notation. As long as this - * is the case, it is OK to query the HostIP once here at this location. HOWEVER, the - * whole concept is not 100% clean and needs to be addressed on a higher layer. - * TODO / rgerhards, 2012-04-11 - */ - pLocalHostIP = glbl.GetLocalHostIP(); + dbgprintf("imuxsock version %s initializing\n", PACKAGE_VERSION); /* init system log socket settings */ - CHKmalloc(listeners = malloc(sizeof(lstn_t))); listeners[0].flags = IGNDATE; listeners[0].sockName = UCHAR_CONSTANT(_PATH_LOG); listeners[0].hostName = NULL; @@ -1533,42 +1132,47 @@ listeners[0].bParseHost = 0; listeners[0].bUseCreds = 0; listeners[0].bAnnotate = 0; - listeners[0].bParseTrusted = 0; - listeners[0].bDiscardOwnMsgs = 1; - listeners[0].bUnlink = 1; listeners[0].bCreatePath = 0; listeners[0].bUseSysTimeStamp = 1; - if((listeners[0].ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, - (void(*)(void*))ratelimitDestruct)) == NULL) { - /* in this case, we simply turn off rate-limiting */ - DBGPRINTF("imuxsock: turning off rate limiting for system socket " - "because we could not create hash table\n"); - listeners[0].ratelimitInterval = 0; + + /* initialize socket names */ + for(i = 1 ; i < MAXFUNIX ; ++i) { + listeners[i].sockName = NULL; + listeners[i].fd = -1; } + /* now init listen socket zero, the local log socket */ + CHKiRet(prop.Construct(&pLocalHostIP)); + CHKiRet(prop.SetString(pLocalHostIP, UCHAR_CONSTANT("127.0.0.1"), sizeof("127.0.0.1") - 1)); + CHKiRet(prop.ConstructFinalize(pLocalHostIP)); + /* register config file handlers */ + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omitlocallogging", 0, eCmdHdlrBinary, + NULL, &bOmitLocalLogging, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketignoremsgtimestamp", 0, eCmdHdlrBinary, - NULL, &cs.bIgnoreTimestamp, STD_LOADABLE_MODULE_ID)); + NULL, &bIgnoreTimestamp, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogsocketname", 0, eCmdHdlrGetWord, + NULL, &pLogSockName, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensockethostname", 0, eCmdHdlrGetWord, - NULL, &cs.pLogHostName, STD_LOADABLE_MODULE_ID)); + NULL, &pLogHostName, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketflowcontrol", 0, eCmdHdlrBinary, - NULL, &cs.bUseFlowCtl, STD_LOADABLE_MODULE_ID)); + NULL, &bUseFlowCtl, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketannotate", 0, eCmdHdlrBinary, - NULL, &cs.bAnnotate, STD_LOADABLE_MODULE_ID)); + NULL, &bAnnotate, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketcreatepath", 0, eCmdHdlrBinary, - NULL, &cs.bCreatePath, STD_LOADABLE_MODULE_ID)); + NULL, &bCreatePath, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketusepidfromsystem", 0, eCmdHdlrBinary, + NULL, &bWritePid, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketusesystimestamp", 0, eCmdHdlrBinary, - NULL, &cs.bUseSysTimeStamp, STD_LOADABLE_MODULE_ID)); + NULL, &bUseSysTimeStamp, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"addunixlistensocket", 0, eCmdHdlrGetWord, - addInstance, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputunixlistensocketusepidfromsystem", 0, eCmdHdlrBinary, - NULL, &cs.bWritePid, STD_LOADABLE_MODULE_ID)); + addLstnSocketName, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"imuxsockratelimitinterval", 0, eCmdHdlrInt, - NULL, &cs.ratelimitInterval, STD_LOADABLE_MODULE_ID)); + NULL, &ratelimitInterval, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"imuxsockratelimitburst", 0, eCmdHdlrInt, - NULL, &cs.ratelimitBurst, STD_LOADABLE_MODULE_ID)); + NULL, &ratelimitBurst, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"imuxsockratelimitseverity", 0, eCmdHdlrInt, - NULL, &cs.ratelimitSeverity, STD_LOADABLE_MODULE_ID)); + NULL, &ratelimitSeverity, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); /* the following one is a (dirty) trick: the system log socket is not added via @@ -1577,41 +1181,35 @@ * for that. We should revisit all of that once we have the new config format... * rgerhards, 2008-03-06 */ - CHKiRet(regCfSysLineHdlr2((uchar *)"omitlocallogging", 0, eCmdHdlrBinary, - NULL, &cs.bOmitLocalLogging, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogsocketname", 0, eCmdHdlrGetWord, - NULL, &cs.pLogSockName, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogsocketignoremsgtimestamp", 0, eCmdHdlrBinary, - NULL, &cs.bIgnoreTimestampSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogsocketflowcontrol", 0, eCmdHdlrBinary, - NULL, &cs.bUseFlowCtlSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogusesystimestamp", 0, eCmdHdlrBinary, - NULL, &cs.bUseSysTimeStampSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogsocketannotate", 0, eCmdHdlrBinary, - NULL, &cs.bAnnotateSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogparsetrusted", 0, eCmdHdlrBinary, - NULL, &cs.bParseTrusted, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogusepidfromsystem", 0, eCmdHdlrBinary, - NULL, &cs.bWritePidSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogratelimitinterval", 0, eCmdHdlrInt, - NULL, &cs.ratelimitIntervalSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogratelimitburst", 0, eCmdHdlrInt, - NULL, &cs.ratelimitBurstSysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(regCfSysLineHdlr2((uchar *)"systemlogratelimitseverity", 0, eCmdHdlrInt, - NULL, &cs.ratelimitSeveritySysSock, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogsocketignoremsgtimestamp", 0, eCmdHdlrBinary, + setSystemLogTimestampIgnore, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogsocketflowcontrol", 0, eCmdHdlrBinary, + setSystemLogFlowControl, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogusesystimestamp", 0, eCmdHdlrBinary, + NULL, &bUseSysTimeStampSysSock, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogsocketannotate", 0, eCmdHdlrBinary, + NULL, &bAnnotateSysSock, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogusepidfromsystem", 0, eCmdHdlrBinary, + NULL, &bWritePidSysSock, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogratelimitinterval", 0, eCmdHdlrInt, + NULL, &ratelimitIntervalSysSock, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogratelimitburst", 0, eCmdHdlrInt, + NULL, &ratelimitBurstSysSock, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"systemlogratelimitseverity", 0, eCmdHdlrInt, + NULL, &ratelimitSeveritySysSock, STD_LOADABLE_MODULE_ID)); /* support statistics gathering */ CHKiRet(statsobj.Construct(&modStats)); CHKiRet(statsobj.SetName(modStats, UCHAR_CONSTANT("imuxsock"))); STATSCOUNTER_INIT(ctrSubmit, mutCtrSubmit); CHKiRet(statsobj.AddCounter(modStats, UCHAR_CONSTANT("submitted"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &ctrSubmit)); + ctrType_IntCtr, &ctrSubmit)); STATSCOUNTER_INIT(ctrLostRatelimit, mutCtrLostRatelimit); CHKiRet(statsobj.AddCounter(modStats, UCHAR_CONSTANT("ratelimit.discarded"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &ctrLostRatelimit)); + ctrType_IntCtr, &ctrLostRatelimit)); STATSCOUNTER_INIT(ctrNumRatelimiters, mutCtrNumRatelimiters); CHKiRet(statsobj.AddCounter(modStats, UCHAR_CONSTANT("ratelimit.numratelimiters"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &ctrNumRatelimiters)); + ctrType_IntCtr, &ctrNumRatelimiters)); CHKiRet(statsobj.ConstructFinalize(modStats)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/imuxsock/Makefile.am rsyslog-5.10.1/plugins/imuxsock/Makefile.am --- rsyslog-7.6.0/plugins/imuxsock/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imuxsock/Makefile.am 2012-09-18 15:03:57.000000000 +0000 @@ -1,6 +1,6 @@ pkglib_LTLIBRARIES = imuxsock.la imuxsock_la_SOURCES = imuxsock.c -imuxsock_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +imuxsock_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -I../../runtime/hashtable -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) imuxsock_la_LDFLAGS = -module -avoid-version imuxsock_la_LIBADD = $(RSRT_LIBS) diff -Nru rsyslog-7.6.0/plugins/imuxsock/Makefile.in rsyslog-5.10.1/plugins/imuxsock/Makefile.in --- rsyslog-7.6.0/plugins/imuxsock/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imuxsock/Makefile.in 2012-10-17 14:42:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = imuxsock_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_imuxsock_la_OBJECTS = imuxsock_la-imuxsock.lo imuxsock_la_OBJECTS = $(am_imuxsock_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent imuxsock_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(imuxsock_la_SOURCES) DIST_SOURCES = $(imuxsock_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -311,7 +267,7 @@ top_srcdir = @top_srcdir@ pkglib_LTLIBRARIES = imuxsock.la imuxsock_la_SOURCES = imuxsock.c -imuxsock_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +imuxsock_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -I../../runtime/hashtable -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) imuxsock_la_LDFLAGS = -module -avoid-version imuxsock_la_LIBADD = $(RSRT_LIBS) all: all-am @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -imuxsock.la: $(imuxsock_la_OBJECTS) $(imuxsock_la_DEPENDENCIES) $(EXTRA_imuxsock_la_DEPENDENCIES) +imuxsock.la: $(imuxsock_la_OBJECTS) $(imuxsock_la_DEPENDENCIES) $(AM_V_CCLD)$(imuxsock_la_LINK) -rpath $(pkglibdir) $(imuxsock_la_OBJECTS) $(imuxsock_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< imuxsock_la-imuxsock.lo: imuxsock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imuxsock_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imuxsock_la-imuxsock.lo -MD -MP -MF $(DEPDIR)/imuxsock_la-imuxsock.Tpo -c -o imuxsock_la-imuxsock.lo `test -f 'imuxsock.c' || echo '$(srcdir)/'`imuxsock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imuxsock_la-imuxsock.Tpo $(DEPDIR)/imuxsock_la-imuxsock.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imuxsock.c' object='imuxsock_la-imuxsock.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imuxsock.c' object='imuxsock_la-imuxsock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imuxsock_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imuxsock_la-imuxsock.lo `test -f 'imuxsock.c' || echo '$(srcdir)/'`imuxsock.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imuxsock_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imuxsock_la-imuxsock.lo `test -f 'imuxsock.c' || echo '$(srcdir)/'`imuxsock.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/imzmq3/imzmq3.c rsyslog-5.10.1/plugins/imzmq3/imzmq3.c --- rsyslog-7.6.0/plugins/imzmq3/imzmq3.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imzmq3/imzmq3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,876 +0,0 @@ -/* imzmq3.c - * - * This input plugin enables rsyslog to read messages from a ZeroMQ - * queue. - * - * Copyright 2012 Talksum, Inc. - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - * - * Authors: - * David Kelly - * Hongfei Cheng - */ - - -#include "config.h" -#include "rsyslog.h" - -#include -#include -#include -#include -#include -#include "cfsysline.h" -#include "dirty.h" -#include "errmsg.h" -#include "glbl.h" -#include "module-template.h" -#include "msg.h" -#include "net.h" -#include "parser.h" -#include "prop.h" -#include "ruleset.h" -#include "srUtils.h" -#include "unicode-helper.h" - -#include - -MODULE_TYPE_INPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("imzmq3"); - -/* convienent symbols to denote a socket we want to bind - * vs one we want to just connect to - */ -#define ACTION_CONNECT 1 -#define ACTION_BIND 2 - -/* Module static data */ -DEF_IMOD_STATIC_DATA -DEFobjCurrIf(errmsg) -DEFobjCurrIf(glbl) -DEFobjCurrIf(prop) -DEFobjCurrIf(ruleset) - - -/* ---------------------------------------------------------------------------- - * structs to describe sockets - */ -typedef struct _socket_type { - char* name; - int type; -} socket_type; - -/* more overkill, but seems nice to be consistent.*/ -typedef struct _socket_action { - char* name; - int action; -} socket_action; - -typedef struct _poller_data { - ruleset_t* ruleset; - thrdInfo_t* thread; -} poller_data; - - -/* a linked-list of subscription topics */ -typedef struct sublist_t { - char* subscribe; - struct sublist_t* next; -} sublist; - -struct instanceConf_s { - int type; - int action; - char* description; - int sndHWM; /* if you want more than 2^32 messages, */ - int rcvHWM; /* then pass in 0 (the default). */ - char* identity; - sublist* subscriptions; - int sndBuf; - int rcvBuf; - int linger; - int backlog; - int sndTimeout; - int rcvTimeout; - int maxMsgSize; - int rate; - int recoveryIVL; - int multicastHops; - int reconnectIVL; - int reconnectIVLMax; - int ipv4Only; - int affinity; - uchar* pszBindRuleset; - ruleset_t* pBindRuleset; - struct instanceConf_s* next; - -}; - -struct modConfData_s { - rsconf_t* pConf; - instanceConf_t* root; - instanceConf_t* tail; - int io_threads; -}; -struct lstn_s { - struct lstn_s* next; - void* sock; - ruleset_t* pRuleset; -}; - -/* ---------------------------------------------------------------------------- - * Static definitions/initializations. - */ -static modConfData_t* runModConf = NULL; -static struct lstn_s* lcnfRoot = NULL; -static struct lstn_s* lcnfLast = NULL; -static prop_t* s_namep = NULL; -static zloop_t* s_zloop = NULL; -static zctx_t* s_context = NULL; -static socket_type socketTypes[] = { - {"SUB", ZMQ_SUB }, - {"PULL", ZMQ_PULL }, - {"ROUTER", ZMQ_ROUTER }, - {"XSUB", ZMQ_XSUB } -}; - -static socket_action socketActions[] = { - {"BIND", ACTION_BIND}, - {"CONNECT", ACTION_CONNECT}, -}; - -static struct cnfparamdescr modpdescr[] = { - { "ioThreads", eCmdHdlrInt, 0 }, -}; - -static struct cnfparamblk modpblk = { - CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr -}; - -static struct cnfparamdescr inppdescr[] = { - { "description", eCmdHdlrGetWord, 0 }, - { "sockType", eCmdHdlrGetWord, 0 }, - { "subscribe", eCmdHdlrGetWord, 0 }, - { "ruleset", eCmdHdlrGetWord, 0 }, - { "action", eCmdHdlrGetWord, 0 }, - { "sndHWM", eCmdHdlrInt, 0 }, - { "rcvHWM", eCmdHdlrInt, 0 }, - { "identity", eCmdHdlrGetWord, 0 }, - { "sndBuf", eCmdHdlrInt, 0 }, - { "rcvBuf", eCmdHdlrInt, 0 }, - { "linger", eCmdHdlrInt, 0 }, - { "backlog", eCmdHdlrInt, 0 }, - { "sndTimeout", eCmdHdlrInt, 0 }, - { "rcvTimeout", eCmdHdlrInt, 0 }, - { "maxMsgSize", eCmdHdlrInt, 0 }, - { "rate", eCmdHdlrInt, 0 }, - { "recoveryIVL", eCmdHdlrInt, 0 }, - { "multicastHops", eCmdHdlrInt, 0 }, - { "reconnectIVL", eCmdHdlrInt, 0 }, - { "reconnectIVLMax", eCmdHdlrInt, 0 }, - { "ipv4Only", eCmdHdlrInt, 0 }, - { "affinity", eCmdHdlrInt, 0 } -}; - -static struct cnfparamblk inppblk = { - CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr -}; - -#include "im-helper.h" /* must be included AFTER the type definitions! */ - -/* ---------------------------------------------------------------------------- - * Helper functions - */ - -/* get the name of a socket type, return the ZMQ_XXX type - or -1 if not a supported type (see above) -*/ -static int getSocketType(char* name) { - int type = -1; - uint i; - - /* match name with known socket type */ - for(i=0; itype = -1; - info->action = -1; - info->description = NULL; - info->sndHWM = -1; - info->rcvHWM = -1; - info->identity = NULL; - info->subscriptions = NULL; - info->pszBindRuleset = NULL; - info->pBindRuleset = NULL; - info->sndBuf = -1; - info->rcvBuf = -1; - info->linger = -1; - info->backlog = -1; - info->sndTimeout = -1; - info->rcvTimeout = -1; - info->maxMsgSize = -1; - info->rate = -1; - info->recoveryIVL = -1; - info->multicastHops = -1; - info->reconnectIVL = -1; - info->reconnectIVLMax = -1; - info->ipv4Only = -1; - info->affinity = -1; - info->next = NULL; -}; - -/* given a comma separated list of subscriptions, create a char* array of them - * to set later - */ -static rsRetVal parseSubscriptions(char* subscribes, sublist** subList){ - char* tok = strtok(subscribes, ","); - sublist* currentSub; - sublist* head; - DEFiRet; - - /* create empty list */ - CHKmalloc(*subList = (sublist*)MALLOC(sizeof(sublist))); - head = *subList; - head->next = NULL; - head->subscribe=NULL; - currentSub=head; - - if(tok) { - head->subscribe=strdup(tok); - for(tok=strtok(NULL, ","); tok!=NULL;tok=strtok(NULL, ",")) { - CHKmalloc(currentSub->next = (sublist*)MALLOC(sizeof(sublist))); - currentSub=currentSub->next; - currentSub->subscribe=strdup(tok); - currentSub->next=NULL; - } - } else { - /* make empty subscription ie subscribe="" */ - head->subscribe=strdup(""); - } - /* TODO: temporary logging */ - currentSub = head; - DBGPRINTF("imzmq3: Subscriptions:"); - for(currentSub = head; currentSub != NULL; currentSub=currentSub->next) { - DBGPRINTF("'%s'", currentSub->subscribe); - } - DBGPRINTF("\n"); -finalize_it: - RETiRet; -} - -static rsRetVal validateConfig(instanceConf_t* info) { - - if (info->type == -1) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "you entered an invalid type"); - return RS_RET_INVALID_PARAMS; - } - if (info->action == -1) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "you entered an invalid action"); - return RS_RET_INVALID_PARAMS; - } - if (info->description == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "you didn't enter a description"); - return RS_RET_INVALID_PARAMS; - } - if(info->type == ZMQ_SUB && info->subscriptions == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "SUB sockets need a subscription"); - return RS_RET_INVALID_PARAMS; - } - if(info->type != ZMQ_SUB && info->subscriptions != NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "only SUB sockets can have subscriptions"); - return RS_RET_INVALID_PARAMS; - } - return RS_RET_OK; -} - -static rsRetVal createContext() { - if (s_context == NULL) { - DBGPRINTF("imzmq3: creating zctx..."); - zsys_handler_set(NULL); - s_context = zctx_new(); - - if (s_context == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "zctx_new failed: %s", - zmq_strerror(errno)); - /* DK: really should do better than invalid params...*/ - return RS_RET_INVALID_PARAMS; - } - DBGPRINTF("success!\n"); - if (runModConf->io_threads > 1) { - DBGPRINTF("setting io worker threads to %d\n", runModConf->io_threads); - zctx_set_iothreads(s_context, runModConf->io_threads); - } - } - return RS_RET_OK; -} - -static rsRetVal createSocket(instanceConf_t* info, void** sock) { - int rv; - sublist* sub; - - *sock = zsocket_new(s_context, info->type); - if (!sock) { - errmsg.LogError(0, - RS_RET_INVALID_PARAMS, - "zsocket_new failed: %s, for type %d", - zmq_strerror(errno),info->type); - /* DK: invalid params seems right here */ - return RS_RET_INVALID_PARAMS; - } - DBGPRINTF("imzmq3: socket of type %d created successfully\n", info->type) - /* Set options *before* the connect/bind. */ - if (info->identity) zsocket_set_identity(*sock, info->identity); - if (info->sndBuf > -1) zsocket_set_sndbuf(*sock, info->sndBuf); - if (info->rcvBuf > -1) zsocket_set_rcvbuf(*sock, info->rcvBuf); - if (info->linger > -1) zsocket_set_linger(*sock, info->linger); - if (info->backlog > -1) zsocket_set_backlog(*sock, info->backlog); - if (info->sndTimeout > -1) zsocket_set_sndtimeo(*sock, info->sndTimeout); - if (info->rcvTimeout > -1) zsocket_set_rcvtimeo(*sock, info->rcvTimeout); - if (info->maxMsgSize > -1) zsocket_set_maxmsgsize(*sock, info->maxMsgSize); - if (info->rate > -1) zsocket_set_rate(*sock, info->rate); - if (info->recoveryIVL > -1) zsocket_set_recovery_ivl(*sock, info->recoveryIVL); - if (info->multicastHops > -1) zsocket_set_multicast_hops(*sock, info->multicastHops); - if (info->reconnectIVL > -1) zsocket_set_reconnect_ivl(*sock, info->reconnectIVL); - if (info->reconnectIVLMax > -1) zsocket_set_reconnect_ivl_max(*sock, info->reconnectIVLMax); - if (info->ipv4Only > -1) zsocket_set_ipv4only(*sock, info->ipv4Only); - if (info->affinity > -1) zsocket_set_affinity(*sock, info->affinity); - if (info->sndHWM > -1 ) zsocket_set_sndhwm(*sock, info->sndHWM); - if (info->rcvHWM > -1 ) zsocket_set_rcvhwm(*sock, info->rcvHWM); - /* Set subscriptions.*/ - if (info->type == ZMQ_SUB) { - for(sub = info->subscriptions; sub!=NULL; sub=sub->next) { - zsocket_set_subscribe(*sock, sub->subscribe); - } - } - - /* Do the bind/connect... */ - if (info->action==ACTION_CONNECT) { - rv = zsocket_connect(*sock, info->description); - if (rv == -1) { - errmsg.LogError(0, - RS_RET_INVALID_PARAMS, - "zmq_connect using %s failed: %s", - info->description, zmq_strerror(errno)); - return RS_RET_INVALID_PARAMS; - } - DBGPRINTF("imzmq3: connect for %s successful\n",info->description); - } else { - rv = zsocket_bind(*sock, info->description); - if (rv == -1) { - errmsg.LogError(0, - RS_RET_INVALID_PARAMS, - "zmq_bind using %s failed: %s", - info->description, zmq_strerror(errno)); - return RS_RET_INVALID_PARAMS; - } - DBGPRINTF("imzmq3: bind for %s successful\n",info->description); - } - return RS_RET_OK; -} - -/* ---------------------------------------------------------------------------- - * Module endpoints - */ - - -/* add an actual endpoint - */ -static rsRetVal createInstance(instanceConf_t** pinst) { - DEFiRet; - instanceConf_t* inst; - CHKmalloc(inst = MALLOC(sizeof(instanceConf_t))); - - /* set defaults into new instance config struct */ - setDefaults(inst); - - /* add this to the config */ - if (runModConf->root == NULL || runModConf->tail == NULL) { - runModConf->tail = runModConf->root = inst; - } else { - runModConf->tail->next = inst; - runModConf->tail = inst; - } - *pinst = inst; -finalize_it: - RETiRet; -} - -static rsRetVal createListener(struct cnfparamvals* pvals) { - instanceConf_t* inst; - int i; - DEFiRet; - - CHKiRet(createInstance(&inst)); - for(i = 0 ; i < inppblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(inppblk.descr[i].name, "ruleset")) { - inst->pszBindRuleset = (uchar *)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "description")) { - inst->description = es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "sockType")){ - inst->type = getSocketType(es_str2cstr(pvals[i].val.d.estr, NULL)); - } else if(!strcmp(inppblk.descr[i].name, "action")){ - inst->action = getSocketAction(es_str2cstr(pvals[i].val.d.estr, NULL)); - } else if(!strcmp(inppblk.descr[i].name, "sndHWM")) { - inst->sndHWM = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "rcvHWM")) { - inst->rcvHWM = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "subscribe")) { - CHKiRet(parseSubscriptions(es_str2cstr(pvals[i].val.d.estr, NULL), - &inst->subscriptions)); - } else if(!strcmp(inppblk.descr[i].name, "identity")){ - inst->identity = es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(inppblk.descr[i].name, "sndBuf")) { - inst->sndBuf = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "rcvBuf")) { - inst->rcvBuf = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "linger")) { - inst->linger = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "backlog")) { - inst->backlog = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "sndTimeout")) { - inst->sndTimeout = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "rcvTimeout")) { - inst->rcvTimeout = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "maxMsgSize")) { - inst->maxMsgSize = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "rate")) { - inst->rate = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "recoveryIVL")) { - inst->recoveryIVL = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "multicastHops")) { - inst->multicastHops = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "reconnectIVL")) { - inst->reconnectIVL = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "reconnectIVLMax")) { - inst->reconnectIVLMax = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "ipv4Only")) { - inst->ipv4Only = (int) pvals[i].val.d.n; - } else if(!strcmp(inppblk.descr[i].name, "affinity")) { - inst->affinity = (int) pvals[i].val.d.n; - } else { - errmsg.LogError(0, NO_ERRCODE, "imzmq3: program error, non-handled " - "param '%s'\n", inppblk.descr[i].name); - } - - } -finalize_it: - RETiRet; -} - -static rsRetVal addListener(instanceConf_t* inst){ - /* create the socket */ - void* sock; - struct lstn_s* newcnfinfo; - DEFiRet; - - CHKiRet(createSocket(inst, &sock)); - - /* now create new lstn_s struct */ - CHKmalloc(newcnfinfo=(struct lstn_s*)MALLOC(sizeof(struct lstn_s))); - newcnfinfo->next = NULL; - newcnfinfo->sock = sock; - newcnfinfo->pRuleset = inst->pBindRuleset; - - /* add this struct to the global */ - if(lcnfRoot == NULL) { - lcnfRoot = newcnfinfo; - } - if(lcnfLast == NULL) { - lcnfLast = newcnfinfo; - } else { - lcnfLast->next = newcnfinfo; - lcnfLast = newcnfinfo; - } - -finalize_it: - RETiRet; -} - -static int handlePoll(zloop_t __attribute__((unused)) * loop, zmq_pollitem_t *poller, void* pd) { - msg_t* pMsg; - poller_data* pollerData = (poller_data*)pd; - - char* buf = zstr_recv(poller->socket); - if (msgConstruct(&pMsg) == RS_RET_OK) { - MsgSetRawMsg(pMsg, buf, strlen(buf)); - MsgSetInputName(pMsg, s_namep); - MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); - MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); - MsgSetRcvFromIP(pMsg, glbl.GetLocalHostIP()); - MsgSetMSGoffs(pMsg, 0); - MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY); - MsgSetRuleset(pMsg, pollerData->ruleset); - pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME; - submitMsg2(pMsg); - } - - /* gotta free the string returned from zstr_recv() */ - free(buf); - - if( pollerData->thread->bShallStop == TRUE) { - /* a handler that returns -1 will terminate the - czmq reactor loop - */ - return -1; - } - - return 0; -} - -/* called when runInput is called by rsyslog - */ -static rsRetVal rcv_loop(thrdInfo_t* pThrd){ - size_t n_items = 0; - size_t i; - int rv; - zmq_pollitem_t* items = NULL; - poller_data* pollerData = NULL; - struct lstn_s* current; - instanceConf_t* inst; - DEFiRet; - - /* now add listeners. This actually creates the sockets, etc... */ - for (inst = runModConf->root; inst != NULL; inst=inst->next) { - addListener(inst); - } - if (lcnfRoot == NULL) { - errmsg.LogError(0, NO_ERRCODE, "imzmq3: no listeners were " - "started, input not activated.\n"); - ABORT_FINALIZE(RS_RET_NO_RUN); - } - - /* count the # of items first */ - for(current=lcnfRoot;current!=NULL;current=current->next) - n_items++; - - /* make arrays of pollitems, pollerdata so they are easy to delete later */ - - /* create the poll items*/ - CHKmalloc(items = (zmq_pollitem_t*)MALLOC(sizeof(zmq_pollitem_t)*n_items)); - - /* create poller data (stuff to pass into the zmq closure called when we get a message)*/ - CHKmalloc(pollerData = (poller_data*)MALLOC(sizeof(poller_data)*n_items)); - - /* loop through and initialize the poll items and poller_data arrays...*/ - for(i=0, current = lcnfRoot; current != NULL; current = current->next, i++) { - /* create the socket, update items.*/ - items[i].socket=current->sock; - items[i].events = ZMQ_POLLIN; - - /* now update the poller_data for this item */ - pollerData[i].thread = pThrd; - pollerData[i].ruleset = current->pRuleset; - } - - s_zloop = zloop_new(); - for(i=0; ipConf = pConf; - /* init module config */ - runModConf->io_threads = 0; /* 0 means don't set it */ -ENDbeginCnfLoad - - -BEGINsetModCnf - struct cnfparamvals* pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if (NULL == pvals) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "imzmq3: error processing module " - " config parameters ['module(...)']"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - for (i=0; i < modpblk.nParams; ++i) { - if (!pvals[i].bUsed) - continue; - if (!strcmp(modpblk.descr[i].name, "ioThreads")) { - runModConf->io_threads = (int)pvals[i].val.d.n; - } else { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, - "imzmq3: config error, unknown " - "param %s in setModCnf\n", - modpblk.descr[i].name); - } - } - -finalize_it: - if (pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - - -BEGINendCnfLoad -CODESTARTendCnfLoad - /* Last chance to make changes to the in-memory config object for this - * input module. After this call, the config object must no longer be - * changed. */ - if (pModConf != runModConf) { - errmsg.LogError(0, NO_ERRCODE, "imzmq3: pointer of in-memory config object has " - "changed - pModConf=%p, runModConf=%p", pModConf, runModConf); - } - assert(pModConf == runModConf); -ENDendCnfLoad - - -/* function to generate error message if framework does not find requested ruleset */ -static inline void -std_checkRuleset_genErrMsg(__attribute__((unused)) modConfData_t *modConf, instanceConf_t *inst) -{ - errmsg.LogError(0, NO_ERRCODE, "imzmq3: ruleset '%s' for socket %s not found - " - "using default ruleset instead", inst->pszBindRuleset, - inst->description); -} - - -BEGINcheckCnf -instanceConf_t* inst; -CODESTARTcheckCnf - for(inst = pModConf->root; inst!=NULL; inst=inst->next) { - std_checkRuleset(pModConf, inst); - /* now, validate the instanceConf */ - CHKiRet(validateConfig(inst)); - } -finalize_it: - RETiRet; -ENDcheckCnf - - -BEGINactivateCnfPrePrivDrop -CODESTARTactivateCnfPrePrivDrop - if (pModConf != runModConf) { - errmsg.LogError(0, NO_ERRCODE, "imzmq3: pointer of in-memory config object has " - "changed - pModConf=%p, runModConf=%p", pModConf, runModConf); - } - assert(pModConf == runModConf); - - /* first create the context */ - createContext(); - - /* could setup context here, and set the global worker threads - and so on... */ -ENDactivateCnfPrePrivDrop - - -BEGINactivateCnf -CODESTARTactivateCnf - if (pModConf != runModConf) { - errmsg.LogError(0, NO_ERRCODE, "imzmq3: pointer of in-memory config object has " - "changed - pModConf=%p, runModConf=%p", pModConf, runModConf); - } - assert(pModConf == runModConf); -ENDactivateCnf - - -BEGINfreeCnf - struct lstn_s *lstn, *lstn_r; - instanceConf_t *inst, *inst_r; - sublist *sub, *sub_r; -CODESTARTfreeCnf - DBGPRINTF("imzmq3: BEGINfreeCnf ...\n"); - if (pModConf != runModConf) { - errmsg.LogError(0, NO_ERRCODE, "imzmq3: pointer of in-memory config object has " - "changed - pModConf=%p, runModConf=%p", pModConf, runModConf); - } - for (lstn = lcnfRoot; lstn != NULL; ) { - lstn_r = lstn; - lstn = lstn_r->next; - free(lstn_r); - } - for (inst = pModConf->root ; inst != NULL ; ) { - for (sub = inst->subscriptions; sub != NULL; ) { - free(sub->subscribe); - sub_r = sub; - sub = sub_r->next; - free(sub_r); - } - free(inst->pszBindRuleset); - inst_r = inst; - inst = inst->next; - free(inst_r); - } -ENDfreeCnf - - -BEGINnewInpInst - struct cnfparamvals* pvals; -CODESTARTnewInpInst - - DBGPRINTF("newInpInst (imzmq3)\n"); - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(NULL==pvals) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imzmq3: required parameters are missing\n"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - DBGPRINTF("imzmq3: input param blk:\n"); - cnfparamsPrint(&inppblk, pvals); - - /* now, parse the config params and so on... */ - CHKiRet(createListener(pvals)); - -finalize_it: -CODE_STD_FINALIZERnewInpInst - cnfparamvalsDestruct(pvals, &inppblk); -ENDnewInpInst - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_IMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES -CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES -CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - /* we only support the current interface specification */ - *ipIFVersProvided = CURR_MOD_IF_VERSION; -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); - CHKiRet(objUse(ruleset, CORE_COMPONENT)); -ENDmodInit - - diff -Nru rsyslog-7.6.0/plugins/imzmq3/Makefile.am rsyslog-5.10.1/plugins/imzmq3/Makefile.am --- rsyslog-7.6.0/plugins/imzmq3/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imzmq3/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = imzmq3.la - -imzmq3_la_SOURCES = imzmq3.c -imzmq3_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(CZMQ_CFLAGS) -imzmq3_la_LDFLAGS = -module -avoid-version -imzmq3_la_LIBADD = $(CZMQ_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/imzmq3/Makefile.in rsyslog-5.10.1/plugins/imzmq3/Makefile.in --- rsyslog-7.6.0/plugins/imzmq3/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/imzmq3/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/imzmq3 -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -imzmq3_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_imzmq3_la_OBJECTS = imzmq3_la-imzmq3.lo -imzmq3_la_OBJECTS = $(am_imzmq3_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -imzmq3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(imzmq3_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(imzmq3_la_SOURCES) -DIST_SOURCES = $(imzmq3_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = imzmq3.la -imzmq3_la_SOURCES = imzmq3.c -imzmq3_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(CZMQ_CFLAGS) -imzmq3_la_LDFLAGS = -module -avoid-version -imzmq3_la_LIBADD = $(CZMQ_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/imzmq3/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/imzmq3/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -imzmq3.la: $(imzmq3_la_OBJECTS) $(imzmq3_la_DEPENDENCIES) $(EXTRA_imzmq3_la_DEPENDENCIES) - $(AM_V_CCLD)$(imzmq3_la_LINK) -rpath $(pkglibdir) $(imzmq3_la_OBJECTS) $(imzmq3_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imzmq3_la-imzmq3.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -imzmq3_la-imzmq3.lo: imzmq3.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imzmq3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT imzmq3_la-imzmq3.lo -MD -MP -MF $(DEPDIR)/imzmq3_la-imzmq3.Tpo -c -o imzmq3_la-imzmq3.lo `test -f 'imzmq3.c' || echo '$(srcdir)/'`imzmq3.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/imzmq3_la-imzmq3.Tpo $(DEPDIR)/imzmq3_la-imzmq3.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imzmq3.c' object='imzmq3_la-imzmq3.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(imzmq3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o imzmq3_la-imzmq3.lo `test -f 'imzmq3.c' || echo '$(srcdir)/'`imzmq3.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/imzmq3/README rsyslog-5.10.1/plugins/imzmq3/README --- rsyslog-7.6.0/plugins/imzmq3/README 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/imzmq3/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -ZeroMQ 3.x Input Plugin - -Building this plugin: -Requires libzmq and libczmq. First, download the tarballs of both libzmq -and its supporting libczmq from http://download.zeromq.org. As of this -writing (04/23/2013), the most recent versions of libzmq and czmq are -3.2.2 and 1.3.2 respectively. Configure, build, and then install both libs. - -Imzmq3 allows you to push data into rsyslog from a zeromq socket. The example -below binds a SUB socket to port 7172, and then any messages with the topic -"foo" will be pushed into rsyslog. - -Please note: -This plugin only supports the newer (v7) config format. Legacy config support -was removed. - -Example Rsyslog.conf snippet: -------------------------------------------------------------------------------- -module(load="imzmq3" ioThreads="1") -input(type="imzmq3" action="CONNECT" socktype="SUB" description="tcp://*:7172" subscribe="foo,bar") - -------------------------------------------------------------------------------- -Note you can specify multiple subscriptions with a comma-delimited list, with -no spaces between values. - -The only global parameter for this plugin is ioThreads, which is optional and -probably best left to the zmq default unless you know exactly what you are -doing. - -The instance-level parameters are: - -Required -description -subscribe (required if the sockType is SUB) - -Optional -sockType (defaults to SUB) -action (defaults to BIND -sndHWM -rcvHWM -identity -sndBuf -rcvBuf -linger -backlog -sndTimeout -rcvTimeout -maxMsgSize -rate -recoveryIVL -multicastHops -reconnectIVL -reconnectIVLMax -ipv4Only -affinity - -These all correspond to zmq optional settings. Except where noted, the defaults -are the zmq defaults if not set. See http://api.zeromq.org/3-2:zmq-setsockopt -for info on these. diff -Nru rsyslog-7.6.0/plugins/mmanon/Makefile.am rsyslog-5.10.1/plugins/mmanon/Makefile.am --- rsyslog-7.6.0/plugins/mmanon/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmanon/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmanon.la - -mmanon_la_SOURCES = mmanon.c -mmanon_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmanon_la_LDFLAGS = -module -avoid-version -mmanon_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmanon/Makefile.in rsyslog-5.10.1/plugins/mmanon/Makefile.in --- rsyslog-7.6.0/plugins/mmanon/Makefile.in 2014-02-12 12:06:33.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmanon/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmanon -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmanon_la_DEPENDENCIES = -am_mmanon_la_OBJECTS = mmanon_la-mmanon.lo -mmanon_la_OBJECTS = $(am_mmanon_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmanon_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(mmanon_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmanon_la_SOURCES) -DIST_SOURCES = $(mmanon_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmanon.la -mmanon_la_SOURCES = mmanon.c -mmanon_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmanon_la_LDFLAGS = -module -avoid-version -mmanon_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmanon/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmanon/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmanon.la: $(mmanon_la_OBJECTS) $(mmanon_la_DEPENDENCIES) $(EXTRA_mmanon_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmanon_la_LINK) -rpath $(pkglibdir) $(mmanon_la_OBJECTS) $(mmanon_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmanon_la-mmanon.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmanon_la-mmanon.lo: mmanon.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmanon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmanon_la-mmanon.lo -MD -MP -MF $(DEPDIR)/mmanon_la-mmanon.Tpo -c -o mmanon_la-mmanon.lo `test -f 'mmanon.c' || echo '$(srcdir)/'`mmanon.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmanon_la-mmanon.Tpo $(DEPDIR)/mmanon_la-mmanon.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmanon.c' object='mmanon_la-mmanon.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmanon_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmanon_la-mmanon.lo `test -f 'mmanon.c' || echo '$(srcdir)/'`mmanon.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmanon/mmanon.c rsyslog-5.10.1/plugins/mmanon/mmanon.c --- rsyslog-7.6.0/plugins/mmanon/mmanon.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmanon/mmanon.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,402 +0,0 @@ -/* mmanon.c - * anonnymize IP addresses inside the syslog message part - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmanon") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - -/* precomputed table of IPv4 anonymization masks */ -static const uint32_t ipv4masks[33] = { - 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8, - 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80, - 0xffffff00, 0xfffffe00, 0xfffffc00, 0xfffff800, - 0xfffff000, 0xffffe000, 0xffffc000, 0xffff8000, - 0xffff0000, 0xfffe0000, 0xfffc0000, 0xfff80000, - 0xfff00000, 0xffe00000, 0xffc00000, 0xff800000, - 0xff000000, 0xfe000000, 0xfc000000, 0xf8000000, - 0xf0000000, 0xe0000000, 0xc0000000, 0x80000000, - 0x00000000 - }; - -/* define operation modes we have */ -#define SIMPLE_MODE 0 /* just overwrite */ -#define REWRITE_MODE 1 /* rewrite IP address, canoninized */ -typedef struct _instanceData { - char replChar; - int8_t mode; - struct { - int8_t bits; - } ipv4; -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "mode", eCmdHdlrGetWord, 0 }, - { "replacementchar", eCmdHdlrGetChar, 0 }, - { "ipv4.bits", eCmdHdlrInt, 0 }, -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->mode = REWRITE_MODE; - pData->replChar = 'x'; - pData->ipv4.bits = 16; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; - sbool bHadBitsErr; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmanon)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "mode")) { - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"simple", - sizeof("simple")-1)) { - pData->mode = SIMPLE_MODE; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"rewrite", - sizeof("rewrite")-1)) { - pData->mode = REWRITE_MODE; - } else { - char *cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_INVLD_MODE, - "mmanon: invalid anonymization mode '%s' - ignored", - cstr); - free(cstr); - } - } else if(!strcmp(actpblk.descr[i].name, "replacementchar")) { - pData->replChar = es_getBufAddr(pvals[i].val.d.estr)[0]; - } else if(!strcmp(actpblk.descr[i].name, "ipv4.bits")) { - pData->ipv4.bits = (int8_t) pvals[i].val.d.n; - } else { - dbgprintf("mmanon: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->mode == SIMPLE_MODE) { - bHadBitsErr = 0; - if(pData->ipv4.bits < 8) { - pData->ipv4.bits = 8; - bHadBitsErr = 1; - } else if(pData->ipv4.bits < 16) { - pData->ipv4.bits = 16; - bHadBitsErr = 1; - } else if(pData->ipv4.bits < 24) { - pData->ipv4.bits = 24; - bHadBitsErr = 1; - } else if(pData->ipv4.bits != 32) { - pData->ipv4.bits = 32; - bHadBitsErr = 1; - } - if(bHadBitsErr) - errmsg.LogError(0, RS_RET_INVLD_ANON_BITS, - "mmanon: invalid number of ipv4 bits " - "in simple mode, corrected to %d", - pData->ipv4.bits); - } else { /* REWRITE_MODE */ - if(pData->ipv4.bits < 1 || pData->ipv4.bits > 32) { - pData->ipv4.bits = 32; - errmsg.LogError(0, RS_RET_INVLD_ANON_BITS, - "mmanon: invalid number of ipv4 bits " - "in rewrite mode, corrected to %d", - pData->ipv4.bits); - } - if(pData->replChar != 'x') { - errmsg.LogError(0, RS_RET_REPLCHAR_IGNORED, - "mmanon: replacementChar parameter is ignored " - "in rewrite mode"); - } - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -static int -getnum(uchar *msg, int lenMsg, int *idx) -{ - int num = 0; - int i = *idx; - - while(i < lenMsg && msg[i] >= '0' && msg[i] <= '9') { - num = num * 10 + msg[i] - '0'; - ++i; - } - - *idx = i; - return num; -} - - -/* write an IP address octet to the output position */ -static int -writeOctet(uchar *msg, int idx, int *nxtidx, uint8_t octet) -{ - if(octet > 99) { - msg[idx++] = '0' + octet / 100; - octet = octet % 100; - } - if(octet > 9) { - msg[idx++] = '0' + octet / 10; - octet = octet % 10; - } - msg[idx++] = '0' + octet; - - if(nxtidx != NULL) { - if(idx + 1 != *nxtidx) { - /* we got shorter, fix it! */ - msg[idx] = '.'; - *nxtidx = idx + 1; - } - } - return idx; -} - -/* currently works for IPv4 only! */ -void -anonip(instanceData *pData, uchar *msg, int *pLenMsg, int *idx) -{ - int i = *idx; - int octet; - uint32_t ipv4addr; - int ipstart[4]; - int j; - int endpos; - int lenMsg = *pLenMsg; - - while(i < lenMsg && (msg[i] <= '0' || msg[i] >= '9')) { - ++i; /* skip to first number */ - } - if(i >= lenMsg) - goto done; - - /* got digit, let's see if ip */ - ipstart[0] = i; - octet = getnum(msg, lenMsg, &i); - if(octet > 255 || msg[i] != '.') goto done; - ipv4addr = octet << 24; - ++i; - ipstart[1] = i; - octet = getnum(msg, lenMsg, &i); - if(octet > 255 || msg[i] != '.') goto done; - ipv4addr |= octet << 16; - ++i; - ipstart[2] = i; - octet = getnum(msg, lenMsg, &i); - if(octet > 255 || msg[i] != '.') goto done; - ipv4addr |= octet << 8; - ++i; - ipstart[3] = i; - octet = getnum(msg, lenMsg, &i); - if(octet > 255) goto done; - ipv4addr |= octet; - - /* OK, we now found an ip address */ - if(pData->mode == SIMPLE_MODE) { - if(pData->ipv4.bits == 8) - j = ipstart[3]; - else if(pData->ipv4.bits == 16) - j = ipstart[2]; - else if(pData->ipv4.bits == 24) - j = ipstart[1]; - else /* due to our checks, this *must* be 32 */ - j = ipstart[0]; - while(j < i) { - if(msg[j] != '.') - msg[j] = pData->replChar; - ++j; - } - } else { /* REWRITE_MODE */ - ipv4addr &= ipv4masks[pData->ipv4.bits]; - if(pData->ipv4.bits > 24) - writeOctet(msg, ipstart[0], &(ipstart[1]), ipv4addr >> 24); - if(pData->ipv4.bits > 16) - writeOctet(msg, ipstart[1], &(ipstart[2]), (ipv4addr >> 16) & 0xff); - if(pData->ipv4.bits > 8) - writeOctet(msg, ipstart[2], &(ipstart[3]), (ipv4addr >> 8) & 0xff); - endpos = writeOctet(msg, ipstart[3], NULL, ipv4addr & 0xff); - /* if we had truncation, we need to shrink the msg */ - dbgprintf("existing i %d, endpos %d\n", i, endpos); - if(i - endpos > 0) { - *pLenMsg = lenMsg - (i - endpos); - memmove(msg+endpos, msg+i, lenMsg - i + 1); - /* correct index for next search! */ - i -= (i - endpos); - } - } - -done: *idx = i; - return; -} - - -BEGINdoAction - msg_t *pMsg; - uchar *msg; - int lenMsg; - int i; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - lenMsg = getMSGLen(pMsg); - msg = getMSG(pMsg); - for(i = 0 ; i < lenMsg ; ++i) { - anonip(pData, msg, &lenMsg, &i); - } - if(lenMsg != getMSGLen(pMsg)) - setMSGLen(pMsg, lenMsg); -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmanon:", sizeof(":mmanon:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmanon supports only v6+ config format, use: " - "action(type=\"mmanon\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmanon: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/mmaudit/Makefile.am rsyslog-5.10.1/plugins/mmaudit/Makefile.am --- rsyslog-7.6.0/plugins/mmaudit/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmaudit/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmaudit.la - -mmaudit_la_SOURCES = mmaudit.c -mmaudit_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmaudit_la_LDFLAGS = -module -avoid-version -mmaudit_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmaudit/Makefile.in rsyslog-5.10.1/plugins/mmaudit/Makefile.in --- rsyslog-7.6.0/plugins/mmaudit/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmaudit/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmaudit -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmaudit_la_DEPENDENCIES = -am_mmaudit_la_OBJECTS = mmaudit_la-mmaudit.lo -mmaudit_la_OBJECTS = $(am_mmaudit_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmaudit_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(mmaudit_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmaudit_la_SOURCES) -DIST_SOURCES = $(mmaudit_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmaudit.la -mmaudit_la_SOURCES = mmaudit.c -mmaudit_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmaudit_la_LDFLAGS = -module -avoid-version -mmaudit_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmaudit/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmaudit/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmaudit.la: $(mmaudit_la_OBJECTS) $(mmaudit_la_DEPENDENCIES) $(EXTRA_mmaudit_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmaudit_la_LINK) -rpath $(pkglibdir) $(mmaudit_la_OBJECTS) $(mmaudit_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmaudit_la-mmaudit.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmaudit_la-mmaudit.lo: mmaudit.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmaudit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmaudit_la-mmaudit.lo -MD -MP -MF $(DEPDIR)/mmaudit_la-mmaudit.Tpo -c -o mmaudit_la-mmaudit.lo `test -f 'mmaudit.c' || echo '$(srcdir)/'`mmaudit.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmaudit_la-mmaudit.Tpo $(DEPDIR)/mmaudit_la-mmaudit.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmaudit.c' object='mmaudit_la-mmaudit.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmaudit_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmaudit_la-mmaudit.lo `test -f 'mmaudit.c' || echo '$(srcdir)/'`mmaudit.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmaudit/mmaudit.c rsyslog-5.10.1/plugins/mmaudit/mmaudit.c --- rsyslog-7.6.0/plugins/mmaudit/mmaudit.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmaudit/mmaudit.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,354 +0,0 @@ -/* mmaudit.c - * This is a message modification module supporting Linux audit format - * in various settings. The module tries to identify the provided - * message as being a Linux audit record and, if so, converts it into - * cee-enhanced syslog format. - * - * NOTE WELL: - * Right now, we do not do any trust checks. So it is possible that a - * malicous user emits something that looks like an audit record and - * tries to fool the system with that. Solving this trust issue is NOT - * an easy thing to do. This will be worked on, as the lumberjack effort - * continues. Please consider the module in its current state as a proof - * of concept. - * - * File begun on 2012-02-23 by RGerhards - * - * Copyright 2012 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "cfsysline.h" -#include "dirty.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmaudit") - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - -/* static data */ -DEFobjCurrIf(errmsg); - -/* internal structures - */ -DEF_OMOD_STATIC_DATA - -typedef struct _instanceData { - int dummy; /* remove when the first real parameter is needed */ -} instanceData; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - resetConfigVariables(NULL, NULL); -ENDinitConfVars - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo - dbgprintf("mmaudit\n"); -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -static inline void -skipWhitespace(uchar **buf) -{ - while(**buf && isspace(**buf)) - ++(*buf); -} - - -static inline rsRetVal -parseName(uchar **buf, char *name, unsigned lenName) -{ - unsigned i; - skipWhitespace(buf); - --lenName; /* reserve space for '\0' */ - i = 0; - while(**buf && **buf != '=' && lenName) { -//dbgprintf("parseNAme, buf: %s\n", *buf); - name[i++] = **buf; - ++(*buf), --lenName; - } - name[i] = '\0'; - return RS_RET_OK; -} - - -static inline rsRetVal -parseValue(uchar **buf, char *val, unsigned lenval) -{ - char termc; - unsigned i; - DEFiRet; - - --lenval; /* reserve space for '\0' */ - i = 0; - if(**buf == '\0') { - FINALIZE; - } else if(**buf == '\'') { - termc = '\''; - ++(*buf); - } else if(**buf == '"') { - termc = '"'; - ++(*buf); - } else { - termc = ' '; - } - - while(**buf && **buf != termc && lenval) { -//dbgprintf("parseValue, termc '%c', buf: %s\n", termc, *buf); - val[i++] = **buf; - ++(*buf), --lenval; - } - val[i] = '\0'; - -finalize_it: - RETiRet; -} - - -/* parse the audit record and create libee structure - */ -static rsRetVal -audit_parse(uchar *buf, struct json_object **jsonRoot) -{ - struct json_object *json; - struct json_object *jval; - char name[1024]; - char val[1024]; - DEFiRet; - - *jsonRoot = json_object_new_object(); - if(*jsonRoot == NULL) { - ABORT_FINALIZE(RS_RET_ERR); - } - json = json_object_new_object(); - json_object_object_add(*jsonRoot, "data", json); - - while(*buf) { -//dbgprintf("audit_parse, buf: '%s'\n", buf); - CHKiRet(parseName(&buf, name, sizeof(name))); - if(*buf != '=') { - ABORT_FINALIZE(RS_RET_ERR); - } - ++buf; - CHKiRet(parseValue(&buf, val, sizeof(val))); - jval = json_object_new_string(val); - json_object_object_add(json, name, jval); -dbgprintf("mmaudit: parsed %s=%s\n", name, val); - } - - -finalize_it: - RETiRet; -} - - -BEGINdoAction - msg_t *pMsg; - uchar *buf; - int typeID; - struct json_object *jsonRoot; - struct json_object *json; - struct json_object *jval; - int i; - char auditID[1024]; - int bSuccess = 0; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - /* note that we can performance-optimize the interface, but this also - * requires changes to the libraries. For now, we accept message - * duplication. -- rgerhards, 2010-12-01 - */ - buf = getMSG(pMsg); - -dbgprintf("mmaudit: msg is '%s'\n", buf); - while(*buf && isspace(*buf)) { - ++buf; - } - - if(*buf == '\0' || strncmp((char*)buf, "type=", 5)) { - DBGPRINTF("mmaudit: type= undetected: '%s'\n", buf); - FINALIZE; - } - buf += 5; - - typeID = 0; - while(*buf && isdigit(*buf)) { - typeID = typeID * 10 + *buf - '0'; - ++buf; - } - - if(*buf == '\0' || strncmp((char*)buf, " audit(", sizeof(" audit(")-1)) { - DBGPRINTF("mmaudit: audit( header not found: %s'\n", buf); - FINALIZE; - } - buf += sizeof(" audit("); - - for(i = 0 ; i < (int) (sizeof(auditID)-2) && *buf && *buf != ')' ; ++i) { - auditID[i] = *buf++; - } - auditID[i] = '\0'; - if(*buf != ')' || *(buf+1) != ':') { - DBGPRINTF("mmaudit: trailer '):' not found, no audit record: %s'\n", buf); - FINALIZE; - } - buf += 2; - - audit_parse(buf, &jsonRoot); - if(jsonRoot == NULL) { - DBGPRINTF("mmaudit: audit parse error, assuming no " - "audit message: '%s'\n", buf); - FINALIZE; - } - - /* we now need to shuffle the "outer" properties into that stream */ - json = json_object_new_object(); - json_object_object_add(jsonRoot, "hdr", json); - jval = json_object_new_string(auditID); - json_object_object_add(json, "auditid", jval); - jval = json_object_new_int(typeID); - json_object_object_add(json, "type", jval); - - msgAddJSON(pMsg, (uchar*)"!audit", jsonRoot); - bSuccess = 1; - -finalize_it: - MsgSetParseSuccess(pMsg, bSuccess); -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - /* first check if this config line is actually for us */ - if(strncmp((char*) p, ":mmaudit:", sizeof(":mmaudit:") - 1)) { - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); - } - - /* ok, if we reach this point, we have something for us */ - p += sizeof(":mmaudit:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ - CHKiRet(createInstance(&pData)); - - /* check if a non-standard template is to be applied */ - if(*(p-1) == ';') - --p; - /* we call the function below because we need to call it via our interface definition. However, - * the format specified (if any) is always ignored. - */ - CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_TPL_AS_MSG, (uchar*) "RSYSLOG_FileFormat")); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -ENDqueryEtryPt - - - -/* Reset config variables for this module to default values. - */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - DEFiRet; - RETiRet; -} - - -BEGINmodInit() - rsRetVal localRet; - rsRetVal (*pomsrGetSupportedTplOpts)(unsigned long *pOpts); - unsigned long opts; - int bMsgPassingSupported; -CODESTARTmodInit -INITLegCnfVars - *ipIFVersProvided = CURR_MOD_IF_VERSION; - /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - /* check if the rsyslog core supports parameter passing code */ - bMsgPassingSupported = 0; - localRet = pHostQueryEtryPt((uchar*)"OMSRgetSupportedTplOpts", - &pomsrGetSupportedTplOpts); - if(localRet == RS_RET_OK) { - /* found entry point, so let's see if core supports msg passing */ - CHKiRet((*pomsrGetSupportedTplOpts)(&opts)); - if(opts & OMSR_TPL_AS_MSG) - bMsgPassingSupported = 1; - } else if(localRet != RS_RET_ENTRY_POINT_NOT_FOUND) { - ABORT_FINALIZE(localRet); /* Something else went wrong, not acceptable */ - } - - if(!bMsgPassingSupported) { - DBGPRINTF("mmaudit: msg-passing is not supported by rsyslog core, " - "can not continue.\n"); - ABORT_FINALIZE(RS_RET_NO_MSG_PASSING); - } - - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -ENDmodInit - -/* vi:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/mmcount/Makefile.am rsyslog-5.10.1/plugins/mmcount/Makefile.am --- rsyslog-7.6.0/plugins/mmcount/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmcount/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmcount.la - -mmcount_la_SOURCES = mmcount.c -mmcount_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmcount_la_LDFLAGS = -module -avoid-version -mmcount_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmcount/Makefile.in rsyslog-5.10.1/plugins/mmcount/Makefile.in --- rsyslog-7.6.0/plugins/mmcount/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmcount/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmcount -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmcount_la_DEPENDENCIES = -am_mmcount_la_OBJECTS = mmcount_la-mmcount.lo -mmcount_la_OBJECTS = $(am_mmcount_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmcount_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(mmcount_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmcount_la_SOURCES) -DIST_SOURCES = $(mmcount_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmcount.la -mmcount_la_SOURCES = mmcount.c -mmcount_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmcount_la_LDFLAGS = -module -avoid-version -mmcount_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmcount/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmcount/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmcount.la: $(mmcount_la_OBJECTS) $(mmcount_la_DEPENDENCIES) $(EXTRA_mmcount_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmcount_la_LINK) -rpath $(pkglibdir) $(mmcount_la_OBJECTS) $(mmcount_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmcount_la-mmcount.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmcount_la-mmcount.lo: mmcount.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcount_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmcount_la-mmcount.lo -MD -MP -MF $(DEPDIR)/mmcount_la-mmcount.Tpo -c -o mmcount_la-mmcount.lo `test -f 'mmcount.c' || echo '$(srcdir)/'`mmcount.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmcount_la-mmcount.Tpo $(DEPDIR)/mmcount_la-mmcount.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmcount.c' object='mmcount_la-mmcount.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmcount_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmcount_la-mmcount.lo `test -f 'mmcount.c' || echo '$(srcdir)/'`mmcount.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmcount/mmcount.c rsyslog-5.10.1/plugins/mmcount/mmcount.c --- rsyslog-7.6.0/plugins/mmcount/mmcount.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmcount/mmcount.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,342 +0,0 @@ -/* mmcount.c - * count messages by priority or json property of given app-name. - * - * Copyright 2013 Red Hat Inc. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "hashtable.h" - -#define JSON_COUNT_NAME "!mmcount" -#define SEVERITY_COUNT 8 - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmcount") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - -typedef struct _instanceData { - char *pszAppName; - int severity[SEVERITY_COUNT]; - char *pszKey; - char *pszValue; - int valueCounter; - struct hashtable *ht; -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "appname", eCmdHdlrGetWord, 0 }, - { "key", eCmdHdlrGetWord, 0 }, - { "value", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - int i; - - pData->pszAppName = NULL; - for (i = 0; i < SEVERITY_COUNT; i++) - pData->severity[i] = 0; - pData->pszKey = NULL; - pData->pszValue = NULL; - pData->valueCounter = 0; - pData->ht = NULL; -} - -static unsigned int -hash_from_key_fn(void *k) -{ - return *(unsigned int *)k; -} - -static int -key_equals_fn(void *k1, void *k2) -{ - return (*(unsigned int *)k1 == *(unsigned int *)k2); -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmcount)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "appname")) { - pData->pszAppName = es_str2cstr(pvals[i].val.d.estr, NULL); - continue; - } - if(!strcmp(actpblk.descr[i].name, "key")) { - pData->pszKey = es_str2cstr(pvals[i].val.d.estr, NULL); - continue; - } - if(!strcmp(actpblk.descr[i].name, "value")) { - pData->pszValue = es_str2cstr(pvals[i].val.d.estr, NULL); - continue; - } - dbgprintf("mmcount: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - - if(pData->pszAppName == NULL) { - dbgprintf("mmcount: action requires a appname"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(pData->pszKey != NULL && pData->pszValue == NULL) { - if(NULL == (pData->ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, NULL))) { - DBGPRINTF("mmcount: error creating hash table!\n"); - ABORT_FINALIZE(RS_RET_ERR); - } - } -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - -static int * -getCounter(struct hashtable *ht, char *str) { - unsigned int key; - int *pCounter; - unsigned int *pKey; - - /* we dont store str as key, instead we store hash of the str - as key to reduce memory usage */ - key = hash_from_string(str); - pCounter = hashtable_search(ht, &key); - if(pCounter) { - return pCounter; - } - - /* counter is not found for the str, so add new entry and - return the counter */ - if(NULL == (pKey = (unsigned int*)malloc(sizeof(unsigned int)))) { - DBGPRINTF("mmcount: memory allocation for key failed\n"); - return NULL; - } - *pKey = key; - - if(NULL == (pCounter = (int*)malloc(sizeof(int)))) { - DBGPRINTF("mmcount: memory allocation for value failed\n"); - free(pKey); - return NULL; - } - *pCounter = 0; - - if(!hashtable_insert(ht, pKey, pCounter)) { - DBGPRINTF("mmcount: inserting element into hashtable failed\n"); - free(pKey); - free(pCounter); - return NULL; - } - return pCounter; -} - -BEGINdoAction - msg_t *pMsg; - char *appname; - struct json_object *json = NULL; - es_str_t *estr = NULL; - struct json_object *keyjson = NULL; - char *pszValue; - int *pCounter; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - appname = getAPPNAME(pMsg, LOCK_MUTEX); - - if(0 != strcmp(appname, pData->pszAppName)) { - /* we are not working for this appname. nothing to do */ - ABORT_FINALIZE(RS_RET_OK); - } - - if(!pData->pszKey) { - /* no key given for count, so we count severity */ - if(pMsg->iSeverity <= SEVERITY_COUNT) { - pData->severity[pMsg->iSeverity]++; - json = json_object_new_int(pData->severity[pMsg->iSeverity]); - } - ABORT_FINALIZE(RS_RET_OK); - } - - /* key is given, so get the property json */ - estr = es_newStrFromBuf(pData->pszKey, strlen(pData->pszKey)); - if(msgGetCEEPropJSON(pMsg, estr, &keyjson) != RS_RET_OK) { - /* key not found in the message. nothing to do */ - ABORT_FINALIZE(RS_RET_OK); - } - - /* key found, so get the value */ - pszValue = (char*)json_object_get_string(keyjson); - - if(pData->pszValue) { - /* value also given for count */ - if(!strcmp(pszValue, pData->pszValue)) { - /* count for (value and key and appname) matched */ - pData->valueCounter++; - json = json_object_new_int(pData->valueCounter); - } - ABORT_FINALIZE(RS_RET_OK); - } - - /* value is not given, so we count for each value of given key */ - pCounter = getCounter(pData->ht, pszValue); - if(pCounter) { - (*pCounter)++; - json = json_object_new_int(*pCounter); - } -finalize_it: - if(estr) { - es_deleteStr(estr); - } - - if(json) { - msgAddJSON(pMsg, (uchar *)JSON_COUNT_NAME, json); - } -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmcount:", sizeof(":mmcount:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmcount supports only v6+ config format, use: " - "action(type=\"mmcount\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmcount: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/mmfields/Makefile.am rsyslog-5.10.1/plugins/mmfields/Makefile.am --- rsyslog-7.6.0/plugins/mmfields/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmfields/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmfields.la - -mmfields_la_SOURCES = mmfields.c -mmfields_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmfields_la_LDFLAGS = -module -avoid-version -mmfields_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmfields/Makefile.in rsyslog-5.10.1/plugins/mmfields/Makefile.in --- rsyslog-7.6.0/plugins/mmfields/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmfields/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmfields -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmfields_la_DEPENDENCIES = -am_mmfields_la_OBJECTS = mmfields_la-mmfields.lo -mmfields_la_OBJECTS = $(am_mmfields_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmfields_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(mmfields_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmfields_la_SOURCES) -DIST_SOURCES = $(mmfields_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmfields.la -mmfields_la_SOURCES = mmfields.c -mmfields_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmfields_la_LDFLAGS = -module -avoid-version -mmfields_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmfields/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmfields/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmfields.la: $(mmfields_la_OBJECTS) $(mmfields_la_DEPENDENCIES) $(EXTRA_mmfields_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmfields_la_LINK) -rpath $(pkglibdir) $(mmfields_la_OBJECTS) $(mmfields_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmfields_la-mmfields.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmfields_la-mmfields.lo: mmfields.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmfields_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmfields_la-mmfields.lo -MD -MP -MF $(DEPDIR)/mmfields_la-mmfields.Tpo -c -o mmfields_la-mmfields.lo `test -f 'mmfields.c' || echo '$(srcdir)/'`mmfields.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmfields_la-mmfields.Tpo $(DEPDIR)/mmfields_la-mmfields.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmfields.c' object='mmfields_la-mmfields.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmfields_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmfields_la-mmfields.lo `test -f 'mmfields.c' || echo '$(srcdir)/'`mmfields.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmfields/mmfields.c rsyslog-5.10.1/plugins/mmfields/mmfields.c --- rsyslog-7.6.0/plugins/mmfields/mmfields.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmfields/mmfields.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,274 +0,0 @@ -/* mmfields.c - * Parse all fields of the message into structured data inside the - * JSON tree. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmfields") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - -/* define operation modes we have */ -#define SIMPLE_MODE 0 /* just overwrite */ -#define REWRITE_MODE 1 /* rewrite IP address, canoninized */ -typedef struct _instanceData { - char separator; - uchar *jsonRoot; /**< container where to store fields */ -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "separator", eCmdHdlrGetChar, 0 }, - { "jsonroot", eCmdHdlrString, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance - free(pData->jsonRoot); -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->separator = ','; - pData->jsonRoot = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmfields)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "separator")) { - pData->separator = es_getBufAddr(pvals[i].val.d.estr)[0]; - } else if(!strcmp(actpblk.descr[i].name, "jsonroot")) { - pData->jsonRoot = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("mmfields: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - if(pData->jsonRoot == NULL) { - CHKmalloc(pData->jsonRoot = (uchar*) strdup("!")); - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -static inline rsRetVal -extractField(instanceData *pData, uchar *msgtext, int lenMsg, int *curridx, uchar *fieldbuf) -{ - int i, j; - DEFiRet; - i = *curridx; - j = 0; - while(i < lenMsg && msgtext[i] != pData->separator) { - fieldbuf[j++] = msgtext[i++]; - } - fieldbuf[j] = '\0'; - if(i < lenMsg) - ++i; - *curridx = i; - - RETiRet; -} - - -static inline rsRetVal -parse_fields(instanceData *pData, msg_t *pMsg, uchar *msgtext, int lenMsg) -{ - uchar fieldbuf[32*1024]; - uchar fieldname[512]; - struct json_object *json; - struct json_object *jval; - int field; - uchar *buf; - int currIdx = 0; - DEFiRet; - - if(lenMsg < (int) sizeof(fieldbuf)) { - buf = fieldbuf; - } else { - CHKmalloc(buf = malloc(lenMsg+1)); - } - - json = json_object_new_object(); - if(json == NULL) { - ABORT_FINALIZE(RS_RET_ERR); - } - field = 1; - while(currIdx < lenMsg) { - CHKiRet(extractField(pData, msgtext, lenMsg, &currIdx, buf)); - DBGPRINTF("mmfields: field %d: '%s'\n", field, buf); - snprintf((char*)fieldname, sizeof(fieldname), "f%d", field); - fieldname[sizeof(fieldname)-1] = '\0'; - jval = json_object_new_string((char*)fieldbuf); - json_object_object_add(json, (char*)fieldname, jval); - field++; - } - msgAddJSON(pMsg, pData->jsonRoot, json); -finalize_it: - RETiRet; -} - - -BEGINdoAction - msg_t *pMsg; - uchar *msg; - int lenMsg; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - lenMsg = getMSGLen(pMsg); - msg = getMSG(pMsg); - CHKiRet(parse_fields(pData, pMsg, msg, lenMsg)); -finalize_it: -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmfields:", sizeof(":mmfields:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmfields supports only v6+ config format, use: " - "action(type=\"mmfields\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmfields: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/mmjsonparse/Makefile.am rsyslog-5.10.1/plugins/mmjsonparse/Makefile.am --- rsyslog-7.6.0/plugins/mmjsonparse/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmjsonparse/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmjsonparse.la - -mmjsonparse_la_SOURCES = mmjsonparse.c -mmjsonparse_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmjsonparse_la_LDFLAGS = -module -avoid-version -mmjsonparse_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmjsonparse/Makefile.in rsyslog-5.10.1/plugins/mmjsonparse/Makefile.in --- rsyslog-7.6.0/plugins/mmjsonparse/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmjsonparse/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmjsonparse -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmjsonparse_la_DEPENDENCIES = -am_mmjsonparse_la_OBJECTS = mmjsonparse_la-mmjsonparse.lo -mmjsonparse_la_OBJECTS = $(am_mmjsonparse_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmjsonparse_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(mmjsonparse_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmjsonparse_la_SOURCES) -DIST_SOURCES = $(mmjsonparse_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmjsonparse.la -mmjsonparse_la_SOURCES = mmjsonparse.c -mmjsonparse_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmjsonparse_la_LDFLAGS = -module -avoid-version -mmjsonparse_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmjsonparse/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmjsonparse/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmjsonparse.la: $(mmjsonparse_la_OBJECTS) $(mmjsonparse_la_DEPENDENCIES) $(EXTRA_mmjsonparse_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmjsonparse_la_LINK) -rpath $(pkglibdir) $(mmjsonparse_la_OBJECTS) $(mmjsonparse_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmjsonparse_la-mmjsonparse.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmjsonparse_la-mmjsonparse.lo: mmjsonparse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmjsonparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmjsonparse_la-mmjsonparse.lo -MD -MP -MF $(DEPDIR)/mmjsonparse_la-mmjsonparse.Tpo -c -o mmjsonparse_la-mmjsonparse.lo `test -f 'mmjsonparse.c' || echo '$(srcdir)/'`mmjsonparse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmjsonparse_la-mmjsonparse.Tpo $(DEPDIR)/mmjsonparse_la-mmjsonparse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmjsonparse.c' object='mmjsonparse_la-mmjsonparse.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmjsonparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmjsonparse_la-mmjsonparse.lo `test -f 'mmjsonparse.c' || echo '$(srcdir)/'`mmjsonparse.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmjsonparse/mmjsonparse.c rsyslog-5.10.1/plugins/mmjsonparse/mmjsonparse.c --- rsyslog-7.6.0/plugins/mmjsonparse/mmjsonparse.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmjsonparse/mmjsonparse.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,311 +0,0 @@ -/* mmjsonparse.c - * This is a message modification module. If give, it extracts JSON data - * and populates the EE event structure with it. - * - * NOTE: read comments in module-template.h for details on the calling interface! - * - * File begun on 2012-02-20 by RGerhards - * - * Copyright 2012 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "cfsysline.h" -#include "dirty.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmjsonparse") - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - -/* static data */ -DEFobjCurrIf(errmsg); - -/* internal structures - */ -DEF_OMOD_STATIC_DATA - -typedef struct _instanceData { - struct json_tokener *tokener; -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance - pData->tokener = json_tokener_new(); - if(pData->tokener == NULL) { - errmsg.LogError(0, RS_RET_ERR, "error: could not create json " - "tokener, cannot activate action"); - ABORT_FINALIZE(RS_RET_ERR); - } -finalize_it: -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance - if(pData->tokener != NULL) - json_tokener_free(pData->tokener); -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo - DBGPRINTF("mmjsonparse\n"); -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -static rsRetVal -processJSON(instanceData *pData, msg_t *pMsg, char *buf, size_t lenBuf) -{ - struct json_object *json; - const char *errMsg; - DEFiRet; - - assert(pData->tokener != NULL); - DBGPRINTF("mmjsonparse: toParse: '%s'\n", buf); - json_tokener_reset(pData->tokener); - - json = json_tokener_parse_ex(pData->tokener, buf, lenBuf); - if(Debug) { - errMsg = NULL; - if(json == NULL) { - enum json_tokener_error err; - - err = pData->tokener->err; - if(err != json_tokener_continue) - errMsg = json_tokener_errors[err]; - else - errMsg = "Unterminated input"; - } else if((size_t)pData->tokener->char_offset < lenBuf) - errMsg = "Extra characters after JSON object"; - else if(!json_object_is_type(json, json_type_object)) - errMsg = "JSON value is not an object"; - if(errMsg != NULL) { - DBGPRINTF("mmjsonparse: Error parsing JSON '%s': %s\n", - buf, errMsg); - } - } - if(json == NULL - || ((size_t)pData->tokener->char_offset < lenBuf) - || (!json_object_is_type(json, json_type_object))) { - ABORT_FINALIZE(RS_RET_NO_CEE_MSG); - } - - msgAddJSON(pMsg, (uchar*)"!", json); -finalize_it: - RETiRet; -} - -#define COOKIE "@cee:" -#define LEN_COOKIE (sizeof(COOKIE)-1) -BEGINdoAction - msg_t *pMsg; - uchar *buf; - int bSuccess = 0; - struct json_object *jval; - struct json_object *json; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - /* note that we can performance-optimize the interface, but this also - * requires changes to the libraries. For now, we accept message - * duplication. -- rgerhards, 2010-12-01 - */ - buf = getMSG(pMsg); - - while(*buf && isspace(*buf)) { - ++buf; - } - - if(*buf == '\0' || strncmp((char*)buf, COOKIE, LEN_COOKIE)) { - DBGPRINTF("mmjsonparse: no JSON cookie: '%s'\n", buf); - ABORT_FINALIZE(RS_RET_NO_CEE_MSG); - } - buf += LEN_COOKIE; - CHKiRet(processJSON(pData, pMsg, (char*) buf, strlen((char*)buf))); - bSuccess = 1; -finalize_it: - if(iRet == RS_RET_NO_CEE_MSG) { - /* add buf as msg */ - json = json_object_new_object(); - jval = json_object_new_string((char*)buf); - json_object_object_add(json, "msg", jval); - msgAddJSON(pMsg, (uchar*)"!", json); - iRet = RS_RET_OK; - } - MsgSetParseSuccess(pMsg, bSuccess); -ENDdoAction - -BEGINnewActInst -CODESTARTnewActInst - /* Note: we currently do not have any parameters, so we do not need - * the lst ptr. However, we will most probably need params in the - * future. - */ - DBGPRINTF("newActInst (mmjsonparse)\n"); - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - /*setInstParamDefaults(pData);*/ - -CODE_STD_FINALIZERnewActInst -/* cnfparamvalsDestruct(pvals, &actpblk);*/ -ENDnewActInst - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - /* first check if this config line is actually for us */ - if(strncmp((char*) p, ":mmjsonparse:", sizeof(":mmjsonparse:") - 1)) { - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); - } - - /* ok, if we reach this point, we have something for us */ - p += sizeof(":mmjsonparse:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ - CHKiRet(createInstance(&pData)); - - /* check if a non-standard template is to be applied */ - if(*(p-1) == ';') - --p; - /* we call the function below because we need to call it via our interface definition. However, - * the format specified (if any) is always ignored. - */ - CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_TPL_AS_MSG, (uchar*) "RSYSLOG_FileFormat")); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -/* Reset config variables for this module to default values. - */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - DEFiRet; - RETiRet; -} - - -BEGINmodInit() - rsRetVal localRet; - rsRetVal (*pomsrGetSupportedTplOpts)(unsigned long *pOpts); - unsigned long opts; - int bMsgPassingSupported; -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; - /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmjsonparse: module compiled with rsyslog version %s.\n", VERSION); - /* check if the rsyslog core supports parameter passing code */ - bMsgPassingSupported = 0; - localRet = pHostQueryEtryPt((uchar*)"OMSRgetSupportedTplOpts", - &pomsrGetSupportedTplOpts); - if(localRet == RS_RET_OK) { - /* found entry point, so let's see if core supports msg passing */ - CHKiRet((*pomsrGetSupportedTplOpts)(&opts)); - if(opts & OMSR_TPL_AS_MSG) - bMsgPassingSupported = 1; - } else if(localRet != RS_RET_ENTRY_POINT_NOT_FOUND) { - ABORT_FINALIZE(localRet); /* Something else went wrong, not acceptable */ - } - - if(!bMsgPassingSupported) { - DBGPRINTF("mmjsonparse: msg-passing is not supported by rsyslog core, " - "can not continue.\n"); - ABORT_FINALIZE(RS_RET_NO_MSG_PASSING); - } - - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -ENDmodInit - -/* vi:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/mmnormalize/Makefile.am rsyslog-5.10.1/plugins/mmnormalize/Makefile.am --- rsyslog-7.6.0/plugins/mmnormalize/Makefile.am 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmnormalize/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmnormalize.la - -mmnormalize_la_SOURCES = mmnormalize.c -mmnormalize_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBLOGNORM_CFLAGS) $(LIBEE_CFLAGS) -mmnormalize_la_LDFLAGS = -module -avoid-version $(LIBLOGNORM_LIBS) $(LIBEE_LIBS) -mmnormalize_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmnormalize/Makefile.in rsyslog-5.10.1/plugins/mmnormalize/Makefile.in --- rsyslog-7.6.0/plugins/mmnormalize/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmnormalize/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmnormalize -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmnormalize_la_DEPENDENCIES = -am_mmnormalize_la_OBJECTS = mmnormalize_la-mmnormalize.lo -mmnormalize_la_OBJECTS = $(am_mmnormalize_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmnormalize_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(mmnormalize_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmnormalize_la_SOURCES) -DIST_SOURCES = $(mmnormalize_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmnormalize.la -mmnormalize_la_SOURCES = mmnormalize.c -mmnormalize_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBLOGNORM_CFLAGS) $(LIBEE_CFLAGS) -mmnormalize_la_LDFLAGS = -module -avoid-version $(LIBLOGNORM_LIBS) $(LIBEE_LIBS) -mmnormalize_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmnormalize/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmnormalize/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmnormalize.la: $(mmnormalize_la_OBJECTS) $(mmnormalize_la_DEPENDENCIES) $(EXTRA_mmnormalize_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmnormalize_la_LINK) -rpath $(pkglibdir) $(mmnormalize_la_OBJECTS) $(mmnormalize_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmnormalize_la-mmnormalize.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmnormalize_la-mmnormalize.lo: mmnormalize.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmnormalize_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmnormalize_la-mmnormalize.lo -MD -MP -MF $(DEPDIR)/mmnormalize_la-mmnormalize.Tpo -c -o mmnormalize_la-mmnormalize.lo `test -f 'mmnormalize.c' || echo '$(srcdir)/'`mmnormalize.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmnormalize_la-mmnormalize.Tpo $(DEPDIR)/mmnormalize_la-mmnormalize.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmnormalize.c' object='mmnormalize_la-mmnormalize.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmnormalize_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmnormalize_la-mmnormalize.lo `test -f 'mmnormalize.c' || echo '$(srcdir)/'`mmnormalize.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmnormalize/mmnormalize.c rsyslog-5.10.1/plugins/mmnormalize/mmnormalize.c --- rsyslog-7.6.0/plugins/mmnormalize/mmnormalize.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmnormalize/mmnormalize.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,408 +0,0 @@ -/* mmnormalize.c - * This is a message modification module. It normalizes the input message with - * the help of liblognorm. The messages EE event structure is updated. - * - * NOTE: read comments in module-template.h for details on the calling interface! - * - * TODO: check if we can replace libee via JSON system - currently that part - * is pretty inefficient... rgerhards, 2012-08-27 - * - * File begun on 2010-01-01 by RGerhards - * - * Copyright 2010-2012 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Rsyslog 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. - * - * Rsyslog 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 Rsyslog. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "cfsysline.h" -#include "dirty.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmnormalize") - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - -/* static data */ -DEFobjCurrIf(errmsg); - -/* internal structures - */ -DEF_OMOD_STATIC_DATA - -typedef struct _instanceData { - sbool bUseRawMsg; /**< use %rawmsg% instead of %msg% */ - uchar *rulebase; /**< name of rulebase to use */ - ln_ctx ctxln; /**< context to be used for liblognorm */ - ee_ctx ctxee; /**< context to be used for libee */ -} instanceData; - -typedef struct configSettings_s { - uchar *rulebase; /**< name of normalization rulebase to use */ - int bUseRawMsg; /**< use %rawmsg% instead of %msg% */ -} configSettings_t; -static configSettings_t cs; - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "rulebase", eCmdHdlrGetWord, 1 }, - { "userawmsg", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* to be called to build the libee part of the instance ONCE ALL PARAMETERS ARE CORRECT - * (and set within pData!). - */ -static rsRetVal -buildInstance(instanceData *pData) -{ - DEFiRet; - if((pData->ctxee = ee_initCtx()) == NULL) { - errmsg.LogError(0, RS_RET_ERR_LIBEE_INIT, "error: could not initialize libee " - "ctx, cannot activate action"); - ABORT_FINALIZE(RS_RET_ERR_LIBEE_INIT); - } - - if((pData->ctxln = ln_initCtx()) == NULL) { - errmsg.LogError(0, RS_RET_ERR_LIBLOGNORM_INIT, "error: could not initialize " - "liblognorm ctx, cannot activate action"); - ee_exitCtx(pData->ctxee); - ABORT_FINALIZE(RS_RET_ERR_LIBLOGNORM_INIT); - } - ln_setEECtx(pData->ctxln, pData->ctxee); - if(ln_loadSamples(pData->ctxln, (char*) pData->rulebase) != 0) { - errmsg.LogError(0, RS_RET_NO_RULEBASE, "error: normalization rulebase '%s' " - "could not be loaded cannot activate action", cs.rulebase); - ee_exitCtx(pData->ctxee); - ln_exitCtx(pData->ctxln); - ABORT_FINALIZE(RS_RET_ERR_LIBLOGNORM_SAMPDB_LOAD); - } -finalize_it: - RETiRet; -} - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - resetConfigVariables(NULL, NULL); -ENDinitConfVars - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.rulebase); - cs.rulebase = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance - free(pData->rulebase); - ee_exitCtx(pData->ctxee); - ln_exitCtx(pData->ctxln); -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo - dbgprintf("mmnormalize\n"); -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - -BEGINdoAction - msg_t *pMsg; - es_str_t *str; - uchar *buf; - char *cstrJSON; - int len; - int r; - struct ee_event *event = NULL; - struct json_tokener *tokener; - struct json_object *json; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - /* note that we can performance-optimize the interface, but this also - * requires changes to the libraries. For now, we accept message - * duplication. -- rgerhards, 2010-12-01 - */ - if(pData->bUseRawMsg) { - getRawMsg(pMsg, &buf, &len); - } else { - buf = getMSG(pMsg); - len = getMSGLen(pMsg); - } - str = es_newStrFromCStr((char*)buf, len); - r = ln_normalize(pData->ctxln, str, &event); - if(r != 0) { - DBGPRINTF("error %d during ln_normalize\n", r); - MsgSetParseSuccess(pMsg, 0); - } else { - MsgSetParseSuccess(pMsg, 1); - } - es_deleteStr(str); - - /* reformat to our json data struct */ - /* TODO: this is all extremly ineffcient! */ - ee_fmtEventToJSON(event, &str); - cstrJSON = es_str2cstr(str, NULL); - ee_deleteEvent(event); - dbgprintf("mmnormalize generated: %s\n", cstrJSON); - - tokener = json_tokener_new(); - json = json_tokener_parse_ex(tokener, cstrJSON, strlen((char*)cstrJSON)); - json_tokener_free(tokener); - msgAddJSON(pMsg, (uchar*)"!", json); - - free(cstrJSON); - es_deleteStr(str); -ENDdoAction - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->rulebase = NULL; - pData->bUseRawMsg = 0; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; - int bDestructPValsOnExit; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmnormalize)\n"); - - bDestructPValsOnExit = 0; - pvals = nvlstGetParams(lst, &actpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "mmnormalize: error reading " - "config parameters"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - bDestructPValsOnExit = 1; - - if(Debug) { - dbgprintf("action param blk in mmnormalize:\n"); - cnfparamsPrint(&actpblk, pvals); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "rulebase")) { - pData->rulebase = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "userawmsg")) { - pData->bUseRawMsg = (int) pvals[i].val.d.n; - } else { - DBGPRINTF("mmnormalize: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - - iRet = buildInstance(pData); -CODE_STD_FINALIZERnewActInst - if(bDestructPValsOnExit) - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - /* first check if this config line is actually for us */ - if(strncmp((char*) p, ":mmnormalize:", sizeof(":mmnormalize:") - 1)) { - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); - } - - if(cs.rulebase == NULL) { - errmsg.LogError(0, RS_RET_NO_RULEBASE, "error: no normalization rulebase was specified, use " - "$MMNormalizeSampleDB directive first!"); - ABORT_FINALIZE(RS_RET_NO_RULEBASE); - } - - /* ok, if we reach this point, we have something for us */ - p += sizeof(":mmnormalize:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ - CHKiRet(createInstance(&pData)); - - pData->rulebase = cs.rulebase; - pData->bUseRawMsg = cs.bUseRawMsg; - /* all config vars auto-reset! */ - cs.bUseRawMsg = 0; - cs.rulebase = NULL; /* we used it up! */ - - /* check if a non-standard template is to be applied */ - if(*(p-1) == ';') - --p; - /* we call the function below because we need to call it via our interface definition. However, - * the format specified (if any) is always ignored. - */ - CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_TPL_AS_MSG, (uchar*) "RSYSLOG_FileFormat")); - CHKiRet(buildInstance(pData)); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -ENDqueryEtryPt - - - -/* Reset config variables for this module to default values. - */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - DEFiRet; - cs.rulebase = NULL; - cs.bUseRawMsg = 0; - RETiRet; -} - -/* set the rulebase name */ -static rsRetVal -setRuleBase(void __attribute__((unused)) *pVal, uchar *pszName) -{ - DEFiRet; - cs.rulebase = pszName; - pszName = NULL; - RETiRet; -} - -BEGINmodInit() - rsRetVal localRet; - rsRetVal (*pomsrGetSupportedTplOpts)(unsigned long *pOpts); - unsigned long opts; - int bMsgPassingSupported; -CODESTARTmodInit -INITLegCnfVars - *ipIFVersProvided = CURR_MOD_IF_VERSION; - /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmnormalize: module compiled with rsyslog version %s.\n", VERSION); - /* check if the rsyslog core supports parameter passing code */ - bMsgPassingSupported = 0; - localRet = pHostQueryEtryPt((uchar*)"OMSRgetSupportedTplOpts", - &pomsrGetSupportedTplOpts); - if(localRet == RS_RET_OK) { - /* found entry point, so let's see if core supports msg passing */ - CHKiRet((*pomsrGetSupportedTplOpts)(&opts)); - if(opts & OMSR_TPL_AS_MSG) - bMsgPassingSupported = 1; - } else if(localRet != RS_RET_ENTRY_POINT_NOT_FOUND) { - ABORT_FINALIZE(localRet); /* Something else went wrong, not acceptable */ - } - - if(!bMsgPassingSupported) { - DBGPRINTF("mmnormalize: msg-passing is not supported by rsyslog core, " - "can not continue.\n"); - ABORT_FINALIZE(RS_RET_NO_MSG_PASSING); - } - - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - - CHKiRet(omsdRegCFSLineHdlr((uchar *)"mmnormalizerulebase", 0, eCmdHdlrGetWord, - setRuleBase, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"mmnormalizeuserawmsg", 0, eCmdHdlrBinary, - NULL, &cs.bUseRawMsg, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -ENDmodInit - -/* vi:set ai: - */ diff -Nru rsyslog-7.6.0/plugins/mmpstrucdata/Makefile.am rsyslog-5.10.1/plugins/mmpstrucdata/Makefile.am --- rsyslog-7.6.0/plugins/mmpstrucdata/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmpstrucdata/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmpstrucdata.la - -mmpstrucdata_la_SOURCES = mmpstrucdata.c -mmpstrucdata_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmpstrucdata_la_LDFLAGS = -module -avoid-version -mmpstrucdata_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmpstrucdata/Makefile.in rsyslog-5.10.1/plugins/mmpstrucdata/Makefile.in --- rsyslog-7.6.0/plugins/mmpstrucdata/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmpstrucdata/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmpstrucdata -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmpstrucdata_la_DEPENDENCIES = -am_mmpstrucdata_la_OBJECTS = mmpstrucdata_la-mmpstrucdata.lo -mmpstrucdata_la_OBJECTS = $(am_mmpstrucdata_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmpstrucdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(mmpstrucdata_la_LDFLAGS) $(LDFLAGS) \ - -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmpstrucdata_la_SOURCES) -DIST_SOURCES = $(mmpstrucdata_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmpstrucdata.la -mmpstrucdata_la_SOURCES = mmpstrucdata.c -mmpstrucdata_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmpstrucdata_la_LDFLAGS = -module -avoid-version -mmpstrucdata_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmpstrucdata/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmpstrucdata/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmpstrucdata.la: $(mmpstrucdata_la_OBJECTS) $(mmpstrucdata_la_DEPENDENCIES) $(EXTRA_mmpstrucdata_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmpstrucdata_la_LINK) -rpath $(pkglibdir) $(mmpstrucdata_la_OBJECTS) $(mmpstrucdata_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmpstrucdata_la-mmpstrucdata.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmpstrucdata_la-mmpstrucdata.lo: mmpstrucdata.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmpstrucdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmpstrucdata_la-mmpstrucdata.lo -MD -MP -MF $(DEPDIR)/mmpstrucdata_la-mmpstrucdata.Tpo -c -o mmpstrucdata_la-mmpstrucdata.lo `test -f 'mmpstrucdata.c' || echo '$(srcdir)/'`mmpstrucdata.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmpstrucdata_la-mmpstrucdata.Tpo $(DEPDIR)/mmpstrucdata_la-mmpstrucdata.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmpstrucdata.c' object='mmpstrucdata_la-mmpstrucdata.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmpstrucdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmpstrucdata_la-mmpstrucdata.lo `test -f 'mmpstrucdata.c' || echo '$(srcdir)/'`mmpstrucdata.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmpstrucdata/mmpstrucdata.c rsyslog-5.10.1/plugins/mmpstrucdata/mmpstrucdata.c --- rsyslog-7.6.0/plugins/mmpstrucdata/mmpstrucdata.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmpstrucdata/mmpstrucdata.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,402 +0,0 @@ -/* mmpstrucdata.c - * Parse all fields of the message into structured data inside the - * JSON tree. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmpstrucdata") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - -typedef struct _instanceData { - uchar *jsonRoot; /**< container where to store fields */ -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "jsonroot", eCmdHdlrString, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance - free(pData->jsonRoot); -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->jsonRoot = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmpstrucdata)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "jsonroot")) { - pData->jsonRoot = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("mmpstrucdata: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - if(pData->jsonRoot == NULL) { - CHKmalloc(pData->jsonRoot = (uchar*) strdup("!")); - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -static inline rsRetVal -parsePARAM_VALUE(uchar *sdbuf, int lenbuf, int *curridx, uchar *fieldbuf) -{ - int i, j; - DEFiRet; -dbgprintf("DDDD: parsePARAM_VALUE\n"); - i = *curridx; - j = 0; - while(i < lenbuf && sdbuf[i] != '"') { - if(sdbuf[i] == '\\') { - if(++i == lenbuf) { - fieldbuf[j++] = '\\'; - } else { - if(sdbuf[i] == '"') { - fieldbuf[j++] = '"'; - } else if(sdbuf[i] == '\\') { - fieldbuf[j++] = '\\'; - } else if(sdbuf[i] == ']') { - fieldbuf[j++] = '"'; - } else { - fieldbuf[j++] = '\\'; - fieldbuf[j++] = sdbuf[i]; - } - ++i; - } - } else { - fieldbuf[j++] = sdbuf[i++]; - } - } - fieldbuf[j] = '\0'; - *curridx = i; -dbgprintf("DDDD: parsePARAM_VALUE: '%s'\n", fieldbuf); - RETiRet; -} - - -static rsRetVal -parseSD_NAME(uchar *sdbuf, int lenbuf, int *curridx, uchar *namebuf) -{ - int i, j; - DEFiRet; -dbgprintf("DDDD: parseSD_NAME %s\n", sdbuf+*curridx); - i = *curridx; - for(j = 0 ; i < lenbuf && j < 32; ++j) { - if( sdbuf[i] == '=' || sdbuf[i] == '"' - || sdbuf[i] == ']' || sdbuf[i] == ' ') - break; - namebuf[j] = tolower(sdbuf[i]); - ++i; - } - namebuf[j] = '\0'; -dbgprintf("DDDD: parseSD_NAME, NAME: '%s'\n", namebuf); - *curridx = i; - RETiRet; -} - - -static inline rsRetVal -parseSD_PARAM(instanceData *pData, uchar *sdbuf, int lenbuf, int *curridx, struct json_object *jroot) -{ - int i; - uchar pName[33]; - uchar pVal[32*1024]; - struct json_object *jval; - DEFiRet; -dbgprintf("DDDD: parseSD_PARAM %s\n", sdbuf+*curridx); - - i = *curridx; - CHKiRet(parseSD_NAME(sdbuf, lenbuf, &i, pName)); - if(sdbuf[i] != '=') { - ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD); - } - ++i; - if(sdbuf[i] != '"') { - ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD); - } - ++i; - CHKiRet(parsePARAM_VALUE(sdbuf, lenbuf, &i, pVal)); - if(sdbuf[i] != '"') { - ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD); - } - ++i; - - jval = json_object_new_string((char*)pVal); - json_object_object_add(jroot, (char*)pName, jval); - - *curridx = i; -finalize_it: - RETiRet; -} - - -static inline rsRetVal -parseSD_ELEMENT(instanceData *pData, uchar *sdbuf, int lenbuf, int *curridx, struct json_object *jroot) -{ - int i; - uchar sd_id[33]; - struct json_object *json; - DEFiRet; -dbgprintf("DDDD: parseSD_ELEMENT: %s\n", sdbuf+*curridx); - - i = *curridx; - if(sdbuf[i] != '[') { - ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD); - } - ++i; /* eat '[' */ - - CHKiRet(parseSD_NAME(sdbuf, lenbuf, &i, sd_id)); - json = json_object_new_object(); - - while(i < lenbuf) { - if(sdbuf[i] == ']') { - break; - } else if(sdbuf[i] != ' ') { - ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD); - } - ++i; - while(i < lenbuf && sdbuf[i] == ' ') - ++i; - CHKiRet(parseSD_PARAM(pData, sdbuf, lenbuf, &i, json)); -dbgprintf("DDDD: done parseSD_PARAM, in loop, i:%d, lenbuf:%d, rest: %s\n", i, lenbuf, sdbuf+i); - } - - if(sdbuf[i] != ']') { - DBGPRINTF("mmpstrucdata: SD-ELEMENT does not terminate with " - "']': '%s'\n", sdbuf+i); - ABORT_FINALIZE(RS_RET_STRUC_DATA_INVLD); - } - ++i; /* eat ']' */ - *curridx = i; - json_object_object_add(jroot, (char*)sd_id, json); -dbgprintf("DDDD: SD_ELEMENT: json: '%s'\n", json_object_get_string(json)); -dbgprintf("DDDD: SD_ELEMENT: jroot '%s'\n", json_object_get_string(json)); -finalize_it: -dbgprintf("DDDD: parseSD_ELEMENT iRet:%d, i:%d, *curridx:%d\n", iRet, i, *curridx); - RETiRet; -} - -static inline rsRetVal -parse_sd(instanceData *pData, msg_t *pMsg) -{ -#if 0 - uchar fieldbuf[32*1024]; - uchar fieldname[512]; - struct json_object *json; - struct json_object *jval; - int field; - uchar *buf; -#endif - struct json_object *json, *jroot; - uchar *sdbuf; - int lenbuf; - int i = 0; - DEFiRet; - -#if 0 - if(lenMsg < (int) sizeof(fieldbuf)) { - buf = fieldbuf; - } else { - CHKmalloc(buf = malloc(lenMsg+1)); - } -#endif - -dbgprintf("DDDD: parse_sd\n"); - json = json_object_new_object(); - if(json == NULL) { - ABORT_FINALIZE(RS_RET_ERR); - } - MsgGetStructuredData(pMsg, &sdbuf,&lenbuf); - while(i < lenbuf) { - CHKiRet(parseSD_ELEMENT(pData, sdbuf, lenbuf, &i, json)); -dbgprintf("DDDD: parse_sd, i:%d\n", i); - } -dbgprintf("DDDD: json: '%s'\n", json_object_get_string(json)); - - jroot = json_object_new_object(); - if(jroot == NULL) { - ABORT_FINALIZE(RS_RET_ERR); - } - json_object_object_add(jroot, "rfc5424-sd", json); - msgAddJSON(pMsg, pData->jsonRoot, jroot); -finalize_it: - RETiRet; -} - - -BEGINdoAction - msg_t *pMsg; -CODESTARTdoAction -dbgprintf("DDDD: enter mmpstrucdata\n"); - pMsg = (msg_t*) ppString[0]; - if(!MsgHasStructuredData(pMsg)) { - DBGPRINTF("mmpstrucdata: message does not have structured data\n"); - FINALIZE; - } -dbgprintf("DDDD: parse mmpstrucdata\n"); - /* don't check return code - we never want rsyslog to retry - * or suspend this action! - */ - parse_sd(pData, pMsg); -dbgprintf("DDDD: done parse mmpstrucdata\n"); -finalize_it: -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmpstrucdata:", sizeof(":mmpstrucdata:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmpstrucdata supports only v6+ config format, use: " - "action(type=\"mmpstrucdata\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmpstrucdata: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/mmrfc5424addhmac/Makefile.am rsyslog-5.10.1/plugins/mmrfc5424addhmac/Makefile.am --- rsyslog-7.6.0/plugins/mmrfc5424addhmac/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmrfc5424addhmac/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmrfc5424addhmac.la - -mmrfc5424addhmac_la_SOURCES = mmrfc5424addhmac.c -mmrfc5424addhmac_la_CPPFLAGS = $(OPENSSL_CFLAGS) $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmrfc5424addhmac_la_LDFLAGS = -module -avoid-version -mmrfc5424addhmac_la_LIBADD = $(OPENSSL_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmrfc5424addhmac/Makefile.in rsyslog-5.10.1/plugins/mmrfc5424addhmac/Makefile.in --- rsyslog-7.6.0/plugins/mmrfc5424addhmac/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmrfc5424addhmac/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,639 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmrfc5424addhmac -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -mmrfc5424addhmac_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_mmrfc5424addhmac_la_OBJECTS = \ - mmrfc5424addhmac_la-mmrfc5424addhmac.lo -mmrfc5424addhmac_la_OBJECTS = $(am_mmrfc5424addhmac_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmrfc5424addhmac_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(mmrfc5424addhmac_la_LDFLAGS) \ - $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmrfc5424addhmac_la_SOURCES) -DIST_SOURCES = $(mmrfc5424addhmac_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmrfc5424addhmac.la -mmrfc5424addhmac_la_SOURCES = mmrfc5424addhmac.c -mmrfc5424addhmac_la_CPPFLAGS = $(OPENSSL_CFLAGS) $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmrfc5424addhmac_la_LDFLAGS = -module -avoid-version -mmrfc5424addhmac_la_LIBADD = $(OPENSSL_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmrfc5424addhmac/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmrfc5424addhmac/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmrfc5424addhmac.la: $(mmrfc5424addhmac_la_OBJECTS) $(mmrfc5424addhmac_la_DEPENDENCIES) $(EXTRA_mmrfc5424addhmac_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmrfc5424addhmac_la_LINK) -rpath $(pkglibdir) $(mmrfc5424addhmac_la_OBJECTS) $(mmrfc5424addhmac_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmrfc5424addhmac_la-mmrfc5424addhmac.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmrfc5424addhmac_la-mmrfc5424addhmac.lo: mmrfc5424addhmac.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmrfc5424addhmac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmrfc5424addhmac_la-mmrfc5424addhmac.lo -MD -MP -MF $(DEPDIR)/mmrfc5424addhmac_la-mmrfc5424addhmac.Tpo -c -o mmrfc5424addhmac_la-mmrfc5424addhmac.lo `test -f 'mmrfc5424addhmac.c' || echo '$(srcdir)/'`mmrfc5424addhmac.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmrfc5424addhmac_la-mmrfc5424addhmac.Tpo $(DEPDIR)/mmrfc5424addhmac_la-mmrfc5424addhmac.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmrfc5424addhmac.c' object='mmrfc5424addhmac_la-mmrfc5424addhmac.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmrfc5424addhmac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmrfc5424addhmac_la-mmrfc5424addhmac.lo `test -f 'mmrfc5424addhmac.c' || echo '$(srcdir)/'`mmrfc5424addhmac.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmrfc5424addhmac/mmrfc5424addhmac.c rsyslog-5.10.1/plugins/mmrfc5424addhmac/mmrfc5424addhmac.c --- rsyslog-7.6.0/plugins/mmrfc5424addhmac/mmrfc5424addhmac.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmrfc5424addhmac/mmrfc5424addhmac.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,379 +0,0 @@ -/* mmrfc5424addhmac.c - * custom module: add hmac to RFC5424 messages - * - * Note on important design decision: This module is fully self-contained. - * Most importantly, it does not rely on mmpstrucdata to populate the - * structured data portion of the messages JSON. There are two reasons - * for this: - * 1. robustness - * - this guard against misconfiguration - * - it permits us to be more liberal in regard to malformed - * structured data - * - it permits us to handle border-cases (like duplicate - * SD-IDs) with much less complexity - * 2. performance - * With being "on the spot" of what we need we can reduce memory - * reads and writes. This is a considerable save if the JSON representation - * is not otherwise needed. - * - * Note that the recommended calling sequence if both of these modules - * are used is - * - * 1. mmrfc5424addhmac - * 2. mmpstrucdata - * - * This sequence permits mmpstrucdata to pick up the modifications we - * made in this module here. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmrfc5424addhmac") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - -typedef struct _instanceData { - uchar *key; - int16_t keylen; /* cached length of key, to avoid recomputation */ - uchar *sdid; /* SD-ID to be used to persist the hmac */ - int16_t sdidLen; - const EVP_MD *algo; -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "key", eCmdHdlrString, 1 }, - { "hashfunction", eCmdHdlrString, 1 }, - { "sd_id", eCmdHdlrGetWord, 1 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->key = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - char *ciphername; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmrfc5424addhmac)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "key")) { - pData->key = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - pData->keylen = es_strlen(pvals[i].val.d.estr); - } else if(!strcmp(actpblk.descr[i].name, "hashfunction")) { - ciphername = es_str2cstr(pvals[i].val.d.estr, NULL); - pData->algo = EVP_get_digestbyname(ciphername); - if(pData->algo == NULL) { - errmsg.LogError(0, RS_RET_CRY_INVLD_ALGO, - "hashFunction '%s' unknown to openssl - " - "cannot continue", ciphername); - free(ciphername); - ABORT_FINALIZE(RS_RET_CRY_INVLD_ALGO); - } - free(ciphername); - } else if(!strcmp(actpblk.descr[i].name, "sd_id")) { - pData->sdid = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - pData->sdidLen = es_strlen(pvals[i].val.d.estr); - } else { - dbgprintf("mmrfc5424addhmac: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -/* turn the binary data in bin of length len into a - * printable hex string. "print" must be 2*len+1 (for \0) - */ -static inline void -hexify(uchar *bin, int len, uchar *print) -{ - static const char hexchars[16] = - {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; - int iSrc, iDst; - - for(iSrc = iDst = 0 ; iSrc < len ; ++iSrc) { - print[iDst++] = hexchars[bin[iSrc]>>4]; - print[iDst++] = hexchars[bin[iSrc]&0x0f]; - } - print[iDst] = '\0'; -} - - -/* skip to end of current SD-ID. This function can be improved - * in regard to fully parsing based on RFC5424, HOWEVER, this would - * also reduce performance. So we consider the current implementation - * to be superior. - */ -static inline void -skipSDID(uchar *sdbuf, int sdlen, int *rootIdx) -{ - int i; - i = *rootIdx; - while(i < sdlen) { - if(sdbuf[i] == ']') { - if(i > *rootIdx && sdbuf[i-1] == '\\') { - ; /* escaped, nothing to do! */ - } else { - ++i; /* eat ']' */ - break; - } - } - ++i; - } - *rootIdx = i; -} - -static inline void -getSDID(uchar *sdbuf, int sdlen, int *rootIdx, uchar *sdid) -{ - int i, j; - i = *rootIdx; - j = 0; - - if(sdbuf[i] != '[') { - ++i; - goto done; - } - - ++i; - while(i < sdlen && sdbuf[i] != '=' && sdbuf[i] != ' ' - && sdbuf[i] != ']' && sdbuf[i] != '"') { - sdid[j++] = sdbuf[i++]; - } -done: - sdid[j] = '\0'; - *rootIdx = i; -} - -/* check if "our" hmac is already present */ -static inline sbool -isHmacPresent(instanceData *pData, msg_t *pMsg) -{ - uchar *sdbuf; - rs_size_t sdlen; - sbool found; - int i; - uchar sdid[33]; /* RFC-based size limit */ - - MsgGetStructuredData(pMsg, &sdbuf, &sdlen); - found = 0; - - if(sdbuf[0] == '-') /* RFC: struc data is empty! */ - goto done; - - i = 0; - while(i < sdlen && !found) { - getSDID(sdbuf, sdlen, &i, sdid); - if(!strcmp((char*)pData->sdid, (char*)sdid)) { - found = 1; - break; - } - skipSDID(sdbuf, sdlen, &i); - } - -done: - return found; -} - -static inline rsRetVal -hashMsg(instanceData *pData, msg_t *pMsg) -{ - uchar *pRawMsg; - int lenRawMsg; - uchar *sdbuf; - rs_size_t sdlen; - unsigned int hashlen; - uchar hash[EVP_MAX_MD_SIZE]; - uchar hashPrintable[2*EVP_MAX_MD_SIZE+1]; - uchar newsd[64*1024]; /* we assume this is sufficient... */ - int lenNewsd; - DEFiRet; - - MsgGetStructuredData(pMsg, &sdbuf, &sdlen); - getRawMsg(pMsg, &pRawMsg, &lenRawMsg); - HMAC(pData->algo, pData->key, pData->keylen, - pRawMsg, lenRawMsg, hash, &hashlen); - hexify(hash, hashlen, hashPrintable); - lenNewsd = snprintf((char*)newsd, sizeof(newsd), "[%s hash=\"%s\"]", - (char*)pData->sdid, (char*)hashPrintable); - MsgAddToStructuredData(pMsg, newsd, lenNewsd); - RETiRet; -} - - -BEGINdoAction - msg_t *pMsg; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - if( msgGetProtocolVersion(pMsg) == MSG_RFC5424_PROTOCOL - && !isHmacPresent(pData, pMsg)) { - hashMsg(pData, pMsg); - } else { - if(Debug) { - uchar *pRawMsg; - int lenRawMsg; - getRawMsg(pMsg, &pRawMsg, &lenRawMsg); - dbgprintf("mmrfc5424addhmac: non-rfc5424 or HMAC already " - "present: %.256s\n", pRawMsg); - } - } -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmrfc5424addhmac:", sizeof(":mmrfc5424addhmac:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmrfc5424addhmac supports only v6+ config format, use: " - "action(type=\"mmrfc5424addhmac\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); - EVP_cleanup(); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmrfc5424addhmac: module compiled with rsyslog version %s.\n", VERSION); - OpenSSL_add_all_digests(); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/mmsequence/Makefile.am rsyslog-5.10.1/plugins/mmsequence/Makefile.am --- rsyslog-7.6.0/plugins/mmsequence/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmsequence/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmsequence.la - -mmsequence_la_SOURCES = mmsequence.c -mmsequence_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmsequence_la_LDFLAGS = -module -avoid-version -mmsequence_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmsequence/Makefile.in rsyslog-5.10.1/plugins/mmsequence/Makefile.in --- rsyslog-7.6.0/plugins/mmsequence/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmsequence/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmsequence -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmsequence_la_DEPENDENCIES = -am_mmsequence_la_OBJECTS = mmsequence_la-mmsequence.lo -mmsequence_la_OBJECTS = $(am_mmsequence_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmsequence_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(mmsequence_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmsequence_la_SOURCES) -DIST_SOURCES = $(mmsequence_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmsequence.la -mmsequence_la_SOURCES = mmsequence.c -mmsequence_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmsequence_la_LDFLAGS = -module -avoid-version -mmsequence_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmsequence/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmsequence/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmsequence.la: $(mmsequence_la_OBJECTS) $(mmsequence_la_DEPENDENCIES) $(EXTRA_mmsequence_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmsequence_la_LINK) -rpath $(pkglibdir) $(mmsequence_la_OBJECTS) $(mmsequence_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsequence_la-mmsequence.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmsequence_la-mmsequence.lo: mmsequence.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmsequence_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmsequence_la-mmsequence.lo -MD -MP -MF $(DEPDIR)/mmsequence_la-mmsequence.Tpo -c -o mmsequence_la-mmsequence.lo `test -f 'mmsequence.c' || echo '$(srcdir)/'`mmsequence.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmsequence_la-mmsequence.Tpo $(DEPDIR)/mmsequence_la-mmsequence.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmsequence.c' object='mmsequence_la-mmsequence.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmsequence_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmsequence_la-mmsequence.lo `test -f 'mmsequence.c' || echo '$(srcdir)/'`mmsequence.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmsequence/mmsequence.c rsyslog-5.10.1/plugins/mmsequence/mmsequence.c --- rsyslog-7.6.0/plugins/mmsequence/mmsequence.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmsequence/mmsequence.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ -/* mmsequence.c - * Generate a number based on some sequence. - * - * Copyright 2013 pavel@levshin.spb.ru. - * - * Based on: mmcount.c - * Copyright 2013 Red Hat Inc. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "hashtable.h" - -#define JSON_VAR_NAME "$!mmsequence" - -enum mmSequenceModes { - mmSequenceRandom, - mmSequencePerInstance, - mmSequencePerKey -}; - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmsequence") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - -typedef struct _instanceData { - enum mmSequenceModes mode; - int valueFrom; - int valueTo; - int step; - unsigned int seed; - int value; - char *pszKey; - char *pszVar; -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "mode", eCmdHdlrGetWord, 0 }, - { "from", eCmdHdlrNonNegInt, 0 }, - { "to", eCmdHdlrPositiveInt, 0 }, - { "step", eCmdHdlrNonNegInt, 0 }, - { "key", eCmdHdlrGetWord, 0 }, - { "var", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -/* table for key-counter pairs */ -static struct hashtable *ght; -static pthread_mutex_t ght_mutex = PTHREAD_MUTEX_INITIALIZER; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->mode = mmSequencePerInstance; - pData->valueFrom = 0; - pData->valueTo = INT_MAX; - pData->step = 1; - pData->pszKey = ""; - pData->pszVar = JSON_VAR_NAME; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; - char *cstr; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmsequence)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "mode")) { - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"random", - sizeof("random")-1)) { - pData->mode = mmSequenceRandom; - } else if (!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"instance", - sizeof("instance")-1)) { - pData->mode = mmSequencePerInstance; - } else if (!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"key", - sizeof("key")-1)) { - pData->mode = mmSequencePerKey; - } else { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_INVLD_MODE, - "mmsequence: invalid mode '%s' - ignored", - cstr); - free(cstr); - } - continue; - } - if(!strcmp(actpblk.descr[i].name, "from")) { - pData->valueFrom = pvals[i].val.d.n; - continue; - } - if(!strcmp(actpblk.descr[i].name, "to")) { - pData->valueTo = pvals[i].val.d.n; - continue; - } - if(!strcmp(actpblk.descr[i].name, "step")) { - pData->step = pvals[i].val.d.n; - continue; - } - if(!strcmp(actpblk.descr[i].name, "key")) { - pData->pszKey = es_str2cstr(pvals[i].val.d.estr, NULL); - continue; - } - if(!strcmp(actpblk.descr[i].name, "var")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - if (strlen(cstr) < 3) { - errmsg.LogError(0, RS_RET_VALUE_NOT_SUPPORTED, - "mmsequence: valid variable name should be at least " - "3 symbols long, got %s", cstr); - free(cstr); - } else if (cstr[0] != '$') { - errmsg.LogError(0, RS_RET_VALUE_NOT_SUPPORTED, - "mmsequence: valid variable name should start with $," - "got %s", cstr); - free(cstr); - } else { - pData->pszVar = cstr; - } - continue; - } - dbgprintf("mmsequence: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - switch(pData->mode) { - case mmSequenceRandom: - pData->seed = (unsigned int)(intptr_t)pData ^ (unsigned int)time(NULL); - break; - case mmSequencePerInstance: - pData->value = pData->valueTo; - break; - case mmSequencePerKey: - if (pthread_mutex_lock(&ght_mutex)) { - DBGPRINTF("mmsequence: mutex lock has failed!\n"); - ABORT_FINALIZE(RS_RET_ERR); - } - if (ght == NULL) { - if(NULL == (ght = create_hashtable(100, hash_from_string, key_equals_string, NULL))) { - pthread_mutex_unlock(&ght_mutex); - DBGPRINTF("mmsequence: error creating hash table!\n"); - ABORT_FINALIZE(RS_RET_ERR); - } - } - pthread_mutex_unlock(&ght_mutex); - break; - default: - errmsg.LogError(0, RS_RET_INVLD_MODE, - "mmsequence: this mode is not currently implemented"); - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - -static int * -getCounter(struct hashtable *ht, char *str, int initial) { - int *pCounter; - char *pStr; - - pCounter = hashtable_search(ht, str); - if(pCounter) { - return pCounter; - } - - /* counter is not found for the str, so add new entry and - return the counter */ - if(NULL == (pStr = strdup(str))) { - DBGPRINTF("mmsequence: memory allocation for key failed\n"); - return NULL; - } - - if(NULL == (pCounter = (int*)malloc(sizeof(*pCounter)))) { - DBGPRINTF("mmsequence: memory allocation for value failed\n"); - free(pStr); - return NULL; - } - *pCounter = initial; - - if(!hashtable_insert(ht, pStr, pCounter)) { - DBGPRINTF("mmsequence: inserting element into hashtable failed\n"); - free(pStr); - free(pCounter); - return NULL; - } - return pCounter; -} - - -BEGINdoAction - msg_t *pMsg; - struct json_object *json; - int val = 0; - int *pCounter; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - - switch(pData->mode) { - case mmSequenceRandom: - val = pData->valueFrom + (rand_r(&pData->seed) % - (pData->valueTo - pData->valueFrom)); - break; - case mmSequencePerInstance: - if (pData->value >= pData->valueTo - pData->step) { - pData->value = pData->valueFrom; - } else { - pData->value += pData->step; - } - val = pData->value; - break; - case mmSequencePerKey: - if (!pthread_mutex_lock(&ght_mutex)) { - pCounter = getCounter(ght, pData->pszKey, pData->valueTo); - if(pCounter) { - if (*pCounter >= pData->valueTo - pData->step - || *pCounter < pData->valueFrom ) { - *pCounter = pData->valueFrom; - } else { - *pCounter += pData->step; - } - val = *pCounter; - } else { - errmsg.LogError(0, RS_RET_NOT_FOUND, - "mmsequence: unable to fetch the counter from hash"); - } - pthread_mutex_unlock(&ght_mutex); - } else { - errmsg.LogError(0, RS_RET_ERR, - "mmsequence: mutex lock has failed!"); - } - - break; - default: - errmsg.LogError(0, RS_RET_NOT_IMPLEMENTED, - "mmsequence: this mode is not currently implemented"); - } - - /* finalize_it: */ - json = json_object_new_int(val); - if (json == NULL) { - errmsg.LogError(0, RS_RET_OBJ_CREATION_FAILED, - "mmsequence: unable to create JSON"); - } else if (RS_RET_OK != msgAddJSON(pMsg, (uchar *)pData->pszVar + 1, json)) { - errmsg.LogError(0, RS_RET_OBJ_CREATION_FAILED, - "mmsequence: unable to pass out the value"); - json_object_put(json); - } -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmsequence:", sizeof(":mmsequence:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmsequence supports only v6+ config format, use: " - "action(type=\"mmsequence\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmsequence: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/mmsnmptrapd/Makefile.in rsyslog-5.10.1/plugins/mmsnmptrapd/Makefile.in --- rsyslog-7.6.0/plugins/mmsnmptrapd/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmsnmptrapd/Makefile.in 2012-10-17 14:42:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) mmsnmptrapd_la_DEPENDENCIES = am_mmsnmptrapd_la_OBJECTS = mmsnmptrapd_la-mmsnmptrapd.lo mmsnmptrapd_la_OBJECTS = $(am_mmsnmptrapd_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent mmsnmptrapd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(mmsnmptrapd_la_SOURCES) DIST_SOURCES = $(mmsnmptrapd_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -mmsnmptrapd.la: $(mmsnmptrapd_la_OBJECTS) $(mmsnmptrapd_la_DEPENDENCIES) $(EXTRA_mmsnmptrapd_la_DEPENDENCIES) +mmsnmptrapd.la: $(mmsnmptrapd_la_OBJECTS) $(mmsnmptrapd_la_DEPENDENCIES) $(AM_V_CCLD)$(mmsnmptrapd_la_LINK) -rpath $(pkglibdir) $(mmsnmptrapd_la_OBJECTS) $(mmsnmptrapd_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mmsnmptrapd_la-mmsnmptrapd.lo: mmsnmptrapd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmsnmptrapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmsnmptrapd_la-mmsnmptrapd.lo -MD -MP -MF $(DEPDIR)/mmsnmptrapd_la-mmsnmptrapd.Tpo -c -o mmsnmptrapd_la-mmsnmptrapd.lo `test -f 'mmsnmptrapd.c' || echo '$(srcdir)/'`mmsnmptrapd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmsnmptrapd_la-mmsnmptrapd.Tpo $(DEPDIR)/mmsnmptrapd_la-mmsnmptrapd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmsnmptrapd.c' object='mmsnmptrapd_la-mmsnmptrapd.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mmsnmptrapd.c' object='mmsnmptrapd_la-mmsnmptrapd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmsnmptrapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmsnmptrapd_la-mmsnmptrapd.lo `test -f 'mmsnmptrapd.c' || echo '$(srcdir)/'`mmsnmptrapd.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmsnmptrapd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmsnmptrapd_la-mmsnmptrapd.lo `test -f 'mmsnmptrapd.c' || echo '$(srcdir)/'`mmsnmptrapd.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/mmsnmptrapd/mmsnmptrapd.c rsyslog-5.10.1/plugins/mmsnmptrapd/mmsnmptrapd.c --- rsyslog-7.6.0/plugins/mmsnmptrapd/mmsnmptrapd.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmsnmptrapd/mmsnmptrapd.c 2012-10-17 14:41:20.000000000 +0000 @@ -49,7 +49,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmsnmptrapd") static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); @@ -77,7 +76,11 @@ uchar *pszTagName; /**< name of tag start value that indicates snmptrapd initiated message */ uchar *pszSeverityMapping; /**< severitystring to numerical code mapping for snmptrapd string */ } configSettings_t; -static configSettings_t cs; +configSettings_t cs; + +//TODO: enable for v6 +#if 0 +SCOPING_SUPPORT; /* must be set AFTER configSettings_t is defined */ BEGINinitConfVars /* (re)set config variables to default values */ CODESTARTinitConfVars @@ -85,6 +88,7 @@ cs.pszSeverityMapping = NULL; resetConfigVariables(NULL, NULL); ENDinitConfVars +#endif BEGINcreateInstance @@ -362,7 +366,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES ENDqueryEtryPt @@ -386,7 +389,7 @@ unsigned long opts; int bMsgPassingSupported; CODESTARTmodInit -INITLegCnfVars +//TODO v6: add SCOPINGmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr diff -Nru rsyslog-7.6.0/plugins/mmutf8fix/Makefile.am rsyslog-5.10.1/plugins/mmutf8fix/Makefile.am --- rsyslog-7.6.0/plugins/mmutf8fix/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmutf8fix/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = mmutf8fix.la - -mmutf8fix_la_SOURCES = mmutf8fix.c -mmutf8fix_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmutf8fix_la_LDFLAGS = -module -avoid-version -mmutf8fix_la_LIBADD = - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/mmutf8fix/Makefile.in rsyslog-5.10.1/plugins/mmutf8fix/Makefile.in --- rsyslog-7.6.0/plugins/mmutf8fix/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmutf8fix/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/mmutf8fix -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -mmutf8fix_la_DEPENDENCIES = -am_mmutf8fix_la_OBJECTS = mmutf8fix_la-mmutf8fix.lo -mmutf8fix_la_OBJECTS = $(am_mmutf8fix_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -mmutf8fix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(mmutf8fix_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(mmutf8fix_la_SOURCES) -DIST_SOURCES = $(mmutf8fix_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = mmutf8fix.la -mmutf8fix_la_SOURCES = mmutf8fix.c -mmutf8fix_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -mmutf8fix_la_LDFLAGS = -module -avoid-version -mmutf8fix_la_LIBADD = -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/mmutf8fix/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/mmutf8fix/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -mmutf8fix.la: $(mmutf8fix_la_OBJECTS) $(mmutf8fix_la_DEPENDENCIES) $(EXTRA_mmutf8fix_la_DEPENDENCIES) - $(AM_V_CCLD)$(mmutf8fix_la_LINK) -rpath $(pkglibdir) $(mmutf8fix_la_OBJECTS) $(mmutf8fix_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmutf8fix_la-mmutf8fix.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mmutf8fix_la-mmutf8fix.lo: mmutf8fix.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmutf8fix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmutf8fix_la-mmutf8fix.lo -MD -MP -MF $(DEPDIR)/mmutf8fix_la-mmutf8fix.Tpo -c -o mmutf8fix_la-mmutf8fix.lo `test -f 'mmutf8fix.c' || echo '$(srcdir)/'`mmutf8fix.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmutf8fix_la-mmutf8fix.Tpo $(DEPDIR)/mmutf8fix_la-mmutf8fix.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmutf8fix.c' object='mmutf8fix_la-mmutf8fix.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmutf8fix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmutf8fix_la-mmutf8fix.lo `test -f 'mmutf8fix.c' || echo '$(srcdir)/'`mmutf8fix.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/mmutf8fix/mmutf8fix.c rsyslog-5.10.1/plugins/mmutf8fix/mmutf8fix.c --- rsyslog-7.6.0/plugins/mmutf8fix/mmutf8fix.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/mmutf8fix/mmutf8fix.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -/* mmutf8fix.c - * fix invalid UTF8 sequences. This is begun as a very simple replacer - * of non-control characters, and actually breaks some UTF-8 encoding - * right now. If the module turns out to be useful, it should be enhanced - * to support modes that really detect invalid UTF8. In the longer term - * it could also be evolved into an any-charset-to-UTF8 converter. But - * first let's see if it really gets into widespread enough use. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("mmutf8fix") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* define operation modes we have */ -#define MODE_CC 0 /* just fix control characters */ -#define MODE_UTF8 1 /* do real UTF-8 fixing */ - -/* config variables */ -typedef struct _instanceData { - uchar replChar; - uint8_t mode; /* operations mode */ -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "mode", eCmdHdlrGetWord, 0 }, - { "replacementchar", eCmdHdlrGetChar, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->mode = MODE_UTF8; - pData->replChar = ' '; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (mmutf8fix)\n"); - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "mode")) { - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"utf-8", - sizeof("utf-8")-1)) { - pData->mode = MODE_UTF8; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"controlcharacters", - sizeof("controlcharacters")-1)) { - pData->mode = MODE_CC; - } else { - char *cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_INVLD_MODE, - "mmutf8fix: invalid mode '%s' - ignored", - cstr); - free(cstr); - } - } else if(!strcmp(actpblk.descr[i].name, "replacementchar")) { - pData->replChar = es_getBufAddr(pvals[i].val.d.estr)[0]; - } else { - dbgprintf("mmutf8fix: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - - -static inline void -doCC(instanceData *pData, uchar *msg, int lenMsg) -{ - int i; - - for(i = 0 ; i < lenMsg ; ++i) { - if(msg[i] < 32 || msg[i] > 126) { - msg[i] = pData->replChar; - } - } -} - -/* fix an invalid multibyte sequence */ -static inline void -fixInvldMBSeq(instanceData *pData, uchar *msg, int lenMsg, int strtIdx, int *endIdx, int8_t seqLen) -{ - int i; - - *endIdx = strtIdx + seqLen; - if(*endIdx > lenMsg) - *endIdx = lenMsg; - for(i = strtIdx ; i < *endIdx ; ++i) - msg[i] = pData->replChar; -} - -static inline void -doUTF8(instanceData *pData, uchar *msg, int lenMsg) -{ - uchar c; - int8_t seqLen, bytesLeft = 0; - uint32_t codepoint; - int strtIdx, endIdx; - int i; - - for(i = 0 ; i < lenMsg ; ++i) { - c = msg[i]; - if(bytesLeft) { - if((c & 0xc0) != 0x80) { - /* sequence invalid, invalidate all bytes */ - fixInvldMBSeq(pData, msg, lenMsg, strtIdx, &endIdx, - seqLen); - i = endIdx - 1; - bytesLeft = 0; - } else { - codepoint = (codepoint << 6) | (c & 0x3f); - --bytesLeft; - if(bytesLeft == 0) { - /* too-large codepoint? */ - if(codepoint > 0x10FFFF) { - fixInvldMBSeq(pData, msg, lenMsg, - strtIdx, &endIdx, - seqLen); - } - } - } - } else { - if((c & 0x80) == 0) { - /* 1-byte sequence, US-ASCII */ - ; /* nothing to do, all well */ - } else if((c & 0xe0) == 0xc0) { - /* 2-byte sequence */ - strtIdx = i; - seqLen = bytesLeft = 1; - codepoint = c & 0x1f; - } else if((c & 0xf0) == 0xe0) { - /* 3-byte sequence */ - strtIdx = i; - seqLen = bytesLeft = 2; - codepoint = c & 0x0f; - } else if((c & 0xf8) == 0xf0) { - /* 4-byte sequence */ - strtIdx = i; - seqLen = bytesLeft = 3; - codepoint = c & 0x07; - } else { /* invalid (5&6 byte forbidden by RFC3629) */ - msg[i] = pData->replChar; - } - if(i+bytesLeft >= lenMsg) { - int dummy = lenMsg; - /* invalid, as rest of message cannot contain full char */ - fixInvldMBSeq(pData, msg, lenMsg, strtIdx, &dummy, seqLen); - i = lenMsg - 1; - } - } - } -} - -BEGINdoAction - msg_t *pMsg; - uchar *msg; - int lenMsg; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - lenMsg = getMSGLen(pMsg); - msg = getMSG(pMsg); - if(pData->mode == MODE_CC) { - doCC(pData, msg, lenMsg); - } else { - doUTF8(pData, msg, lenMsg); - } -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(strncmp((char*) p, ":mmutf8fix:", sizeof(":mmutf8fix:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "mmutf8fix supports only v6+ config format, use: " - "action(type=\"mmutf8fix\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("mmutf8fix: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omdbalerting/Makefile.am rsyslog-5.10.1/plugins/omdbalerting/Makefile.am --- rsyslog-7.6.0/plugins/omdbalerting/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/omdbalerting/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,8 @@ +pkglib_LTLIBRARIES = omdbalerting.la + +omdbalerting_la_SOURCES = omdbalerting.c +omdbalerting_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) +omdbalerting_la_LDFLAGS = -module -avoid-version +omdbalerting_la_LIBADD = + +EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omdbalerting/Makefile.in rsyslog-5.10.1/plugins/omdbalerting/Makefile.in --- rsyslog-7.6.0/plugins/omdbalerting/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/omdbalerting/Makefile.in 2012-10-17 14:42:40.000000000 +0000 @@ -0,0 +1,592 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/omdbalerting +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ + $(top_srcdir)/m4/atomic_operations_64bit.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +omdbalerting_la_DEPENDENCIES = +am_omdbalerting_la_OBJECTS = omdbalerting_la-omdbalerting.lo +omdbalerting_la_OBJECTS = $(am_omdbalerting_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +omdbalerting_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(omdbalerting_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(omdbalerting_la_SOURCES) +DIST_SOURCES = $(omdbalerting_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_LIBS = @CURL_LIBS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIBS = @DL_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GSS_LIBS = @GSS_LIBS@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ +HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ +HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ +HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ +IMUDP_LIBS = @IMUDP_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ +LIBDBI_LIBS = @LIBDBI_LIBS@ +LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ +LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORACLE_CFLAGS = @ORACLE_CFLAGS@ +ORACLE_LIBS = @ORACLE_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ +PTHREADS_LIBS = @PTHREADS_LIBS@ +RANLIB = @RANLIB@ +RELP_CFLAGS = @RELP_CFLAGS@ +RELP_LIBS = @RELP_LIBS@ +RSRT_CFLAGS = @RSRT_CFLAGS@ +RSRT_LIBS = @RSRT_LIBS@ +RT_LIBS = @RT_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ +SOL_LIBS = @SOL_LIBS@ +STRIP = @STRIP@ +UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ +UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ +VERSION = @VERSION@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_valgrind = @have_valgrind@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moddirs = @moddirs@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkglib_LTLIBRARIES = omdbalerting.la +omdbalerting_la_SOURCES = omdbalerting.c +omdbalerting_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) +omdbalerting_la_LDFLAGS = -module -avoid-version +omdbalerting_la_LIBADD = +EXTRA_DIST = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/omdbalerting/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/omdbalerting/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +omdbalerting.la: $(omdbalerting_la_OBJECTS) $(omdbalerting_la_DEPENDENCIES) + $(AM_V_CCLD)$(omdbalerting_la_LINK) -rpath $(pkglibdir) $(omdbalerting_la_OBJECTS) $(omdbalerting_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omdbalerting_la-omdbalerting.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +omdbalerting_la-omdbalerting.lo: omdbalerting.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omdbalerting_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omdbalerting_la-omdbalerting.lo -MD -MP -MF $(DEPDIR)/omdbalerting_la-omdbalerting.Tpo -c -o omdbalerting_la-omdbalerting.lo `test -f 'omdbalerting.c' || echo '$(srcdir)/'`omdbalerting.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omdbalerting_la-omdbalerting.Tpo $(DEPDIR)/omdbalerting_la-omdbalerting.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omdbalerting.c' object='omdbalerting_la-omdbalerting.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omdbalerting_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omdbalerting_la-omdbalerting.lo `test -f 'omdbalerting.c' || echo '$(srcdir)/'`omdbalerting.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/omdbalerting/omdbalerting.c rsyslog-5.10.1/plugins/omdbalerting/omdbalerting.c --- rsyslog-7.6.0/plugins/omdbalerting/omdbalerting.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/omdbalerting/omdbalerting.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,145 @@ +/* omdbalerting.c + * generate alerts based on database contents - so far a skeleton + * left for implementation by somebody else (skeleton created on request). + * + * NOTE: read comments in module-template.h for more specifics! + * + * File begun on 2009-11-17 by RGerhards + * + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" +#include "rsyslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "conf.h" +#include "syslogd-types.h" +#include "srUtils.h" +#include "template.h" +#include "module-template.h" +#include "errmsg.h" +#include "cfsysline.h" + +MODULE_TYPE_OUTPUT +MODULE_TYPE_NOKEEP + +/* internal structures + */ +DEF_OMOD_STATIC_DATA + +/* config variables */ + + +typedef struct _instanceData { +} instanceData; + +BEGINcreateInstance +CODESTARTcreateInstance +ENDcreateInstance + + +BEGINisCompatibleWithFeature +CODESTARTisCompatibleWithFeature + if(eFeat == sFEATURERepeatedMsgReduction) + iRet = RS_RET_OK; +ENDisCompatibleWithFeature + + +BEGINfreeInstance +CODESTARTfreeInstance +ENDfreeInstance + + +BEGINdbgPrintInstInfo +CODESTARTdbgPrintInstInfo +ENDdbgPrintInstInfo + + +BEGINtryResume +CODESTARTtryResume +ENDtryResume + +BEGINdoAction +CODESTARTdoAction +ENDdoAction + + +BEGINparseSelectorAct +CODESTARTparseSelectorAct +CODE_STD_STRING_REQUESTparseSelectorAct(1) + /* first check if this config line is actually for us */ + if(strncmp((char*) p, ":omdbalerting:", sizeof(":dbalerting:") - 1)) { + ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); + } + + /* ok, if we reach this point, we have something for us */ + p += sizeof(":omdbalerting:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ + CHKiRet(createInstance(&pData)); + + /* check if a non-standard template is to be applied */ + if(*(p-1) == ';') + --p; + /* we request the standard interface via template, others may be more useful + * here. + */ + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, 0, (uchar*) "RSYSLOG_FileFormat")); +CODE_STD_FINALIZERparseSelectorAct +ENDparseSelectorAct + + +BEGINmodExit +CODESTARTmodExit +ENDmodExit + + +BEGINqueryEtryPt +CODESTARTqueryEtryPt +CODEqueryEtryPt_STD_OMOD_QUERIES +ENDqueryEtryPt + + + +/* Reset config variables for this module to default values. + */ +static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +{ + DEFiRet; + RETiRet; +} + + +BEGINmodInit() +CODESTARTmodInit + *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ +CODEmodInit_QueryRegCFSLineHdlr + // SAMPLE! CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomdbalertingensurelfending", 0, eCmdHdlrBinary, NULL, + // &bEnsureLFEnding, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, + resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); +ENDmodInit + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/plugins/omelasticsearch/cJSON/cjson.c rsyslog-5.10.1/plugins/omelasticsearch/cJSON/cjson.c --- rsyslog-7.6.0/plugins/omelasticsearch/cJSON/cjson.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omelasticsearch/cJSON/cjson.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,514 +0,0 @@ -/* - Copyright (c) 2009 Dave Gamble - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -/* cJSON */ -/* JSON parser in C. */ - -#include -#include -#include -#include -#include -#include -#include -#include "cjson.h" - -static const char *ep; - -const char *cJSON_GetErrorPtr() {return ep;} - -static int cJSON_strcasecmp(const char *s1,const char *s2) -{ - if (!s1) return (s1==s2)?0:1;if (!s2) return 1; - for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0; - return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); -} - -static void *(*cJSON_malloc)(size_t sz) = malloc; -static void (*cJSON_free)(void *ptr) = free; - -static char* cJSON_strdup(const char* str) -{ - size_t len; - char* copy; - - len = strlen(str) + 1; - if (!(copy = (char*)cJSON_malloc(len))) return 0; - memcpy(copy,str,len); - return copy; -} - -void cJSON_InitHooks(cJSON_Hooks* hooks) -{ - if (!hooks) { /* Reset hooks */ - cJSON_malloc = malloc; - cJSON_free = free; - return; - } - - cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc; - cJSON_free = (hooks->free_fn)?hooks->free_fn:free; -} - -/* Internal constructor. */ -static cJSON *cJSON_New_Item() -{ - cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON)); - if (node) memset(node,0,sizeof(cJSON)); - return node; -} - -/* Delete a cJSON structure. */ -void cJSON_Delete(cJSON *c) -{ - cJSON *next; - while (c) - { - next=c->next; - if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); - if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); - if (c->string) cJSON_free(c->string); - cJSON_free(c); - c=next; - } -} - -/* Parse the input text to generate a number, and populate the result into item. */ -static const char *parse_number(cJSON *item,const char *num) -{ - double n=0,sign=1,scale=0;int subscale=0,signsubscale=1; - - /* Could use sscanf for this? */ - if (*num=='-') sign=-1,num++; /* Has sign? */ - if (*num=='0') num++; /* is zero */ - if (*num>='1' && *num<='9') do n=(n*10.0)+(*num++ -'0'); while (*num>='0' && *num<='9'); /* Number? */ - if (*num=='.' && num[1]>='0' && num[1]<='9') {num++; do n=(n*10.0)+(*num++ -'0'),scale--; while (*num>='0' && *num<='9');} /* Fractional part? */ - if (*num=='e' || *num=='E') /* Exponent? */ - { num++;if (*num=='+') num++; else if (*num=='-') signsubscale=-1,num++; /* With sign? */ - while (*num>='0' && *num<='9') subscale=(subscale*10)+(*num++ - '0'); /* Number? */ - } - - n=sign*n*pow(10.0,(scale+subscale*signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */ - - item->valuedouble=n; - item->valueint=(int)n; - item->type=cJSON_Number; - return num; -} - -/* Render the number nicely from the given item into a string. */ -char *cJSON_print_number(cJSON *item) -{ - char *str; - double d=item->valuedouble; - if (fabs(((double)item->valueint)-d)<=DBL_EPSILON && d<=INT_MAX && d>=INT_MIN) - { - str=(char*)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */ - if (str) sprintf(str,"%d",item->valueint); - } - else - { - str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */ - if (str) - { - if (fabs(floor(d)-d)<=DBL_EPSILON) sprintf(str,"%.0f",d); - else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d); - else sprintf(str,"%f",d); - } - } - return str; -} - -/* Parse the input text into an unescaped cstring, and populate item. */ -static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; -static const char *parse_string(cJSON *item,const char *str) -{ - const char *ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; - if (*str!='\"') {ep=str;return 0;} /* not a string! */ - - while (*ptr!='\"' && *ptr && ++len) if (*ptr++ == '\\') ptr++; /* Skip escaped quotes. */ - - out=(char*)cJSON_malloc(len+1); /* This is how long we need for the string, roughly. */ - if (!out) return 0; - - ptr=str+1;ptr2=out; - while (*ptr!='\"' && *ptr) - { - if (*ptr!='\\') *ptr2++=*ptr++; - else - { - ptr++; - switch (*ptr) - { - case 'b': *ptr2++='\b'; break; - case 'f': *ptr2++='\f'; break; - case 'n': *ptr2++='\n'; break; - case 'r': *ptr2++='\r'; break; - case 't': *ptr2++='\t'; break; - case 'u': /* transcode utf16 to utf8. */ - sscanf(ptr+1,"%4x",&uc);ptr+=4; /* get the unicode char. */ - - if ((uc>=0xDC00 && uc<=0xDFFF) || uc==0) break; // check for invalid. - - if (uc>=0xD800 && uc<=0xDBFF) // UTF16 surrogate pairs. - { - if (ptr[1]!='\\' || ptr[2]!='u') break; // missing second-half of surrogate. - sscanf(ptr+3,"%4x",&uc2);ptr+=6; - if (uc2<0xDC00 || uc2>0xDFFF) break; // invalid second-half of surrogate. - uc=0x10000 | ((uc&0x3FF)<<10) | (uc2&0x3FF); - } - - len=4;if (uc<0x80) len=1;else if (uc<0x800) len=2;else if (uc<0x10000) len=3; ptr2+=len; - - switch (len) { - case 4: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; - case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; - case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; - case 1: *--ptr2 =(uc | firstByteMark[len]); - } - ptr2+=len; - break; - default: *ptr2++=*ptr; break; - } - ptr++; - } - } - *ptr2=0; - if (*ptr=='\"') ptr++; - item->valuestring=out; - item->type=cJSON_String; - return ptr; -} - -/* Render the cstring provided to an escaped version that can be printed. */ -static char *print_string_ptr(const char *str) -{ - const char *ptr;char *ptr2,*out;int len=0;unsigned char token; - - if (!str) return cJSON_strdup(""); - ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;} - - out=(char*)cJSON_malloc(len+3); - if (!out) return 0; - - ptr2=out;ptr=str; - *ptr2++='\"'; - while (*ptr) - { - if ((unsigned char)*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++; - else - { - *ptr2++='\\'; - switch (token=*ptr++) - { - case '\\': *ptr2++='\\'; break; - case '\"': *ptr2++='\"'; break; - case '\b': *ptr2++='b'; break; - case '\f': *ptr2++='f'; break; - case '\n': *ptr2++='n'; break; - case '\r': *ptr2++='r'; break; - case '\t': *ptr2++='t'; break; - default: sprintf(ptr2,"u%04x",token);ptr2+=5; break; /* escape and print */ - } - } - } - *ptr2++='\"';*ptr2++=0; - return out; -} -/* Invote print_string_ptr (which is useful) on an item. */ -static char *print_string(cJSON *item) {return print_string_ptr(item->valuestring);} - -/* Predeclare these prototypes. */ -static const char *parse_value(cJSON *item,const char *value); -static char *print_value(cJSON *item,int depth,int fmt); -static const char *parse_array(cJSON *item,const char *value); -static char *print_array(cJSON *item,int depth,int fmt); -static const char *parse_object(cJSON *item,const char *value); -static char *print_object(cJSON *item,int depth,int fmt); - -/* Utility to jump whitespace and cr/lf */ -static const char *skip(const char *in) {while (in && *in && (unsigned char)*in<=32) in++; return in;} - -/* Parse an object - create a new root, and populate. */ -cJSON *cJSON_Parse(const char *value) -{ - cJSON *c=cJSON_New_Item(); - ep=0; - if (!c) return 0; /* memory fail */ - - if (!parse_value(c,skip(value))) {cJSON_Delete(c);return 0;} - return c; -} - -/* Render a cJSON item/entity/structure to text. */ -char *cJSON_Print(cJSON *item) {return print_value(item,0,1);} -char *cJSON_PrintUnformatted(cJSON *item) {return print_value(item,0,0);} - -/* Parser core - when encountering text, process appropriately. */ -static const char *parse_value(cJSON *item,const char *value) -{ - if (!value) return 0; /* Fail on null. */ - if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; } - if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; } - if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; } - if (*value=='\"') { return parse_string(item,value); } - if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); } - if (*value=='[') { return parse_array(item,value); } - if (*value=='{') { return parse_object(item,value); } - - ep=value;return 0; /* failure. */ -} - -/* Render a value to text. */ -static char *print_value(cJSON *item,int depth,int fmt) -{ - char *out=0; - if (!item) return 0; - switch ((item->type)&255) - { - case cJSON_NULL: out=cJSON_strdup("null"); break; - case cJSON_False: out=cJSON_strdup("false");break; - case cJSON_True: out=cJSON_strdup("true"); break; - case cJSON_Number: out=cJSON_print_number(item);break; - case cJSON_String: out=print_string(item);break; - case cJSON_Array: out=print_array(item,depth,fmt);break; - case cJSON_Object: out=print_object(item,depth,fmt);break; - } - return out; -} - -/* Build an array from input text. */ -static const char *parse_array(cJSON *item,const char *value) -{ - cJSON *child; - if (*value!='[') {ep=value;return 0;} /* not an array! */ - - item->type=cJSON_Array; - value=skip(value+1); - if (*value==']') return value+1; /* empty array. */ - - item->child=child=cJSON_New_Item(); - if (!item->child) return 0; /* memory fail */ - value=skip(parse_value(child,skip(value))); /* skip any spacing, get the value. */ - if (!value) return 0; - - while (*value==',') - { - cJSON *new_item; - if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */ - child->next=new_item;new_item->prev=child;child=new_item; - value=skip(parse_value(child,skip(value+1))); - if (!value) return 0; /* memory fail */ - } - - if (*value==']') return value+1; /* end of array */ - ep=value;return 0; /* malformed. */ -} - -/* Render an array to text */ -static char *print_array(cJSON *item,int depth,int fmt) -{ - char **entries; - char *out=0,*ptr,*ret;int len=5; - cJSON *child=item->child; - int numentries=0,i=0,fail=0; - - /* How many entries in the array? */ - while (child) numentries++,child=child->next; - /* Allocate an array to hold the values for each */ - entries=(char**)cJSON_malloc(numentries*sizeof(char*)); - if (!entries) return 0; - memset(entries,0,numentries*sizeof(char*)); - /* Retrieve all the results: */ - child=item->child; - while (child && !fail) - { - ret=print_value(child,depth+1,fmt); - entries[i++]=ret; - if (ret) len+=strlen(ret)+2+(fmt?1:0); else fail=1; - child=child->next; - } - - /* If we didn't fail, try to malloc the output string */ - if (!fail) out=(char*)cJSON_malloc(len); - /* If that fails, we fail. */ - if (!out) fail=1; - - /* Handle failure. */ - if (fail) - { - for (i=0;itype=cJSON_Object; - value=skip(value+1); - if (*value=='}') return value+1; /* empty array. */ - - item->child=child=cJSON_New_Item(); - if (!item->child) return 0; - value=skip(parse_string(child,skip(value))); - if (!value) return 0; - child->string=child->valuestring;child->valuestring=0; - if (*value!=':') {ep=value;return 0;} /* fail! */ - value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */ - if (!value) return 0; - - while (*value==',') - { - cJSON *new_item; - if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */ - child->next=new_item;new_item->prev=child;child=new_item; - value=skip(parse_string(child,skip(value+1))); - if (!value) return 0; - child->string=child->valuestring;child->valuestring=0; - if (*value!=':') {ep=value;return 0;} /* fail! */ - value=skip(parse_value(child,skip(value+1))); /* skip any spacing, get the value. */ - if (!value) return 0; - } - - if (*value=='}') return value+1; /* end of array */ - ep=value;return 0; /* malformed. */ -} - -/* Render an object to text. */ -static char *print_object(cJSON *item,int depth,int fmt) -{ - char **entries=0,**names=0; - char *out=0,*ptr,*ret,*str;int len=7,i=0,j; - cJSON *child=item->child; - int numentries=0,fail=0; - /* Count the number of entries. */ - while (child) numentries++,child=child->next; - /* Allocate space for the names and the objects */ - entries=(char**)cJSON_malloc(numentries*sizeof(char*)); - if (!entries) return 0; - names=(char**)cJSON_malloc(numentries*sizeof(char*)); - if (!names) {cJSON_free(entries);return 0;} - memset(entries,0,sizeof(char*)*numentries); - memset(names,0,sizeof(char*)*numentries); - - /* Collect all the results into our arrays: */ - child=item->child;depth++;if (fmt) len+=depth; - while (child) - { - names[i]=str=print_string_ptr(child->string); - entries[i++]=ret=print_value(child,depth,fmt); - if (str && ret) len+=strlen(ret)+strlen(str)+2+(fmt?2+depth:0); else fail=1; - child=child->next; - } - - /* Try to allocate the output string */ - if (!fail) out=(char*)cJSON_malloc(len); - if (!out) fail=1; - - /* Handle failure */ - if (fail) - { - for (i=0;ichild;int i=0;while(c)i++,c=c->next;return i;} -cJSON *cJSON_GetArrayItem(cJSON *array,int item) {cJSON *c=array->child; while (c && item>0) item--,c=c->next; return c;} -cJSON *cJSON_GetObjectItem(cJSON *object,const char *string) {cJSON *c=object->child; while (c && cJSON_strcasecmp(c->string,string)) c=c->next; return c;} - -/* Utility for array list handling. */ -static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;} -/* Utility for handling references. */ -static cJSON *create_reference(cJSON *item) {cJSON *ref=cJSON_New_Item();if (!ref) return 0;memcpy(ref,item,sizeof(cJSON));ref->string=0;ref->type|=cJSON_IsReference;ref->next=ref->prev=0;return ref;} - -/* Add item to array/object. */ -void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}} -void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);} -void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));} -void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));} - -cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0; - if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;} -void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));} -cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;} -void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));} - -/* Replace array/object items with new ones. */ -void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return; - newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem; - if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=0;cJSON_Delete(c);} -void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}} - -/* Create basic types: */ -cJSON *cJSON_CreateNull() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;} -cJSON *cJSON_CreateTrue() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;} -cJSON *cJSON_CreateFalse() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;} -cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;} -cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;} -cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;} -cJSON *cJSON_CreateArray() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;} -cJSON *cJSON_CreateObject() {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;} - -/* Create Arrays: */ -cJSON *cJSON_CreateIntArray(int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} -cJSON *cJSON_CreateFloatArray(float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} -cJSON *cJSON_CreateDoubleArray(double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} -cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} diff -Nru rsyslog-7.6.0/plugins/omelasticsearch/cJSON/cjson.h rsyslog-5.10.1/plugins/omelasticsearch/cJSON/cjson.h --- rsyslog-7.6.0/plugins/omelasticsearch/cJSON/cjson.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omelasticsearch/cJSON/cjson.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/* - Copyright (c) 2009 Dave Gamble - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#ifndef cJSON__h -#define cJSON__h - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* cJSON Types: */ -#define cJSON_False 0 -#define cJSON_True 1 -#define cJSON_NULL 2 -#define cJSON_Number 3 -#define cJSON_String 4 -#define cJSON_Array 5 -#define cJSON_Object 6 - -#define cJSON_IsReference 256 - -/* The cJSON structure: */ -typedef struct cJSON { - struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ - struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ - - int type; /* The type of the item, as above. */ - - char *valuestring; /* The item's string, if type==cJSON_String */ - int valueint; /* The item's number, if type==cJSON_Number */ - double valuedouble; /* The item's number, if type==cJSON_Number */ - - char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ -} cJSON; - -typedef struct cJSON_Hooks { - void *(*malloc_fn)(size_t sz); - void (*free_fn)(void *ptr); -} cJSON_Hooks; - -/* Supply malloc, realloc and free functions to cJSON */ -extern void cJSON_InitHooks(cJSON_Hooks* hooks); - - -/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ -extern cJSON *cJSON_Parse(const char *value); -/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ -extern char *cJSON_Print(cJSON *item); -/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ -extern char *cJSON_PrintUnformatted(cJSON *item); -/* Delete a cJSON entity and all subentities. */ -extern void cJSON_Delete(cJSON *c); - -/* Returns the number of items in an array (or object). */ -extern int cJSON_GetArraySize(cJSON *array); -/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ -extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); -/* Get item "string" from object. Case insensitive. */ -extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); - -/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ -extern const char *cJSON_GetErrorPtr(); - -/* These calls create a cJSON item of the appropriate type. */ -extern cJSON *cJSON_CreateNull(); -extern cJSON *cJSON_CreateTrue(); -extern cJSON *cJSON_CreateFalse(); -extern cJSON *cJSON_CreateBool(int b); -extern cJSON *cJSON_CreateNumber(double num); -extern cJSON *cJSON_CreateString(const char *string); -extern cJSON *cJSON_CreateArray(); -extern cJSON *cJSON_CreateObject(); - -/* These utilities create an Array of count items. */ -extern cJSON *cJSON_CreateIntArray(int *numbers,int count); -extern cJSON *cJSON_CreateFloatArray(float *numbers,int count); -extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count); -extern cJSON *cJSON_CreateStringArray(const char **strings,int count); - -/* Append item to the specified array/object. */ -extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); -extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); -/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ -extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); -extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); - -/* Remove/Detatch items from Arrays/Objects. */ -extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); -extern void cJSON_DeleteItemFromArray(cJSON *array,int which); -extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); -extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); - -/* Update array items. */ -extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); -extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); - -/* rger: added helpers */ - -char *cJSON_print_number(cJSON *item); -#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) -#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) -#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) -#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) -#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru rsyslog-7.6.0/plugins/omelasticsearch/Makefile.am rsyslog-5.10.1/plugins/omelasticsearch/Makefile.am --- rsyslog-7.6.0/plugins/omelasticsearch/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omelasticsearch/Makefile.am 2012-10-15 13:45:04.000000000 +0000 @@ -1,9 +1,8 @@ pkglib_LTLIBRARIES = omelasticsearch.la -# TODO: replace cJSON -omelasticsearch_la_SOURCES = omelasticsearch.c cJSON/cjson.c cJSON/cjson.h +omelasticsearch_la_SOURCES = omelasticsearch.c omelasticsearch_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) omelasticsearch_la_LDFLAGS = -module -avoid-version -omelasticsearch_la_LIBADD = $(CURL_LIBS) $(LIBM) +omelasticsearch_la_LIBADD = $(CURL_LIBS) EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omelasticsearch/Makefile.in rsyslog-5.10.1/plugins/omelasticsearch/Makefile.in --- rsyslog-7.6.0/plugins/omelasticsearch/Makefile.in 2014-02-12 12:06:34.000000000 +0000 +++ rsyslog-5.10.1/plugins/omelasticsearch/Makefile.in 2012-10-17 14:42:40.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -35,7 +35,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = plugins/omelasticsearch -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ $(top_srcdir)/m4/atomic_operations_64bit.m4 \ @@ -69,22 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = -omelasticsearch_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_omelasticsearch_la_OBJECTS = omelasticsearch_la-omelasticsearch.lo \ - omelasticsearch_la-cjson.lo +omelasticsearch_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_omelasticsearch_la_OBJECTS = omelasticsearch_la-omelasticsearch.lo omelasticsearch_la_OBJECTS = $(am_omelasticsearch_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omelasticsearch_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -100,21 +92,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omelasticsearch_la_SOURCES) DIST_SOURCES = $(omelasticsearch_la_SOURCES) @@ -137,11 +129,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -155,56 +144,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -212,8 +175,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -233,16 +194,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -254,14 +210,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -295,6 +248,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -313,12 +267,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkglib_LTLIBRARIES = omelasticsearch.la - -# TODO: replace cJSON -omelasticsearch_la_SOURCES = omelasticsearch.c cJSON/cjson.c cJSON/cjson.h +omelasticsearch_la_SOURCES = omelasticsearch.c omelasticsearch_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) omelasticsearch_la_LDFLAGS = -module -avoid-version -omelasticsearch_la_LIBADD = $(CURL_LIBS) $(LIBM) +omelasticsearch_la_LIBADD = $(CURL_LIBS) EXTRA_DIST = all: all-am @@ -385,7 +337,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omelasticsearch.la: $(omelasticsearch_la_OBJECTS) $(omelasticsearch_la_DEPENDENCIES) $(EXTRA_omelasticsearch_la_DEPENDENCIES) +omelasticsearch.la: $(omelasticsearch_la_OBJECTS) $(omelasticsearch_la_DEPENDENCIES) $(AM_V_CCLD)$(omelasticsearch_la_LINK) -rpath $(pkglibdir) $(omelasticsearch_la_OBJECTS) $(omelasticsearch_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,43 +346,39 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omelasticsearch_la-cjson.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omelasticsearch_la-omelasticsearch.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omelasticsearch_la-omelasticsearch.lo: omelasticsearch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omelasticsearch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omelasticsearch_la-omelasticsearch.lo -MD -MP -MF $(DEPDIR)/omelasticsearch_la-omelasticsearch.Tpo -c -o omelasticsearch_la-omelasticsearch.lo `test -f 'omelasticsearch.c' || echo '$(srcdir)/'`omelasticsearch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omelasticsearch_la-omelasticsearch.Tpo $(DEPDIR)/omelasticsearch_la-omelasticsearch.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omelasticsearch.c' object='omelasticsearch_la-omelasticsearch.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omelasticsearch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omelasticsearch_la-omelasticsearch.lo `test -f 'omelasticsearch.c' || echo '$(srcdir)/'`omelasticsearch.c - -omelasticsearch_la-cjson.lo: cJSON/cjson.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omelasticsearch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omelasticsearch_la-cjson.lo -MD -MP -MF $(DEPDIR)/omelasticsearch_la-cjson.Tpo -c -o omelasticsearch_la-cjson.lo `test -f 'cJSON/cjson.c' || echo '$(srcdir)/'`cJSON/cjson.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omelasticsearch_la-cjson.Tpo $(DEPDIR)/omelasticsearch_la-cjson.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cJSON/cjson.c' object='omelasticsearch_la-cjson.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omelasticsearch.c' object='omelasticsearch_la-omelasticsearch.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omelasticsearch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omelasticsearch_la-cjson.lo `test -f 'cJSON/cjson.c' || echo '$(srcdir)/'`cJSON/cjson.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omelasticsearch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omelasticsearch_la-omelasticsearch.lo `test -f 'omelasticsearch.c' || echo '$(srcdir)/'`omelasticsearch.c mostlyclean-libtool: -rm -f *.lo @@ -537,15 +485,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omelasticsearch/omelasticsearch.c rsyslog-5.10.1/plugins/omelasticsearch/omelasticsearch.c --- rsyslog-7.6.0/plugins/omelasticsearch/omelasticsearch.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/omelasticsearch/omelasticsearch.c 2012-10-17 14:41:20.000000000 +0000 @@ -4,18 +4,18 @@ * NOTE: read comments in module-template.h for more specifics! * * Copyright 2011 Nathan Scott. - * Copyright 2009-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * -or- * see COPYING.ASL20 in the source distribution - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,15 +29,12 @@ #include #include #include +#include #include #include #include #include #include -#include -#include -#include -#include "cJSON/cjson.h" #include "conf.h" #include "syslogd-types.h" #include "srUtils.h" @@ -46,11 +43,9 @@ #include "errmsg.h" #include "statsobj.h" #include "cfsysline.h" -#include "unicode-helper.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omelasticsearch") /* internal structures */ DEF_OMOD_STATIC_DATA @@ -58,79 +53,28 @@ DEFobjCurrIf(statsobj) statsobj_t *indexStats; +STATSCOUNTER_DEF(indexConFail, mutIndexConFail) STATSCOUNTER_DEF(indexSubmit, mutIndexSubmit) -STATSCOUNTER_DEF(indexHTTPFail, mutIndexHTTPFail) -STATSCOUNTER_DEF(indexHTTPReqFail, mutIndexHTTPReqFail) -STATSCOUNTER_DEF(indexESFail, mutIndexESFail) +STATSCOUNTER_DEF(indexFailed, mutIndexFailed) +STATSCOUNTER_DEF(indexSuccess, mutIndexSuccess) /* REST API for elasticsearch hits this URL: * http://:// */ typedef struct curl_slist HEADER; typedef struct _instanceData { - int port; - int replyLen; - int fdErrFile; /* error file fd or -1 if not open */ - uchar *server; - uchar *uid; - uchar *pwd; - uchar *searchIndex; - uchar *searchType; - uchar *parent; - uchar *tplName; - uchar *timeout; - uchar *bulkId; - uchar *restURL; /* last used URL for error reporting */ - uchar *errorFile; - char *reply; - sbool dynSrchIdx; - sbool dynSrchType; - sbool dynParent; - sbool dynBulkId; - sbool bulkmode; - sbool asyncRepl; - struct { - es_str_t *data; - int nmemb; /* number of messages in batch (for statistics counting) */ - uchar *currTpl1; - uchar *currTpl2; - } batch; CURL *curlHandle; /* libcurl session handle */ HEADER *postHeader; /* json POST request info */ } instanceData; - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "server", eCmdHdlrGetWord, 0 }, - { "serverport", eCmdHdlrInt, 0 }, - { "uid", eCmdHdlrGetWord, 0 }, - { "pwd", eCmdHdlrGetWord, 0 }, - { "searchindex", eCmdHdlrGetWord, 0 }, - { "searchtype", eCmdHdlrGetWord, 0 }, - { "parent", eCmdHdlrGetWord, 0 }, - { "dynsearchindex", eCmdHdlrBinary, 0 }, - { "dynsearchtype", eCmdHdlrBinary, 0 }, - { "dynparent", eCmdHdlrBinary, 0 }, - { "bulkmode", eCmdHdlrBinary, 0 }, - { "asyncrepl", eCmdHdlrBinary, 0 }, - { "timeout", eCmdHdlrGetWord, 0 }, - { "errorfile", eCmdHdlrGetWord, 0 }, - { "template", eCmdHdlrGetWord, 1 }, - { "dynbulkid", eCmdHdlrBinary, 0 }, - { "bulkid", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; +/* config variables */ +static int restPort = 9200; +static char *hostName = "localhost"; +static char *searchIndex = "system"; +static char *searchType = "events"; BEGINcreateInstance CODESTARTcreateInstance - pData->restURL = NULL; - pData->fdErrFile = -1; ENDcreateInstance BEGINisCompatibleWithFeature @@ -149,556 +93,78 @@ curl_easy_cleanup(pData->curlHandle); pData->curlHandle = NULL; } - if(pData->fdErrFile != -1) - close(pData->fdErrFile); - free(pData->server); - free(pData->uid); - free(pData->pwd); - free(pData->searchIndex); - free(pData->searchType); - free(pData->parent); - free(pData->tplName); - free(pData->timeout); - free(pData->restURL); - free(pData->errorFile); - free(pData->bulkId); ENDfreeInstance BEGINdbgPrintInstInfo CODESTARTdbgPrintInstInfo - dbgprintf("omelasticsearch\n"); - dbgprintf("\ttemplate='%s'\n", pData->tplName); - dbgprintf("\tserver='%s'\n", pData->server); - dbgprintf("\tserverport=%d\n", pData->port); - dbgprintf("\tuid='%s'\n", pData->uid == NULL ? (uchar*)"(not configured)" : pData->uid); - dbgprintf("\tpwd=(%sconfigured)\n", pData->pwd == NULL ? "not " : ""); - dbgprintf("\tsearch index='%s'\n", pData->searchIndex); - dbgprintf("\tsearch index='%s'\n", pData->searchType); - dbgprintf("\tparent='%s'\n", pData->parent); - dbgprintf("\ttimeout='%s'\n", pData->timeout); - dbgprintf("\tdynamic search index=%d\n", pData->dynSrchIdx); - dbgprintf("\tdynamic search type=%d\n", pData->dynSrchType); - dbgprintf("\tdynamic parent=%d\n", pData->dynParent); - dbgprintf("\tasync replication=%d\n", pData->asyncRepl); - dbgprintf("\tbulkmode=%d\n", pData->bulkmode); - dbgprintf("\terrorfile='%s'\n", pData->errorFile == NULL ? - (uchar*)"(not configured)" : pData->errorFile); - dbgprintf("\tdynbulkid=%d\n", pData->dynBulkId); - dbgprintf("\tbulkid='%s'\n", pData->bulkId); ENDdbgPrintInstInfo - -/* Build basic URL part, which includes hostname and port as follows: - * http://hostname:port/ - * Newly creates an estr for this purpose. - */ -static rsRetVal -setBaseURL(instanceData *pData, es_str_t **url) -{ - char portBuf[64]; - int r; - DEFiRet; - - *url = es_newStr(128); - snprintf(portBuf, sizeof(portBuf), "%d", pData->port); - r = es_addBuf(url, "http://", sizeof("http://")-1); - if(r == 0) r = es_addBuf(url, (char*)pData->server, strlen((char*)pData->server)); - if(r == 0) r = es_addChar(url, ':'); - if(r == 0) r = es_addBuf(url, portBuf, strlen(portBuf)); - if(r == 0) r = es_addChar(url, '/'); - RETiRet; -} - - -static inline rsRetVal -checkConn(instanceData *pData) -{ - es_str_t *url; - CURL *curl = NULL; - CURLcode res; - char *cstr; - DEFiRet; - - setBaseURL(pData, &url); - curl = curl_easy_init(); - if(curl == NULL) { - DBGPRINTF("omelasticsearch: checkConn() curl_easy_init() failed\n"); - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - /* Bodypart of request not needed, so set curl opt to nobody and httpget, otherwise lib-curl could sigsegv */ - curl_easy_setopt(curl, CURLOPT_HTTPGET, TRUE); - curl_easy_setopt(curl, CURLOPT_NOBODY, TRUE); - /* Only enable for debugging - curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); */ - - cstr = es_str2cstr(url, NULL); - curl_easy_setopt(curl, CURLOPT_URL, cstr); - free(cstr); - - pData->reply = NULL; - pData->replyLen = 0; - curl_easy_setopt(curl, CURLOPT_WRITEDATA, pData); - res = curl_easy_perform(curl); - if(res != CURLE_OK) { - DBGPRINTF("omelasticsearch: checkConn() curl_easy_perform() " - "failed: %s\n", curl_easy_strerror(res)); - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - free(pData->reply); - DBGPRINTF("omelasticsearch: checkConn() completed with success\n"); - -finalize_it: - if(curl != NULL) - curl_easy_cleanup(curl); - RETiRet; -} - - BEGINtryResume CODESTARTtryResume - DBGPRINTF("omelasticsearch: tryResume called\n"); - iRet = checkConn(pData); ENDtryResume - -/* get the current index and type for this message */ -static inline void -getIndexTypeAndParent(instanceData *pData, uchar **tpls, - uchar **srchIndex, uchar **srchType, uchar **parent, - uchar **bulkId) -{ - if(pData->dynSrchIdx) { - *srchIndex = tpls[1]; - if(pData->dynSrchType) { - *srchType = tpls[2]; - if(pData->dynParent) { - *parent = tpls[3]; - if(pData->dynBulkId) { - *bulkId = tpls[4]; - } - } else { - *parent = pData->parent; - if(pData->dynBulkId) { - *bulkId = tpls[3]; - } - } - } else { - *srchType = pData->searchType; - if(pData->dynParent) { - *parent = tpls[2]; - if(pData->dynBulkId) { - *bulkId = tpls[3]; - } - } else { - *parent = pData->parent; - if(pData->dynBulkId) { - *bulkId = tpls[2]; - } - } - } - } else { - *srchIndex = pData->searchIndex; - if(pData->dynSrchType) { - *srchType = tpls[1]; - if(pData->dynParent) { - *parent = tpls[2]; - if(pData->dynBulkId) { - *bulkId = tpls[3]; - } - } else { - *parent = pData->parent; - if(pData->dynBulkId) { - *bulkId = tpls[2]; - } - } - } else { - *srchType = pData->searchType; - if(pData->dynParent) { - *parent = tpls[1]; - if(pData->dynBulkId) { - *bulkId = tpls[2]; - } - } else { - *parent = pData->parent; - if(pData->dynBulkId) { - *bulkId = tpls[1]; - } - } - } - } -} - - -static rsRetVal -setCurlURL(instanceData *pData, uchar **tpls) -{ - char authBuf[1024]; - uchar *searchIndex; - uchar *searchType; - uchar *parent; - uchar *bulkId; - es_str_t *url; - int rLocal; - int r; - DEFiRet; - - setBaseURL(pData, &url); - - if(pData->bulkmode) { - r = es_addBuf(&url, "_bulk", sizeof("_bulk")-1); - parent = NULL; - } else { - getIndexTypeAndParent(pData, tpls, &searchIndex, &searchType, &parent, &bulkId); - r = es_addBuf(&url, (char*)searchIndex, ustrlen(searchIndex)); - if(r == 0) r = es_addChar(&url, '/'); - if(r == 0) r = es_addBuf(&url, (char*)searchType, ustrlen(searchType)); - } - if(r == 0) r = es_addChar(&url, '?'); - if(pData->asyncRepl) { - if(r == 0) r = es_addBuf(&url, "replication=async&", - sizeof("replication=async&")-1); - } - if(pData->timeout != NULL) { - if(r == 0) r = es_addBuf(&url, "timeout=", sizeof("timeout=")-1); - if(r == 0) r = es_addBuf(&url, (char*)pData->timeout, ustrlen(pData->timeout)); - if(r == 0) r = es_addChar(&url, '&'); - } - if(parent != NULL) { - if(r == 0) r = es_addBuf(&url, "parent=", sizeof("parent=")-1); - if(r == 0) r = es_addBuf(&url, (char*)parent, ustrlen(parent)); - } - - free(pData->restURL); - pData->restURL = (uchar*)es_str2cstr(url, NULL); - curl_easy_setopt(pData->curlHandle, CURLOPT_URL, pData->restURL); - es_deleteStr(url); - DBGPRINTF("omelasticsearch: using REST URL: '%s'\n", pData->restURL); - - if(pData->uid != NULL) { - rLocal = snprintf(authBuf, sizeof(authBuf), "%s:%s", pData->uid, - (pData->pwd == NULL) ? "" : (char*)pData->pwd); - if(rLocal < 1) { - errmsg.LogError(0, RS_RET_ERR, "omelasticsearch: snprintf failed " - "when trying to build auth string (return %d)\n", - rLocal); - ABORT_FINALIZE(RS_RET_ERR); - } - curl_easy_setopt(pData->curlHandle, CURLOPT_USERPWD, authBuf); - curl_easy_setopt(pData->curlHandle, CURLOPT_PROXYAUTH, CURLAUTH_ANY); - } -finalize_it: - RETiRet; -} - - -/* this method does not directly submit but builds a batch instead. It - * may submit, if we have dynamic index/type and the current type or - * index changes. - */ -static rsRetVal -buildBatch(instanceData *pData, uchar *message, uchar **tpls) -{ - int length = strlen((char *)message); - int r; - uchar *searchIndex; - uchar *searchType; - uchar *parent; - uchar *bulkId = NULL; - DEFiRet; -# define META_STRT "{\"index\":{\"_index\": \"" -# define META_TYPE "\",\"_type\":\"" -# define META_PARENT "\",\"_parent\":\"" -# define META_ID "\", \"_id\":\"" -# define META_END "\"}}\n" - - getIndexTypeAndParent(pData, tpls, &searchIndex, &searchType, &parent, &bulkId); - r = es_addBuf(&pData->batch.data, META_STRT, sizeof(META_STRT)-1); - if(r == 0) r = es_addBuf(&pData->batch.data, (char*)searchIndex, - ustrlen(searchIndex)); - if(r == 0) r = es_addBuf(&pData->batch.data, META_TYPE, sizeof(META_TYPE)-1); - if(r == 0) r = es_addBuf(&pData->batch.data, (char*)searchType, - ustrlen(searchType)); - if(parent != NULL) { - if(r == 0) r = es_addBuf(&pData->batch.data, META_PARENT, sizeof(META_PARENT)-1); - if(r == 0) r = es_addBuf(&pData->batch.data, (char*)parent, ustrlen(parent)); - } - if(bulkId != NULL) { - if(r == 0) r = es_addBuf(&pData->batch.data, META_ID, sizeof(META_ID)-1); - if(r == 0) r = es_addBuf(&pData->batch.data, (char*)bulkId, ustrlen(bulkId)); - } - if(r == 0) r = es_addBuf(&pData->batch.data, META_END, sizeof(META_END)-1); - if(r == 0) r = es_addBuf(&pData->batch.data, (char*)message, length); - if(r == 0) r = es_addBuf(&pData->batch.data, "\n", sizeof("\n")-1); - if(r != 0) { - DBGPRINTF("omelasticsearch: growing batch failed with code %d\n", r); - ABORT_FINALIZE(RS_RET_ERR); - } - ++pData->batch.nmemb; - iRet = RS_RET_DEFER_COMMIT; - -finalize_it: - RETiRet; -} - - -/* write data error request/replies to separate error file - * Note: we open the file but never close it before exit. If it - * needs to be closed, HUP must be sent. - */ -static inline rsRetVal -writeDataError(instanceData *pData, cJSON **pReplyRoot, uchar *reqmsg) -{ - char *rendered = NULL; - cJSON *errRoot; - cJSON *req; - cJSON *replyRoot = *pReplyRoot; - size_t toWrite; - ssize_t wrRet; - char errStr[1024]; - DEFiRet; - - if(pData->errorFile == NULL) { - DBGPRINTF("omelasticsearch: no local error logger defined - " - "ignoring ES error information\n"); - FINALIZE; - } - - if(pData->fdErrFile == -1) { - pData->fdErrFile = open((char*)pData->errorFile, - O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE|O_CLOEXEC, - S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); - if(pData->fdErrFile == -1) { - rs_strerror_r(errno, errStr, sizeof(errStr)); - DBGPRINTF("omelasticsearch: error opening error file: %s\n", errStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } - if((req=cJSON_CreateObject()) == NULL) ABORT_FINALIZE(RS_RET_ERR); - cJSON_AddItemToObject(req, "url", cJSON_CreateString((char*)pData->restURL)); - cJSON_AddItemToObject(req, "postdata", cJSON_CreateString((char*)reqmsg)); - - if((errRoot=cJSON_CreateObject()) == NULL) ABORT_FINALIZE(RS_RET_ERR); - cJSON_AddItemToObject(errRoot, "request", req); - cJSON_AddItemToObject(errRoot, "reply", replyRoot); - rendered = cJSON_Print(errRoot); - /* we do not do real error-handling on the err file, as this finally complicates - * things way to much. - */ - DBGPRINTF("omelasticsearch: error record: '%s'\n", rendered); - toWrite = strlen(rendered); - wrRet = write(pData->fdErrFile, rendered, toWrite); - if(wrRet != (ssize_t) toWrite) { - DBGPRINTF("omelasticsearch: error %d writing error file, write returns %lld\n", - errno, (long long) wrRet); - } - cJSON_Delete(errRoot); - *pReplyRoot = NULL; /* tell caller not to delete once again! */ - -finalize_it: - free(rendered); - RETiRet; -} - - -static inline rsRetVal -checkResultBulkmode(instanceData *pData, cJSON *root) -{ - int i; - int numitems; - cJSON *items; - cJSON *item; - cJSON *create; - cJSON *ok; - DEFiRet; - - items = cJSON_GetObjectItem(root, "items"); - if(items == NULL || items->type != cJSON_Array) { - DBGPRINTF("omelasticsearch: error in elasticsearch reply: " - "bulkmode insert does not return array, reply is: %s\n", - pData->reply); - ABORT_FINALIZE(RS_RET_DATAFAIL); - } - numitems = cJSON_GetArraySize(items); -DBGPRINTF("omelasticsearch: %d items in reply\n", numitems); - for(i = 0 ; i < numitems ; ++i) { - item = cJSON_GetArrayItem(items, i); - if(item == NULL) { - DBGPRINTF("omelasticsearch: error in elasticsearch reply: " - "cannot obtain reply array item %d\n", i); - ABORT_FINALIZE(RS_RET_DATAFAIL); - } - create = cJSON_GetObjectItem(item, "create"); - if(create == NULL || create->type != cJSON_Object) { - DBGPRINTF("omelasticsearch: error in elasticsearch reply: " - "cannot obtain 'create' item for #%d\n", i); - ABORT_FINALIZE(RS_RET_DATAFAIL); - } - ok = cJSON_GetObjectItem(create, "ok"); - if(ok == NULL || ok->type != cJSON_True) { - DBGPRINTF("omelasticsearch: error in elasticsearch reply: " - "item %d, prop ok (%p) not ok\n", i, ok); - ABORT_FINALIZE(RS_RET_DATAFAIL); - } - } - -finalize_it: - RETiRet; -} - - -static inline rsRetVal -checkResult(instanceData *pData, uchar *reqmsg) -{ - cJSON *root; - cJSON *ok; - DEFiRet; - - root = cJSON_Parse(pData->reply); - if(root == NULL) { - DBGPRINTF("omelasticsearch: could not parse JSON result \n"); - ABORT_FINALIZE(RS_RET_ERR); - } - - if(pData->bulkmode) { - iRet = checkResultBulkmode(pData, root); - } else { - ok = cJSON_GetObjectItem(root, "ok"); - if(ok == NULL || ok->type != cJSON_True) { - iRet = RS_RET_DATAFAIL; - } - } - - /* Note: we ignore errors writing the error file, as we cannot handle - * these in any case. - */ - if(iRet == RS_RET_DATAFAIL) { - STATSCOUNTER_INC(indexESFail, mutIndexESFail); - writeDataError(pData, &root, reqmsg); - iRet = RS_RET_OK; /* we have handled the problem! */ - } - -finalize_it: - if(root != NULL) - cJSON_Delete(root); - if(iRet != RS_RET_OK) { - STATSCOUNTER_INC(indexESFail, mutIndexESFail); - } - RETiRet; -} - - -static rsRetVal -curlPost(instanceData *pData, uchar *message, int msglen, uchar **tpls, int nmsgs) +rsRetVal +curlPost(instanceData *instance, uchar *message) { CURLcode code; - CURL *curl = pData->curlHandle; - DEFiRet; - - pData->reply = NULL; - pData->replyLen = 0; - - if(pData->dynSrchIdx || pData->dynSrchType || pData->dynParent) - CHKiRet(setCurlURL(pData, tpls)); + CURL *curl = instance->curlHandle; + int length = strlen((char *)message); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, pData); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *)message); - curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, msglen); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (char *)message); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *)message); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, length); code = curl_easy_perform(curl); switch (code) { case CURLE_COULDNT_RESOLVE_HOST: case CURLE_COULDNT_RESOLVE_PROXY: case CURLE_COULDNT_CONNECT: case CURLE_WRITE_ERROR: - STATSCOUNTER_INC(indexHTTPReqFail, mutIndexHTTPReqFail); - indexHTTPFail += nmsgs; - DBGPRINTF("omelasticsearch: we are suspending ourselfs due " - "to failure %lld of curl_easy_perform()\n", - (long long) code); - ABORT_FINALIZE(RS_RET_SUSPENDED); + STATSCOUNTER_INC(indexConFail, mutIndexConFail); + return RS_RET_SUSPENDED; default: - break; + STATSCOUNTER_INC(indexSubmit, mutIndexSubmit); + return RS_RET_OK; } - - DBGPRINTF("omelasticsearch: pData replyLen = '%d'\n", pData->replyLen); - if (pData->replyLen > 0) { - pData->reply[pData->replyLen] = '\0'; /* Append 0 Byte if replyLen is above 0 - byte has been reserved in malloc */ - } - DBGPRINTF("omelasticsearch: pData reply: '%s'\n", pData->reply); - - CHKiRet(checkResult(pData, message)); -finalize_it: - free(pData->reply); - RETiRet; } -BEGINbeginTransaction -CODESTARTbeginTransaction -dbgprintf("omelasticsearch: beginTransaction\n"); - if(!pData->bulkmode) { - FINALIZE; - } - - es_emptyStr(pData->batch.data); - pData->batch.nmemb = 0; -finalize_it: -ENDbeginTransaction - - BEGINdoAction CODESTARTdoAction - STATSCOUNTER_INC(indexSubmit, mutIndexSubmit); - if(pData->bulkmode) { - CHKiRet(buildBatch(pData, ppString[0], ppString)); - } else { - CHKiRet(curlPost(pData, ppString[0], strlen((char*)ppString[0]), - ppString, 1)); - } + CHKiRet(curlPost(pData, ppString[0])); finalize_it: -dbgprintf("omelasticsearch: result doAction: %d (bulkmode %d)\n", iRet, pData->bulkmode); ENDdoAction - -BEGINendTransaction - char *cstr = NULL; -CODESTARTendTransaction -dbgprintf("omelasticsearch: endTransaction init\n"); - /* End Transaction only if batch data is not empty */ - if (pData->batch.data != NULL ) { - cstr = es_str2cstr(pData->batch.data, NULL); - dbgprintf("omelasticsearch: endTransaction, batch: '%s'\n", cstr); - CHKiRet(curlPost(pData, (uchar*) cstr, strlen(cstr), NULL, pData->batch.nmemb)); - } - else - dbgprintf("omelasticsearch: endTransaction, pData->batch.data is NULL, nothing to send. \n"); -finalize_it: - free(cstr); -dbgprintf("omelasticsearch: endTransaction done with %d\n", iRet); -ENDendTransaction - /* elasticsearch POST result string ... useful for debugging */ size_t curlResult(void *ptr, size_t size, size_t nmemb, void *userdata) { + unsigned int i; char *p = (char *)ptr; - instanceData *pData = (instanceData*) userdata; - char *buf; - size_t newlen; - - newlen = pData->replyLen + size*nmemb; - if((buf = realloc(pData->reply, newlen + 1)) == NULL) { - DBGPRINTF("omelasticsearch: realloc failed in curlResult\n"); - return 0; /* abort due to failure */ + char *jsonData = (char *)userdata; + static char ok[] = "{\"ok\":true,"; + + ASSERT(size == 1); + + if (size == 1 && + nmemb > sizeof(ok)-1 && + strncmp(p, ok, sizeof(ok)-1) == 0) { + STATSCOUNTER_INC(indexSuccess, mutIndexSuccess); + } else { + STATSCOUNTER_INC(indexFailed, mutIndexFailed); + if (Debug) { + DBGPRINTF("omelasticsearch request: %s\n", jsonData); + DBGPRINTF("omelasticsearch result: "); + for (i = 0; i < nmemb; i++) + DBGPRINTF("%c", p[i]); + DBGPRINTF("\n"); + } } - memcpy(buf+pData->replyLen, p, size*nmemb); - pData->replyLen = newlen; - pData->reply = buf; - return size*nmemb; + return size * nmemb; } - static rsRetVal -curlSetup(instanceData *pData) +curlSetup(instanceData *instance) { + char restURL[2048]; /* libcurl makes a copy, using the stack here is OK */ HEADER *header; CURL *handle; @@ -707,268 +173,41 @@ return RS_RET_OBJ_CREATION_FAILED; } + snprintf(restURL, sizeof(restURL)-1, "http://%s:%d/%s/%s", + hostName, restPort, searchIndex, searchType); header = curl_slist_append(NULL, "Content-Type: text/json; charset=utf-8"); - curl_easy_setopt(handle, CURLOPT_HTTPHEADER, header); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, curlResult); - curl_easy_setopt(handle, CURLOPT_POST, 1); - - pData->curlHandle = handle; - pData->postHeader = header; + curl_easy_setopt(handle, CURLOPT_HTTPHEADER, header); + curl_easy_setopt(handle, CURLOPT_URL, restURL); + curl_easy_setopt(handle, CURLOPT_POST, 1); - if( pData->bulkmode - || (pData->dynSrchIdx == 0 && pData->dynSrchType == 0 && pData->dynParent == 0)) { - /* in this case, we know no tpls are involved in the request-->NULL OK! */ - setCurlURL(pData, NULL); - } + instance->curlHandle = handle; + instance->postHeader = header; - if(Debug) { - if(pData->dynSrchIdx == 0 && pData->dynSrchType == 0 && pData->dynParent == 0) - dbgprintf("omelasticsearch setup, using static REST URL\n"); - else - dbgprintf("omelasticsearch setup, we have a dynamic REST URL\n"); - } + DBGPRINTF("omelasticsearch setup, using REST URL: %s\n", restURL); return RS_RET_OK; } -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->server = NULL; - pData->port = 9200; - pData->uid = NULL; - pData->pwd = NULL; - pData->searchIndex = NULL; - pData->searchType = NULL; - pData->parent = NULL; - pData->timeout = NULL; - pData->dynSrchIdx = 0; - pData->dynSrchType = 0; - pData->dynParent = 0; - pData->asyncRepl = 0; - pData->bulkmode = 0; - pData->tplName = NULL; - pData->errorFile = NULL; - pData->dynBulkId= 0; - pData->bulkId = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; - int iNumTpls; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); +BEGINparseSelectorAct +CODESTARTparseSelectorAct +CODE_STD_STRING_REQUESTparseSelectorAct(1) + if(strncmp((char*) p, ":omelasticsearch:", sizeof(":omelasticsearch:") - 1)) { + ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); } - + p += sizeof(":omelasticsearch:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "server")) { - pData->server = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "errorfile")) { - pData->errorFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "serverport")) { - pData->port = (int) pvals[i].val.d.n, NULL; - } else if(!strcmp(actpblk.descr[i].name, "uid")) { - pData->uid = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "pwd")) { - pData->pwd = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "searchindex")) { - pData->searchIndex = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "searchtype")) { - pData->searchType = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "parent")) { - pData->parent = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "dynsearchindex")) { - pData->dynSrchIdx = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dynsearchtype")) { - pData->dynSrchType = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dynparent")) { - pData->dynParent = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "bulkmode")) { - pData->bulkmode = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "timeout")) { - pData->timeout = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "asyncrepl")) { - pData->asyncRepl = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "dynbulkid")) { - pData->dynBulkId = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "bulkid")) { - pData->bulkId = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omelasticsearch: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->pwd != NULL && pData->uid == NULL) { - errmsg.LogError(0, RS_RET_UID_MISSING, - "omelasticsearch: password is provided, but no uid " - "- action definition invalid"); - ABORT_FINALIZE(RS_RET_UID_MISSING); - } - if(pData->dynSrchIdx && pData->searchIndex == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, - "omelasticsearch: requested dynamic search index, but no " - "name for index template given - action definition invalid"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if(pData->dynSrchType && pData->searchType == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, - "omelasticsearch: requested dynamic search type, but no " - "name for type template given - action definition invalid"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if(pData->dynParent && pData->parent == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, - "omelasticsearch: requested dynamic parent, but no " - "name for parent template given - action definition invalid"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if(pData->dynBulkId && pData->bulkId == NULL) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, - "omelasticsearch: requested dynamic bulkid, but no " - "name for bulkid template given - action definition invalid"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - - if(pData->bulkmode) { - pData->batch.currTpl1 = NULL; - pData->batch.currTpl2 = NULL; - if((pData->batch.data = es_newStr(1024)) == NULL) { - DBGPRINTF("omelasticsearch: error creating batch string " - "turned off bulk mode\n"); - pData->bulkmode = 0; /* at least it works */ - } - } - - iNumTpls = 1; - if(pData->dynSrchIdx) ++iNumTpls; - if(pData->dynSrchType) ++iNumTpls; - if(pData->dynParent) ++iNumTpls; - if(pData->dynBulkId) ++iNumTpls; - DBGPRINTF("omelasticsearch: requesting %d templates\n", iNumTpls); - CODE_STD_STRING_REQUESTnewActInst(iNumTpls) - - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? - " StdJSONFmt" : (char*)pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - - - /* we need to request additional templates. If we have a dynamic search index, - * it will always be string 1. Type may be 1 or 2, depending on whether search - * index is dynamic as well. Rule needs to be followed throughout the module. - */ - if(pData->dynSrchIdx) { - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->searchIndex), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynSrchType) { - CHKiRet(OMSRsetEntry(*ppOMSR, 2, ustrdup(pData->searchType), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynParent) { - CHKiRet(OMSRsetEntry(*ppOMSR, 3, ustrdup(pData->parent), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 4, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } else { - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 3, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } - } else { - if(pData->dynParent) { - CHKiRet(OMSRsetEntry(*ppOMSR, 2, ustrdup(pData->parent), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 3, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } else { - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 2, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } - } - } else { - if(pData->dynSrchType) { - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->searchType), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynParent) { - CHKiRet(OMSRsetEntry(*ppOMSR, 2, ustrdup(pData->parent), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 3, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } else { - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 2, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } - } else { - if(pData->dynParent) { - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->parent), - OMSR_NO_RQD_TPL_OPTS)); - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 2, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } else { - if(pData->dynBulkId) { - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->bulkId), - OMSR_NO_RQD_TPL_OPTS)); - } - } - } - } - - if(pData->server == NULL) - pData->server = (uchar*) strdup("localhost"); - if(pData->searchIndex == NULL) - pData->searchIndex = (uchar*) strdup("system"); - if(pData->searchType == NULL) - pData->searchType = (uchar*) strdup("events"); + /* check if a non-standard template is to be applied */ + if(*(p-1) == ';') + --p; + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) " StdJSONFmt")); + /* all good, we can now initialise our private data */ CHKiRet(curlSetup(pData)); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(!strncmp((char*) p, ":omelasticsearch:", sizeof(":omelasticsearch:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "omelasticsearch supports only v6 config format, use: " - "action(type=\"omelasticsearch\" server=...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct -BEGINdoHUP -CODESTARTdoHUP - if(pData->fdErrFile != -1) { - close(pData->fdErrFile); - pData->fdErrFile = -1; - } -ENDdoHUP - - BEGINmodExit CODESTARTmodExit curl_global_cleanup(); @@ -981,11 +220,18 @@ CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_doHUP -CODEqueryEtryPt_TXIF_OMOD_QUERIES /* we support the transactional interface! */ ENDqueryEtryPt +static rsRetVal +resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +{ + DEFiRet; + restPort = 9200; + hostName = "localhost"; + searchIndex = "system"; + searchType = "events"; + RETiRet; +} BEGINmodInit() CODESTARTmodInit @@ -994,6 +240,13 @@ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(statsobj, CORE_COMPONENT)); + /* register config file handlers */ + CHKiRet(omsdRegCFSLineHdlr((uchar *)"elasticsearchindex", 0, eCmdHdlrGetWord, NULL, &searchIndex, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"elasticsearchtype", 0, eCmdHdlrGetWord, NULL, &searchType, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"elasticsearchhost", 0, eCmdHdlrGetWord, NULL, &hostName, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"elasticsearchport", 0, eCmdHdlrInt, NULL, &restPort, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + if (curl_global_init(CURL_GLOBAL_ALL) != 0) { errmsg.LogError(0, RS_RET_OBJ_CREATION_FAILED, "CURL fail. -elasticsearch indexing disabled"); ABORT_FINALIZE(RS_RET_OBJ_CREATION_FAILED); @@ -1001,19 +254,15 @@ /* support statistics gathering */ CHKiRet(statsobj.Construct(&indexStats)); - CHKiRet(statsobj.SetName(indexStats, (uchar *)"omelasticsearch")); - STATSCOUNTER_INIT(indexSubmit, mutIndexSubmit); - CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"submitted", - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &indexSubmit)); - STATSCOUNTER_INIT(indexHTTPFail, mutIndexHTTPFail); - CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.http", - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &indexHTTPFail)); - STATSCOUNTER_INIT(indexHTTPReqFail, mutIndexHTTPReqFail); - CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.httprequests", - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &indexHTTPReqFail)); - STATSCOUNTER_INIT(indexESFail, mutIndexESFail); - CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed.es", - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &indexESFail)); + CHKiRet(statsobj.SetName(indexStats, (uchar *)"elasticsearch")); + CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"connfail", + ctrType_IntCtr, &indexConFail)); + CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"submits", + ctrType_IntCtr, &indexSubmit)); + CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"failed", + ctrType_IntCtr, &indexFailed)); + CHKiRet(statsobj.AddCounter(indexStats, (uchar *)"success", + ctrType_IntCtr, &indexSuccess)); CHKiRet(statsobj.ConstructFinalize(indexStats)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omelasticsearch/README rsyslog-5.10.1/plugins/omelasticsearch/README --- rsyslog-7.6.0/plugins/omelasticsearch/README 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omelasticsearch/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -How to produce an error: -======================== -It's quite easy to get 400, if you put a wrong mapping to your -index. That would be easy to reproduce in "normal" omelasticsearch usage -conditions, by only altering the ES configuration: - -1. Make your index first. Let's call it "testindex": -$ curl -XPUT localhost:9200/testindex/ - -2. Put your mapping for a search type called "mytype", where you specify -that date property should be an integer: -$ curl -XPUT localhost:9200/testindex/mytype/_mapping -d '{"mytype":{"properties": {"timegenerated":{"type":"integer"}}}}' - -3. Now try to insert something where date is not an integer: -$ curl -XPOST localhost:9200/testindex/mytype/ -d '{"timegenerated":"bla"}' -{"error":"MapperParsingException[Failed to parse [date]]; nested: NumberFormatException[For input string: \"bla\"]; ","status":400} - diff -Nru rsyslog-7.6.0/plugins/omgssapi/Makefile.in rsyslog-5.10.1/plugins/omgssapi/Makefile.in --- rsyslog-7.6.0/plugins/omgssapi/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/omgssapi/Makefile.in 2012-10-17 14:42:41.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omgssapi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omgssapi_la_OBJECTS = omgssapi_la-omgssapi.lo omgssapi_la_OBJECTS = $(am_omgssapi_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omgssapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omgssapi_la_SOURCES) DIST_SOURCES = $(omgssapi_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omgssapi.la: $(omgssapi_la_OBJECTS) $(omgssapi_la_DEPENDENCIES) $(EXTRA_omgssapi_la_DEPENDENCIES) +omgssapi.la: $(omgssapi_la_OBJECTS) $(omgssapi_la_DEPENDENCIES) $(AM_V_CCLD)$(omgssapi_la_LINK) -rpath $(pkglibdir) $(omgssapi_la_OBJECTS) $(omgssapi_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omgssapi_la-omgssapi.lo: omgssapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omgssapi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omgssapi_la-omgssapi.lo -MD -MP -MF $(DEPDIR)/omgssapi_la-omgssapi.Tpo -c -o omgssapi_la-omgssapi.lo `test -f 'omgssapi.c' || echo '$(srcdir)/'`omgssapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omgssapi_la-omgssapi.Tpo $(DEPDIR)/omgssapi_la-omgssapi.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omgssapi.c' object='omgssapi_la-omgssapi.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omgssapi.c' object='omgssapi_la-omgssapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omgssapi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omgssapi_la-omgssapi.lo `test -f 'omgssapi.c' || echo '$(srcdir)/'`omgssapi.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omgssapi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omgssapi_la-omgssapi.lo `test -f 'omgssapi.c' || echo '$(srcdir)/'`omgssapi.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omgssapi/omgssapi.c rsyslog-5.10.1/plugins/omgssapi/omgssapi.c --- rsyslog-7.6.0/plugins/omgssapi/omgssapi.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omgssapi/omgssapi.c 2012-10-17 14:41:20.000000000 +0000 @@ -59,11 +59,8 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omgssapi") -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); - /* internal structures */ DEF_OMOD_STATIC_DATA @@ -89,18 +86,12 @@ } instanceData; /* config data */ - -typedef enum gss_mode_e { +static uchar *pszTplName = NULL; /* name of the default template to use */ +static char *gss_base_service_name = NULL; +static enum gss_mode_t { GSSMODE_MIC, GSSMODE_ENC -} gss_mode_t; - -static struct configSettings_s { - uchar *pszTplName; /* name of the default template to use */ - char *gss_base_service_name; - gss_mode_t gss_mode; -} cs; - +} gss_mode = GSSMODE_ENC; /* get the syslog forward port from selector_t. The passed in * struct must be one that is setup for forwarding. @@ -151,8 +142,10 @@ /* this is meant to be done when module is unloaded, but since this module is static... */ - free(cs.gss_base_service_name); - cs.gss_base_service_name = NULL; + if (gss_base_service_name != NULL) { + free(gss_base_service_name); + gss_base_service_name = NULL; + } /* final cleanup */ tcpclt.Destruct(&pData->pTCPClt); @@ -199,7 +192,7 @@ if(pData->sock > 0) ABORT_FINALIZE(RS_RET_OK); - base = (cs.gss_base_service_name == NULL) ? "host" : cs.gss_base_service_name; + base = (gss_base_service_name == NULL) ? "host" : gss_base_service_name; out_tok.length = strlen(pData->f_hname) + strlen(base) + 2; CHKmalloc(out_tok.value = MALLOC(out_tok.length)); strcpy(out_tok.value, base); @@ -223,10 +216,10 @@ sess_flags = &pData->gss_flags; *sess_flags = GSS_C_MUTUAL_FLAG; - if (cs.gss_mode == GSSMODE_MIC) { + if (gss_mode == GSSMODE_MIC) { *sess_flags |= GSS_C_INTEG_FLAG; } - if (cs.gss_mode == GSSMODE_ENC) { + if (gss_mode == GSSMODE_ENC) { *sess_flags |= GSS_C_CONF_FLAG; } dbgprintf("GSS-API requested context flags:\n"); @@ -307,7 +300,7 @@ context = &pData->gss_context; in_buf.value = msg; in_buf.length = len; - maj_stat = gss_wrap(&min_stat, *context, (cs.gss_mode == GSSMODE_ENC) ? 1 : 0, GSS_C_QOP_DEFAULT, + maj_stat = gss_wrap(&min_stat, *context, (gss_mode == GSSMODE_ENC) ? 1 : 0, GSS_C_QOP_DEFAULT, &in_buf, NULL, &out_buf); if (maj_stat != GSS_S_COMPLETE) { gssutil.display_status("wrapping message", maj_stat, min_stat); @@ -609,7 +602,7 @@ /* process template */ CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, - (cs.pszTplName == NULL) ? (uchar*)"RSYSLOG_TraditionalForwardFormat" : cs.pszTplName)); + (pszTplName == NULL) ? (uchar*)"RSYSLOG_TraditionalForwardFormat" : pszTplName)); /* first set the pData->eDestState */ memset(&hints, 0, sizeof(hints)); @@ -646,9 +639,9 @@ objRelease(gssutil, LM_GSSUTIL_FILENAME); objRelease(tcpclt, LM_TCPCLT_FILENAME); - if(cs.pszTplName != NULL) { - free(cs.pszTplName); - cs.pszTplName = NULL; + if(pszTplName != NULL) { + free(pszTplName); + pszTplName = NULL; } ENDmodExit @@ -665,10 +658,10 @@ DEFiRet; if (!strcmp((char *) mode, "integrity")) { - cs.gss_mode = GSSMODE_MIC; + gss_mode = GSSMODE_MIC; dbgprintf("GSS-API gssmode set to GSSMODE_MIC\n"); } else if (!strcmp((char *) mode, "encryption")) { - cs.gss_mode = GSSMODE_ENC; + gss_mode = GSSMODE_ENC; dbgprintf("GSS-API gssmode set to GSSMODE_ENC\n"); } else { errmsg.LogError(0, RS_RET_INVALID_PARAMS, "unknown gssmode parameter: %s", (char *) mode); @@ -682,11 +675,15 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - cs.gss_mode = GSSMODE_ENC; - free(cs.gss_base_service_name); - cs.gss_base_service_name = NULL; - free(cs.pszTplName); - cs.pszTplName = NULL; + gss_mode = GSSMODE_ENC; + if (gss_base_service_name != NULL) { + free(gss_base_service_name); + gss_base_service_name = NULL; + } + if(pszTplName != NULL) { + free(pszTplName); + pszTplName = NULL; + } return RS_RET_OK; } @@ -700,9 +697,9 @@ CHKiRet(objUse(gssutil, LM_GSSUTIL_FILENAME)); CHKiRet(objUse(tcpclt, LM_TCPCLT_FILENAME)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssforwardservicename", 0, eCmdHdlrGetWord, NULL, &cs.gss_base_service_name, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssmode", 0, eCmdHdlrGetWord, setGSSMode, &cs.gss_mode, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actiongssforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &cs.pszTplName, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssforwardservicename", 0, eCmdHdlrGetWord, NULL, &gss_base_service_name, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssmode", 0, eCmdHdlrGetWord, setGSSMode, &gss_mode, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actiongssforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omhdfs/Makefile.in rsyslog-5.10.1/plugins/omhdfs/Makefile.in --- rsyslog-7.6.0/plugins/omhdfs/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhdfs/Makefile.in 2012-10-17 14:42:41.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omhdfs_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omhdfs_la_OBJECTS = omhdfs_la-omhdfs.lo omhdfs_la_OBJECTS = $(am_omhdfs_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omhdfs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omhdfs_la_SOURCES) DIST_SOURCES = $(omhdfs_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omhdfs.la: $(omhdfs_la_OBJECTS) $(omhdfs_la_DEPENDENCIES) $(EXTRA_omhdfs_la_DEPENDENCIES) +omhdfs.la: $(omhdfs_la_OBJECTS) $(omhdfs_la_DEPENDENCIES) $(AM_V_CCLD)$(omhdfs_la_LINK) -rpath $(pkglibdir) $(omhdfs_la_OBJECTS) $(omhdfs_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omhdfs_la-omhdfs.lo: omhdfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omhdfs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omhdfs_la-omhdfs.lo -MD -MP -MF $(DEPDIR)/omhdfs_la-omhdfs.Tpo -c -o omhdfs_la-omhdfs.lo `test -f 'omhdfs.c' || echo '$(srcdir)/'`omhdfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omhdfs_la-omhdfs.Tpo $(DEPDIR)/omhdfs_la-omhdfs.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omhdfs.c' object='omhdfs_la-omhdfs.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omhdfs.c' object='omhdfs_la-omhdfs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omhdfs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omhdfs_la-omhdfs.lo `test -f 'omhdfs.c' || echo '$(srcdir)/'`omhdfs.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omhdfs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omhdfs_la-omhdfs.lo `test -f 'omhdfs.c' || echo '$(srcdir)/'`omhdfs.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omhdfs/omhdfs.c rsyslog-5.10.1/plugins/omhdfs/omhdfs.c --- rsyslog-7.6.0/plugins/omhdfs/omhdfs.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhdfs/omhdfs.c 2012-10-17 14:41:20.000000000 +0000 @@ -51,7 +51,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omhdfs") /* internal structures */ @@ -61,18 +60,12 @@ /* global data */ static struct hashtable *files; /* holds all file objects that we know */ -typedef struct configSettings_s { - uchar *fileName; - uchar *hdfsHost; - uchar *dfltTplName; /* default template name to use */ - int hdfsPort; -} configSettings_t; -static configSettings_t cs; - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars -ENDinitConfVars +/* globals for default values */ +static uchar *fileName = NULL; +static uchar *hdfsHost = NULL; +static uchar *dfltTplName = NULL; /* default template name to use */ +int hdfsPort = 0; +/* end globals for default values */ typedef struct { uchar *name; @@ -446,22 +439,22 @@ CHKiRet(createInstance(&pData)); CODE_STD_STRING_REQUESTparseSelectorAct(1) CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, 0, - (cs.dfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : cs.dfltTplName)); + (dfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : dfltTplName)); - if(cs.fileName == NULL) { + if(fileName == NULL) { errmsg.LogError(0, RS_RET_ERR_HDFS_OPEN, "omhdfs: no file name specified, can not continue"); ABORT_FINALIZE(RS_RET_FILE_NOT_SPECIFIED); } - pFile = hashtable_search(files, cs.fileName); + pFile = hashtable_search(files, fileName); if(pFile == NULL) { /* we need a new file object, this one not seen before */ CHKiRet(fileObjConstruct(&pFile)); - CHKmalloc(pFile->name = cs.fileName); - CHKmalloc(keybuf = ustrdup(cs.fileName)); - cs.fileName = NULL; /* re-set, data passed to file object */ - CHKmalloc(pFile->hdfsHost = strdup((cs.hdfsHost == NULL) ? "default" : (char*) cs.hdfsHost)); - pFile->hdfsPort = cs.hdfsPort; + CHKmalloc(pFile->name = fileName); + CHKmalloc(keybuf = ustrdup(fileName)); + fileName = NULL; /* re-set, data passed to file object */ + CHKmalloc(pFile->hdfsHost = strdup((hdfsHost == NULL) ? "default" : (char*) hdfsHost)); + pFile->hdfsPort = hdfsPort; fileOpen(pFile); if(pFile->fh == NULL){ errmsg.LogError(0, RS_RET_ERR_HDFS_OPEN, "omhdfs: failed to open %s - " @@ -504,12 +497,8 @@ */ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - cs.hdfsHost = NULL; - cs.hdfsPort = 0; - free(cs.fileName); - cs.fileName = NULL; - free(cs.dfltTplName); - cs.dfltTplName = NULL; + hdfsHost = NULL; + hdfsPort = 0; return RS_RET_OK; } @@ -530,7 +519,6 @@ ENDqueryEtryPt - BEGINmodInit() CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; @@ -539,10 +527,10 @@ CHKmalloc(files = create_hashtable(20, hash_from_string, key_equals_string, fileObjDestruct4Hashtable)); - CHKiRet(regCfSysLineHdlr((uchar *)"omhdfsfilename", 0, eCmdHdlrGetWord, NULL, &cs.fileName, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"omhdfshost", 0, eCmdHdlrGetWord, NULL, &cs.hdfsHost, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"omhdfsport", 0, eCmdHdlrInt, NULL, &cs.hdfsPort, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"omhdfsdefaulttemplate", 0, eCmdHdlrGetWord, NULL, &cs.dfltTplName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"omhdfsfilename", 0, eCmdHdlrGetWord, NULL, &fileName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"omhdfshost", 0, eCmdHdlrGetWord, NULL, &hdfsHost, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"omhdfsport", 0, eCmdHdlrInt, NULL, &hdfsPort, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"omhdfsdefaulttemplate", 0, eCmdHdlrGetWord, NULL, &dfltTplName, NULL)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); DBGPRINTF("omhdfs: module compiled with rsyslog version %s.\n", VERSION); CODEmodInit_QueryRegCFSLineHdlr diff -Nru rsyslog-7.6.0/plugins/omhiredis/COPYING rsyslog-5.10.1/plugins/omhiredis/COPYING --- rsyslog-7.6.0/plugins/omhiredis/COPYING 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhiredis/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff -Nru rsyslog-7.6.0/plugins/omhiredis/Makefile.am rsyslog-5.10.1/plugins/omhiredis/Makefile.am --- rsyslog-7.6.0/plugins/omhiredis/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhiredis/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -pkglib_LTLIBRARIES = omhiredis.la -omhiredis_la_SOURCES = omhiredis.c -omhiredis_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(HIREDIS_CFLAGS) -omhiredis_la_LDFLAGS = -module -avoid-version -omhiredis_la_LIBADD = $(HIREDIS_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omhiredis/Makefile.in rsyslog-5.10.1/plugins/omhiredis/Makefile.in --- rsyslog-7.6.0/plugins/omhiredis/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhiredis/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,638 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/omhiredis -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - COPYING -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -omhiredis_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_omhiredis_la_OBJECTS = omhiredis_la-omhiredis.lo -omhiredis_la_OBJECTS = $(am_omhiredis_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -omhiredis_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(omhiredis_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(omhiredis_la_SOURCES) -DIST_SOURCES = $(omhiredis_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = omhiredis.la -omhiredis_la_SOURCES = omhiredis.c -omhiredis_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(HIREDIS_CFLAGS) -omhiredis_la_LDFLAGS = -module -avoid-version -omhiredis_la_LIBADD = $(HIREDIS_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/omhiredis/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/omhiredis/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -omhiredis.la: $(omhiredis_la_OBJECTS) $(omhiredis_la_DEPENDENCIES) $(EXTRA_omhiredis_la_DEPENDENCIES) - $(AM_V_CCLD)$(omhiredis_la_LINK) -rpath $(pkglibdir) $(omhiredis_la_OBJECTS) $(omhiredis_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omhiredis_la-omhiredis.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -omhiredis_la-omhiredis.lo: omhiredis.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omhiredis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omhiredis_la-omhiredis.lo -MD -MP -MF $(DEPDIR)/omhiredis_la-omhiredis.Tpo -c -o omhiredis_la-omhiredis.lo `test -f 'omhiredis.c' || echo '$(srcdir)/'`omhiredis.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omhiredis_la-omhiredis.Tpo $(DEPDIR)/omhiredis_la-omhiredis.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omhiredis.c' object='omhiredis_la-omhiredis.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omhiredis_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omhiredis_la-omhiredis.lo `test -f 'omhiredis.c' || echo '$(srcdir)/'`omhiredis.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/omhiredis/omhiredis.c rsyslog-5.10.1/plugins/omhiredis/omhiredis.c --- rsyslog-7.6.0/plugins/omhiredis/omhiredis.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhiredis/omhiredis.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,300 +0,0 @@ -/* omhiredis.c - * Copyright 2012 Talksum, Inc -* -* This program is free software: you can redistribute it and/or -* modify it under the terms of the GNU Lesser 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 -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program. If not, see -* . -* -* Author: Brian Knox -* -*/ - - -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "cfsysline.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omhiredis") -/* internal structures - */ -DEF_OMOD_STATIC_DATA -DEFobjCurrIf(errmsg) - -/* our instance data. - * this will be accessable - * via pData */ -typedef struct _instanceData { - redisContext *conn; /* redis connection */ - uchar *server; /* redis server address */ - int port; /* redis port */ - uchar *tplName; /* template name */ - redisReply **replies; /* array to hold replies from redis */ - int count; /* count of command sent for current batch */ -} instanceData; - - -static struct cnfparamdescr actpdescr[] = { - { "server", eCmdHdlrGetWord, 0 }, - { "serverport", eCmdHdlrInt, 0 }, - { "template", eCmdHdlrGetWord, 1 } -}; -static struct cnfparamblk actpblk = { - CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr -}; - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - if(eFeat == sFEATURERepeatedMsgReduction) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - -/* called when closing */ -static void closeHiredis(instanceData *pData) -{ - if(pData->conn != NULL) { - redisFree(pData->conn); - pData->conn = NULL; - } -} - -/* Free our instance data. - * TODO: free **replies */ -BEGINfreeInstance -CODESTARTfreeInstance - closeHiredis(pData); - free(pData->server); -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo - /* nothing special here */ -ENDdbgPrintInstInfo - -/* establish our connection to redis */ -static rsRetVal initHiredis(instanceData *pData, int bSilent) -{ - char *server; - DEFiRet; - - server = (pData->server == NULL) ? "127.0.0.1" : (char*) pData->server; - DBGPRINTF("omhiredis: trying connect to '%s' at port %d\n", server, pData->port); - - struct timeval timeout = { 1, 500000 }; /* 1.5 seconds */ - pData->conn = redisConnectWithTimeout(server, pData->port, timeout); - if (pData->conn->err) { - if(!bSilent) - errmsg.LogError(0, RS_RET_SUSPENDED, - "can not initialize redis handle"); - ABORT_FINALIZE(RS_RET_SUSPENDED); - } -finalize_it: - RETiRet; -} - -rsRetVal writeHiredis(uchar *message, instanceData *pData) -{ - DEFiRet; - - /* if we do not have a redis connection, call - * initHiredis and try to establish one */ - if(pData->conn == NULL) - CHKiRet(initHiredis(pData, 0)); - - /* try to append the command to the pipeline. - * REDIS_ERR reply indicates something bad - * happened, in which case abort. otherwise - * increase our current pipeline count - * by 1 and continue. */ - int rc; - rc = redisAppendCommand(pData->conn, (char*)message); - if (rc == REDIS_ERR) { - errmsg.LogError(0, NO_ERRCODE, "omhiredis: %s", pData->conn->errstr); - dbgprintf("omhiredis: %s\n", pData->conn->errstr); - ABORT_FINALIZE(RS_RET_ERR); - } else { - pData->count++; - } - -finalize_it: - RETiRet; -} - -/* called when resuming from suspended state. - * try to restablish our connection to redis */ -BEGINtryResume -CODESTARTtryResume - if(pData->conn == NULL) - iRet = initHiredis(pData, 0); -ENDtryResume - -/* begin a transaction. for now does nothing. - * if I decide to use MULTI ... EXEC in the - * fture, this block should send the - * MULTI command to redis. */ -BEGINbeginTransaction -CODESTARTbeginTransaction - dbgprintf("omhiredis: beginTransaction called\n"); -ENDbeginTransaction - -/* call writeHiredis for this log line, - * which appends it as a command to the - * current pipeline */ -BEGINdoAction -CODESTARTdoAction - CHKiRet(writeHiredis(ppString[0], pData)); - iRet = RS_RET_DEFER_COMMIT; -finalize_it: -ENDdoAction - -/* called when we have reached the end of a - * batch (queue.dequeuebatchsize). this - * iterates over the replies, putting them - * into the pData->replies buffer. we currently - * don't really bother to check for errors - * which should be fixed */ -BEGINendTransaction -CODESTARTendTransaction - dbgprintf("omhiredis: endTransaction called\n"); - int i; - pData->replies = malloc ( sizeof ( redisReply* ) * pData->count ); - for ( i = 0; i < pData->count; i++ ) { - redisGetReply ( pData->conn, (void *)&pData->replies[i] ); - /* TODO: add error checking here! */ - freeReplyObject ( pData->replies[i] ); - } - free ( pData->replies ); - pData->count = 0; -ENDendTransaction - -/* set defaults. note server is set to NULL - * and is set to a default in initHiredis if - * it is still null when it's called - I should - * probable just set the default here instead */ -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->server = NULL; - pData->port = 6379; - pData->tplName = NULL; - pData->count = 0; -} - -/* here is where the work to set up a new instance - * is done. this reads the config options from - * the rsyslog conf and takes appropriate setup - * actions. */ -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - - if(!strcmp(actpblk.descr[i].name, "server")) { - pData->server = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "serverport")) { - pData->port = (int) pvals[i].val.d.n, NULL; - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omhiredis: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->tplName == NULL) { - dbgprintf("omhiredis: action requires a template name"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - /* template string 0 is just a regular string */ - OMSRsetEntry(*ppOMSR, 0,(uchar*)pData->tplName, OMSR_NO_RQD_TPL_OPTS); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct - -/* tell the engine we only want one template string */ -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(!strncmp((char*) p, ":omhiredis:", sizeof(":omhiredis:") - 1)) - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "omhiredis supports only v6 config format, use: " - "action(type=\"omhiredis\" server=...)"); - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit -ENDmodExit - -/* register our plugin entry points - * with the rsyslog core engine */ -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_TXIF_OMOD_QUERIES /* supports transaction interface */ -ENDqueryEtryPt - -/* note we do not support rsyslog v5 syntax */ -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* only supports rsyslog 6 configs */ -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - INITChkCoreFeature(bCoreSupportsBatching, CORE_FEATURE_BATCHING); - if (!bCoreSupportsBatching) { - errmsg.LogError(0, NO_ERRCODE, "omhiredis: rsyslog core does not support batching - abort"); - ABORT_FINALIZE(RS_RET_ERR); - } - DBGPRINTF("omhiredis: module compiled with rsyslog version %s.\n", VERSION); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omhiredis/README rsyslog-5.10.1/plugins/omhiredis/README --- rsyslog-7.6.0/plugins/omhiredis/README 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omhiredis/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -Redis Outplug Plugin using hiredis library - -tested in Centos 6.2 and Archlinux - -BUILDING THIS PLUGIN -Requires the hiredis C client library: https://github.com/redis/hiredis/ - -in your /etc/rsyslog.conf, together with other modules: - -Brian Knox - ---------------------------------------------------------------------------------------------- -module(load="omhiredis") - -template(name="simple_count" type="string" string="HINCRBY progcount %programname% 1") - -action(name="simple_count_redis" type="omhiredis" queue.type="FixedArray" queue.size="10000" queue.dequeuebatchsize="100" template="simple_count") ---------------------------------------------------------------------------------------------- - -Note: dequeuebatchsize now sets the pipeline size for hiredis, allowing pipelining commands. -Note: this plugin will NOT handle full rsyslog messages properly yet. spaces in a property will - cause the redis command to be constructed improperly. a fix for this is in the works! diff -Nru rsyslog-7.6.0/plugins/omjournal/Makefile.am rsyslog-5.10.1/plugins/omjournal/Makefile.am --- rsyslog-7.6.0/plugins/omjournal/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omjournal/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = omjournal.la - -omjournal_la_SOURCES = omjournal.c -omjournal_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBSYSTEMD_JOURNAL_CFLAGS) -omjournal_la_LDFLAGS = -module -avoid-version -omjournal_la_LIBADD = $(LIBSYSTEMD_JOURNAL_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omjournal/Makefile.in rsyslog-5.10.1/plugins/omjournal/Makefile.in --- rsyslog-7.6.0/plugins/omjournal/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/omjournal/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/omjournal -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -omjournal_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_omjournal_la_OBJECTS = omjournal_la-omjournal.lo -omjournal_la_OBJECTS = $(am_omjournal_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -omjournal_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(omjournal_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(omjournal_la_SOURCES) -DIST_SOURCES = $(omjournal_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = omjournal.la -omjournal_la_SOURCES = omjournal.c -omjournal_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBSYSTEMD_JOURNAL_CFLAGS) -omjournal_la_LDFLAGS = -module -avoid-version -omjournal_la_LIBADD = $(LIBSYSTEMD_JOURNAL_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/omjournal/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/omjournal/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -omjournal.la: $(omjournal_la_OBJECTS) $(omjournal_la_DEPENDENCIES) $(EXTRA_omjournal_la_DEPENDENCIES) - $(AM_V_CCLD)$(omjournal_la_LINK) -rpath $(pkglibdir) $(omjournal_la_OBJECTS) $(omjournal_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omjournal_la-omjournal.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -omjournal_la-omjournal.lo: omjournal.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omjournal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omjournal_la-omjournal.lo -MD -MP -MF $(DEPDIR)/omjournal_la-omjournal.Tpo -c -o omjournal_la-omjournal.lo `test -f 'omjournal.c' || echo '$(srcdir)/'`omjournal.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omjournal_la-omjournal.Tpo $(DEPDIR)/omjournal_la-omjournal.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omjournal.c' object='omjournal_la-omjournal.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omjournal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omjournal_la-omjournal.lo `test -f 'omjournal.c' || echo '$(srcdir)/'`omjournal.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/omjournal/omjournal.c rsyslog-5.10.1/plugins/omjournal/omjournal.c --- rsyslog-7.6.0/plugins/omjournal/omjournal.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omjournal/omjournal.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/* omjournal.c - * send messages to the Linux Journal. This is meant to be used - * in cases where journal serves as the whole system log database. - * Note that we may get into a loop if journald re-injects messages - * into the syslog stream and we read that via imuxsock. Thus there - * is an option in imuxsock to ignore messages from ourselves - * (actually from our pid). So there are some module-interdependencies. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omjournal") - - -DEFobjCurrIf(errmsg); -DEF_OMOD_STATIC_DATA - -/* config variables */ - - -typedef struct _instanceData { -} instanceData; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ -}; -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; -ENDbeginCnfLoad - -BEGINendCnfLoad -CODESTARTendCnfLoad -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf -ENDfreeCnf - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance -ENDfreeInstance - - -BEGINnewActInst -CODESTARTnewActInst - /* Note: we currently do not have any parameters, so we do not need - * the lst ptr. However, we will most probably need params in the - * future. - */ - (void) lst; /* prevent compiler warning */ - DBGPRINTF("newActInst (mmjournal)\n"); - CODE_STD_STRING_REQUESTnewActInst(1) - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - CHKiRet(createInstance(&pData)); - /*setInstParamDefaults(pData);*/ -CODE_STD_FINALIZERnewActInst -/* cnfparamvalsDestruct(pvals, &actpblk);*/ -ENDnewActInst - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume -ENDtryResume - -BEGINdoAction - msg_t *pMsg; - uchar *tag; - int lenTag; - int sev; - int r; -CODESTARTdoAction - pMsg = (msg_t*) ppString[0]; - MsgGetSeverity(pMsg, &sev); - getTAG(pMsg, &tag, &lenTag); - /* we can use more properties here, but let's see if there - * is some real user interest. We can always add later... - */ - r = sd_journal_send("MESSAGE=%s", getMSG(pMsg), - "PRIORITY=%d", sev, - "SYSLOG_FACILITY=%d", pMsg->iFacility, - "SYSLOG_IDENTIFIER=%s", tag, - NULL); - /* FIXME: think about what to do with errors ;) */ - (void) r; /* prevent compiler warning */ -ENDdoAction - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(!strncmp((char*) p, ":omjournal:", sizeof(":omjournal:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "omjournal supports only v6+ config format, use: " - "action(type=\"omjournal\" ...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -ENDqueryEtryPt - - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - DBGPRINTF("omjournal: module compiled with rsyslog version %s.\n", VERSION); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omlibdbi/Makefile.in rsyslog-5.10.1/plugins/omlibdbi/Makefile.in --- rsyslog-7.6.0/plugins/omlibdbi/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/omlibdbi/Makefile.in 2012-10-17 14:42:41.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omlibdbi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omlibdbi_la_OBJECTS = omlibdbi_la-omlibdbi.lo omlibdbi_la_OBJECTS = $(am_omlibdbi_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omlibdbi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omlibdbi_la_SOURCES) DIST_SOURCES = $(omlibdbi_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omlibdbi.la: $(omlibdbi_la_OBJECTS) $(omlibdbi_la_DEPENDENCIES) $(EXTRA_omlibdbi_la_DEPENDENCIES) +omlibdbi.la: $(omlibdbi_la_OBJECTS) $(omlibdbi_la_DEPENDENCIES) $(AM_V_CCLD)$(omlibdbi_la_LINK) -rpath $(pkglibdir) $(omlibdbi_la_OBJECTS) $(omlibdbi_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omlibdbi_la-omlibdbi.lo: omlibdbi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omlibdbi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omlibdbi_la-omlibdbi.lo -MD -MP -MF $(DEPDIR)/omlibdbi_la-omlibdbi.Tpo -c -o omlibdbi_la-omlibdbi.lo `test -f 'omlibdbi.c' || echo '$(srcdir)/'`omlibdbi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omlibdbi_la-omlibdbi.Tpo $(DEPDIR)/omlibdbi_la-omlibdbi.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omlibdbi.c' object='omlibdbi_la-omlibdbi.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omlibdbi.c' object='omlibdbi_la-omlibdbi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omlibdbi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omlibdbi_la-omlibdbi.lo `test -f 'omlibdbi.c' || echo '$(srcdir)/'`omlibdbi.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omlibdbi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omlibdbi_la-omlibdbi.lo `test -f 'omlibdbi.c' || echo '$(srcdir)/'`omlibdbi.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omlibdbi/omlibdbi.c rsyslog-5.10.1/plugins/omlibdbi/omlibdbi.c --- rsyslog-7.6.0/plugins/omlibdbi/omlibdbi.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omlibdbi/omlibdbi.c 2012-10-17 14:41:20.000000000 +0000 @@ -10,7 +10,7 @@ * * File begun on 2008-02-14 by RGerhards (extracted from syslogd.c) * - * Copyright 2008-2013 Adiscon GmbH. + * Copyright 2008-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -48,11 +48,9 @@ #include "module-template.h" #include "debug.h" #include "errmsg.h" -#include "conf.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omlibdbi") /* internal structures */ @@ -61,7 +59,6 @@ static int bDbiInitialized = 0; /* dbi_initialize() can only be called one - this keeps track of it */ typedef struct _instanceData { - uchar *dbiDrvrDir; /* where do the dbi drivers reside? */ dbi_conn conn; /* handle to database */ uchar *drvrName; /* driver to use */ uchar *host; /* host to connect to */ @@ -69,85 +66,16 @@ uchar *pwd; /* password for connect */ uchar *dbName; /* database to use */ unsigned uLastDBErrno; /* last errno returned by libdbi or 0 if all is well */ - uchar *tplName; /* format template to use */ - int txSupport; /* transaction support */ } instanceData; -typedef struct configSettings_s { - uchar *dbiDrvrDir; /* global: where do the dbi drivers reside? */ - uchar *drvrName; /* driver to use */ - uchar *host; /* host to connect to */ - uchar *usrName; /* user name for connect */ - uchar *pwd; /* password for connect */ - uchar *dbName; /* database to use */ -} configSettings_t; -static configSettings_t cs; -uchar *pszFileDfltTplName; /* name of the default template to use */ - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - uchar *dbiDrvrDir; /* where do the dbi drivers reside? */ - uchar *tplName; /* default template */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ -static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config parameters permitted? */ - - -/* tables for interfacing with the v6 config system */ -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "template", eCmdHdlrGetWord, 0 }, - { "driverdirectory", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "server", eCmdHdlrGetWord, 1 }, - { "db", eCmdHdlrGetWord, 1 }, - { "uid", eCmdHdlrGetWord, 1 }, - { "pwd", eCmdHdlrGetWord, 1 }, - { "driver", eCmdHdlrGetWord, 1 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -/* this function gets the default template. It coordinates action between - * old-style and new-style configuration parts. - */ -static inline uchar* -getDfltTpl(void) -{ - if(loadModConf != NULL && loadModConf->tplName != NULL) - return loadModConf->tplName; - else if(pszFileDfltTplName == NULL) - return (uchar*)" StdDBFmt"; - else - return pszFileDfltTplName; -} - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.dbiDrvrDir = NULL; - cs.drvrName = NULL; - cs.host = NULL; - cs.usrName = NULL; - cs.pwd = NULL; - cs.dbName = NULL; -ENDinitConfVars - /* config settings */ +static uchar *dbiDrvrDir = NULL;/* global: where do the dbi drivers reside? */ +static uchar *drvrName = NULL; /* driver to use */ +static uchar *host = NULL; /* host to connect to */ +static uchar *usrName = NULL; /* user name for connect */ +static uchar *pwd = NULL; /* password for connect */ +static uchar *dbName = NULL; /* database to use */ #ifdef HAVE_DBI_R static dbi_inst dbiInst; #endif @@ -240,9 +168,9 @@ if(bDbiInitialized == 0) { /* we need to init libdbi first */ # ifdef HAVE_DBI_R - iDrvrsLoaded = dbi_initialize_r((char*) pData->dbiDrvrDir, &dbiInst); + iDrvrsLoaded = dbi_initialize_r((char*) dbiDrvrDir, &dbiInst); # else - iDrvrsLoaded = dbi_initialize((char*) pData->dbiDrvrDir); + iDrvrsLoaded = dbi_initialize((char*) dbiDrvrDir); # endif if(iDrvrsLoaded == 0) { errmsg.LogError(0, RS_RET_SUSPENDED, "libdbi error: libdbi or libdbi drivers not present on this system - suspending."); @@ -262,7 +190,7 @@ # endif if(pData->conn == NULL) { errmsg.LogError(0, RS_RET_SUSPENDED, "can not initialize libdbi connection"); - ABORT_FINALIZE(RS_RET_SUSPENDED); + iRet = RS_RET_SUSPENDED; } else { /* we could get the handle, now on with work... */ /* Connect to database */ dbi_conn_set_option(pData->conn, "host", (char*) pData->host); @@ -273,9 +201,8 @@ if(dbi_conn_connect(pData->conn) < 0) { reportDBError(pData, bSilent); closeConn(pData); /* ignore any error we may get */ - ABORT_FINALIZE(RS_RET_SUSPENDED); + iRet = RS_RET_SUSPENDED; } - pData->txSupport = dbi_conn_cap_get(pData->conn, "transaction_support"); } finalize_it: @@ -331,174 +258,12 @@ } ENDtryResume -/* transaction support 2013-03 */ -BEGINbeginTransaction -CODESTARTbeginTransaction - if(pData->conn == NULL) { - CHKiRet(initConn(pData, 0)); - } -# if HAVE_DBI_TXSUPP - if (pData->txSupport == 1) { - if (dbi_conn_transaction_begin(pData->conn) != 0) { - const char *emsg; - dbi_conn_error(pData->conn, &emsg); - dbgprintf("libdbi server error: begin transaction " - "not successful: %s\n", emsg); - closeConn(pData); - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - } -# endif -finalize_it: -ENDbeginTransaction -/* end transaction */ - BEGINdoAction CODESTARTdoAction - CHKiRet(writeDB(ppString[0], pData)); -# if HAVE_DBI_TXSUPP - if (pData->txSupport == 1) { - iRet = RS_RET_DEFER_COMMIT; - } -# endif -finalize_it: + dbgprintf("\n"); + iRet = writeDB(ppString[0], pData); ENDdoAction -/* transaction support 2013-03 */ -BEGINendTransaction -CODESTARTendTransaction -# if HAVE_DBI_TXSUPP - if (dbi_conn_transaction_commit(pData->conn) != 0) { - const char *emsg; - dbi_conn_error(pData->conn, &emsg); - dbgprintf("libdbi server error: transaction not committed: %s\n", - emsg); - closeConn(pData); - iRet = RS_RET_SUSPENDED; - } -# endif -ENDendTransaction -/* end transaction */ - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->tplName = NULL; - bLegacyCnfModGlobalsPermitted = 1; -ENDbeginCnfLoad - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "omlibdbi: error processing " - "module config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for omlibdbi:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "template")) { - loadModConf->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - if(pszFileDfltTplName != NULL) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "omlibdbi: warning: default template " - "was already set via legacy directive - may lead to inconsistent " - "results."); - } - } else if(!strcmp(modpblk.descr[i].name, "driverdirectory")) { - loadModConf->dbiDrvrDir = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omlibdbi: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } - bLegacyCnfModGlobalsPermitted = 0; -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(pszFileDfltTplName); - pszFileDfltTplName = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf - free(pModConf->tplName); - free(pModConf->dbiDrvrDir); -ENDfreeCnf - - - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->tplName = NULL; -} - - -BEGINnewActInst - struct cnfparamvals *pvals; - uchar *tplToUse; - int i; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "server")) { - pData->host = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "db")) { - pData->dbName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "uid")) { - pData->usrName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "pwd")) { - pData->pwd = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "driver")) { - pData->drvrName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omlibdbi: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - tplToUse = (pData->tplName == NULL) ? (uchar*)strdup((char*)getDfltTpl()) : pData->tplName; - CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_RQD_TPL_OPT_SQL)); -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - BEGINparseSelectorAct CODESTARTparseSelectorAct @@ -511,27 +276,28 @@ /* ok, if we reach this point, we have something for us */ CHKiRet(createInstance(&pData)); + /* no create the instance based on what we currently have */ - if(cs.drvrName == NULL) { + if(drvrName == NULL) { errmsg.LogError(0, RS_RET_NO_DRIVERNAME, "omlibdbi: no db driver name given - action can not be created"); ABORT_FINALIZE(RS_RET_NO_DRIVERNAME); } - if((pData->drvrName = (uchar*) strdup((char*)cs.drvrName)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + if((pData->drvrName = (uchar*) strdup((char*)drvrName)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); /* NULL values are supported because drivers have different needs. * They will err out on connect. -- rgerhards, 2008-02-15 */ - if(cs.host != NULL) - CHKmalloc(pData->host = (uchar*) strdup((char*)cs.host)); - if(cs.usrName != NULL) - CHKmalloc(pData->usrName = (uchar*) strdup((char*)cs.usrName)); - if(cs.dbName != NULL) - CHKmalloc(pData->dbName = (uchar*) strdup((char*)cs.dbName)); - if(cs.pwd != NULL) - CHKmalloc(pData->pwd = (uchar*) strdup((char*)cs.pwd)); - if(cs.dbiDrvrDir != NULL) - CHKmalloc(loadModConf->dbiDrvrDir = (uchar*) strdup((char*)cs.dbiDrvrDir)); - CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_RQD_TPL_OPT_SQL, getDfltTpl())); + if(host != NULL) + if((pData->host = (uchar*) strdup((char*)host)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + if(usrName != NULL) + if((pData->usrName = (uchar*) strdup((char*)usrName)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + if(dbName != NULL) + if((pData->dbName = (uchar*) strdup((char*)dbName)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + if(pwd != NULL) + if((pData->pwd = (uchar*) strdup((char*)pwd)) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_RQD_TPL_OPT_SQL, (uchar*) " StdDBFmt")); + CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -552,10 +318,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_TXIF_OMOD_QUERIES /* we support the transactional interface! */ ENDqueryEtryPt @@ -564,39 +326,53 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - free(cs.dbiDrvrDir); - cs.dbiDrvrDir = NULL; - free(cs.drvrName); - cs.drvrName = NULL; - free(cs.host); - cs.host = NULL; - free(cs.usrName); - cs.usrName = NULL; - free(cs.pwd); - cs.pwd = NULL; - free(cs.dbName); - cs.dbName = NULL; + + if(dbiDrvrDir != NULL) { + free(dbiDrvrDir); + dbiDrvrDir = NULL; + } + + if(drvrName != NULL) { + free(drvrName); + drvrName = NULL; + } + + if(host != NULL) { + free(host); + host = NULL; + } + + if(usrName != NULL) { + free(usrName); + usrName = NULL; + } + + if(pwd != NULL) { + free(pwd); + pwd = NULL; + } + + if(dbName != NULL) { + free(dbName); + dbName = NULL; + } + RETiRet; } BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr -# ifndef HAVE_DBI_TXSUPP - DBGPRINTF("omlibdbi: no transaction support in libdbi\n"); -# warning libdbi too old - transactions are not enabled (use 0.9 or later) -# endif CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(regCfSysLineHdlr2((uchar *)"actionlibdbidriverdirectory", 0, eCmdHdlrGetWord, NULL, &cs.dbiDrvrDir, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionlibdbidriver", 0, eCmdHdlrGetWord, NULL, &cs.drvrName, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionlibdbihost", 0, eCmdHdlrGetWord, NULL, &cs.host, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionlibdbiusername", 0, eCmdHdlrGetWord, NULL, &cs.usrName, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionlibdbipassword", 0, eCmdHdlrGetWord, NULL, &cs.pwd, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionlibdbidbname", 0, eCmdHdlrGetWord, NULL, &cs.dbName, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionlibdbidriverdirectory", 0, eCmdHdlrGetWord, NULL, &dbiDrvrDir, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionlibdbidriver", 0, eCmdHdlrGetWord, NULL, &drvrName, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionlibdbihost", 0, eCmdHdlrGetWord, NULL, &host, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionlibdbiusername", 0, eCmdHdlrGetWord, NULL, &usrName, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionlibdbipassword", 0, eCmdHdlrGetWord, NULL, &pwd, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionlibdbidbname", 0, eCmdHdlrGetWord, NULL, &dbName, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); DBGPRINTF("omlibdbi compiled with version %s loaded, libdbi version %s\n", VERSION, dbi_version()); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/ommail/Makefile.in rsyslog-5.10.1/plugins/ommail/Makefile.in --- rsyslog-7.6.0/plugins/ommail/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommail/Makefile.in 2012-10-17 14:42:41.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) ommail_la_DEPENDENCIES = am_ommail_la_OBJECTS = ommail_la-ommail.lo ommail_la_OBJECTS = $(am_ommail_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent ommail_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(ommail_la_SOURCES) DIST_SOURCES = $(ommail_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -ommail.la: $(ommail_la_OBJECTS) $(ommail_la_DEPENDENCIES) $(EXTRA_ommail_la_DEPENDENCIES) +ommail.la: $(ommail_la_OBJECTS) $(ommail_la_DEPENDENCIES) $(AM_V_CCLD)$(ommail_la_LINK) -rpath $(pkglibdir) $(ommail_la_OBJECTS) $(ommail_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< ommail_la-ommail.lo: ommail.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommail_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ommail_la-ommail.lo -MD -MP -MF $(DEPDIR)/ommail_la-ommail.Tpo -c -o ommail_la-ommail.lo `test -f 'ommail.c' || echo '$(srcdir)/'`ommail.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ommail_la-ommail.Tpo $(DEPDIR)/ommail_la-ommail.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ommail.c' object='ommail_la-ommail.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ommail.c' object='ommail_la-ommail.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommail_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ommail_la-ommail.lo `test -f 'ommail.c' || echo '$(srcdir)/'`ommail.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommail_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ommail_la-ommail.lo `test -f 'ommail.c' || echo '$(srcdir)/'`ommail.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/ommail/ommail.c rsyslog-5.10.1/plugins/ommail/ommail.c --- rsyslog-7.6.0/plugins/ommail/ommail.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommail/ommail.c 2012-10-17 14:41:20.000000000 +0000 @@ -54,7 +54,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("ommail") /* internal structures */ @@ -71,6 +70,12 @@ uchar *pszTo; toRcpt_t *pNext; }; +static toRcpt_t *lstRcpt = NULL; +static uchar *pszSrv = NULL; +static uchar *pszSrvPort = NULL; +static uchar *pszFrom = NULL; +static uchar *pszSubject = NULL; +static int bEnableBody = 1; /* should a mail body be generated? (set to 0 eg for SMS gateways) */ typedef struct _instanceData { int iMode; /* 0 - smtp, 1 - sendmail */ @@ -90,26 +95,6 @@ } md; /* mode-specific data */ } instanceData; -typedef struct configSettings_s { - toRcpt_t *lstRcpt; - uchar *pszSrv; - uchar *pszSrvPort; - uchar *pszFrom; - uchar *pszSubject; - int bEnableBody; /* should a mail body be generated? (set to 0 eg for SMS gateways) */ -} configSettings_t; -static configSettings_t cs; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.lstRcpt = NULL; - cs.pszSrv = NULL; - cs.pszSrvPort = NULL; - cs.pszFrom = NULL; - cs.pszSubject = NULL; - cs.bEnableBody = 1; /* should a mail body be generated? (set to 0 eg for SMS gateways) */ -ENDinitConfVars - /* forward definitions (as few as possible) */ static rsRetVal Send(int sock, char *msg, size_t len); static rsRetVal readResponse(instanceData *pData, int *piState, int iExpected); @@ -143,8 +128,8 @@ CHKmalloc(pNew = calloc(1, sizeof(toRcpt_t))); pNew->pszTo = pNewVal; - pNew->pNext = cs.lstRcpt; - cs.lstRcpt = pNew; + pNew->pNext = lstRcpt; + lstRcpt = pNew; dbgprintf("ommail::addRcpt adds recipient %s\n", pNewVal); @@ -176,7 +161,7 @@ for(pRcpt = pData->md.smtp.lstRcpt ; pRcpt != NULL ; pRcpt = pRcpt->pNext) { dbgprintf("Sending '%s: <%s>'\n", pszOp, pRcpt->pszTo); CHKiRet(Send(pData->md.smtp.sock, (char*)pszOp, lenOp)); - CHKiRet(Send(pData->md.smtp.sock, ":<", sizeof(":<") - 1)); + CHKiRet(Send(pData->md.smtp.sock, ": <", sizeof(": <") - 1)); CHKiRet(Send(pData->md.smtp.sock, (char*)pRcpt->pszTo, strlen((char*)pRcpt->pszTo))); CHKiRet(Send(pData->md.smtp.sock, ">\r\n", sizeof(">\r\n") - 1)); if(iStatusToCheck >= 0) @@ -522,7 +507,7 @@ CHKiRet(Send(pData->md.smtp.sock, "\r\n", sizeof("\r\n") - 1)); CHKiRet(readResponse(pData, &iState, 250)); - CHKiRet(Send(pData->md.smtp.sock, "MAIL FROM:<", sizeof("MAIL FROM:<") - 1)); + CHKiRet(Send(pData->md.smtp.sock, "MAIL FROM: <", sizeof("MAIL FROM: <") - 1)); CHKiRet(Send(pData->md.smtp.sock, (char*)pData->md.smtp.pszFrom, strlen((char*)pData->md.smtp.pszFrom))); CHKiRet(Send(pData->md.smtp.sock, ">\r\n", sizeof(">\r\n") - 1)); CHKiRet(readResponse(pData, &iState, 250)); @@ -623,32 +608,32 @@ /* TODO: check strdup() result */ - if(cs.pszFrom == NULL) { + if(pszFrom == NULL) { errmsg.LogError(0, RS_RET_MAIL_NO_FROM, "no sender address given - specify $ActionMailFrom"); ABORT_FINALIZE(RS_RET_MAIL_NO_FROM); } - if(cs.lstRcpt == NULL) { + if(lstRcpt == NULL) { errmsg.LogError(0, RS_RET_MAIL_NO_TO, "no recipient address given - specify $ActionMailTo"); ABORT_FINALIZE(RS_RET_MAIL_NO_TO); } - pData->md.smtp.pszFrom = (uchar*) strdup((char*)cs.pszFrom); - pData->md.smtp.lstRcpt = cs.lstRcpt; /* we "hand over" this memory */ - cs.lstRcpt = NULL; /* note: this is different from pre-3.21.2 versions! */ + pData->md.smtp.pszFrom = (uchar*) strdup((char*)pszFrom); + pData->md.smtp.lstRcpt = lstRcpt; /* we "hand over" this memory */ + lstRcpt = NULL; /* note: this is different from pre-3.21.2 versions! */ - if(cs.pszSubject == NULL) { + if(pszSubject == NULL) { /* if no subject is configured, we need just one template string */ CODE_STD_STRING_REQUESTparseSelectorAct(1) } else { CODE_STD_STRING_REQUESTparseSelectorAct(2) pData->bHaveSubject = 1; - CHKiRet(OMSRsetEntry(*ppOMSR, 1, (uchar*)strdup((char*) cs.pszSubject), OMSR_NO_RQD_TPL_OPTS)); + CHKiRet(OMSRsetEntry(*ppOMSR, 1, (uchar*)strdup((char*) pszSubject), OMSR_NO_RQD_TPL_OPTS)); } - if(cs.pszSrv != NULL) - pData->md.smtp.pszSrv = (uchar*) strdup((char*)cs.pszSrv); - if(cs.pszSrvPort != NULL) - pData->md.smtp.pszSrvPort = (uchar*) strdup((char*)cs.pszSrvPort); - pData->bEnableBody = cs.bEnableBody; + if(pszSrv != NULL) + pData->md.smtp.pszSrv = (uchar*) strdup((char*)pszSrv); + if(pszSrvPort != NULL) + pData->md.smtp.pszSrvPort = (uchar*) strdup((char*)pszSrvPort); + pData->bEnableBody = bEnableBody; /* process template */ CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) "RSYSLOG_FileFormat")); @@ -661,14 +646,20 @@ { DEFiRet; - free(cs.pszSrv); - cs.pszSrv = NULL; - free(cs.pszSrvPort); - cs.pszSrvPort = NULL; - free(cs.pszFrom); - cs.pszFrom = NULL; - lstRcptDestruct(cs.lstRcpt); - cs.lstRcpt = NULL; + if(pszSrv != NULL) { + free(pszSrv); + pszSrv = NULL; + } + if(pszSrvPort != NULL) { + free(pszSrvPort); + pszSrvPort = NULL; + } + if(pszFrom != NULL) { + free(pszFrom); + pszFrom = NULL; + } + lstRcptDestruct(lstRcpt); + lstRcpt = NULL; RETiRet; } @@ -689,7 +680,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES ENDqueryEtryPt @@ -698,7 +688,7 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - cs.bEnableBody = 1; + bEnableBody = 1; iRet = freeConfigVariables(); RETiRet; } @@ -706,7 +696,6 @@ BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr /* tell which objects we need */ @@ -716,12 +705,12 @@ dbgprintf("ommail version %s initializing\n", VERSION); - CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailsmtpserver", 0, eCmdHdlrGetWord, NULL, &cs.pszSrv, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailsmtpport", 0, eCmdHdlrGetWord, NULL, &cs.pszSrvPort, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailfrom", 0, eCmdHdlrGetWord, NULL, &cs.pszFrom, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailsmtpserver", 0, eCmdHdlrGetWord, NULL, &pszSrv, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailsmtpport", 0, eCmdHdlrGetWord, NULL, &pszSrvPort, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailfrom", 0, eCmdHdlrGetWord, NULL, &pszFrom, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailto", 0, eCmdHdlrGetWord, addRcpt, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailsubject", 0, eCmdHdlrGetWord, NULL, &cs.pszSubject, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailenablebody", 0, eCmdHdlrBinary, NULL, &cs.bEnableBody, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailsubject", 0, eCmdHdlrGetWord, NULL, &pszSubject, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionmailenablebody", 0, eCmdHdlrBinary, NULL, &bEnableBody, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/ommongodb/Makefile.am rsyslog-5.10.1/plugins/ommongodb/Makefile.am --- rsyslog-7.6.0/plugins/ommongodb/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommongodb/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -pkglib_LTLIBRARIES = ommongodb.la -ommongodb_la_SOURCES = ommongodb.c -ommongodb_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBMONGO_CLIENT_CFLAGS) -ommongodb_la_LDFLAGS = -module -avoid-version -ommongodb_la_LIBADD = $(LIBMONGO_CLIENT_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/ommongodb/Makefile.in rsyslog-5.10.1/plugins/ommongodb/Makefile.in --- rsyslog-7.6.0/plugins/ommongodb/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommongodb/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/ommongodb -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -ommongodb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_ommongodb_la_OBJECTS = ommongodb_la-ommongodb.lo -ommongodb_la_OBJECTS = $(am_ommongodb_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -ommongodb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(ommongodb_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(ommongodb_la_SOURCES) -DIST_SOURCES = $(ommongodb_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = ommongodb.la -ommongodb_la_SOURCES = ommongodb.c -ommongodb_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(LIBMONGO_CLIENT_CFLAGS) -ommongodb_la_LDFLAGS = -module -avoid-version -ommongodb_la_LIBADD = $(LIBMONGO_CLIENT_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/ommongodb/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/ommongodb/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -ommongodb.la: $(ommongodb_la_OBJECTS) $(ommongodb_la_DEPENDENCIES) $(EXTRA_ommongodb_la_DEPENDENCIES) - $(AM_V_CCLD)$(ommongodb_la_LINK) -rpath $(pkglibdir) $(ommongodb_la_OBJECTS) $(ommongodb_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ommongodb_la-ommongodb.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -ommongodb_la-ommongodb.lo: ommongodb.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommongodb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ommongodb_la-ommongodb.lo -MD -MP -MF $(DEPDIR)/ommongodb_la-ommongodb.Tpo -c -o ommongodb_la-ommongodb.lo `test -f 'ommongodb.c' || echo '$(srcdir)/'`ommongodb.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ommongodb_la-ommongodb.Tpo $(DEPDIR)/ommongodb_la-ommongodb.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ommongodb.c' object='ommongodb_la-ommongodb.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommongodb_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ommongodb_la-ommongodb.lo `test -f 'ommongodb.c' || echo '$(srcdir)/'`ommongodb.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/ommongodb/ommongodb.c rsyslog-5.10.1/plugins/ommongodb/ommongodb.c --- rsyslog-7.6.0/plugins/ommongodb/ommongodb.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommongodb/ommongodb.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,596 +0,0 @@ -/* ommongodb.c - * Output module for mongodb. - * Note: this module uses the libmongo-client library. The original 10gen - * mongodb C interface is crap. Obtain the library here: - * https://github.com/algernon/libmongo-client - * - * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -/* For struct json_object_iter, should not be necessary in future versions */ -#include - -#include "rsyslog.h" -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "datetime.h" -#include "errmsg.h" -#include "cfsysline.h" -#include "unicode-helper.h" - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("ommongodb") -/* internal structures - */ -DEF_OMOD_STATIC_DATA -DEFobjCurrIf(errmsg) -DEFobjCurrIf(datetime) - -typedef struct _instanceData { - mongo_sync_connection *conn; - struct json_tokener *json_tokener; /* only if (tplName != NULL) */ - uchar *server; - int port; - uchar *db; - uchar *collection; - uchar *uid; - uchar *pwd; - uchar *dbNcoll; - uchar *tplName; - int bErrMsgPermitted; /* only one errmsg permitted per connection */ -} instanceData; - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "server", eCmdHdlrGetWord, 0 }, - { "serverport", eCmdHdlrInt, 0 }, - { "db", eCmdHdlrGetWord, 0 }, - { "collection", eCmdHdlrGetWord, 0 }, - { "uid", eCmdHdlrGetWord, 0 }, - { "pwd", eCmdHdlrGetWord, 0 }, - { "template", eCmdHdlrGetWord, 1 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - /* use this to specify if select features are supported by this - * plugin. If not, the framework will handle that. Currently, only - * RepeatedMsgReduction ("last message repeated n times") is optional. - */ - if(eFeat == sFEATURERepeatedMsgReduction) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - -static void closeMongoDB(instanceData *pData) -{ - if(pData->conn != NULL) { - mongo_sync_disconnect(pData->conn); - pData->conn = NULL; - } -} - - -BEGINfreeInstance -CODESTARTfreeInstance - closeMongoDB(pData); - if (pData->json_tokener != NULL) - json_tokener_free(pData->json_tokener); - free(pData->server); - free(pData->db); - free(pData->collection); - free(pData->uid); - free(pData->pwd); - free(pData->dbNcoll); - free(pData->tplName); -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo - /* nothing special here */ - (void)pData; -ENDdbgPrintInstInfo - - -/* report error that occured during *last* operation - */ -static void -reportMongoError(instanceData *pData) -{ - char errStr[1024]; - gchar *err; - int eno; - - if(pData->bErrMsgPermitted) { - eno = errno; - if(mongo_sync_cmd_get_last_error(pData->conn, (gchar*)pData->db, &err) == TRUE) { - errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", err); - } else { - DBGPRINTF("ommongodb: we had an error, but can not obtain specifics, " - "using plain old errno error message generator\n"); - errmsg.LogError(0, RS_RET_ERR, "ommongodb: error: %s", - rs_strerror_r(eno, errStr, sizeof(errStr))); - } - pData->bErrMsgPermitted = 0; - } -} - - -/* The following function is responsible for initializing a - * MySQL connection. - * Initially added 2004-10-28 mmeckelein - */ -static rsRetVal initMongoDB(instanceData *pData, int bSilent) -{ - char *server; - DEFiRet; - - server = (pData->server == NULL) ? "127.0.0.1" : (char*) pData->server; - DBGPRINTF("ommongodb: trying connect to '%s' at port %d\n", server, pData->port); - - pData->conn = mongo_sync_connect(server, pData->port, TRUE); - if(pData->conn == NULL) { - if(!bSilent) { - reportMongoError(pData); - dbgprintf("ommongodb: can not initialize MongoDB handle"); - } - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - -finalize_it: - RETiRet; -} - - -/* map syslog severity to lumberjack level - * TODO: consider moving this to msg.c - make some dirty "friend" references... - * rgerhards, 2012-03-19 - */ -static inline char * -getLumberjackLevel(short severity) -{ - switch(severity) { - case 0: return "FATAL"; - case 1: - case 2: - case 3: return "ERROR"; - case 4: return "WARN"; - case 5: - case 6: return "INFO"; - case 7: return "DEBUG"; - default:DBGPRINTF("ommongodb: invalid syslog severity %u\n", severity); - return "INVLD"; - } -} - - -/* small helper: get integer power of 10 */ -static inline int -i10pow(int exp) -{ - int r = 1; - while(exp > 0) { - r *= 10; - exp--; - } - return r; -} -/* Return a BSON document when an user hasn't specified a template. - * In this mode, we use the standard document format, which is somewhat - * aligned to cee (as described in project lumberjack). Note that this is - * a moving target, so we may run out of sync (and stay so to retain - * backward compatibility, which we consider pretty important). - */ -static bson * -getDefaultBSON(msg_t *pMsg) -{ - bson *doc = NULL; - uchar *procid; short unsigned procid_free; rs_size_t procid_len; - uchar *tag; short unsigned tag_free; rs_size_t tag_len; - uchar *pid; short unsigned pid_free; rs_size_t pid_len; - uchar *sys; short unsigned sys_free; rs_size_t sys_len; - uchar *msg; short unsigned msg_free; rs_size_t msg_len; - int severity, facil; - gint64 ts_gen, ts_rcv; /* timestamps: generated, received */ - int secfrac; - msgPropDescr_t cProp; /* we use internal implementation knowledge... */ - - cProp.id = PROP_PROGRAMNAME; - procid = MsgGetProp(pMsg, NULL, &cProp, &procid_len, &procid_free, NULL); - cProp.id = PROP_SYSLOGTAG; - tag = MsgGetProp(pMsg, NULL, &cProp, &tag_len, &tag_free, NULL); - cProp.id = PROP_PROCID; - pid = MsgGetProp(pMsg, NULL, &cProp, &pid_len, &pid_free, NULL); - cProp.id = PROP_HOSTNAME; - sys = MsgGetProp(pMsg, NULL, &cProp, &sys_len, &sys_free, NULL); - cProp.id = PROP_MSG; - msg = MsgGetProp(pMsg, NULL, &cProp, &msg_len, &msg_free, NULL); - - // TODO: move to datetime? Refactor in any case! rgerhards, 2012-03-30 - ts_gen = (gint64) datetime.syslogTime2time_t(&pMsg->tTIMESTAMP) * 1000; /* ms! */ -dbgprintf("ommongodb: ts_gen is %lld\n", (long long) ts_gen); -dbgprintf("ommongodb: secfrac is %d, precision %d\n", pMsg->tTIMESTAMP.secfrac, pMsg->tTIMESTAMP.secfracPrecision); - if(pMsg->tTIMESTAMP.secfracPrecision > 3) { - secfrac = pMsg->tTIMESTAMP.secfrac / i10pow(pMsg->tTIMESTAMP.secfracPrecision - 3); - } else if(pMsg->tTIMESTAMP.secfracPrecision < 3) { - secfrac = pMsg->tTIMESTAMP.secfrac * i10pow(3 - pMsg->tTIMESTAMP.secfracPrecision); - } else { - secfrac = pMsg->tTIMESTAMP.secfrac; - } - ts_gen += secfrac; - ts_rcv = (gint64) datetime.syslogTime2time_t(&pMsg->tRcvdAt) * 1000; /* ms! */ - if(pMsg->tRcvdAt.secfracPrecision > 3) { - secfrac = pMsg->tRcvdAt.secfrac / i10pow(pMsg->tRcvdAt.secfracPrecision - 3); - } else if(pMsg->tRcvdAt.secfracPrecision < 3) { - secfrac = pMsg->tRcvdAt.secfrac * i10pow(3 - pMsg->tRcvdAt.secfracPrecision); - } else { - secfrac = pMsg->tRcvdAt.secfrac; - } - ts_rcv += secfrac; - - /* the following need to be int, but are short, so we need to xlat */ - severity = pMsg->iSeverity; - facil = pMsg->iFacility; - - doc = bson_build(BSON_TYPE_STRING, "sys", sys, sys_len, - BSON_TYPE_UTC_DATETIME, "time", ts_gen, - BSON_TYPE_UTC_DATETIME, "time_rcvd", ts_rcv, - BSON_TYPE_STRING, "msg", msg, msg_len, - BSON_TYPE_INT32, "syslog_fac", facil, - BSON_TYPE_INT32, "syslog_sever", severity, - BSON_TYPE_STRING, "syslog_tag", tag, tag_len, - BSON_TYPE_STRING, "procid", procid, procid_len, - BSON_TYPE_STRING, "pid", pid, pid_len, - BSON_TYPE_STRING, "level", getLumberjackLevel(pMsg->iSeverity), -1, - BSON_TYPE_NONE); - - if(procid_free) free(procid); - if(tag_free) free(tag); - if(pid_free) free(pid); - if(sys_free) free(sys); - if(msg_free) free(msg); - - if(doc == NULL) - return doc; - bson_finish(doc); - return doc; -} - -static bson *BSONFromJSONArray(struct json_object *json); -static bson *BSONFromJSONObject(struct json_object *json); - -/* Append a BSON variant of json to doc using name. Return TRUE on success */ -static gboolean -BSONAppendJSONObject(bson *doc, const gchar *name, struct json_object *json) -{ - switch(json != NULL ? json_object_get_type(json) : json_type_null) { - case json_type_null: - return bson_append_null(doc, name); - case json_type_boolean: - return bson_append_boolean(doc, name, - json_object_get_boolean(json)); - case json_type_double: - return bson_append_double(doc, name, - json_object_get_double(json)); - case json_type_int: { - int64_t i; - -#ifdef HAVE_JSON_OBJECT_NEW_INT64 - i = json_object_get_int64(json); -#else /* HAVE_JSON_OBJECT_NEW_INT64 */ - i = json_object_get_int(json); -#endif /* HAVE_JSON_OBJECT_NEW_INT64 */ - if (i >= INT32_MIN && i <= INT32_MAX) - return bson_append_int32(doc, name, i); - else - return bson_append_int64(doc, name, i); - } - case json_type_object: { - bson *sub; - gboolean ok; - - sub = BSONFromJSONObject(json); - if (sub == NULL) - return FALSE; - ok = bson_append_document(doc, name, sub); - bson_free(sub); - return ok; - } - case json_type_array: { - bson *sub; - gboolean ok; - - sub = BSONFromJSONArray(json); - if (sub == NULL) - return FALSE; - ok = bson_append_document(doc, name, sub); - bson_free(sub); - return ok; - } - case json_type_string: - return bson_append_string(doc, name, - json_object_get_string(json), -1); - - default: - return FALSE; - } -} - -/* Return a BSON variant of json, which must be a json_type_array */ -static bson * -BSONFromJSONArray(struct json_object *json) -{ - /* Way more than necessary */ - bson *doc = NULL; - size_t i, array_len; - - doc = bson_new(); - if(doc == NULL) - goto error; - - array_len = json_object_array_length(json); - for (i = 0; i < array_len; i++) { - char buf[sizeof(size_t) * CHAR_BIT + 1]; - - if ((size_t)snprintf(buf, sizeof(buf), "%zu", i) >= sizeof(buf)) - goto error; - if (BSONAppendJSONObject(doc, buf, - json_object_array_get_idx(json, i)) - == FALSE) - goto error; - } - - if(bson_finish(doc) == FALSE) - goto error; - - return doc; - -error: - if(doc != NULL) - bson_free(doc); - return NULL; -} - -/* Return a BSON variant of json, which must be a json_type_object */ -static bson * -BSONFromJSONObject(struct json_object *json) -{ - bson *doc = NULL; - struct json_object_iter it; - - doc = bson_new(); - if(doc == NULL) - goto error; - - json_object_object_foreachC(json, it) { - if (BSONAppendJSONObject(doc, it.key, it.val) == FALSE) - goto error; - } - - if(bson_finish(doc) == FALSE) - goto error; - - return doc; - -error: - if(doc != NULL) - bson_free(doc); - return NULL; -} - -BEGINtryResume -CODESTARTtryResume - if(pData->conn == NULL) { - iRet = initMongoDB(pData, 1); - } -ENDtryResume - -BEGINdoAction - bson *doc = NULL; -CODESTARTdoAction - /* see if we are ready to proceed */ - if(pData->conn == NULL) { - CHKiRet(initMongoDB(pData, 0)); - } - - if(pData->tplName == NULL) { - doc = getDefaultBSON((msg_t*)ppString[0]); - } else { - doc = BSONFromJSONObject((struct json_object *)ppString[0]); - } - if(doc == NULL) { - dbgprintf("ommongodb: error creating BSON doc\n"); - /* FIXME: is this a correct return code? */ - ABORT_FINALIZE(RS_RET_ERR); - } - if(mongo_sync_cmd_insert(pData->conn, (char*)pData->dbNcoll, doc, NULL)) { - pData->bErrMsgPermitted = 1; - } else { - dbgprintf("ommongodb: insert error\n"); - reportMongoError(pData); - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - -finalize_it: - if(doc != NULL) - bson_free(doc); -ENDdoAction - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->server = NULL; - pData->port = 27017; - pData->db = NULL; - pData->collection= NULL; - pData->uid = NULL; - pData->pwd = NULL; - pData->tplName = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; - unsigned lendb, lencoll; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "server")) { - pData->server = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "serverport")) { - pData->port = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "db")) { - pData->db = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "collection")) { - pData->collection = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "uid")) { - pData->uid = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "pwd")) { - pData->pwd = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("ommongodb: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->tplName == NULL) { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, NULL, OMSR_TPL_AS_MSG)); - } else { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, ustrdup(pData->tplName), - OMSR_TPL_AS_JSON)); - CHKmalloc(pData->json_tokener = json_tokener_new()); - } - - if(pData->db == NULL) - pData->db = (uchar*)strdup("syslog"); - if(pData->collection == NULL) - pData->collection = (uchar*)strdup("log"); - - /* we now create a db+collection string as we need to pass this - * into the API and we do not want to generate it each time ;) - * +2 ==> dot as delimiter and \0 - */ - lendb = strlen((char*)pData->db); - lencoll = strlen((char*)pData->collection); - CHKmalloc(pData->dbNcoll = malloc(lendb+lencoll+2)); - memcpy(pData->dbNcoll, pData->db, lendb); - pData->dbNcoll[lendb] = '.'; - /* lencoll+1 => copy \0! */ - memcpy(pData->dbNcoll+lendb+1, pData->collection, lencoll+1); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(!strncmp((char*) p, ":ommongodb:", sizeof(":ommongodb:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "ommongodb supports only v6 config format, use: " - "action(type=\"ommongodb\" server=...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); - objRelease(datetime, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -ENDqueryEtryPt - -BEGINmodInit() - rsRetVal localRet; - rsRetVal (*pomsrGetSupportedTplOpts)(unsigned long *pOpts); - unsigned long opts; - int bJSONPassingSupported; -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(datetime, CORE_COMPONENT)); - INITChkCoreFeature(bCoreSupportsBatching, CORE_FEATURE_BATCHING); - DBGPRINTF("ommongodb: module compiled with rsyslog version %s.\n", VERSION); - - /* check if the rsyslog core supports parameter passing code */ - bJSONPassingSupported = 0; - localRet = pHostQueryEtryPt((uchar*)"OMSRgetSupportedTplOpts", - &pomsrGetSupportedTplOpts); - if(localRet == RS_RET_OK) { - /* found entry point, so let's see if core supports msg passing */ - CHKiRet((*pomsrGetSupportedTplOpts)(&opts)); - if(opts & OMSR_TPL_AS_JSON) - bJSONPassingSupported = 1; - } else if(localRet != RS_RET_ENTRY_POINT_NOT_FOUND) { - ABORT_FINALIZE(localRet); /* Something else went wrong, not acceptable */ - } - if(!bJSONPassingSupported) { - DBGPRINTF("ommongodb: JSON-passing is not supported by rsyslog core, " - "can not continue.\n"); - ABORT_FINALIZE(RS_RET_NO_JSON_PASSING); - } -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/ommongodb/README rsyslog-5.10.1/plugins/ommongodb/README --- rsyslog-7.6.0/plugins/ommongodb/README 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommongodb/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -plugin to use MongoDB as backend. - -tested in ubuntu 10.04 and ubuntu 10.10 - -configuration: - -in your /etc/rsyslog.conf, together with other modules: -$ModLoad ommongodb # provides mongodb support -*.* action(type="ommongodb" db="..." collection="..." template="...") - -Note: if no template is specified, a default schema will be used. That schema -contains proper data types. However, if a template is specified, only strings -are supported. This is a restriction of the rsyslog v6 core engine. This -changed in v7. - -If templates are used, it is suggested to use list-based templates. Constants -can ONLY be inserted with list-based templates, as only these provide the -capability to specify a field name (outname parameter). diff -Nru rsyslog-7.6.0/plugins/ommysql/Makefile.in rsyslog-5.10.1/plugins/ommysql/Makefile.in --- rsyslog-7.6.0/plugins/ommysql/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommysql/Makefile.in 2012-10-17 14:42:41.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = ommysql_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ommysql_la_OBJECTS = ommysql_la-ommysql.lo ommysql_la_OBJECTS = $(am_ommysql_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent ommysql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(ommysql_la_SOURCES) DIST_SOURCES = $(ommysql_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -ommysql.la: $(ommysql_la_OBJECTS) $(ommysql_la_DEPENDENCIES) $(EXTRA_ommysql_la_DEPENDENCIES) +ommysql.la: $(ommysql_la_OBJECTS) $(ommysql_la_DEPENDENCIES) $(AM_V_CCLD)$(ommysql_la_LINK) -rpath $(pkglibdir) $(ommysql_la_OBJECTS) $(ommysql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< ommysql_la-ommysql.lo: ommysql.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ommysql_la-ommysql.lo -MD -MP -MF $(DEPDIR)/ommysql_la-ommysql.Tpo -c -o ommysql_la-ommysql.lo `test -f 'ommysql.c' || echo '$(srcdir)/'`ommysql.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ommysql_la-ommysql.Tpo $(DEPDIR)/ommysql_la-ommysql.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ommysql.c' object='ommysql_la-ommysql.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ommysql.c' object='ommysql_la-ommysql.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ommysql_la-ommysql.lo `test -f 'ommysql.c' || echo '$(srcdir)/'`ommysql.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ommysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ommysql_la-ommysql.lo `test -f 'ommysql.c' || echo '$(srcdir)/'`ommysql.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/ommysql/ommysql.c rsyslog-5.10.1/plugins/ommysql/ommysql.c --- rsyslog-7.6.0/plugins/ommysql/ommysql.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/ommysql/ommysql.c 2012-10-17 14:41:20.000000000 +0000 @@ -45,9 +45,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("ommysql") - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); /* internal structures */ @@ -55,48 +52,21 @@ DEFobjCurrIf(errmsg) typedef struct _instanceData { - MYSQL *f_hmysql; /* handle to MySQL */ - char dbsrv[MAXHOSTNAMELEN+1]; /* IP or hostname of DB server*/ - unsigned int dbsrvPort; /* port of MySQL server */ - char dbname[_DB_MAXDBLEN+1]; /* DB name */ - char dbuid[_DB_MAXUNAMELEN+1]; /* DB user */ - char dbpwd[_DB_MAXPWDLEN+1]; /* DB user's password */ - unsigned uLastMySQLErrno; /* last errno returned by MySQL or 0 if all is well */ - uchar * f_configfile; /* MySQL Client Configuration File */ - uchar * f_configsection; /* MySQL Client Configuration Section */ - uchar *tplName; /* format template to use */ + MYSQL *f_hmysql; /* handle to MySQL */ + char f_dbsrv[MAXHOSTNAMELEN+1]; /* IP or hostname of DB server*/ + unsigned int f_dbsrvPort; /* port of MySQL server */ + char f_dbname[_DB_MAXDBLEN+1]; /* DB name */ + char f_dbuid[_DB_MAXUNAMELEN+1]; /* DB user */ + char f_dbpwd[_DB_MAXPWDLEN+1]; /* DB user's password */ + unsigned uLastMySQLErrno; /* last errno returned by MySQL or 0 if all is well */ + uchar * f_configfile; /* MySQL Client Configuration File */ + uchar * f_configsection; /* MySQL Client Configuration Section */ } instanceData; -typedef struct configSettings_s { - int iSrvPort; /* database server port */ - uchar *pszMySQLConfigFile; /* MySQL Client Configuration File */ - uchar *pszMySQLConfigSection; /* MySQL Client Configuration Section */ -} configSettings_t; -static configSettings_t cs; - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "server", eCmdHdlrGetWord, 1 }, - { "db", eCmdHdlrGetWord, 1 }, - { "uid", eCmdHdlrGetWord, 1 }, - { "pwd", eCmdHdlrGetWord, 1 }, - { "serverport", eCmdHdlrInt, 0 }, - { "mysqlconfig.file", eCmdHdlrGetWord, 0 }, - { "mysqlconfig.section", eCmdHdlrGetWord, 0 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - resetConfigVariables(NULL, NULL); -ENDinitConfVars +/* config variables */ +static uchar * pszMySQLConfigFile = NULL; /* MySQL Client Configuration File */ +static uchar * pszMySQLConfigSection = NULL; /* MySQL Client Configuration Section */ +static int iSrvPort = 0; /* database server port */ BEGINcreateInstance @@ -123,13 +93,18 @@ mysql_close(pData->f_hmysql); pData->f_hmysql = NULL; } + if(pData->f_configfile!=NULL){ + free(pData->f_configfile); + pData->f_configfile=NULL; + } + if(pData->f_configsection!=NULL){ + free(pData->f_configsection); + pData->f_configsection=NULL; + } } BEGINfreeInstance CODESTARTfreeInstance - free(pData->f_configfile); - free(pData->f_configsection); - free(pData->tplName); closeMySQL(pData); ENDfreeInstance @@ -181,6 +156,7 @@ ASSERT(pData != NULL); ASSERT(pData->f_hmysql == NULL); + pData->f_hmysql = mysql_init(NULL); if(pData->f_hmysql == NULL) { errmsg.LogError(0, RS_RET_SUSPENDED, "can not initialize MySQL handle"); @@ -206,16 +182,14 @@ } } /* Connect to database */ - if(mysql_real_connect(pData->f_hmysql, pData->dbsrv, pData->dbuid, - pData->dbpwd, pData->dbname, pData->dbsrvPort, NULL, 0) == NULL) { + if(mysql_real_connect(pData->f_hmysql, pData->f_dbsrv, pData->f_dbuid, + pData->f_dbpwd, pData->f_dbname, pData->f_dbsrvPort, NULL, 0) == NULL) { reportDBError(pData, bSilent); closeMySQL(pData); /* ignore any error we may get */ - ABORT_FINALIZE(RS_RET_SUSPENDED); + iRet = RS_RET_SUSPENDED; } - mysql_autocommit(pData->f_hmysql, 0); } -finalize_it: RETiRet; } @@ -234,7 +208,6 @@ /* see if we are ready to proceed */ if(pData->f_hmysql == NULL) { CHKiRet(initMySQL(pData, 0)); - } /* try insert */ @@ -266,102 +239,12 @@ } ENDtryResume -BEGINbeginTransaction -CODESTARTbeginTransaction - CHKiRet(writeMySQL((uchar*)"START TRANSACTION", pData)); -finalize_it: -ENDbeginTransaction - BEGINdoAction CODESTARTdoAction dbgprintf("\n"); - CHKiRet(writeMySQL(ppString[0], pData)); - iRet = RS_RET_DEFER_COMMIT; -finalize_it: + iRet = writeMySQL(ppString[0], pData); ENDdoAction -BEGINendTransaction -CODESTARTendTransaction - if (mysql_commit(pData->f_hmysql) != 0) { - dbgprintf("mysql server error: transaction not committed\n"); - iRet = RS_RET_SUSPENDED; - } -ENDendTransaction - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->dbsrvPort = 0; - pData->f_configfile = NULL; - pData->f_configsection = NULL; - pData->tplName = NULL; - pData->f_hmysql = NULL; /* initialize, but connect only on first message (important for queued mode!) */ -} - - -/* note: we use the fixed-size buffers inside the config object to avoid - * changing too much of the previous plumbing. rgerhards, 2012-02-02 - */ -BEGINnewActInst - struct cnfparamvals *pvals; - int i; - char *cstr; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTparseSelectorAct(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "server")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - strncpy(pData->dbsrv, cstr, sizeof(pData->dbsrv)); - free(cstr); - } else if(!strcmp(actpblk.descr[i].name, "serverport")) { - pData->dbsrvPort = (int) pvals[i].val.d.n, NULL; - } else if(!strcmp(actpblk.descr[i].name, "db")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - strncpy(pData->dbname, cstr, sizeof(pData->dbname)); - free(cstr); - } else if(!strcmp(actpblk.descr[i].name, "uid")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - strncpy(pData->dbuid, cstr, sizeof(pData->dbuid)); - free(cstr); - } else if(!strcmp(actpblk.descr[i].name, "pwd")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - strncpy(pData->dbpwd, cstr, sizeof(pData->dbpwd)); - free(cstr); - } else if(!strcmp(actpblk.descr[i].name, "mysqlconfig.file")) { - pData->f_configfile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "mysqlconfig.section")) { - pData->f_configsection = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("ommysql: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->tplName == NULL) { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*) strdup(" StdDBFmt"), - OMSR_RQD_TPL_OPT_SQL)); - } else { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, - (uchar*) strdup((char*) pData->tplName), - OMSR_RQD_TPL_OPT_SQL)); - } -CODE_STD_FINALIZERnewActInst -dbgprintf("XXXX: added param, iRet %d\n", iRet); - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - BEGINparseSelectorAct int iMySQLPropErr = 0; @@ -391,19 +274,19 @@ * Now we read the MySQL connection properties * and verify that the properties are valid. */ - if(getSubString(&p, pData->dbsrv, MAXHOSTNAMELEN+1, ',')) + if(getSubString(&p, pData->f_dbsrv, MAXHOSTNAMELEN+1, ',')) iMySQLPropErr++; - if(*pData->dbsrv == '\0') + if(*pData->f_dbsrv == '\0') iMySQLPropErr++; - if(getSubString(&p, pData->dbname, _DB_MAXDBLEN+1, ',')) + if(getSubString(&p, pData->f_dbname, _DB_MAXDBLEN+1, ',')) iMySQLPropErr++; - if(*pData->dbname == '\0') + if(*pData->f_dbname == '\0') iMySQLPropErr++; - if(getSubString(&p, pData->dbuid, _DB_MAXUNAMELEN+1, ',')) + if(getSubString(&p, pData->f_dbuid, _DB_MAXUNAMELEN+1, ',')) iMySQLPropErr++; - if(*pData->dbuid == '\0') + if(*pData->f_dbuid == '\0') iMySQLPropErr++; - if(getSubString(&p, pData->dbpwd, _DB_MAXPWDLEN+1, ';')) + if(getSubString(&p, pData->f_dbpwd, _DB_MAXPWDLEN+1, ';')) iMySQLPropErr++; /* now check for template * We specify that the SQL option must be present in the template. @@ -423,9 +306,9 @@ errmsg.LogError(0, RS_RET_INVALID_PARAMS, "Trouble with MySQL connection properties. -MySQL logging disabled"); ABORT_FINALIZE(RS_RET_INVALID_PARAMS); } else { - pData->dbsrvPort = (unsigned) cs.iSrvPort; /* set configured port */ - pData->f_configfile = cs.pszMySQLConfigFile; - pData->f_configsection = cs.pszMySQLConfigSection; + pData->f_dbsrvPort = (unsigned) iSrvPort; /* set configured port */ + pData->f_configfile = pszMySQLConfigFile; + pData->f_configsection = pszMySQLConfigSection; pData->f_hmysql = NULL; /* initialize, but connect only on first message (important for queued mode!) */ } @@ -446,8 +329,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_TXIF_OMOD_QUERIES /* we support the transactional interface! */ ENDqueryEtryPt @@ -456,25 +337,19 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - cs.iSrvPort = 0; /* zero is the default port */ - free(cs.pszMySQLConfigFile); - cs.pszMySQLConfigFile = NULL; - free(cs.pszMySQLConfigSection); - cs.pszMySQLConfigSection = NULL; + iSrvPort = 0; /* zero is the default port */ + free(pszMySQLConfigFile); + pszMySQLConfigFile = NULL; + free(pszMySQLConfigSection); + pszMySQLConfigSection = NULL; RETiRet; } BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); - INITChkCoreFeature(bCoreSupportsBatching, CORE_FEATURE_BATCHING); - if(!bCoreSupportsBatching) { - errmsg.LogError(0, NO_ERRCODE, "ommysql: rsyslog core too old"); - ABORT_FINALIZE(RS_RET_ERR); - } /* we need to init the MySQL library. If that fails, we cannot run */ if( @@ -490,10 +365,10 @@ } /* register our config handlers */ - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionommysqlserverport", 0, eCmdHdlrInt, NULL, &cs.iSrvPort, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"ommysqlconfigfile",0,eCmdHdlrGetWord,NULL,&cs.pszMySQLConfigFile,STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"ommysqlconfigsection",0,eCmdHdlrGetWord,NULL,&cs.pszMySQLConfigSection,STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionommysqlserverport", 0, eCmdHdlrInt, NULL, &iSrvPort, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"ommysqlconfigfile",0,eCmdHdlrGetWord,NULL,&pszMySQLConfigFile,STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"ommysqlconfigsection",0,eCmdHdlrGetWord,NULL,&pszMySQLConfigSection,STD_LOADABLE_MODULE_ID)); ENDmodInit /* vi:set ai: diff -Nru rsyslog-7.6.0/plugins/omoracle/Makefile.in rsyslog-5.10.1/plugins/omoracle/Makefile.in --- rsyslog-7.6.0/plugins/omoracle/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/omoracle/Makefile.in 2012-10-17 14:42:41.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omoracle_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omoracle_la_OBJECTS = omoracle_la-omoracle.lo omoracle_la_OBJECTS = $(am_omoracle_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omoracle_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omoracle_la_SOURCES) DIST_SOURCES = $(omoracle_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omoracle.la: $(omoracle_la_OBJECTS) $(omoracle_la_DEPENDENCIES) $(EXTRA_omoracle_la_DEPENDENCIES) +omoracle.la: $(omoracle_la_OBJECTS) $(omoracle_la_DEPENDENCIES) $(AM_V_CCLD)$(omoracle_la_LINK) -rpath $(pkglibdir) $(omoracle_la_OBJECTS) $(omoracle_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omoracle_la-omoracle.lo: omoracle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omoracle_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omoracle_la-omoracle.lo -MD -MP -MF $(DEPDIR)/omoracle_la-omoracle.Tpo -c -o omoracle_la-omoracle.lo `test -f 'omoracle.c' || echo '$(srcdir)/'`omoracle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omoracle_la-omoracle.Tpo $(DEPDIR)/omoracle_la-omoracle.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omoracle.c' object='omoracle_la-omoracle.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omoracle.c' object='omoracle_la-omoracle.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omoracle_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omoracle_la-omoracle.lo `test -f 'omoracle.c' || echo '$(srcdir)/'`omoracle.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omoracle_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omoracle_la-omoracle.lo `test -f 'omoracle.c' || echo '$(srcdir)/'`omoracle.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omoracle/omoracle.c rsyslog-5.10.1/plugins/omoracle/omoracle.c --- rsyslog-7.6.0/plugins/omoracle/omoracle.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omoracle/omoracle.c 2012-10-17 14:41:20.000000000 +0000 @@ -83,7 +83,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omoracle") /** */ DEF_OMOD_STATIC_DATA diff -Nru rsyslog-7.6.0/plugins/ompgsql/Makefile.in rsyslog-5.10.1/plugins/ompgsql/Makefile.in --- rsyslog-7.6.0/plugins/ompgsql/Makefile.in 2014-02-12 12:06:35.000000000 +0000 +++ rsyslog-5.10.1/plugins/ompgsql/Makefile.in 2012-10-17 14:42:42.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = ompgsql_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ompgsql_la_OBJECTS = ompgsql_la-ompgsql.lo ompgsql_la_OBJECTS = $(am_ompgsql_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent ompgsql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(ompgsql_la_SOURCES) DIST_SOURCES = $(ompgsql_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -ompgsql.la: $(ompgsql_la_OBJECTS) $(ompgsql_la_DEPENDENCIES) $(EXTRA_ompgsql_la_DEPENDENCIES) +ompgsql.la: $(ompgsql_la_OBJECTS) $(ompgsql_la_DEPENDENCIES) $(AM_V_CCLD)$(ompgsql_la_LINK) -rpath $(pkglibdir) $(ompgsql_la_OBJECTS) $(ompgsql_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< ompgsql_la-ompgsql.lo: ompgsql.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ompgsql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ompgsql_la-ompgsql.lo -MD -MP -MF $(DEPDIR)/ompgsql_la-ompgsql.Tpo -c -o ompgsql_la-ompgsql.lo `test -f 'ompgsql.c' || echo '$(srcdir)/'`ompgsql.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ompgsql_la-ompgsql.Tpo $(DEPDIR)/ompgsql_la-ompgsql.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ompgsql.c' object='ompgsql_la-ompgsql.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ompgsql.c' object='ompgsql_la-ompgsql.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ompgsql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ompgsql_la-ompgsql.lo `test -f 'ompgsql.c' || echo '$(srcdir)/'`ompgsql.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ompgsql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ompgsql_la-ompgsql.lo `test -f 'ompgsql.c' || echo '$(srcdir)/'`ompgsql.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/ompgsql/ompgsql.c rsyslog-5.10.1/plugins/ompgsql/ompgsql.c --- rsyslog-7.6.0/plugins/ompgsql/ompgsql.c 2014-02-12 11:59:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/ompgsql/ompgsql.c 2012-10-17 14:41:20.000000000 +0000 @@ -50,7 +50,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("ompgsql") /* internal structures */ @@ -66,15 +65,6 @@ ConnStatusType eLastPgSQLStatus; /* last status from postgres */ } instanceData; -typedef struct configSettings_s { - EMPTY_STRUCT -} configSettings_t; -static configSettings_t __attribute__((unused)) cs; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars -ENDinitConfVars - static rsRetVal writePgSQL(uchar *psz, instanceData *pData); @@ -262,9 +252,7 @@ BEGINbeginTransaction CODESTARTbeginTransaction - dbgprintf("ompgsql: beginTransaction\n"); - if(pData->f_hpgsql == NULL) - initPgSQL(pData, 0); +dbgprintf("ompgsql: beginTransaction\n"); iRet = writePgSQL((uchar*) "begin", pData); /* TODO: make user-configurable */ ENDbeginTransaction @@ -348,6 +336,8 @@ if (iPgSQLPropErr) { errmsg.LogError(0, RS_RET_INVALID_PARAMS, "Trouble with PgSQL connection properties. -PgSQL logging disabled"); ABORT_FINALIZE(RS_RET_INVALID_PARAMS); + } else { + CHKiRet(initPgSQL(pData, 0)); } CODE_STD_FINALIZERparseSelectorAct @@ -367,7 +357,6 @@ BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); diff -Nru rsyslog-7.6.0/plugins/omprog/Makefile.in rsyslog-5.10.1/plugins/omprog/Makefile.in --- rsyslog-7.6.0/plugins/omprog/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omprog/Makefile.in 2012-10-17 14:42:42.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) omprog_la_DEPENDENCIES = am_omprog_la_OBJECTS = omprog_la-omprog.lo omprog_la_OBJECTS = $(am_omprog_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omprog_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omprog_la_SOURCES) DIST_SOURCES = $(omprog_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omprog.la: $(omprog_la_OBJECTS) $(omprog_la_DEPENDENCIES) $(EXTRA_omprog_la_DEPENDENCIES) +omprog.la: $(omprog_la_OBJECTS) $(omprog_la_DEPENDENCIES) $(AM_V_CCLD)$(omprog_la_LINK) -rpath $(pkglibdir) $(omprog_la_OBJECTS) $(omprog_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omprog_la-omprog.lo: omprog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omprog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omprog_la-omprog.lo -MD -MP -MF $(DEPDIR)/omprog_la-omprog.Tpo -c -o omprog_la-omprog.lo `test -f 'omprog.c' || echo '$(srcdir)/'`omprog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omprog_la-omprog.Tpo $(DEPDIR)/omprog_la-omprog.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omprog.c' object='omprog_la-omprog.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omprog.c' object='omprog_la-omprog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omprog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omprog_la-omprog.lo `test -f 'omprog.c' || echo '$(srcdir)/'`omprog.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omprog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omprog_la-omprog.lo `test -f 'omprog.c' || echo '$(srcdir)/'`omprog.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omprog/omprog.c rsyslog-5.10.1/plugins/omprog/omprog.c --- rsyslog-7.6.0/plugins/omprog/omprog.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/omprog/omprog.c 2012-10-17 14:41:20.000000000 +0000 @@ -45,7 +45,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omprog") /* internal structures */ @@ -54,38 +53,13 @@ typedef struct _instanceData { uchar *szBinary; /* name of binary to call */ - char **aParams; /* Optional Parameters for binary command */ - uchar *tplName; /* assigned output template */ - pid_t pid; /* pid of currently running process */ - int fdPipe; /* file descriptor to write to */ + pid_t pid; /* pid of currently running process */ + int fdPipe; /* file descriptor to write to */ int bIsRunning; /* is binary currently running? 0-no, 1-yes */ - int iParams; /* Holds the count of parameters if set*/ } instanceData; -typedef struct configSettings_s { - uchar *szBinary; /* name of binary to call */ -} configSettings_t; -static configSettings_t cs; - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "binary", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.szBinary = NULL; /* name of binary to call */ -ENDinitConfVars - /* config settings */ +static uchar *szBinary = NULL; /* name of binary to call */ BEGINcreateInstance CODESTARTcreateInstance @@ -100,16 +74,9 @@ BEGINfreeInstance - int i; CODESTARTfreeInstance if(pData->szBinary != NULL) free(pData->szBinary); - if(pData->aParams != NULL) { - for (i = 0; i < pData->iParams; i++) { - free(pData->aParams[i]); - } - free(pData->aParams); - } ENDfreeInstance @@ -129,21 +96,16 @@ static void execBinary(instanceData *pData, int fdStdin) { - int i, iRet; + int i; struct sigaction sigAct; - sigset_t set; + char *newargv[] = { NULL }; char *newenviron[] = { NULL }; assert(pData != NULL); fclose(stdin); - if(dup(fdStdin) == -1) { - DBGPRINTF("omprog: dup() failed\n"); - /* do some more error handling here? Maybe if the module - * gets some more widespread use... - */ - } - /*fclose(stdout);*/ + dup(fdStdin); + //fclose(stdout); /* we close all file handles as we fork soon * Is there a better way to do this? - mail me! rgerhards@adiscon.com @@ -155,21 +117,19 @@ /* reset signal handlers to default */ memset(&sigAct, 0, sizeof(sigAct)); - sigemptyset(&sigAct.sa_mask); + sigfillset(&sigAct.sa_mask); sigAct.sa_handler = SIG_DFL; for(i = 1 ; i < NSIG ; ++i) sigaction(i, &sigAct, NULL); - sigemptyset(&set); - sigprocmask(SIG_SETMASK, &set, NULL); alarm(0); /* finally exec child */ - iRet = execve((char*)pData->szBinary, pData->aParams, newenviron); - if (iRet == -1) { - dbgprintf("omprog: failed to execute binary '%s' with return code: %d\n", pData->szBinary, errno); - } - + execve((char*)pData->szBinary, newargv, newenviron); + /* switch to? + execlp((char*)program, (char*) program, (char*)arg, NULL); + */ + /* we should never reach this point, but if we do, we terminate */ exit(1); } @@ -191,7 +151,7 @@ ABORT_FINALIZE(RS_RET_ERR_CREAT_PIPE); } - DBGPRINTF("omprog: executing program '%s' with '%d' parameters\n", pData->szBinary, pData->iParams); + DBGPRINTF("executing program '%s'\n", pData->szBinary); /* NO OUTPUT AFTER FORK! */ @@ -209,7 +169,7 @@ /*NO CODE HERE - WILL NEVER BE REACHED!*/ } - DBGPRINTF("omprog: child has pid %d\n", (int) cpid); + DBGPRINTF("child has pid %d\n", (int) cpid); pData->fdPipe = pipefd[1]; pData->pid = cpid; close(pipefd[0]); @@ -234,11 +194,11 @@ ret = waitpid(pData->pid, &status, 0); if(ret != pData->pid) { /* if waitpid() fails, we can not do much - try to ignore it... */ - DBGPRINTF("omprog: waitpid() returned state %d[%s], future malfunction may happen\n", ret, + DBGPRINTF("waitpid() returned state %d[%s], future malfunction may happen\n", ret, rs_strerror_r(errno, errStr, sizeof(errStr))); } else { /* check if we should print out some diagnostic information */ - DBGPRINTF("omprog: waitpid status return for program '%s': %2.2x\n", + DBGPRINTF("waitpid status return for program '%s': %2.2x\n", pData->szBinary, status); if(WIFEXITED(status)) { errmsg.LogError(0, NO_ERRCODE, "program '%s' exited normally, state %d", @@ -293,13 +253,13 @@ if(lenWritten == -1) { switch(errno) { case EPIPE: - DBGPRINTF("omprog: Program '%s' terminated, trying to restart\n", + DBGPRINTF("Program '%s' terminated, trying to restart\n", pData->szBinary); CHKiRet(cleanup(pData)); CHKiRet(tryRestart(pData)); break; default: - DBGPRINTF("omprog: error %d writing to pipe: %s\n", errno, + DBGPRINTF("error %d writing to pipe: %s\n", errno, rs_strerror_r(errno, errStr, sizeof(errStr))); ABORT_FINALIZE(RS_RET_ERR_WRITE_PIPE); break; @@ -328,129 +288,6 @@ ENDdoAction -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->szBinary = NULL; - pData->aParams = NULL; - pData->iParams = 0; - pData->fdPipe = -1; - pData->bIsRunning = 0; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - sbool bInQuotes; - int i; - int iPrm; - unsigned char *c; - es_size_t iCnt; - es_size_t iStr; - es_str_t *estrBinary; - es_str_t *estrParams; - es_str_t *estrTmp; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "binary")) { - estrBinary = pvals[i].val.d.estr; - estrParams = NULL; - - /* Search for space */ - c = es_getBufAddr(pvals[i].val.d.estr); - iCnt = 0; - while(iCnt < es_strlen(pvals[i].val.d.estr) ) { - if (c[iCnt] == ' ') { - /* Split binary name from parameters */ - estrBinary = es_newStrFromSubStr ( pvals[i].val.d.estr, 0, iCnt ); - estrParams = es_newStrFromSubStr ( pvals[i].val.d.estr, iCnt+1, es_strlen(pvals[i].val.d.estr)); - break; - } - iCnt++; - } - /* Assign binary and params */ - pData->szBinary = (uchar*)es_str2cstr(estrBinary, NULL); - dbgprintf("omprog: szBinary = '%s'\n", pData->szBinary); - /* Check for Params! */ - if (estrParams != NULL) { - dbgprintf("omprog: szParams = '%s'\n", es_str2cstr(estrParams, NULL) ); - - /* Count parameters if set */ - c = es_getBufAddr(estrParams); /* Reset to beginning */ - pData->iParams = 2; /* Set default to 2, first parameter for binary and second parameter at least from config*/ - iCnt = 0; - while(iCnt < es_strlen(estrParams) ) { - if (c[iCnt] == ' ' && c[iCnt-1] != '\\') - pData->iParams++; - iCnt++; - } - dbgprintf("omprog: iParams = '%d'\n", pData->iParams); - - /* Create argv Array */ - CHKmalloc(pData->aParams = malloc( (pData->iParams+1) * sizeof(char*))); /* One more for first param */ - - /* Second Loop, create parameter array*/ - c = es_getBufAddr(estrParams); /* Reset to beginning */ - iCnt = iStr = iPrm = 0; - estrTmp = NULL; - bInQuotes = FALSE; - /* Set first parameter to binary */ - pData->aParams[iPrm] = strdup((char*)pData->szBinary); - dbgprintf("omprog: Param (%d): '%s'\n", iPrm, pData->aParams[iPrm]); - iPrm++; - while(iCnt < es_strlen(estrParams) ) { - if ( c[iCnt] == ' ' && !bInQuotes ) { - /* Copy into Param Array! */ - estrTmp = es_newStrFromSubStr( estrParams, iStr, iCnt-iStr); - } - else if ( iCnt+1 >= es_strlen(estrParams) ) { - /* Copy rest of string into Param Array! */ - estrTmp = es_newStrFromSubStr( estrParams, iStr, iCnt-iStr+1); - } - else if (c[iCnt] == '"') { - /* switch inQuotes Mode */ - bInQuotes = !bInQuotes; - } - - if ( estrTmp != NULL ) { - pData->aParams[iPrm] = es_str2cstr(estrTmp, NULL); - iStr = iCnt+1; /* Set new start */ - dbgprintf("omprog: Param (%d): '%s'\n", iPrm, pData->aParams[iPrm]); - es_deleteStr( estrTmp ); - estrTmp = NULL; - iPrm++; - } - - /*Next char*/ - iCnt++; - } - /* NULL last parameter! */ - pData->aParams[iPrm] = NULL; - - } - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omprog: program error, non-handled param '%s'\n", actpblk.descr[i].name); - } - } - - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? - "RSYSLOG_FileFormat" : (char*)pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - BEGINparseSelectorAct CODESTARTparseSelectorAct CODE_STD_STRING_REQUESTparseSelectorAct(1) @@ -461,21 +298,15 @@ /* ok, if we reach this point, we have something for us */ p += sizeof(":omprog:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ - if(cs.szBinary == NULL) { - errmsg.LogError(0, RS_RET_CONF_RQRD_PARAM_MISSING, - "no binary to execute specified"); - ABORT_FINALIZE(RS_RET_CONF_RQRD_PARAM_MISSING); - } - CHKiRet(createInstance(&pData)); - if(cs.szBinary == NULL) { + if(szBinary == NULL) { errmsg.LogError(0, RS_RET_CONF_RQRD_PARAM_MISSING, "no binary to execute specified"); ABORT_FINALIZE(RS_RET_CONF_RQRD_PARAM_MISSING); } - CHKmalloc(pData->szBinary = (uchar*) strdup((char*)cs.szBinary)); + CHKmalloc(pData->szBinary = (uchar*) strdup((char*)szBinary)); /* check if a non-standard template is to be applied */ if(*(p-1) == ';') --p; @@ -486,8 +317,10 @@ BEGINmodExit CODESTARTmodExit - free(cs.szBinary); - cs.szBinary = NULL; + if(szBinary != NULL) { + free(szBinary); + szBinary = NULL; + } CHKiRet(objRelease(errmsg, CORE_COMPONENT)); finalize_it: ENDmodExit @@ -496,8 +329,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES ENDqueryEtryPt @@ -507,19 +338,22 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - free(cs.szBinary); - cs.szBinary = NULL; + + if(szBinary != NULL) { + free(szBinary); + szBinary = NULL; + } + RETiRet; } BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomprogbinary", 0, eCmdHdlrGetWord, NULL, &cs.szBinary, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomprogbinary", 0, eCmdHdlrGetWord, NULL, &szBinary, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); CODEmodInit_QueryRegCFSLineHdlr ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omrabbitmq/Makefile.am rsyslog-5.10.1/plugins/omrabbitmq/Makefile.am --- rsyslog-7.6.0/plugins/omrabbitmq/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omrabbitmq/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = omrabbitmq.la - -omrabbitmq_la_SOURCES = omrabbitmq.c -omrabbitmq_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -omrabbitmq_la_LDFLAGS = -module -avoid-version -omrabbitmq_la_LIBADD = $(RABBITMQ_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omrabbitmq/Makefile.in rsyslog-5.10.1/plugins/omrabbitmq/Makefile.in --- rsyslog-7.6.0/plugins/omrabbitmq/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omrabbitmq/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/omrabbitmq -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -omrabbitmq_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_omrabbitmq_la_OBJECTS = omrabbitmq_la-omrabbitmq.lo -omrabbitmq_la_OBJECTS = $(am_omrabbitmq_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -omrabbitmq_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(omrabbitmq_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(omrabbitmq_la_SOURCES) -DIST_SOURCES = $(omrabbitmq_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = omrabbitmq.la -omrabbitmq_la_SOURCES = omrabbitmq.c -omrabbitmq_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) -omrabbitmq_la_LDFLAGS = -module -avoid-version -omrabbitmq_la_LIBADD = $(RABBITMQ_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/omrabbitmq/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/omrabbitmq/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -omrabbitmq.la: $(omrabbitmq_la_OBJECTS) $(omrabbitmq_la_DEPENDENCIES) $(EXTRA_omrabbitmq_la_DEPENDENCIES) - $(AM_V_CCLD)$(omrabbitmq_la_LINK) -rpath $(pkglibdir) $(omrabbitmq_la_OBJECTS) $(omrabbitmq_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omrabbitmq_la-omrabbitmq.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -omrabbitmq_la-omrabbitmq.lo: omrabbitmq.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omrabbitmq_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omrabbitmq_la-omrabbitmq.lo -MD -MP -MF $(DEPDIR)/omrabbitmq_la-omrabbitmq.Tpo -c -o omrabbitmq_la-omrabbitmq.lo `test -f 'omrabbitmq.c' || echo '$(srcdir)/'`omrabbitmq.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omrabbitmq_la-omrabbitmq.Tpo $(DEPDIR)/omrabbitmq_la-omrabbitmq.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omrabbitmq.c' object='omrabbitmq_la-omrabbitmq.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omrabbitmq_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omrabbitmq_la-omrabbitmq.lo `test -f 'omrabbitmq.c' || echo '$(srcdir)/'`omrabbitmq.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/omrabbitmq/omrabbitmq.c rsyslog-5.10.1/plugins/omrabbitmq/omrabbitmq.c --- rsyslog-7.6.0/plugins/omrabbitmq/omrabbitmq.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omrabbitmq/omrabbitmq.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,466 +0,0 @@ -/* omrabbitmq.c - * - * This output plugin enables rsyslog to send messages to the RabbitMQ. - * - * Copyright 2012-2013 Vaclav Tomec - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program. If not, see - * . - * - * Author: Vaclav Tomec - * - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "cfsysline.h" - -#include - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omrabbitmq") - - -/* - * internal structures - */ -DEF_OMOD_STATIC_DATA -DEFobjCurrIf(errmsg) - - -typedef struct _instanceData { - /* here you need to define all action-specific data. A record of type - * instanceData will be handed over to each instance of the action. Keep - * in mind that there may be several invocations of the same type of action - * inside rsyslog.conf, and this is what keeps them apart. Do NOT use - * static data for this! - */ - amqp_connection_state_t conn; - amqp_basic_properties_t props; - uchar *host; - int port; - uchar *vhost; - uchar *user; - uchar *password; - uchar *exchange; - uchar *routing_key; - uchar *tplName; -} instanceData; - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "host", eCmdHdlrGetWord, 0 }, - { "port", eCmdHdlrInt, 0 }, - { "virtual_host", eCmdHdlrGetWord, 0 }, - { "user", eCmdHdlrGetWord, 0 }, - { "password", eCmdHdlrGetWord, 0 }, - { "exchange", eCmdHdlrGetWord, 0 }, - { "routing_key", eCmdHdlrGetWord, 0 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { - CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - - -/* - * Report general error - */ -static int -die_on_error(int x, char const *context) -{ - int retVal = 0; // false - - if (x < 0) { - char *errstr = amqp_error_string(-x); - errmsg.LogError(0, RS_RET_ERR, "omrabbitmq: %s: %s", context, errstr); - free(errstr); - retVal = 1; // true - } - - return retVal; -} - - -/* - * Report AMQP specific error - */ -static int -die_on_amqp_error(amqp_rpc_reply_t x, char const *context) -{ - int retVal = 1; // true - - switch (x.reply_type) { - case AMQP_RESPONSE_NORMAL: - retVal = 0; // false - break; - - case AMQP_RESPONSE_NONE: - errmsg.LogError(0, RS_RET_ERR, "omrabbitmq: %s: missing RPC reply type!", context); - break; - - case AMQP_RESPONSE_LIBRARY_EXCEPTION: - errmsg.LogError(0, RS_RET_ERR, "omrabbitmq: %s: %s", context, amqp_error_string(x.library_error)); - break; - - case AMQP_RESPONSE_SERVER_EXCEPTION: - switch (x.reply.id) { - case AMQP_CONNECTION_CLOSE_METHOD: { - amqp_connection_close_t *m = (amqp_connection_close_t *) x.reply.decoded; - errmsg.LogError(0, RS_RET_ERR, "omrabbitmq: %s: server connection error %d, message: %.*s", - context, - m->reply_code, - (int) m->reply_text.len, (char *) m->reply_text.bytes); - break; - } - case AMQP_CHANNEL_CLOSE_METHOD: { - amqp_channel_close_t *m = (amqp_channel_close_t *) x.reply.decoded; - errmsg.LogError(0, RS_RET_ERR, "omrabbitmq: %s: server channel error %d, message: %.*s", - context, - m->reply_code, - (int) m->reply_text.len, (char *) m->reply_text.bytes); - break; - } - default: - errmsg.LogError(0, RS_RET_ERR, "omrabbitmq: %s: unknown server error, method id 0x%08X\n", context, x.reply.id); - break; - } - break; - - } - - return retVal; -} - - -static amqp_bytes_t -cstring_bytes(const char *str) -{ - return str ? amqp_cstring_bytes(str) : amqp_empty_bytes; -} - - -static void -closeAMQPConnection(instanceData *pData) -{ - if (pData->conn != NULL) { - die_on_amqp_error(amqp_channel_close(pData->conn, 1, AMQP_REPLY_SUCCESS), "amqp_channel_close"); - die_on_amqp_error(amqp_connection_close(pData->conn, AMQP_REPLY_SUCCESS), "amqp_connection_close"); - die_on_error(amqp_destroy_connection(pData->conn), "amqp_destroy_connection"); - - pData->conn = NULL; - } -} - - -/* - * Initialize RabbitMQ connection - */ -static rsRetVal -initRabbitMQ(instanceData *pData) -{ - int sockfd; - DEFiRet; - - DBGPRINTF("omrabbitmq: trying connect to '%s' at port %d\n", pData->host, pData->port); - - pData->conn = amqp_new_connection(); - - if (die_on_error(sockfd = amqp_open_socket((char*) pData->host, pData->port), "Opening socket")) { - pData->conn = NULL; - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - - amqp_set_sockfd(pData->conn, sockfd); - - if (die_on_amqp_error(amqp_login(pData->conn, (char*) pData->vhost, 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, pData->user, pData->password), - "Logging in")) { - pData->conn = NULL; - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - - amqp_channel_open(pData->conn, 1); - - if (die_on_amqp_error(amqp_get_rpc_reply(pData->conn), "Opening channel")) { - pData->conn = NULL; - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - -finalize_it: - RETiRet; -} - - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - /* use this to specify if select features are supported by this - * plugin. If not, the framework will handle that. Currently, only - * RepeatedMsgReduction ("last message repeated n times") is optional. - */ - if(eFeat == sFEATURERepeatedMsgReduction) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - - -BEGINfreeInstance -CODESTARTfreeInstance - /* this is a cleanup callback. All dynamically-allocated resources - * in instance data must be cleaned up here. Prime examples are - * malloc()ed memory, file & database handles and the like. - */ - closeAMQPConnection(pData); - free(pData->host); - free(pData->vhost); - free(pData->user); - free(pData->password); - free(pData->exchange); - free(pData->routing_key); - free(pData->tplName); -ENDfreeInstance - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo - /* permits to spit out some debug info */ - dbgprintf("omrabbitmq\n"); - dbgprintf("\thost='%s'\n", pData->host); - dbgprintf("\tport=%d\n", pData->port); - dbgprintf("\tvirtual_host='%s'\n", pData->vhost); - dbgprintf("\tuser='%s'\n", pData->user == NULL ? (uchar*)"(not configured)" : pData->user); - dbgprintf("\tpassword=(%sconfigured)\n", pData->password == NULL ? "not " : ""); - dbgprintf("\texchange='%s'\n", pData->exchange); - dbgprintf("\trouting_key='%s'\n", pData->routing_key); - dbgprintf("\ttemplate='%s'\n", pData->tplName); -ENDdbgPrintInstInfo - - -BEGINtryResume -CODESTARTtryResume - /* this is called when an action has been suspended and the - * rsyslog core tries to resume it. The action must then - * retry (if possible) and report RS_RET_OK if it succeeded - * or RS_RET_SUSPENDED otherwise. - * Note that no data can be written in this callback, as it is - * not present. Prime examples of what can be retried are - * reconnects to remote hosts, reconnects to database, - * opening of files and the like. - * If there is no retry-type of operation, the action may - * return RS_RET_OK, so that it will get called on its doAction - * entry point (where it receives data), retries there, and - * immediately returns RS_RET_SUSPENDED if that does not work - * out. This disables some optimizations in the core's retry logic, - * but is a valid and expected behaviour. Note that it is also OK - * for the retry entry point to return OK but the immediately following - * doAction call to fail. In real life, for example, a buggy com line - * may cause such behaviour. - * Note that there is no guarantee that the core will very quickly - * call doAction after the retry succeeded. Today, it does, but that may - * not always be the case. - */ - - if (pData->conn == NULL) { - iRet = initRabbitMQ(pData); - } - -ENDtryResume - - -BEGINdoAction -CODESTARTdoAction - /* this is where you receive the message and need to carry out the - * action. Data is provided in ppString[i] where 0 <= i <= num of strings - * requested. - * Return RS_RET_OK if all goes well, RS_RET_SUSPENDED if the action can - * currently not complete, or an error code or RS_RET_DISABLED. The later - * two should only be returned if there is no hope that the action can be - * restored unless an rsyslog restart (prime example is an invalid config). - * Error code or RS_RET_DISABLED permanently disables the action, up to - * the next restart. - */ - - amqp_bytes_t body_bytes; - - if (pData->conn == NULL) { - CHKiRet(initRabbitMQ(pData)); - } - - body_bytes = amqp_cstring_bytes((char *)ppString[0]); - - if (die_on_error(amqp_basic_publish(pData->conn, 1, - cstring_bytes((char *) pData->exchange), - cstring_bytes((char *) pData->routing_key), - 0, 0, &pData->props, body_bytes), "amqp_basic_publish")) { - closeAMQPConnection(pData); - ABORT_FINALIZE(RS_RET_SUSPENDED); - } - -finalize_it: - -ENDdoAction - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->host = NULL; - pData->port = 5672; - pData->vhost = NULL; - pData->user = NULL; - pData->password = NULL; - pData->exchange = NULL; - pData->routing_key = NULL; - pData->tplName = NULL; -} - - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTparseSelectorAct(1) - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if (!pvals[i].bUsed) - continue; - if (!strcmp(actpblk.descr[i].name, "host")) { - pData->host = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "port")) { - pData->port = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "virtual_host")) { - pData->vhost = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "user")) { - pData->user = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "password")) { - pData->password = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "exchange")) { - pData->exchange = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "routing_key")) { - pData->routing_key = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omrabbitmq: program error, non-handled param '%s'\n", actpblk.descr[i].name); - } - } - - if (pData->host == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module disabled: parameter host must be specified"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - if (pData->vhost == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module disabled: parameter virtual_host must be specified"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - if (pData->user == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module disabled: parameter user must be specified"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - if (pData->password == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module disabled: parameter password must be specified"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - if (pData->exchange == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module disabled: parameter exchange must be specified"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - if (pData->routing_key == NULL) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "omrabbitmq module disabled: parameter routing_key must be specified"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - // RabbitMQ properties initialization - memset(&pData->props, 0, sizeof pData->props); - pData->props._flags = AMQP_BASIC_DELIVERY_MODE_FLAG; - pData->props.delivery_mode = 2; /* persistent delivery mode */ - pData->props._flags |= AMQP_BASIC_CONTENT_TYPE_FLAG; - pData->props.content_type = amqp_cstring_bytes("application/json"); - - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? - " StdJSONFmt" : (char*)pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - -BEGINparseSelectorAct -CODESTARTparseSelectorAct - CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(!strncmp((char*) p, ":omrabbitmq:", sizeof(":omrabbitmq:") - 1)) { - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "omrabbitmq supports only v6 config format, use: " - "action(type=\"omrabbitmq\" host=...)"); - } - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - - -BEGINmodExit -CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt - CODEqueryEtryPt_STD_OMOD_QUERIES - CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omrelp/Makefile.in rsyslog-5.10.1/plugins/omrelp/Makefile.in --- rsyslog-7.6.0/plugins/omrelp/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omrelp/Makefile.in 2012-10-17 14:42:42.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omrelp_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omrelp_la_OBJECTS = omrelp_la-omrelp.lo omrelp_la_OBJECTS = $(am_omrelp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omrelp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omrelp_la_SOURCES) DIST_SOURCES = $(omrelp_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omrelp.la: $(omrelp_la_OBJECTS) $(omrelp_la_DEPENDENCIES) $(EXTRA_omrelp_la_DEPENDENCIES) +omrelp.la: $(omrelp_la_OBJECTS) $(omrelp_la_DEPENDENCIES) $(AM_V_CCLD)$(omrelp_la_LINK) -rpath $(pkglibdir) $(omrelp_la_OBJECTS) $(omrelp_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omrelp_la-omrelp.lo: omrelp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omrelp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omrelp_la-omrelp.lo -MD -MP -MF $(DEPDIR)/omrelp_la-omrelp.Tpo -c -o omrelp_la-omrelp.lo `test -f 'omrelp.c' || echo '$(srcdir)/'`omrelp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omrelp_la-omrelp.Tpo $(DEPDIR)/omrelp_la-omrelp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omrelp.c' object='omrelp_la-omrelp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omrelp.c' object='omrelp_la-omrelp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omrelp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omrelp_la-omrelp.lo `test -f 'omrelp.c' || echo '$(srcdir)/'`omrelp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omrelp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omrelp_la-omrelp.lo `test -f 'omrelp.c' || echo '$(srcdir)/'`omrelp.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omrelp/omrelp.c rsyslog-5.10.1/plugins/omrelp/omrelp.c --- rsyslog-7.6.0/plugins/omrelp/omrelp.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/omrelp/omrelp.c 2012-10-17 14:41:20.000000000 +0000 @@ -7,7 +7,7 @@ * * File begun on 2008-03-13 by RGerhards * - * Copyright 2008-2013 Adiscon GmbH. + * Copyright 2008-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -43,11 +43,9 @@ #include "glbl.h" #include "errmsg.h" #include "debug.h" -#include "unicode-helper.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omrelp") /* internal structures */ @@ -55,275 +53,37 @@ DEFobjCurrIf(errmsg) DEFobjCurrIf(glbl) -#define DFLT_ENABLE_TLS 0 -#define DFLT_ENABLE_TLSZIP 0 - static relpEngine_t *pRelpEngine; /* our relp engine */ typedef struct _instanceData { - uchar *target; - uchar *port; + char *f_hname; + int compressionLevel; /* 0 - no compression, else level for zlib */ + char *port; int bInitialConnect; /* is this the initial connection request of our module? (0-no, 1-yes) */ int bIsConnected; /* currently connected to server? 0 - no, 1 - yes */ - int sizeWindow; /**< the RELP window size - 0=use default */ - unsigned timeout; - unsigned rebindInterval; - unsigned nSent; - relpClt_t *pRelpClt; /* relp client for this instance */ - sbool bEnableTLS; - sbool bEnableTLSZip; - sbool bHadAuthFail; /**< set on auth failure, will cause retry to disable action */ - uchar *pristring; /* GnuTLS priority string (NULL if not to be provided) */ - uchar *authmode; - uchar *caCertFile; - uchar *myCertFile; - uchar *myPrivKeyFile; - uchar *tplName; - struct { - int nmemb; - uchar **name; - } permittedPeers; + relpClt_t *pRelpClt; /* relp client for this instance */ } instanceData; -typedef struct configSettings_s { - EMPTY_STRUCT -} configSettings_t; -static configSettings_t __attribute__((unused)) cs; - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "target", eCmdHdlrGetWord, 1 }, - { "tls", eCmdHdlrBinary, 0 }, - { "tls.compression", eCmdHdlrBinary, 0 }, - { "tls.prioritystring", eCmdHdlrString, 0 }, - { "tls.cacert", eCmdHdlrString, 0 }, - { "tls.mycert", eCmdHdlrString, 0 }, - { "tls.myprivkey", eCmdHdlrString, 0 }, - { "tls.authmode", eCmdHdlrString, 0 }, - { "tls.permittedpeer", eCmdHdlrArray, 0 }, - { "port", eCmdHdlrGetWord, 0 }, - { "rebindinterval", eCmdHdlrInt, 0 }, - { "windowsize", eCmdHdlrInt, 0 }, - { "timeout", eCmdHdlrInt, 0 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars -ENDinitConfVars - -/* We may change the implementation to try to lookup the port - * if it is unspecified. So far, we use 514 as default (what probably - * is not a really bright idea, but kept for backward compatibility). +/* get the syslog forward port from selector_t. The passed in + * struct must be one that is setup for forwarding. + * rgerhards, 2007-06-28 + * We may change the implementation to try to lookup the port + * if it is unspecified. So far, we use the IANA default auf 514. */ -static uchar *getRelpPt(instanceData *pData) +static char *getRelpPt(instanceData *pData) { assert(pData != NULL); if(pData->port == NULL) - return((uchar*)"514"); + return("514"); else return(pData->port); } -static void -onErr(void *pUsr, char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) -{ - instanceData *pData = (instanceData*) pUsr; - errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "omrelp[%s:%s]: error '%s', object " - " '%s' - action may not work as intended", - pData->target, pData->port, errmesg, objinfo); -} - -static void -onGenericErr(char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) -{ - errmsg.LogError(0, RS_RET_RELP_ERR, "omrelp: librelp error '%s', object " - "'%s' - action may not work as intended", - errmesg, objinfo); -} - -static void -onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) -{ - instanceData *pData = (instanceData*) pUsr; - errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "omrelp[%s:%s]: authentication error '%s', peer " - "is '%s' - DISABLING action", pData->target, pData->port, errmesg, authinfo); - pData->bHadAuthFail = 1; -} - -static inline rsRetVal -doCreateRelpClient(instanceData *pData) -{ - int i; - DEFiRet; - if(relpEngineCltConstruct(pRelpEngine, &pData->pRelpClt) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpCltSetTimeout(pData->pRelpClt, pData->timeout) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpCltSetWindowSize(pData->pRelpClt, pData->sizeWindow) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpCltSetUsrPtr(pData->pRelpClt, pData) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(pData->bEnableTLS) { - if(relpCltEnableTLS(pData->pRelpClt) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(pData->bEnableTLSZip) { - if(relpCltEnableTLSZip(pData->pRelpClt) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - } - if(relpCltSetGnuTLSPriString(pData->pRelpClt, (char*) pData->pristring) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpCltSetAuthMode(pData->pRelpClt, (char*) pData->authmode) != RELP_RET_OK) { - errmsg.LogError(0, RS_RET_RELP_ERR, - "omrelp: invalid auth mode '%s'\n", pData->authmode); - ABORT_FINALIZE(RS_RET_RELP_ERR); - } - if(relpCltSetCACert(pData->pRelpClt, (char*) pData->caCertFile) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpCltSetOwnCert(pData->pRelpClt, (char*) pData->myCertFile) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - if(relpCltSetPrivKey(pData->pRelpClt, (char*) pData->myPrivKeyFile) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - for(i = 0 ; i < pData->permittedPeers.nmemb ; ++i) { - relpCltAddPermittedPeer(pData->pRelpClt, (char*)pData->permittedPeers.name[i]); - } - } - if(glbl.GetSourceIPofLocalClient() == NULL) { /* ar Do we have a client IP set? */ - if(relpCltSetClientIP(pData->pRelpClt, glbl.GetSourceIPofLocalClient()) != RELP_RET_OK) - ABORT_FINALIZE(RS_RET_RELP_ERR); - } - pData->bInitialConnect = 1; - pData->nSent = 0; -finalize_it: - RETiRet; -} - BEGINcreateInstance CODESTARTcreateInstance - pData->sizeWindow = 0; - pData->timeout = 90; - pData->rebindInterval = 0; - pData->bEnableTLS = DFLT_ENABLE_TLS; - pData->bEnableTLSZip = DFLT_ENABLE_TLSZIP; - pData->bHadAuthFail = 0; - pData->pristring = NULL; - pData->authmode = NULL; - pData->caCertFile = NULL; - pData->myCertFile = NULL; - pData->myPrivKeyFile = NULL; - pData->permittedPeers.nmemb = 0; + pData->bInitialConnect = 1; ENDcreateInstance -BEGINfreeInstance - int i; -CODESTARTfreeInstance - if(pData->pRelpClt != NULL) - relpEngineCltDestruct(pRelpEngine, &pData->pRelpClt); - free(pData->target); - free(pData->port); - free(pData->tplName); - free(pData->pristring); - free(pData->authmode); - free(pData->caCertFile); - free(pData->myCertFile); - free(pData->myPrivKeyFile); - for(i = 0 ; i < pData->permittedPeers.nmemb ; ++i) { - free(pData->permittedPeers.name[i]); - } -ENDfreeInstance - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->target = NULL; - pData->port = NULL; - pData->tplName = NULL; - pData->timeout = 90; - pData->sizeWindow = 0; - pData->rebindInterval = 0; - pData->bEnableTLS = DFLT_ENABLE_TLS; - pData->bEnableTLSZip = DFLT_ENABLE_TLSZIP; - pData->pristring = NULL; - pData->authmode = NULL; - pData->caCertFile = NULL; - pData->myCertFile = NULL; - pData->myPrivKeyFile = NULL; - pData->permittedPeers.nmemb = 0; -} - - -BEGINnewActInst - struct cnfparamvals *pvals; - int i,j; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "target")) { - pData->target = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "port")) { - pData->port = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "timeout")) { - pData->timeout = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "rebindinterval")) { - pData->rebindInterval = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "windowsize")) { - pData->sizeWindow = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "tls")) { - pData->bEnableTLS = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "tls.compression")) { - pData->bEnableTLSZip = (unsigned) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "tls.prioritystring")) { - pData->pristring = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "tls.cacert")) { - pData->caCertFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "tls.mycert")) { - pData->myCertFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "tls.myprivkey")) { - pData->myPrivKeyFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "tls.authmode")) { - pData->authmode = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "tls.permittedpeer")) { - pData->permittedPeers.nmemb = pvals[i].val.d.ar->nmemb; - CHKmalloc(pData->permittedPeers.name = - malloc(sizeof(uchar*) * pData->permittedPeers.nmemb)); - for(j = 0 ; j < pvals[i].val.d.ar->nmemb ; ++j) { - pData->permittedPeers.name[j] = (uchar*)es_str2cstr(pvals[i].val.d.ar->arr[j], NULL); - } - } else { - dbgprintf("omrelp: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - CODE_STD_STRING_REQUESTnewActInst(1) - - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? - "RSYSLOG_ForwardFormat" : (char*)pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - - CHKiRet(doCreateRelpClient(pData)); - -CODE_STD_FINALIZERnewActInst - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst BEGINisCompatibleWithFeature CODESTARTisCompatibleWithFeature @@ -331,16 +91,25 @@ iRet = RS_RET_OK; ENDisCompatibleWithFeature -BEGINSetShutdownImmdtPtr -CODESTARTSetShutdownImmdtPtr - relpEngineSetShutdownImmdtPtr(pRelpEngine, pPtr); - DBGPRINTF("omrelp: shutdownImmediate ptr now is %p\n", pPtr); -ENDSetShutdownImmdtPtr + +BEGINfreeInstance +CODESTARTfreeInstance + if(pData->port != NULL) + free(pData->port); + + /* final cleanup */ + if(pData->pRelpClt != NULL) + relpEngineCltDestruct(pRelpEngine, &pData->pRelpClt); + + if(pData->f_hname != NULL) + free(pData->f_hname); + +ENDfreeInstance BEGINdbgPrintInstInfo CODESTARTdbgPrintInstInfo - dbgprintf("RELP/%s", pData->target); + printf("RELP/%s", pData->f_hname); ENDdbgPrintInstInfo @@ -352,7 +121,7 @@ DEFiRet; if(pData->bInitialConnect) { - iRet = relpCltConnect(pData->pRelpClt, glbl.GetDefPFFamily(), pData->port, pData->target); + iRet = relpCltConnect(pData->pRelpClt, glbl.GetDefPFFamily(), (uchar*) pData->port, (uchar*) pData->f_hname); if(iRet == RELP_RET_OK) pData->bInitialConnect = 0; } else { @@ -372,41 +141,16 @@ BEGINtryResume CODESTARTtryResume - if(pData->bHadAuthFail) { - ABORT_FINALIZE(RS_RET_DISABLE_ACTION); - } iRet = doConnect(pData); -finalize_it: ENDtryResume -static inline rsRetVal -doRebind(instanceData *pData) -{ - DEFiRet; - DBGPRINTF("omrelp: destructing relp client due to rebindInterval\n"); - CHKiRet(relpEngineCltDestruct(pRelpEngine, &pData->pRelpClt)); - pData->bIsConnected = 0; - CHKiRet(doCreateRelpClient(pData)); -finalize_it: - RETiRet; -} - -BEGINbeginTransaction -CODESTARTbeginTransaction -dbgprintf("omrelp: beginTransaction\n"); - if(!pData->bIsConnected) { - CHKiRet(doConnect(pData)); - } - relpCltHintBurstBegin(pData->pRelpClt); -finalize_it: -ENDbeginTransaction BEGINdoAction uchar *pMsg; /* temporary buffering */ size_t lenMsg; relpRetVal ret; CODESTARTdoAction - dbgprintf(" %s:%s/RELP\n", pData->target, getRelpPt(pData)); + dbgprintf(" %s:%s/RELP\n", pData->f_hname, getRelpPt(pData)); if(!pData->bIsConnected) { CHKiRet(doConnect(pData)); @@ -415,7 +159,7 @@ pMsg = ppString[0]; lenMsg = strlen((char*) pMsg); /* TODO: don't we get this? */ - /* we need to truncate oversize msgs - no way around that... */ + /* TODO: think about handling oversize messages! */ if((int) lenMsg > glbl.GetMaxLine()) lenMsg = glbl.GetMaxLine(); @@ -424,33 +168,13 @@ if(ret != RELP_RET_OK) { /* error! */ dbgprintf("error forwarding via relp, suspending\n"); - ABORT_FINALIZE(RS_RET_SUSPENDED); + iRet = RS_RET_SUSPENDED; } - if(pData->rebindInterval != 0 && - (++pData->nSent >= pData->rebindInterval)) { - doRebind(pData); - } finalize_it: - if(pData->bHadAuthFail) - iRet = RS_RET_DISABLE_ACTION; - if(iRet == RS_RET_OK) { - /* we mimic non-commit, as otherwise our endTransaction handler - * will not get called. While this is not 100% correct, the worst - * that can happen is some message duplication, something that - * rsyslog generally accepts and prefers over message loss. - */ - iRet = RS_RET_PREVIOUS_COMMITTED; - } ENDdoAction -BEGINendTransaction -CODESTARTendTransaction - dbgprintf("omrelp: endTransaction\n"); - relpCltHintBurstEnd(pData->pRelpClt); -ENDendTransaction - BEGINparseSelectorAct uchar *q; int i; @@ -467,6 +191,62 @@ if((iRet = createInstance(&pData)) != RS_RET_OK) FINALIZE; + /* we are now after the protocol indicator. Now check if we should + * use compression. We begin to use a new option format for this: + * @(option,option)host:port + * The first option defined is "z[0..9]" where the digit indicates + * the compression level. If it is not given, 9 (best compression) is + * assumed. An example action statement might be: + * :omrelp:(z5,o)127.0.0.1:1400 + * Which means send via TCP with medium (5) compresion (z) to the local + * host on port 1400. The '0' option means that octet-couting (as in + * IETF I-D syslog-transport-tls) is to be used for framing (this option + * applies to TCP-based syslog only and is ignored when specified with UDP). + * That is not yet implemented. + * rgerhards, 2006-12-07 + * TODO: think of all this in spite of RELP -- rgerhards, 2008-03-13 + */ + if(*p == '(') { + /* at this position, it *must* be an option indicator */ + do { + ++p; /* eat '(' or ',' (depending on when called) */ + /* check options */ + if(*p == 'z') { /* compression */ +# ifdef USE_NETZIP + ++p; /* eat */ + if(isdigit((int) *p)) { + int iLevel; + iLevel = *p - '0'; + ++p; /* eat */ + pData->compressionLevel = iLevel; + } else { + errmsg.LogError(0, NO_ERRCODE, "Invalid compression level '%c' specified in " + "forwardig action - NOT turning on compression.", + *p); + } +# else + errmsg.LogError(0, NO_ERRCODE, "Compression requested, but rsyslogd is not compiled " + "with compression support - request ignored."); +# endif /* #ifdef USE_NETZIP */ + } else { /* invalid option! Just skip it... */ + errmsg.LogError(0, NO_ERRCODE, "Invalid option %c in forwarding action - ignoring.", *p); + ++p; /* eat invalid option */ + } + /* the option processing is done. We now do a generic skip + * to either the next option or the end of the option + * block. + */ + while(*p && *p != ')' && *p != ',') + ++p; /* just skip it */ + } while(*p && *p == ','); /* Attention: do.. while() */ + if(*p == ')') + ++p; /* eat terminator, on to next */ + else + /* we probably have end of string - leave it for the rest + * of the code to handle it (but warn the user) + */ + errmsg.LogError(0, NO_ERRCODE, "Option block not terminated in forwarding action."); + } /* extract the host first (we do a trick - we replace the ';' or ':' with a '\0') * now skip to port and then template name. rgerhards 2005-07-06 */ @@ -516,19 +296,24 @@ ++p; } + /* TODO: make this if go away! */ if(*p == ';') { *p = '\0'; /* trick to obtain hostname (later)! */ - CHKmalloc(pData->target = ustrdup(q)); + CHKmalloc(pData->f_hname = strdup((char*) q)); *p = ';'; } else { - CHKmalloc(pData->target = ustrdup(q)); + CHKmalloc(pData->f_hname = strdup((char*) q)); } /* process template */ CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) "RSYSLOG_ForwardFormat")); - CHKiRet(doCreateRelpClient(pData)); + /* create our relp client */ + CHKiRet(relpEngineCltConstruct(pRelpEngine, &pData->pRelpClt)); /* we use CHKiRet as librelp has a similar return value range */ + /* TODO: do we need to call freeInstance if we failed - this is a general question for + * all output modules. I'll address it later as the interface evolves. rgerhards, 2007-07-25 + */ CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -546,27 +331,22 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_TXIF_OMOD_QUERIES -CODEqueryEtryPt_SetShutdownImmdtPtr ENDqueryEtryPt BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr /* create our relp engine */ CHKiRet(relpEngineConstruct(&pRelpEngine)); CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf)); - CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); - CHKiRet(relpEngineSetOnGenericErr(pRelpEngine, onGenericErr)); - CHKiRet(relpEngineSetOnErr(pRelpEngine, onErr)); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); /* tell which objects we need */ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); ENDmodInit + +/* vim:set ai: + */ diff -Nru rsyslog-7.6.0/plugins/omruleset/Makefile.in rsyslog-5.10.1/plugins/omruleset/Makefile.in --- rsyslog-7.6.0/plugins/omruleset/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omruleset/Makefile.in 2012-10-17 14:42:42.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) omruleset_la_DEPENDENCIES = am_omruleset_la_OBJECTS = omruleset_la-omruleset.lo omruleset_la_OBJECTS = $(am_omruleset_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omruleset_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omruleset_la_SOURCES) DIST_SOURCES = $(omruleset_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omruleset.la: $(omruleset_la_OBJECTS) $(omruleset_la_DEPENDENCIES) $(EXTRA_omruleset_la_DEPENDENCIES) +omruleset.la: $(omruleset_la_OBJECTS) $(omruleset_la_DEPENDENCIES) $(AM_V_CCLD)$(omruleset_la_LINK) -rpath $(pkglibdir) $(omruleset_la_OBJECTS) $(omruleset_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omruleset_la-omruleset.lo: omruleset.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omruleset_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omruleset_la-omruleset.lo -MD -MP -MF $(DEPDIR)/omruleset_la-omruleset.Tpo -c -o omruleset_la-omruleset.lo `test -f 'omruleset.c' || echo '$(srcdir)/'`omruleset.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omruleset_la-omruleset.Tpo $(DEPDIR)/omruleset_la-omruleset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omruleset.c' object='omruleset_la-omruleset.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omruleset.c' object='omruleset_la-omruleset.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omruleset_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omruleset_la-omruleset.lo `test -f 'omruleset.c' || echo '$(srcdir)/'`omruleset.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omruleset_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omruleset_la-omruleset.lo `test -f 'omruleset.c' || echo '$(srcdir)/'`omruleset.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omruleset/omruleset.c rsyslog-5.10.1/plugins/omruleset/omruleset.c --- rsyslog-7.6.0/plugins/omruleset/omruleset.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omruleset/omruleset.c 2012-10-17 14:41:20.000000000 +0000 @@ -50,9 +50,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omruleset") - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); /* static data */ DEFobjCurrIf(ruleset); @@ -63,6 +60,8 @@ DEF_OMOD_STATIC_DATA /* config variables */ +ruleset_t *pRuleset = NULL; /* ruleset to enqueue message to (NULL = Default, not recommended) */ +uchar *pszRulesetName = NULL; typedef struct _instanceData { @@ -70,17 +69,6 @@ uchar *pszRulesetName; /* primarily for debugging/display purposes */ } instanceData; -typedef struct configSettings_s { - ruleset_t *pRuleset; /* ruleset to enqueue message to (NULL = Default, not recommended) */ - uchar *pszRulesetName; -} configSettings_t; -static configSettings_t cs; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - resetConfigVariables(NULL, NULL); -ENDinitConfVars - BEGINcreateInstance CODESTARTcreateInstance @@ -120,11 +108,7 @@ (char*) pData->pszRulesetName, pData->pRuleset); MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY); MsgSetRuleset(pMsg, pData->pRuleset); - /* Note: we intentionally use submitMsg2() here, as we process messages - * that were already run through the rate-limiter. So it is (at least) - * questionable if they were rate-limited again. - */ - submitMsg2(pMsg); + submitMsg(pMsg); finalize_it: ENDdoAction @@ -135,12 +119,12 @@ rsRetVal localRet; DEFiRet; - localRet = ruleset.GetRuleset(ourConf, &cs.pRuleset, pszName); + localRet = ruleset.GetRuleset(&pRuleset, pszName); if(localRet == RS_RET_NOT_FOUND) { errmsg.LogError(0, RS_RET_RULESET_NOT_FOUND, "error: ruleset '%s' not found - ignored", pszName); } CHKiRet(localRet); - cs.pszRulesetName = pszName; /* save for later display purposes */ + pszRulesetName = pszName; /* save for later display purposes */ finalize_it: if(iRet != RS_RET_OK) { /* cleanup needed? */ @@ -159,7 +143,7 @@ ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); } - if(cs.pRuleset == NULL) { + if(pRuleset == NULL) { errmsg.LogError(0, RS_RET_NO_RULESET, "error: no ruleset was specified, use " "$ActionOmrulesetRulesetName directive first!"); ABORT_FINALIZE(RS_RET_NO_RULESET); @@ -169,9 +153,6 @@ p += sizeof(":omruleset:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ CHKiRet(createInstance(&pData)); - errmsg.LogError(0, RS_RET_DEPRECATED, "warning: omruleset is deprecated, consider " - "using the 'call' statement instead"); - /* check if a non-standard template is to be applied */ if(*(p-1) == ';') --p; @@ -180,17 +161,17 @@ * the format specified (if any) is always ignored. */ CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, iTplOpts, (uchar*) "RSYSLOG_FileFormat")); - pData->pRuleset = cs.pRuleset; - pData->pszRulesetName = cs.pszRulesetName; - cs.pRuleset = NULL; /* re-set, because there is a high risk of unwanted behavior if we leave it in! */ - cs.pszRulesetName = NULL; /* note: we must not free, as we handed over this pointer to the instanceDat to the instanceDataa! */ + pData->pRuleset = pRuleset; + pData->pszRulesetName = pszRulesetName; + pRuleset = NULL; /* re-set, because there is a high risk of unwanted behavior if we leave it in! */ + pszRulesetName = NULL; /* note: we must not free, as we handed over this pointer to the instanceDat to the instanceDataa! */ CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct BEGINmodExit CODESTARTmodExit - free(cs.pszRulesetName); + free(pszRulesetName); objRelease(errmsg, CORE_COMPONENT); objRelease(ruleset, CORE_COMPONENT); ENDmodExit @@ -199,7 +180,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES ENDqueryEtryPt @@ -209,9 +189,7 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - cs.pRuleset = NULL; - free(cs.pszRulesetName); - cs.pszRulesetName = NULL; + pRuleset = NULL; RETiRet; } @@ -222,7 +200,6 @@ unsigned long opts; int bMsgPassingSupported; /* does core support template passing as an array? */ CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr /* check if the rsyslog core supports parameter passing code */ @@ -245,9 +222,6 @@ CHKiRet(objUse(ruleset, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); - errmsg.LogError(0, RS_RET_DEPRECATED, "warning: omruleset is deprecated, consider " - "using the 'call' statement instead"); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomrulesetrulesetname", 0, eCmdHdlrGetWord, setRuleset, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, diff -Nru rsyslog-7.6.0/plugins/omsnmp/Makefile.in rsyslog-5.10.1/plugins/omsnmp/Makefile.in --- rsyslog-7.6.0/plugins/omsnmp/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omsnmp/Makefile.in 2012-10-17 14:42:42.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omsnmp_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omsnmp_la_OBJECTS = omsnmp_la-omsnmp.lo omsnmp_la_OBJECTS = $(am_omsnmp_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omsnmp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omsnmp_la_SOURCES) DIST_SOURCES = $(omsnmp_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omsnmp.la: $(omsnmp_la_OBJECTS) $(omsnmp_la_DEPENDENCIES) $(EXTRA_omsnmp_la_DEPENDENCIES) +omsnmp.la: $(omsnmp_la_OBJECTS) $(omsnmp_la_DEPENDENCIES) $(AM_V_CCLD)$(omsnmp_la_LINK) -rpath $(pkglibdir) $(omsnmp_la_OBJECTS) $(omsnmp_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omsnmp_la-omsnmp.lo: omsnmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omsnmp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omsnmp_la-omsnmp.lo -MD -MP -MF $(DEPDIR)/omsnmp_la-omsnmp.Tpo -c -o omsnmp_la-omsnmp.lo `test -f 'omsnmp.c' || echo '$(srcdir)/'`omsnmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omsnmp_la-omsnmp.Tpo $(DEPDIR)/omsnmp_la-omsnmp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omsnmp.c' object='omsnmp_la-omsnmp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omsnmp.c' object='omsnmp_la-omsnmp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omsnmp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omsnmp_la-omsnmp.lo `test -f 'omsnmp.c' || echo '$(srcdir)/'`omsnmp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omsnmp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omsnmp_la-omsnmp.lo `test -f 'omsnmp.c' || echo '$(srcdir)/'`omsnmp.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omsnmp/omsnmp.c rsyslog-5.10.1/plugins/omsnmp/omsnmp.c --- rsyslog-7.6.0/plugins/omsnmp/omsnmp.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omsnmp/omsnmp.c 2012-10-17 14:41:20.000000000 +0000 @@ -44,7 +44,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omsnmp") /* internal structures */ @@ -59,14 +58,36 @@ static oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; static oid objid_sysuptime[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 }; +static uchar* pszTransport = NULL; /* default transport */ +static uchar* pszTarget = NULL; +/* note using an unsigned for a port number is not a good idea from an IPv6 point of view */ +static int iPort = 0; +static int iSNMPVersion = 1; /* 0 Means SNMPv1, 1 Means SNMPv2c */ +static uchar* pszCommunity = NULL; +static uchar* pszEnterpriseOID = NULL; +static uchar* pszSnmpTrapOID = NULL; +static uchar* pszSyslogMessageOID = NULL; +static int iSpecificType = 0; +static int iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC;/*Default is SNMP_TRAP_ENTERPRISESPECIFIC */ +/* + Possible Values + SNMP_TRAP_COLDSTART (0) + SNMP_TRAP_WARMSTART (1) + SNMP_TRAP_LINKDOWN (2) + SNMP_TRAP_LINKUP (3) + SNMP_TRAP_AUTHFAIL (4) + SNMP_TRAP_EGPNEIGHBORLOSS (5) + SNMP_TRAP_ENTERPRISESPECIFIC (6) +*/ typedef struct _instanceData { - uchar *szTransport; /* Transport - Can be udp, tcp, udp6, tcp6 and other types supported by NET-SNMP */ - uchar *szTarget; /* IP/hostname of Snmp Target*/ - uchar *szCommunity; /* Snmp Community */ - uchar *szEnterpriseOID;/* Snmp Enterprise OID - default is (1.3.6.1.4.1.3.1.1 = enterprises.cmu.1.1) */ - uchar *szSnmpTrapOID; /* Snmp Trap OID - default is (1.3.6.1.4.1.19406.1.2.1 = ADISCON-MONITORWARE-MIB::syslogtrap) */ - uchar *szSyslogMessageOID; /* Snmp OID used for the Syslog Message: + uchar szTransport[OMSNMP_MAXTRANSPORLENGTH+1]; /* Transport - Can be udp, tcp, udp6, tcp6 and other types supported by NET-SNMP */ + uchar *szTarget; /* IP/hostname of Snmp Target*/ + uchar *szTargetAndPort; /* IP/hostname + Port,needed format for SNMP LIB */ + uchar szCommunity[OMSNMP_MAXCOMMUNITYLENGHT+1]; /* Snmp Community */ + uchar szEnterpriseOID[OMSNMP_MAXOIDLENGHT+1]; /* Snmp Enterprise OID - default is (1.3.6.1.4.1.3.1.1 = enterprises.cmu.1.1) */ + uchar szSnmpTrapOID[OMSNMP_MAXOIDLENGHT+1]; /* Snmp Trap OID - default is (1.3.6.1.4.1.19406.1.2.1 = ADISCON-MONITORWARE-MIB::syslogtrap) */ + uchar szSyslogMessageOID[OMSNMP_MAXOIDLENGHT+1]; /* Snmp OID used for the Syslog Message: * default is 1.3.6.1.4.1.19406.1.1.2.1 - ADISCON-MONITORWARE-MIB::syslogMsg * You will need the ADISCON-MONITORWARE-MIB and ADISCON-MIB mibs installed on the receiver * side in order to decode this mib. @@ -80,69 +101,8 @@ int iSpecificType; /* Snmp Specific Type */ netsnmp_session *snmpsession; /* Holds to SNMP Session, NULL if not initialized */ - uchar *tplName; /* format template to use */ } instanceData; -typedef struct configSettings_s { - uchar* pszTransport; /* default transport */ - uchar* pszTarget; - /* note using an unsigned for a port number is not a good idea from an IPv6 point of view */ - int iPort; - int iSNMPVersion; /* 0 Means SNMPv1, 1 Means SNMPv2c */ - uchar* pszCommunity; - uchar* pszEnterpriseOID; - uchar* pszSnmpTrapOID; - uchar* pszSyslogMessageOID; - int iSpecificType; - int iTrapType; /*Default is SNMP_TRAP_ENTERPRISESPECIFIC */ - /* - Possible Values - SNMP_TRAP_COLDSTART (0) - SNMP_TRAP_WARMSTART (1) - SNMP_TRAP_LINKDOWN (2) - SNMP_TRAP_LINKUP (3) - SNMP_TRAP_AUTHFAIL (4) - SNMP_TRAP_EGPNEIGHBORLOSS (5) - SNMP_TRAP_ENTERPRISESPECIFIC (6) - */ -} configSettings_t; -static configSettings_t cs; - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "server", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "port", eCmdHdlrInt, 0 }, - { "transport", eCmdHdlrString, 0 }, - { "version", eCmdHdlrInt, 0 }, - { "community", eCmdHdlrString, 0 }, - { "enterpriseoid", eCmdHdlrString, 0 }, - { "trapoid", eCmdHdlrString, 0 }, - { "messageoid", eCmdHdlrString, 0 }, - { "traptype", eCmdHdlrInt, 0 }, - { "specifictype", eCmdHdlrInt, 0 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.pszTransport = NULL; - cs.pszTarget = NULL; - cs.iPort = 0; - cs.iSNMPVersion = 1; - cs.pszCommunity = NULL; - cs.pszEnterpriseOID = NULL; - cs.pszSnmpTrapOID = NULL; - cs.pszSyslogMessageOID = NULL; - cs.iSpecificType = 0; - cs.iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC; -ENDinitConfVars - BEGINcreateInstance CODESTARTcreateInstance ENDcreateInstance @@ -153,6 +113,7 @@ dbgprintf("SNMPTransport: %s\n", pData->szTransport); dbgprintf("SNMPTarget: %s\n", pData->szTarget); dbgprintf("SNMPPort: %d\n", pData->iPort); + dbgprintf("SNMPTarget+PortStr: %s\n", pData->szTargetAndPort); dbgprintf("SNMPVersion (0=v1, 1=v2c): %d\n", pData->iSNMPVersion); dbgprintf("Community: %s\n", pData->szCommunity); dbgprintf("EnterpriseOID: %s\n", pData->szEnterpriseOID); @@ -189,18 +150,13 @@ */ static rsRetVal omsnmp_initSession(instanceData *pData) { - netsnmp_session session; - char szTargetAndPort[MAXHOSTNAMELEN+128]; /* work buffer for specifying a full target and port string */ DEFiRet; + netsnmp_session session; /* should not happen, but if session is not cleared yet - we do it now! */ if (pData->snmpsession != NULL) omsnmp_exitSession(pData); - snprintf((char*)szTargetAndPort, sizeof(szTargetAndPort), "%s:%s:%d", - (pData->szTransport == NULL) ? "udp" : (char*)pData->szTransport, - pData->szTarget, pData->iPort == 0 ? 162 : pData->iPort); - dbgprintf( "omsnmp_initSession: ENTER - Target = '%s' on Port = '%d'\n", pData->szTarget, pData->iPort); putenv(strdup("POSIXLY_CORRECT=1")); @@ -209,12 +165,13 @@ session.version = pData->iSNMPVersion; session.callback = NULL; /* NOT NEEDED */ session.callback_magic = NULL; - session.peername = (char*) szTargetAndPort; + session.peername = (char*) pData->szTargetAndPort; /* Set SNMP Community */ - if (session.version == SNMP_VERSION_1 || session.version == SNMP_VERSION_2c) { - session.community = (unsigned char *) pData->szCommunity == NULL ? (uchar*)"public" : pData->szCommunity; - session.community_len = strlen((char*) session.community); + if (session.version == SNMP_VERSION_1 || session.version == SNMP_VERSION_2c) + { + session.community = (unsigned char *) pData->szCommunity; + session.community_len = strlen((char*) pData->szCommunity); } pData->snmpsession = snmp_open(&session); @@ -250,15 +207,16 @@ dbgprintf( "omsnmp_sendsnmp: ENTER - Syslogmessage = '%s'\n", (char*)psz); /* If SNMP Version1 is configured !*/ - if(pData->snmpsession->version == SNMP_VERSION_1) { + if ( pData->snmpsession->version == SNMP_VERSION_1) + { pdu = snmp_pdu_create(SNMP_MSG_TRAP); /* Set enterprise */ - if(!snmp_parse_oid(pData->szEnterpriseOID == NULL ? "1.3.6.1.4.1.3.1.1" : (char*)pData->szEnterpriseOID, - enterpriseoid, &enterpriseoidlen )) { + if (!snmp_parse_oid( (char*) pData->szEnterpriseOID, enterpriseoid, &enterpriseoidlen )) + { strErr = snmp_api_errstring(snmp_errno); - errmsg.LogError(0, RS_RET_DISABLE_ACTION, "omsnmp_sendsnmp: Parsing EnterpriseOID " - "failed '%s' with error '%s' \n", pData->szSyslogMessageOID, strErr); + errmsg.LogError(0, RS_RET_DISABLE_ACTION, "omsnmp_sendsnmp: Parsing EnterpriseOID failed '%s' with error '%s' \n", pData->szSyslogMessageOID, strErr); + ABORT_FINALIZE(RS_RET_DISABLE_ACTION); } pdu->enterprise = (oid *) MALLOC(enterpriseoidlen * sizeof(oid)); @@ -290,9 +248,8 @@ snmp_add_var(pdu, objid_sysuptime, sizeof(objid_sysuptime) / sizeof(oid), 't', trap); /* Now set the SyslogMessage Trap OID */ - if ( snmp_add_var(pdu, objid_snmptrap, sizeof(objid_snmptrap) / sizeof(oid), 'o', - pData->szSnmpTrapOID == NULL ? "1.3.6.1.4.1.19406.1.2.1" : (char*) pData->szSnmpTrapOID - ) != 0) { + if ( snmp_add_var(pdu, objid_snmptrap, sizeof(objid_snmptrap) / sizeof(oid), 'o', (char*) pData->szSnmpTrapOID ) != 0) + { strErr = snmp_api_errstring(snmp_errno); errmsg.LogError(0, RS_RET_DISABLE_ACTION, "omsnmp_sendsnmp: Adding trap OID failed '%s' with error '%s' \n", pData->szSnmpTrapOID, strErr); ABORT_FINALIZE(RS_RET_DISABLE_ACTION); @@ -303,16 +260,18 @@ /* dbgprintf( "omsnmp_sendsnmp: SyslogMessage '%s'\n", psz );*/ /* First create new OID object */ - if (snmp_parse_oid(pData->szSyslogMessageOID == NULL ? - "1.3.6.1.4.1.19406.1.1.2.1" : (char*)pData->szSyslogMessageOID, - oidSyslogMessage, &oLen)) { + if (snmp_parse_oid( (char*) pData->szSyslogMessageOID, oidSyslogMessage, &oLen)) + { int iErrCode = snmp_add_var(pdu, oidSyslogMessage, oLen, 's', (char*) psz); - if (iErrCode) { + if (iErrCode) + { const char *str = snmp_api_errstring(iErrCode); errmsg.LogError(0, RS_RET_DISABLE_ACTION, "omsnmp_sendsnmp: Invalid SyslogMessage OID, error code '%d' - '%s'\n", iErrCode, str ); ABORT_FINALIZE(RS_RET_DISABLE_ACTION); } - } else { + } + else + { strErr = snmp_api_errstring(snmp_errno); errmsg.LogError(0, RS_RET_DISABLE_ACTION, "omsnmp_sendsnmp: Parsing SyslogMessageOID failed '%s' with error '%s' \n", pData->szSyslogMessageOID, strErr); @@ -367,78 +326,16 @@ /* free snmp Session here */ omsnmp_exitSession(pData); - free(pData->tplName); - free(pData->szTarget); -ENDfreeInstance - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->tplName = NULL; - pData->szCommunity = NULL; - pData->szEnterpriseOID = NULL; - pData->szSnmpTrapOID = NULL; - pData->szSyslogMessageOID = NULL; -} + if(pData->szTarget != NULL) + free(pData->szTarget); + if(pData->szTargetAndPort != NULL) + free(pData->szTargetAndPort); -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "server")) { - pData->szTarget = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "port")) { - pData->iPort = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "transport")) { - pData->szTransport = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "version")) { - pData->iSNMPVersion = pvals[i].val.d.n; - if(pData->iSNMPVersion < 0 || cs.iSNMPVersion > 1) - pData->iSNMPVersion = 1; - } else if(!strcmp(actpblk.descr[i].name, "community")) { - pData->szCommunity = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "enterpriseoid")) { - pData->szEnterpriseOID = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "trapoid")) { - pData->szSnmpTrapOID = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "messageoid")) { - pData->szSyslogMessageOID = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "traptype")) { - pData->iTrapType = pvals[i].val.d.n; - if(cs.iTrapType < 0 && cs.iTrapType >= 6) - pData->iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC; - } else if(!strcmp(actpblk.descr[i].name, "specifictype")) { - pData->iSpecificType = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("ompipe: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? - "RSYSLOG_FileFormat" : (char*)pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst +ENDfreeInstance BEGINparseSelectorAct + uchar szTargetAndPort[MAXHOSTNAMELEN+128]; /* work buffer for specifying a full target and port string */ CODESTARTparseSelectorAct CODE_STD_STRING_REQUESTparseSelectorAct(1) if(!strncmp((char*) p, ":omsnmp:", sizeof(":omsnmp:") - 1)) { @@ -451,38 +348,83 @@ if((iRet = createInstance(&pData)) != RS_RET_OK) FINALIZE; + /* Check Transport */ + if (pszTransport == NULL) { + /* + * Default transport is UDP. Other values supported by NETSNMP are possible as well + */ + strncpy( (char*) pData->szTransport, "udp", sizeof("udp") ); + } else { + /* Copy Transport */ + strncpy( (char*) pData->szTransport, (char*) pszTransport, strlen((char*) pszTransport) ); + } + /* Check Target */ - if(cs.pszTarget == NULL) { + if (pszTarget == NULL) { ABORT_FINALIZE( RS_RET_PARAM_ERROR ); } else { - CHKmalloc(pData->szTarget = (uchar*) strdup((char*)cs.pszTarget)); + /* Copy Target */ + CHKmalloc(pData->szTarget = (uchar*) strdup((char*)pszTarget)); } - /* copy config params */ - pData->szTransport = (uchar*) ((cs.pszTransport == NULL) ? NULL : strdup((char*)cs.pszTransport)); - pData->szCommunity = (uchar*) ((cs.pszCommunity == NULL) ? NULL : strdup((char*)cs.pszCommunity)); - pData->szEnterpriseOID = (uchar*) ((cs.pszEnterpriseOID == NULL) ? NULL : strdup((char*)cs.pszEnterpriseOID)); - pData->szSnmpTrapOID = (uchar*) ((cs.pszSnmpTrapOID == NULL) ? NULL : strdup((char*)cs.pszSnmpTrapOID)); - pData->szSyslogMessageOID = (uchar*) ((cs.pszSyslogMessageOID == NULL) ? NULL : strdup((char*)cs.pszSyslogMessageOID)); - pData->iPort = cs.iPort; - pData->iSpecificType = cs.iSpecificType; + /* Copy Community */ + if (pszCommunity == NULL) /* Failsave */ + strncpy( (char*) pData->szCommunity, "public", sizeof("public") ); + else /* Copy Target */ + strncpy( (char*) pData->szCommunity, (char*) pszCommunity, strlen((char*) pszCommunity) ); + + /* Copy Enterprise OID */ + if (pszEnterpriseOID == NULL) /* Failsave */ + strncpy( (char*) pData->szEnterpriseOID, "1.3.6.1.4.1.3.1.1", sizeof("1.3.6.1.4.1.3.1.1") ); + else /* Copy Target */ + strncpy( (char*) pData->szEnterpriseOID, (char*) pszEnterpriseOID, strlen((char*) pszEnterpriseOID) ); + + /* Copy SnmpTrap OID */ + if (pszSnmpTrapOID == NULL) /* Failsave */ + strncpy( (char*) pData->szSnmpTrapOID, "1.3.6.1.4.1.19406.1.2.1", sizeof("1.3.6.1.4.1.19406.1.2.1") ); + else /* Copy Target */ + strncpy( (char*) pData->szSnmpTrapOID, (char*) pszSnmpTrapOID, strlen((char*) pszSnmpTrapOID) ); + + + /* Copy SyslogMessage OID */ + if (pszSyslogMessageOID == NULL) /* Failsave */ + strncpy( (char*) pData->szSyslogMessageOID, "1.3.6.1.4.1.19406.1.1.2.1", sizeof("1.3.6.1.4.1.19406.1.1.2.1") ); + else /* Copy Target */ + strncpy( (char*) pData->szSyslogMessageOID, (char*) pszSyslogMessageOID, strlen((char*) pszSyslogMessageOID) ); + + /* Copy Port */ + if ( iPort == 0) /* If no Port is set we use the default Port 162 */ + pData->iPort = 162; + else + pData->iPort = iPort; /* Set SNMPVersion */ - if ( cs.iSNMPVersion < 0 || cs.iSNMPVersion > 1) /* Set default to 1 if out of range */ + if ( iSNMPVersion < 0 || iSNMPVersion > 1) /* Set default to 1 if out of range */ pData->iSNMPVersion = 1; else - pData->iSNMPVersion = cs.iSNMPVersion; + pData->iSNMPVersion = iSNMPVersion; + + /* Copy SpecificType */ + if ( iSpecificType == 0) /* If no iSpecificType is set, we use the default 0 */ + pData->iSpecificType = 0; + else + pData->iSpecificType = iSpecificType; /* Copy TrapType */ - if ( cs.iTrapType < 0 && cs.iTrapType >= 6) /* Only allow values from 0 to 6 !*/ + if ( iTrapType < 0 && iTrapType >= 6) /* Only allow values from 0 to 6 !*/ pData->iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC; else - pData->iTrapType = cs.iTrapType; + pData->iTrapType = iTrapType; + /* Create string for session peername! */ + snprintf((char*)szTargetAndPort, sizeof(szTargetAndPort), "%s:%s:%d", pData->szTransport, pData->szTarget, pData->iPort); + CHKmalloc(pData->szTargetAndPort = (uchar*)strdup((char*)szTargetAndPort)); + /* Print Debug info */ dbgprintf("SNMPTransport: %s\n", pData->szTransport); dbgprintf("SNMPTarget: %s\n", pData->szTarget); dbgprintf("SNMPPort: %d\n", pData->iPort); + dbgprintf("SNMPTarget+PortStr: %s\n", pData->szTargetAndPort); dbgprintf("SNMPVersion (0=v1, 1=v2c): %d\n", pData->iSNMPVersion); dbgprintf("Community: %s\n", pData->szCommunity); dbgprintf("EnterpriseOID: %s\n", pData->szEnterpriseOID); @@ -511,31 +453,48 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - free(cs.pszTarget); - cs.pszTarget = NULL; - free(cs.pszCommunity); - cs.pszCommunity = NULL; - free(cs.pszEnterpriseOID); - cs.pszEnterpriseOID = NULL; - free(cs.pszSnmpTrapOID); - cs.pszSnmpTrapOID = NULL; - free(cs.pszSyslogMessageOID); - cs.pszSyslogMessageOID = NULL; - cs.iPort = 0; - cs.iSNMPVersion = 1; - cs.iSpecificType = 0; - cs.iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC; + + if (pszTarget != NULL) + free(pszTarget); + pszTarget = NULL; + + if (pszCommunity != NULL) + free(pszCommunity); + pszCommunity = NULL; + + if (pszEnterpriseOID != NULL) + free(pszEnterpriseOID); + pszEnterpriseOID = NULL; + + if (pszSnmpTrapOID != NULL) + free(pszSnmpTrapOID); + pszSnmpTrapOID = NULL; + + if (pszSyslogMessageOID != NULL) + free(pszSyslogMessageOID); + pszSyslogMessageOID = NULL; + + iPort = 0; + iSNMPVersion = 1; + iSpecificType = 0; + iTrapType = SNMP_TRAP_ENTERPRISESPECIFIC; + RETiRet; } BEGINmodExit CODESTARTmodExit - free(cs.pszTarget); - free(cs.pszCommunity); - free(cs.pszEnterpriseOID); - free(cs.pszSnmpTrapOID); - free(cs.pszSyslogMessageOID); + if (pszTarget != NULL) + free(pszTarget); + if (pszCommunity != NULL) + free(pszCommunity); + if (pszEnterpriseOID != NULL) + free(pszEnterpriseOID); + if (pszSnmpTrapOID != NULL) + free(pszSnmpTrapOID); + if (pszSyslogMessageOID != NULL) + free(pszSyslogMessageOID); /* release what we no longer need */ objRelease(errmsg, CORE_COMPONENT); @@ -545,8 +504,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES ENDqueryEtryPt @@ -554,20 +511,19 @@ CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr - initConfVars(); CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmptransport", 0, eCmdHdlrGetWord, NULL, &cs.pszTransport, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmptarget", 0, eCmdHdlrGetWord, NULL, &cs.pszTarget, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmptargetport", 0, eCmdHdlrInt, NULL, &cs.iPort, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmpversion", 0, eCmdHdlrInt, NULL, &cs.iSNMPVersion, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmpcommunity", 0, eCmdHdlrGetWord, NULL, &cs.pszCommunity, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmpenterpriseoid", 0, eCmdHdlrGetWord, NULL, &cs.pszEnterpriseOID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmptrapoid", 0, eCmdHdlrGetWord, NULL, &cs.pszSnmpTrapOID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmpsyslogmessageoid", 0, eCmdHdlrGetWord, NULL, &cs.pszSyslogMessageOID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmpspecifictype", 0, eCmdHdlrInt, NULL, &cs.iSpecificType, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionsnmptraptype", 0, eCmdHdlrInt, NULL, &cs.iTrapType, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptransport", 0, eCmdHdlrGetWord, NULL, &pszTransport, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptarget", 0, eCmdHdlrGetWord, NULL, &pszTarget, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptargetport", 0, eCmdHdlrInt, NULL, &iPort, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpversion", 0, eCmdHdlrInt, NULL, &iSNMPVersion, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpcommunity", 0, eCmdHdlrGetWord, NULL, &pszCommunity, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpenterpriseoid", 0, eCmdHdlrGetWord, NULL, &pszEnterpriseOID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptrapoid", 0, eCmdHdlrGetWord, NULL, &pszSnmpTrapOID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpsyslogmessageoid", 0, eCmdHdlrGetWord, NULL, &pszSyslogMessageOID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpspecifictype", 0, eCmdHdlrInt, NULL, &iSpecificType, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptraptype", 0, eCmdHdlrInt, NULL, &iTrapType, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* * vi:set ai: diff -Nru rsyslog-7.6.0/plugins/omstdout/Makefile.in rsyslog-5.10.1/plugins/omstdout/Makefile.in --- rsyslog-7.6.0/plugins/omstdout/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omstdout/Makefile.in 2012-10-17 14:42:42.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) omstdout_la_DEPENDENCIES = am_omstdout_la_OBJECTS = omstdout_la-omstdout.lo omstdout_la_OBJECTS = $(am_omstdout_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omstdout_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omstdout_la_SOURCES) DIST_SOURCES = $(omstdout_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omstdout.la: $(omstdout_la_OBJECTS) $(omstdout_la_DEPENDENCIES) $(EXTRA_omstdout_la_DEPENDENCIES) +omstdout.la: $(omstdout_la_OBJECTS) $(omstdout_la_DEPENDENCIES) $(AM_V_CCLD)$(omstdout_la_LINK) -rpath $(pkglibdir) $(omstdout_la_OBJECTS) $(omstdout_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omstdout_la-omstdout.lo: omstdout.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omstdout_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omstdout_la-omstdout.lo -MD -MP -MF $(DEPDIR)/omstdout_la-omstdout.Tpo -c -o omstdout_la-omstdout.lo `test -f 'omstdout.c' || echo '$(srcdir)/'`omstdout.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omstdout_la-omstdout.Tpo $(DEPDIR)/omstdout_la-omstdout.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omstdout.c' object='omstdout_la-omstdout.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omstdout.c' object='omstdout_la-omstdout.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omstdout_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omstdout_la-omstdout.lo `test -f 'omstdout.c' || echo '$(srcdir)/'`omstdout.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omstdout_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omstdout_la-omstdout.lo `test -f 'omstdout.c' || echo '$(srcdir)/'`omstdout.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omstdout/omstdout.c rsyslog-5.10.1/plugins/omstdout/omstdout.c --- rsyslog-7.6.0/plugins/omstdout/omstdout.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omstdout/omstdout.c 2012-10-17 14:41:20.000000000 +0000 @@ -44,15 +44,14 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omstdout") - -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); /* internal structures */ DEF_OMOD_STATIC_DATA /* config variables */ +static int bUseArrayInterface = 0; /* shall action use array instead of string template interface? */ +static int bEnsureLFEnding = 1; /* shall action use array instead of string template interface? */ typedef struct _instanceData { @@ -60,17 +59,6 @@ int bEnsureLFEnding; /* ensure that a linefeed is written at the end of EACH record (test aid for nettester) */ } instanceData; -typedef struct configSettings_s { - int bUseArrayInterface; /* shall action use array instead of string template interface? */ - int bEnsureLFEnding; /* shall action use array instead of string template interface? */ -} configSettings_t; -static configSettings_t cs; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - resetConfigVariables(NULL, NULL); -ENDinitConfVars - BEGINcreateInstance CODESTARTcreateInstance ENDcreateInstance @@ -105,7 +93,6 @@ int iBuf; char szBuf[65564]; size_t len; - int r; CODESTARTdoAction if(pData->bUseArrayInterface) { /* if we use array passing, we need to put together a string @@ -137,19 +124,9 @@ toWrite = (char*) ppString[0]; } len = strlen(toWrite); - /* the following if's are just to silence compiler warnings. If someone - * actually intends to use this module in production (why???), this code - * needs to be more solid. -- rgerhards, 2012-11-28 - */ - if((r = write(1, toWrite, len)) != (int) len) { /* 1 is stdout! */ - DBGPRINTF("omstdout: error %d writing to stdout[%d]: %s\n", - r, len, toWrite); - } + write(1, toWrite, len); /* 1 is stdout! */ if(pData->bEnsureLFEnding && toWrite[len-1] != '\n') { - if((r = write(1, "\n", 1)) != 1) { /* write missing LF */ - DBGPRINTF("omstdout: error %d writing \\n to stdout\n", - r); - } + write(1, "\n", 1); /* write missing LF */ } ENDdoAction @@ -170,10 +147,10 @@ /* check if a non-standard template is to be applied */ if(*(p-1) == ';') --p; - iTplOpts = (cs.bUseArrayInterface == 0) ? 0 : OMSR_TPL_AS_ARRAY; + iTplOpts = (bUseArrayInterface == 0) ? 0 : OMSR_TPL_AS_ARRAY; CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, iTplOpts, (uchar*) "RSYSLOG_FileFormat")); - pData->bUseArrayInterface = cs.bUseArrayInterface; - pData->bEnsureLFEnding = cs.bEnsureLFEnding; + pData->bUseArrayInterface = bUseArrayInterface; + pData->bEnsureLFEnding = bEnsureLFEnding; CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -186,7 +163,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES ENDqueryEtryPt @@ -196,8 +172,8 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { DEFiRet; - cs.bUseArrayInterface = 0; - cs.bEnsureLFEnding = 1; + bUseArrayInterface = 0; + bEnsureLFEnding = 1; RETiRet; } @@ -208,7 +184,6 @@ unsigned long opts; int bArrayPassingSupported; /* does core support template passing as an array? */ CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr /* check if the rsyslog core supports parameter passing code */ @@ -227,10 +202,10 @@ if(bArrayPassingSupported) { /* enable config comand only if core supports it */ CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomstdoutarrayinterface", 0, eCmdHdlrBinary, NULL, - &cs.bUseArrayInterface, STD_LOADABLE_MODULE_ID)); + &bUseArrayInterface, STD_LOADABLE_MODULE_ID)); } CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomstdoutensurelfending", 0, eCmdHdlrBinary, NULL, - &cs.bEnsureLFEnding, STD_LOADABLE_MODULE_ID)); + &bEnsureLFEnding, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omtemplate/Makefile.am rsyslog-5.10.1/plugins/omtemplate/Makefile.am --- rsyslog-7.6.0/plugins/omtemplate/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/omtemplate/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,8 @@ +pkglib_LTLIBRARIES = omtemplate.la + +omtemplate_la_SOURCES = omtemplate.c +omtemplate_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) +omtemplate_la_LDFLAGS = -module -avoid-version +omtemplate_la_LIBADD = + +EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omtemplate/Makefile.in rsyslog-5.10.1/plugins/omtemplate/Makefile.in --- rsyslog-7.6.0/plugins/omtemplate/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/omtemplate/Makefile.in 2012-10-17 14:42:43.000000000 +0000 @@ -0,0 +1,591 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/omtemplate +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ + $(top_srcdir)/m4/atomic_operations_64bit.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkglibdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +omtemplate_la_DEPENDENCIES = +am_omtemplate_la_OBJECTS = omtemplate_la-omtemplate.lo +omtemplate_la_OBJECTS = $(am_omtemplate_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +omtemplate_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(omtemplate_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(omtemplate_la_SOURCES) +DIST_SOURCES = $(omtemplate_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_LIBS = @CURL_LIBS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIBS = @DL_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GSS_LIBS = @GSS_LIBS@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ +HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ +HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ +HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ +IMUDP_LIBS = @IMUDP_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ +LIBDBI_LIBS = @LIBDBI_LIBS@ +LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ +LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_LIBS = @MYSQL_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORACLE_CFLAGS = @ORACLE_CFLAGS@ +ORACLE_LIBS = @ORACLE_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PGSQL_CFLAGS = @PGSQL_CFLAGS@ +PGSQL_LIBS = @PGSQL_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ +PTHREADS_LIBS = @PTHREADS_LIBS@ +RANLIB = @RANLIB@ +RELP_CFLAGS = @RELP_CFLAGS@ +RELP_LIBS = @RELP_LIBS@ +RSRT_CFLAGS = @RSRT_CFLAGS@ +RSRT_LIBS = @RSRT_LIBS@ +RT_LIBS = @RT_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNMP_CFLAGS = @SNMP_CFLAGS@ +SNMP_LIBS = @SNMP_LIBS@ +SOL_LIBS = @SOL_LIBS@ +STRIP = @STRIP@ +UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ +UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ +VERSION = @VERSION@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_valgrind = @have_valgrind@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moddirs = @moddirs@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +pkglib_LTLIBRARIES = omtemplate.la +omtemplate_la_SOURCES = omtemplate.c +omtemplate_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) +omtemplate_la_LDFLAGS = -module -avoid-version +omtemplate_la_LIBADD = +EXTRA_DIST = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/omtemplate/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/omtemplate/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +omtemplate.la: $(omtemplate_la_OBJECTS) $(omtemplate_la_DEPENDENCIES) + $(AM_V_CCLD)$(omtemplate_la_LINK) -rpath $(pkglibdir) $(omtemplate_la_OBJECTS) $(omtemplate_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omtemplate_la-omtemplate.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +omtemplate_la-omtemplate.lo: omtemplate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omtemplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omtemplate_la-omtemplate.lo -MD -MP -MF $(DEPDIR)/omtemplate_la-omtemplate.Tpo -c -o omtemplate_la-omtemplate.lo `test -f 'omtemplate.c' || echo '$(srcdir)/'`omtemplate.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omtemplate_la-omtemplate.Tpo $(DEPDIR)/omtemplate_la-omtemplate.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omtemplate.c' object='omtemplate_la-omtemplate.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omtemplate_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omtemplate_la-omtemplate.lo `test -f 'omtemplate.c' || echo '$(srcdir)/'`omtemplate.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkglibLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/omtemplate/omtemplate.c rsyslog-5.10.1/plugins/omtemplate/omtemplate.c --- rsyslog-7.6.0/plugins/omtemplate/omtemplate.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/plugins/omtemplate/omtemplate.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,221 @@ +/* omtemplate.c + * This is a template for an output module. It implements a very + * simple single-threaded output, just as thought of by the output + * plugin interface. + * + * NOTE: read comments in module-template.h for more specifics! + * + * File begun on 2009-03-16 by RGerhards + * + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" +#include "rsyslog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "conf.h" +#include "syslogd-types.h" +#include "srUtils.h" +#include "template.h" +#include "module-template.h" +#include "errmsg.h" +#include "cfsysline.h" + +MODULE_TYPE_OUTPUT +MODULE_TYPE_NOKEEP + +/* internal structures + */ +DEF_OMOD_STATIC_DATA +DEFobjCurrIf(errmsg) + +typedef struct _instanceData { + /* here you need to define all action-specific data. A record of type + * instanceData will be handed over to each instance of the action. Keep + * in mind that there may be several invocations of the same type of action + * inside rsyslog.conf, and this is what keeps them apart. Do NOT use + * static data for this! + */ + unsigned iSrvPort; /* sample: server port */ +} instanceData; + +/* config variables + * For the configuration interface, we need to keep track of some settings. This + * is done in global variables. It works as follows: when configuration statements + * are entered, the config file handler (or custom function) sets the global + * variable here. When the action then actually is instantiated, this handler + * copies over to instanceData whatever configuration settings (from the global + * variables) apply. The global variables are NEVER used inside an action + * instance (at least this is how it is supposed to work ;) + */ +static int iSrvPort = 0; /* sample: server port */ + + +BEGINcreateInstance +CODESTARTcreateInstance +ENDcreateInstance + + +BEGINisCompatibleWithFeature +CODESTARTisCompatibleWithFeature + /* use this to specify if select features are supported by this + * plugin. If not, the framework will handle that. Currently, only + * RepeatedMsgReduction ("last message repeated n times") is optional. + */ + if(eFeat == sFEATURERepeatedMsgReduction) + iRet = RS_RET_OK; +ENDisCompatibleWithFeature + + +BEGINfreeInstance +CODESTARTfreeInstance + /* this is a cleanup callback. All dynamically-allocated resources + * in instance data must be cleaned up here. Prime examples are + * malloc()ed memory, file & database handles and the like. + */ +ENDfreeInstance + + +BEGINdbgPrintInstInfo +CODESTARTdbgPrintInstInfo + /* permits to spit out some debug info */ +ENDdbgPrintInstInfo + + +BEGINtryResume +CODESTARTtryResume + /* this is called when an action has been suspended and the + * rsyslog core tries to resume it. The action must then + * retry (if possible) and report RS_RET_OK if it succeeded + * or RS_RET_SUSPENDED otherwise. + * Note that no data can be written in this callback, as it is + * not present. Prime examples of what can be retried are + * reconnects to remote hosts, reconnects to database, + * opening of files and the like. + * If there is no retry-type of operation, the action may + * return RS_RET_OK, so that it will get called on its doAction + * entry point (where it receives data), retries there, and + * immediately returns RS_RET_SUSPENDED if that does not work + * out. This disables some optimizations in the core's retry logic, + * but is a valid and expected behaviour. Note that it is also OK + * for the retry entry point to return OK but the immediately following + * doAction call to fail. In real life, for example, a buggy com line + * may cause such behaviour. + * Note that there is no guarantee that the core will very quickly + * call doAction after the retry succeeded. Today, it does, but that may + * not always be the case. + */ +ENDtryResume + +BEGINdoAction +CODESTARTdoAction + /* this is where you receive the message and need to carry out the + * action. Data is provided in ppString[i] where 0 <= i <= num of strings + * requested. + * Return RS_RET_OK if all goes well, RS_RET_SUSPENDED if the action can + * currently not complete, or an error code or RS_RET_DISABLED. The later + * two should only be returned if there is no hope that the action can be + * restored unless an rsyslog restart (prime example is an invalid config). + * Error code or RS_RET_DISABLED permanently disables the action, up to + * the next restart. + */ +ENDdoAction + + +BEGINparseSelectorAct +CODESTARTparseSelectorAct +CODE_STD_STRING_REQUESTparseSelectorAct(1) + /* first check if this config line is actually for us + * This is a clumpsy interface. We receive the action-part of the selector line + * and need to look at the first characters. If they match our signature + * ":omtemplate:", then we need to instantiate an action. It is recommended that + * newer actions just watch for the template and all other parameters are passed in + * via $-config-lines, this will hopefully be compatbile with future config syntaxes. + * If we do not detect our signature, we must return with RS_RET_CONFLINE_UNPROCESSED + * and NOT do anything else. + */ + if(strncmp((char*) p, ":omtemplate:", sizeof(":omtemplate:") - 1)) { + ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); + } + + /* ok, if we reach this point, we have something for us */ + p += sizeof(":omtemplate:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ + CHKiRet(createInstance(&pData)); + + /* check if a non-standard template is to be applied */ + if(*(p-1) == ';') + --p; + /* if we have, call rsyslog runtime to get us template. Note that StdFmt below is + * the standard name. Currently, we may need to patch tools/syslogd.c if we need + * to add a new standard template. + */ + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_RQD_TPL_OPT_SQL, (uchar*) " StdFmt")); + + /* if we reach this point, all went well, and we can copy over to instanceData + * those configuration elements that we need. + */ + pData->iSrvPort = (unsigned) iSrvPort; /* set configured port */ + +CODE_STD_FINALIZERparseSelectorAct +ENDparseSelectorAct + + +BEGINmodExit +CODESTARTmodExit +ENDmodExit + + +BEGINqueryEtryPt +CODESTARTqueryEtryPt +CODEqueryEtryPt_STD_OMOD_QUERIES +ENDqueryEtryPt + + +/* Reset config variables for this module to default values. + */ +static rsRetVal +resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +{ + DEFiRet; + iSrvPort = 0; /* zero is the default port */ + RETiRet; +} + + +BEGINmodInit() +CODESTARTmodInit + *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ +CODEmodInit_QueryRegCFSLineHdlr + CHKiRet(objUse(errmsg, CORE_COMPONENT)); + /* register our config handlers */ + /* confguration parameters MUST always be specified in lower case! */ + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomtemplteserverport", 0, eCmdHdlrInt, NULL, &iSrvPort, STD_LOADABLE_MODULE_ID)); + /* "resetconfigvariables" should be provided. Notat that it is a chained directive */ + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); +ENDmodInit + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/plugins/omtesting/Makefile.in rsyslog-5.10.1/plugins/omtesting/Makefile.in --- rsyslog-7.6.0/plugins/omtesting/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omtesting/Makefile.in 2012-10-17 14:42:43.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) omtesting_la_DEPENDENCIES = am_omtesting_la_OBJECTS = omtesting_la-omtesting.lo omtesting_la_OBJECTS = $(am_omtesting_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omtesting_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omtesting_la_SOURCES) DIST_SOURCES = $(omtesting_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -378,7 +334,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omtesting.la: $(omtesting_la_OBJECTS) $(omtesting_la_DEPENDENCIES) $(EXTRA_omtesting_la_DEPENDENCIES) +omtesting.la: $(omtesting_la_OBJECTS) $(omtesting_la_DEPENDENCIES) $(AM_V_CCLD)$(omtesting_la_LINK) -rpath $(pkglibdir) $(omtesting_la_OBJECTS) $(omtesting_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -392,30 +348,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omtesting_la-omtesting.lo: omtesting.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omtesting_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omtesting_la-omtesting.lo -MD -MP -MF $(DEPDIR)/omtesting_la-omtesting.Tpo -c -o omtesting_la-omtesting.lo `test -f 'omtesting.c' || echo '$(srcdir)/'`omtesting.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omtesting_la-omtesting.Tpo $(DEPDIR)/omtesting_la-omtesting.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omtesting.c' object='omtesting_la-omtesting.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omtesting.c' object='omtesting_la-omtesting.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omtesting_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omtesting_la-omtesting.lo `test -f 'omtesting.c' || echo '$(srcdir)/'`omtesting.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omtesting_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omtesting_la-omtesting.lo `test -f 'omtesting.c' || echo '$(srcdir)/'`omtesting.c mostlyclean-libtool: -rm -f *.lo @@ -522,15 +482,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omtesting/omtesting.c rsyslog-5.10.1/plugins/omtesting/omtesting.c --- rsyslog-7.6.0/plugins/omtesting/omtesting.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omtesting/omtesting.c 2012-10-17 14:41:20.000000000 +0000 @@ -57,12 +57,12 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omtesting") /* internal structures */ DEF_OMOD_STATIC_DATA +static int bEchoStdout = 0; /* echo non-failed messages to stdout */ typedef struct _instanceData { enum { MD_SLEEP, MD_FAIL, MD_RANDFAIL, MD_ALWAYS_SUSPEND } @@ -76,16 +76,6 @@ int iCurrRetries; } instanceData; -typedef struct configSettings_s { - int bEchoStdout; /* echo non-failed messages to stdout */ -} configSettings_t; -static configSettings_t cs; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.bEchoStdout = 0; -ENDinitConfVars - BEGINcreateInstance CODESTARTcreateInstance pData->iWaitSeconds = 1; @@ -297,7 +287,7 @@ dbgprintf("invalid mode '%s', doing 'sleep 1 0' - fix your config\n", szBuf); } - pData->bEchoStdout = cs.bEchoStdout; + pData->bEchoStdout = bEchoStdout; CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*)"RSYSLOG_TraditionalForwardFormat")); @@ -313,17 +303,15 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES ENDqueryEtryPt BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomtestingechostdout", 0, eCmdHdlrBinary, NULL, - &cs.bEchoStdout, STD_LOADABLE_MODULE_ID)); + &bEchoStdout, STD_LOADABLE_MODULE_ID)); /* we seed the random-number generator in any case... */ srand(time(NULL)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omudpspoof/Makefile.in rsyslog-5.10.1/plugins/omudpspoof/Makefile.in --- rsyslog-7.6.0/plugins/omudpspoof/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omudpspoof/Makefile.in 2012-10-17 14:42:43.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = omudpspoof_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_omudpspoof_la_OBJECTS = omudpspoof_la-omudpspoof.lo omudpspoof_la_OBJECTS = $(am_omudpspoof_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omudpspoof_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omudpspoof_la_SOURCES) DIST_SOURCES = $(omudpspoof_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omudpspoof.la: $(omudpspoof_la_OBJECTS) $(omudpspoof_la_DEPENDENCIES) $(EXTRA_omudpspoof_la_DEPENDENCIES) +omudpspoof.la: $(omudpspoof_la_OBJECTS) $(omudpspoof_la_DEPENDENCIES) $(AM_V_CCLD)$(omudpspoof_la_LINK) -rpath $(pkglibdir) $(omudpspoof_la_OBJECTS) $(omudpspoof_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omudpspoof_la-omudpspoof.lo: omudpspoof.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omudpspoof_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omudpspoof_la-omudpspoof.lo -MD -MP -MF $(DEPDIR)/omudpspoof_la-omudpspoof.Tpo -c -o omudpspoof_la-omudpspoof.lo `test -f 'omudpspoof.c' || echo '$(srcdir)/'`omudpspoof.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omudpspoof_la-omudpspoof.Tpo $(DEPDIR)/omudpspoof_la-omudpspoof.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omudpspoof.c' object='omudpspoof_la-omudpspoof.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omudpspoof.c' object='omudpspoof_la-omudpspoof.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omudpspoof_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omudpspoof_la-omudpspoof.lo `test -f 'omudpspoof.c' || echo '$(srcdir)/'`omudpspoof.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omudpspoof_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omudpspoof_la-omudpspoof.lo `test -f 'omudpspoof.c' || echo '$(srcdir)/'`omudpspoof.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omudpspoof/omudpspoof.c rsyslog-5.10.1/plugins/omudpspoof/omudpspoof.c --- rsyslog-7.6.0/plugins/omudpspoof/omudpspoof.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/omudpspoof/omudpspoof.c 2012-10-17 14:41:20.000000000 +0000 @@ -5,7 +5,7 @@ * This file builds on UDP spoofing code contributed by * David Lang . I then created a "real" rsyslog module * out of that code and omfwd. I decided to make it a separate module because - * omfwd already mixes up too many things (TCP & UDP & a different modes, + * omfwd already mixes up too many things (TCP & UDP & a differnt modes, * this has historic reasons), it would not be a good idea to also add * spoofing to it. And, looking at the requirements, there is little in * common between omfwd and this module. @@ -83,7 +83,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omudpspoof") /* internal structures */ @@ -93,126 +92,38 @@ DEFobjCurrIf(net) typedef struct _instanceData { - uchar *tplName; /* name of assigned template */ uchar *host; uchar *port; - uchar *sourceTpl; - int mtu; int *pSockArray; /* sockets to use for UDP */ + int compressionLevel; /* 0 - no compression, else level for zlib */ struct addrinfo *f_addr; u_short sourcePort; u_short sourcePortStart; /* for sorce port iteration */ u_short sourcePortEnd; - int bReportLibnetInitErr; /* help prevent multiple error messages on init err */ - libnet_t *libnet_handle; - char errbuf[LIBNET_ERRBUF_SIZE]; } instanceData; #define DFLT_SOURCE_PORT_START 32000 #define DFLT_SOURCE_PORT_END 42000 -typedef struct configSettings_s { - uchar *tplName; /* name of the default template to use */ - uchar *pszSourceNameTemplate; /* name of the template containing the spoofing address */ - uchar *pszTargetHost; - uchar *pszTargetPort; - int iSourcePortStart; - int iSourcePortEnd; -} configSettings_t; -static configSettings_t cs; - -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "target", eCmdHdlrGetWord, 1 }, - { "port", eCmdHdlrGetWord, 0 }, - { "sourcetemplate", eCmdHdlrGetWord, 0 }, - { "sourceport.start", eCmdHdlrInt, 0 }, - { "sourceport.end", eCmdHdlrInt, 0 }, - { "mtu", eCmdHdlrInt, 0 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "template", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - uchar *tplName; /* default template */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.tplName = NULL; - cs.pszSourceNameTemplate = NULL; - cs.pszTargetHost = NULL; - cs.pszTargetPort = NULL; - cs.iSourcePortStart = DFLT_SOURCE_PORT_START; - cs.iSourcePortEnd = DFLT_SOURCE_PORT_END; -ENDinitConfVars +/* config data */ +static uchar *pszTplName = NULL; /* name of the default template to use */ +static uchar *pszSourceNameTemplate = NULL; /* name of the template containing the spoofing address */ +static uchar *pszTargetHost = NULL; +static uchar *pszTargetPort = NULL; +static int iCompressionLevel = 0; /* zlib compressionlevel, the usual values */ +static int iSourcePortStart = DFLT_SOURCE_PORT_START; +static int iSourcePortEnd = DFLT_SOURCE_PORT_END; /* add some variables needed for libnet */ +libnet_t *libnet_handle; +char errbuf[LIBNET_ERRBUF_SIZE]; pthread_mutex_t mutLibnet; /* forward definitions */ static rsRetVal doTryResume(instanceData *pData); -/* this function gets the default template. It coordinates action between - * old-style and new-style configuration parts. - */ -static inline uchar* -getDfltTpl(void) -{ - if(loadModConf != NULL && loadModConf->tplName != NULL) - return loadModConf->tplName; - else if(cs.tplName == NULL) - return (uchar*)"RSYSLOG_FileFormat"; - else - return cs.tplName; -} - - -/* set the default template to be used - * This is a module-global parameter, and as such needs special handling. It needs to - * be coordinated with values set via the v2 config system (rsyslog v6+). What we do - * is we do not permit this directive after the v2 config system has been used to set - * the parameter. - */ -rsRetVal -setLegacyDfltTpl(void __attribute__((unused)) *pVal, uchar* newVal) -{ - DEFiRet; - - if(loadModConf != NULL && loadModConf->tplName != NULL) { - free(newVal); - errmsg.LogError(0, RS_RET_ERR, "omudpspoof default template already set via module " - "global parameter - can no longer be changed"); - ABORT_FINALIZE(RS_RET_ERR); - } - free(cs.tplName); - cs.tplName = newVal; -finalize_it: - RETiRet; -} - /* Close the UDP sockets. * rgerhards, 2009-05-29 */ @@ -242,77 +153,8 @@ } -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->tplName = NULL; -ENDbeginCnfLoad - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for omudpspoof:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "template")) { - loadModConf->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - if(cs.tplName != NULL) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "omudpspoof: warning: default template " - "was already set via legacy directive - may lead to inconsistent " - "results."); - } - } else { - dbgprintf("omudpspoof: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.tplName); - cs.tplName = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf - free(pModConf->tplName); -ENDfreeCnf - - BEGINcreateInstance CODESTARTcreateInstance - pData->libnet_handle = NULL; - pData->mtu = 1500; - pData->bReportLibnetInitErr = 1; ENDcreateInstance @@ -327,12 +169,8 @@ CODESTARTfreeInstance /* final cleanup */ closeUDPSockets(pData); - free(pData->tplName); free(pData->port); free(pData->host); - free(pData->sourceTpl); - if(pData->libnet_handle != NULL) - libnet_destroy(pData->libnet_handle); ENDfreeInstance @@ -357,22 +195,12 @@ libnet_ptag_t ip, ipo; libnet_ptag_t udp; sbool bNeedUnlock = 0; - /* hdrOffs = fragmentation flags + offset (in bytes) - * divided by 8 */ - unsigned msgOffs, hdrOffs; - unsigned maxPktLen, pktLen; DEFiRet; if(pData->pSockArray == NULL) { CHKiRet(doTryResume(pData)); } - if(len > 65528) { - DBGPRINTF("omudpspoof: msg with length %d truncated to 64k: '%.768s'\n", - len, msg); - len = 65528; - } - ip = ipo = udp = 0; if(pData->sourcePort++ >= pData->sourcePortEnd){ pData->sourcePort = pData->sourcePortStart; @@ -383,43 +211,28 @@ bSendSuccess = RSFALSE; d_pthread_mutex_lock(&mutLibnet); bNeedUnlock = 1; - for (r = pData->f_addr; r && bSendSuccess == RSFALSE ; r = r->ai_next) { + for (r = pData->f_addr; r; r = r->ai_next) { tempaddr = (struct sockaddr_in *)r->ai_addr; - /* Getting max payload size (must be multiple of 8) */ - maxPktLen = (pData->mtu - LIBNET_IPV4_H) & ~0x07; - msgOffs = 0; - /* We're doing (payload size - UDP header size) and not - * checking if it's a multiple of 8 because we know the - * header is 8 bytes long */ - if(len > (maxPktLen - LIBNET_UDP_H) ) { - hdrOffs = IP_MF; - pktLen = maxPktLen - LIBNET_UDP_H; - } else { - hdrOffs = 0; - pktLen = len; - } - DBGPRINTF("omudpspoof: stage 1: MF:%d, hdrOffs %d, pktLen %d\n", - (hdrOffs & IP_MF) >> 13, (hdrOffs & 0x1FFF) << 3, pktLen); - libnet_clear_packet(pData->libnet_handle); + libnet_clear_packet(libnet_handle); /* note: libnet does need ports in host order NOT in network byte order! -- rgerhards, 2009-11-12 */ udp = libnet_build_udp( ntohs(pData->sourcePort),/* source port */ ntohs(tempaddr->sin_port),/* destination port */ - pktLen+LIBNET_UDP_H, /* packet length */ + LIBNET_UDP_H + len, /* packet length */ 0, /* checksum */ (u_char*)msg, /* payload */ - pktLen, /* payload size */ - pData->libnet_handle, /* libnet handle */ + len, /* payload size */ + libnet_handle, /* libnet handle */ udp); /* libnet id */ if (udp == -1) { - DBGPRINTF("omudpspoof: can't build UDP header: %s\n", libnet_geterror(pData->libnet_handle)); + DBGPRINTF("Can't build UDP header: %s\n", libnet_geterror(libnet_handle)); } ip = libnet_build_ipv4( - LIBNET_IPV4_H+LIBNET_UDP_H+pktLen, /* length */ + LIBNET_IPV4_H + len + LIBNET_UDP_H, /* length */ 0, /* TOS */ 242, /* IP ID */ - hdrOffs, /* IP Frag */ + 0, /* IP Frag */ 64, /* TTL */ IPPROTO_UDP, /* protocol */ 0, /* checksum */ @@ -427,84 +240,28 @@ tempaddr->sin_addr.s_addr, NULL, /* payload */ 0, /* payload size */ - pData->libnet_handle, /* libnet handle */ + libnet_handle, /* libnet handle */ ip); /* libnet id */ if (ip == -1) { - DBGPRINTF("omudpspoof: can't build IP header: %s\n", libnet_geterror(pData->libnet_handle)); + DBGPRINTF("Can't build IP header: %s\n", libnet_geterror(libnet_handle)); } /* Write it to the wire. */ - lsent = libnet_write(pData->libnet_handle); - if(lsent != (int) (LIBNET_IPV4_H+LIBNET_UDP_H+pktLen)) { - /* note: access to fd is a libnet internal. If a newer version of libnet does - * not expose that member, we should simply remove it. However, while it is there - * it is useful for consolidating with strace output. - */ - DBGPRINTF("omudpspoof: write error (total len %d): pktLen %d, sent %d, fd %d: %s\n", - len, LIBNET_IPV4_H+LIBNET_UDP_H+pktLen, lsent, pData->libnet_handle->fd, - libnet_geterror(pData->libnet_handle)); - if(lsent != -1) { - bSendSuccess = RSTRUE; - } + lsent = libnet_write(libnet_handle); + if (lsent == -1) { + DBGPRINTF("Write error: %s\n", libnet_geterror(libnet_handle)); } else { bSendSuccess = RSTRUE; - } - msgOffs += pktLen; - - /* We need to get rid of the UDP header to build the other fragments */ - libnet_clear_packet(pData->libnet_handle); - ip = LIBNET_PTAG_INITIALIZER; - while(len > msgOffs ) { /* loop until all payload is sent */ - /* check if there will be more fragments */ - if((len - msgOffs) > maxPktLen) { - /* In IP's eyes, the UDP header in the first packet - * needs to be in the offset, so we add its size to - * the payload offset here */ - hdrOffs = IP_MF + (msgOffs + LIBNET_UDP_H)/8; - pktLen = maxPktLen; - } else { - /* See above */ - hdrOffs = (msgOffs + LIBNET_UDP_H)/8; - pktLen = len - msgOffs; - } - DBGPRINTF("omudpspoof: stage 2: MF:%d, hdrOffs %d, pktLen %d\n", - (hdrOffs & IP_MF) >> 13, (hdrOffs & 0x1FFF) << 3, pktLen); - ip = libnet_build_ipv4( - LIBNET_IPV4_H + pktLen, /* length */ - 0, /* TOS */ - 242, /* IP ID */ - hdrOffs, /* IP Frag */ - 64, /* TTL */ - IPPROTO_UDP, /* protocol */ - 0, /* checksum */ - source_ip.sin_addr.s_addr, - tempaddr->sin_addr.s_addr, - (uint8_t*)(msg+msgOffs), /* payload */ - pktLen, /* payload size */ - pData->libnet_handle, /* libnet handle */ - ip); /* libnet id */ - if (ip == -1) { - DBGPRINTF("omudpspoof: can't build IP fragment header: %s\n", libnet_geterror(pData->libnet_handle)); - } - /* Write it to the wire. */ - lsent = libnet_write(pData->libnet_handle); - if(lsent != (int) (LIBNET_IPV4_H+pktLen)) { - DBGPRINTF("omudpspoof: fragment write error len %d, sent %d: %s\n", - LIBNET_IPV4_H+LIBNET_UDP_H+len, lsent, libnet_geterror(pData->libnet_handle)); - bSendSuccess = RSFALSE; - continue; - } - msgOffs += pktLen; + break; } } + /* finished looping */ + if (bSendSuccess == RSFALSE) { + DBGPRINTF("error forwarding via udp, suspending\n"); + iRet = RS_RET_SUSPENDED; + } finalize_it: - if(iRet != RS_RET_OK) { - if(pData->libnet_handle != NULL) { - libnet_destroy(pData->libnet_handle); - pData->libnet_handle = NULL; - } - } if(bNeedUnlock) { d_pthread_mutex_unlock(&mutLibnet); } @@ -525,29 +282,8 @@ if(pData->pSockArray != NULL) FINALIZE; - if(pData->libnet_handle == NULL) { - /* Initialize the libnet library. Root priviledges are required. - * this initializes a IPv4 socket to use for forging UDP packets. - */ - pData->libnet_handle = libnet_init( - LIBNET_RAW4, /* injection type */ - NULL, /* network interface */ - pData->errbuf); /* errbuf */ - - if(pData->libnet_handle == NULL) { - if(pData->bReportLibnetInitErr) { - errmsg.LogError(0, RS_RET_ERR_LIBNET_INIT, "omudpsoof: error " - "initializing libnet - are you running as root?"); - pData->bReportLibnetInitErr = 0; - } - ABORT_FINALIZE(RS_RET_ERR_LIBNET_INIT); - } - } - DBGPRINTF("omudpspoof: libnit_init() ok\n"); - pData->bReportLibnetInitErr = 1; - /* The remote address is not yet known and needs to be obtained */ - DBGPRINTF("omudpspoof trying resume for '%s'\n", pData->host); + DBGPRINTF(" %s\n", pData->host); memset(&hints, 0, sizeof(hints)); /* port must be numeric, because config file syntax requires this */ hints.ai_flags = AI_NUMERICSERV; @@ -560,7 +296,7 @@ } DBGPRINTF("%s found, resuming.\n", pData->host); pData->f_addr = res; - pData->pSockArray = net.create_udp_socket((uchar*)pData->host, NULL, 0, 0); + pData->pSockArray = net.create_udp_socket((uchar*)pData->host, NULL, 0); finalize_it: if(iRet != RS_RET_OK) { @@ -582,95 +318,67 @@ BEGINdoAction char *psz; /* temporary buffering */ - unsigned l; + register unsigned l; int iMaxLine; CODESTARTdoAction CHKiRet(doTryResume(pData)); - DBGPRINTF(" %s:%s/omudpspoof, src '%s', msg strt '%.256s'\n", pData->host, - getFwdPt(pData), ppString[1], ppString[0]); - iMaxLine = glbl.GetMaxLine(); + + DBGPRINTF(" %s:%s/udpspoofs\n", pData->host, getFwdPt(pData)); + psz = (char*) ppString[0]; l = strlen((char*) psz); if((int) l > iMaxLine) l = iMaxLine; +# ifdef USE_NETZIP + /* Check if we should compress and, if so, do it. We also + * check if the message is large enough to justify compression. + * The smaller the message, the less likely is a gain in compression. + * To save CPU cycles, we do not try to compress very small messages. + * What "very small" means needs to be configured. Currently, it is + * hard-coded but this may be changed to a config parameter. + * rgerhards, 2006-11-30 + */ + if(pData->compressionLevel && (l > CONF_MIN_SIZE_FOR_COMPRESS)) { + Bytef *out; + uLongf destLen = iMaxLine + iMaxLine/100 +12; /* recommended value from zlib doc */ + uLong srcLen = l; + int ret; + /* TODO: optimize malloc sequence? -- rgerhards, 2008-09-02 */ + CHKmalloc(out = (Bytef*) MALLOC(destLen)); + out[0] = 'z'; + out[1] = '\0'; + ret = compress2((Bytef*) out+1, &destLen, (Bytef*) psz, + srcLen, pData->compressionLevel); + DBGPRINTF("Compressing message, length was %d now %d, return state %d.\n", + l, (int) destLen, ret); + if(ret != Z_OK) { + /* if we fail, we complain, but only in debug mode + * Otherwise, we are silent. In any case, we ignore the + * failed compression and just sent the uncompressed + * data, which is still valid. So this is probably the + * best course of action. + * rgerhards, 2006-11-30 + */ + DBGPRINTF("Compression failed, sending uncompressed message\n"); + } else if(destLen+1 < l) { + /* only use compression if there is a gain in using it! */ + DBGPRINTF("there is gain in compression, so we do it\n"); + psz = (char*) out; + l = destLen + 1; /* take care for the "z" at message start! */ + } + ++destLen; + } +# endif + CHKiRet(UDPSend(pData, ppString[1], psz, l)); finalize_it: ENDdoAction -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->tplName = NULL; - pData->sourcePortStart = DFLT_SOURCE_PORT_START; - pData->sourcePortEnd = DFLT_SOURCE_PORT_END; - pData->host = NULL; - pData->port = NULL; - pData->sourceTpl = (uchar*) strdup("RSYSLOG_omudpspoofDfltSourceTpl"); - pData->mtu = 1500; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - uchar *tplToUse; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (omudpspoof)\n"); - - pvals = nvlstGetParams(lst, &actpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "omudpspoof: mandatory " - "parameters missing"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("action param blk in omudpspoof:\n"); - cnfparamsPrint(&actpblk, pvals); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "target")) { - pData->host = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "port")) { - pData->port = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "sourcetemplate")) { - free(pData->sourceTpl); - pData->sourceTpl = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "sourceport.start")) { - pData->sourcePortStart = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "sourceport.end")) { - pData->sourcePortEnd = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "mtu")) { - pData->mtu = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - DBGPRINTF("omudpspoof: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - CODE_STD_STRING_REQUESTnewActInst(2) - pData->sourcePort = pData->sourcePortStart; - - tplToUse = ustrdup((pData->tplName == NULL) ? getDfltTpl() : pData->tplName); - CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_NO_RQD_TPL_OPTS)); - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->sourceTpl), OMSR_NO_RQD_TPL_OPTS)); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - BEGINparseSelectorAct uchar *sourceTpl; CODESTARTparseSelectorAct @@ -684,27 +392,28 @@ p += sizeof(":omudpspoof:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ CHKiRet(createInstance(&pData)); - sourceTpl = (cs.pszSourceNameTemplate == NULL) ? UCHAR_CONSTANT("RSYSLOG_omudpspoofDfltSourceTpl") - : cs.pszSourceNameTemplate; + sourceTpl = (pszSourceNameTemplate == NULL) ? UCHAR_CONSTANT("RSYSLOG_omudpspoofDfltSourceTpl") + : pszSourceNameTemplate; - if(cs.pszTargetHost == NULL) { + if(pszTargetHost == NULL) { errmsg.LogError(0, NO_ERRCODE, "No $ActionOMUDPSpoofTargetHost given, can not continue with this action."); ABORT_FINALIZE(RS_RET_HOST_NOT_SPECIFIED); } /* fill instance properties */ - CHKmalloc(pData->host = ustrdup(cs.pszTargetHost)); - if(cs.pszTargetPort == NULL) + CHKmalloc(pData->host = ustrdup(pszTargetHost)); + if(pszTargetPort == NULL) pData->port = NULL; else - CHKmalloc(pData->port = ustrdup(cs.pszTargetPort)); + CHKmalloc(pData->port = ustrdup(pszTargetPort)); CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(sourceTpl), OMSR_NO_RQD_TPL_OPTS)); - pData->sourcePort = pData->sourcePortStart = cs.iSourcePortStart; - pData->sourcePortEnd = cs.iSourcePortEnd; + pData->compressionLevel = iCompressionLevel; + pData->sourcePort = pData->sourcePortStart = iSourcePortStart; + pData->sourcePortEnd = iSourcePortEnd; /* process template */ CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, - (cs.tplName == NULL) ? (uchar*)"RSYSLOG_TraditionalForwardFormat" : cs.tplName)); + (pszTplName == NULL) ? (uchar*)"RSYSLOG_TraditionalForwardFormat" : pszTplName)); CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -716,18 +425,19 @@ static void freeConfigVars(void) { - free(cs.tplName); - cs.tplName = NULL; - free(cs.pszTargetHost); - cs.pszTargetHost = NULL; - free(cs.pszTargetPort); - cs.pszTargetPort = NULL; + free(pszTplName); + pszTplName = NULL; + free(pszTargetHost); + pszTargetHost = NULL; + free(pszTargetPort); + pszTargetPort = NULL; } BEGINmodExit CODESTARTmodExit /* destroy the libnet state needed for forged UDP sources */ + libnet_destroy(libnet_handle); pthread_mutex_destroy(&mutLibnet); /* release what we no longer need */ objRelease(errmsg, CORE_COMPONENT); @@ -740,9 +450,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES ENDqueryEtryPt @@ -753,29 +460,42 @@ { freeConfigVars(); /* we now must reset all non-string values */ - cs.iSourcePortStart = DFLT_SOURCE_PORT_START; - cs.iSourcePortEnd = DFLT_SOURCE_PORT_END; + iCompressionLevel = 0; + iSourcePortStart = DFLT_SOURCE_PORT_START; + iSourcePortEnd = DFLT_SOURCE_PORT_END; return RS_RET_OK; } BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net,LM_NET_FILENAME)); + /* Initialize the libnet library. Root priviledges are required. + * this initializes a IPv4 socket to use for forging UDP packets. + */ + libnet_handle = libnet_init( + LIBNET_RAW4, /* injection type */ + NULL, /* network interface */ + errbuf); /* errbuf */ + + if(libnet_handle == NULL) { + errmsg.LogError(0, NO_ERRCODE, "Error initializing libnet, can not continue "); + ABORT_FINALIZE(RS_RET_ERR_LIBNET_INIT); + } pthread_mutex_init(&mutLibnet, NULL); - CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofdefaulttemplate", 0, eCmdHdlrGetWord, setLegacyDfltTpl, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourcenametemplate", 0, eCmdHdlrGetWord, NULL, &cs.pszSourceNameTemplate, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspooftargethost", 0, eCmdHdlrGetWord, NULL, &cs.pszTargetHost, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspooftargetport", 0, eCmdHdlrGetWord, NULL, &cs.pszTargetPort, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourceportstart", 0, eCmdHdlrInt, NULL, &cs.iSourcePortStart, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourceportend", 0, eCmdHdlrInt, NULL, &cs.iSourcePortEnd, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofdefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourcenametemplate", 0, eCmdHdlrGetWord, NULL, &pszSourceNameTemplate, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspooftargethost", 0, eCmdHdlrGetWord, NULL, &pszTargetHost, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspooftargetport", 0, eCmdHdlrGetWord, NULL, &pszTargetPort, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourceportstart", 0, eCmdHdlrInt, NULL, &iSourcePortStart, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpspoofsourceportend", 0, eCmdHdlrInt, NULL, &iSourcePortEnd, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionomudpcompressionlevel", 0, eCmdHdlrInt, NULL, &iCompressionLevel, NULL)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omuxsock/Makefile.in rsyslog-5.10.1/plugins/omuxsock/Makefile.in --- rsyslog-7.6.0/plugins/omuxsock/Makefile.in 2014-02-12 12:06:36.000000000 +0000 +++ rsyslog-5.10.1/plugins/omuxsock/Makefile.in 2012-10-17 14:42:43.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) omuxsock_la_DEPENDENCIES = am_omuxsock_la_OBJECTS = omuxsock_la-omuxsock.lo omuxsock_la_OBJECTS = $(am_omuxsock_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent omuxsock_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(omuxsock_la_SOURCES) DIST_SOURCES = $(omuxsock_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -omuxsock.la: $(omuxsock_la_OBJECTS) $(omuxsock_la_DEPENDENCIES) $(EXTRA_omuxsock_la_DEPENDENCIES) +omuxsock.la: $(omuxsock_la_OBJECTS) $(omuxsock_la_DEPENDENCIES) $(AM_V_CCLD)$(omuxsock_la_LINK) -rpath $(pkglibdir) $(omuxsock_la_OBJECTS) $(omuxsock_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< omuxsock_la-omuxsock.lo: omuxsock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omuxsock_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omuxsock_la-omuxsock.lo -MD -MP -MF $(DEPDIR)/omuxsock_la-omuxsock.Tpo -c -o omuxsock_la-omuxsock.lo `test -f 'omuxsock.c' || echo '$(srcdir)/'`omuxsock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omuxsock_la-omuxsock.Tpo $(DEPDIR)/omuxsock_la-omuxsock.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omuxsock.c' object='omuxsock_la-omuxsock.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omuxsock.c' object='omuxsock_la-omuxsock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omuxsock_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omuxsock_la-omuxsock.lo `test -f 'omuxsock.c' || echo '$(srcdir)/'`omuxsock.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omuxsock_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omuxsock_la-omuxsock.lo `test -f 'omuxsock.c' || echo '$(srcdir)/'`omuxsock.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/omuxsock/omuxsock.c rsyslog-5.10.1/plugins/omuxsock/omuxsock.c --- rsyslog-7.6.0/plugins/omuxsock/omuxsock.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/plugins/omuxsock/omuxsock.c 2012-10-17 14:41:20.000000000 +0000 @@ -46,7 +46,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omuxsock") /* internal structures */ @@ -65,80 +64,13 @@ } instanceData; /* config data */ -typedef struct configSettings_s { - uchar *tplName; /* name of the default template to use */ - uchar *sockName; /* name of the default template to use */ -} configSettings_t; -static configSettings_t cs; - -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "template", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - uchar *tplName; /* default template */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.tplName = NULL; - cs.sockName = NULL; -ENDinitConfVars - +static uchar *tplName = NULL; /* name of the default template to use */ +static uchar *sockName = NULL; /* name of the default template to use */ static rsRetVal doTryResume(instanceData *pData); - -/* this function gets the default template. It coordinates action between - * old-style and new-style configuration parts. - */ -static inline uchar* -getDfltTpl(void) -{ - if(loadModConf != NULL && loadModConf->tplName != NULL) - return loadModConf->tplName; - else if(cs.tplName == NULL) - return (uchar*)"RSYSLOG_TraditionalForwardFormat"; - else - return cs.tplName; -} - -/* set the default template to be used - * This is a module-global parameter, and as such needs special handling. It needs to - * be coordinated with values set via the v2 config system (rsyslog v6+). What we do - * is we do not permit this directive after the v2 config system has been used to set - * the parameter. +/* Close socket. */ -rsRetVal -setLegacyDfltTpl(void __attribute__((unused)) *pVal, uchar* newVal) -{ - DEFiRet; - - if(loadModConf != NULL && loadModConf->tplName != NULL) { - free(newVal); - errmsg.LogError(0, RS_RET_ERR, "omuxsock default template already set via module " - "global parameter - can no longer be changed"); - ABORT_FINALIZE(RS_RET_ERR); - } - free(cs.tplName); - cs.tplName = newVal; -finalize_it: - RETiRet; -} - - static inline rsRetVal closeSocket(instanceData *pData) { @@ -153,72 +85,6 @@ - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->tplName = NULL; -ENDbeginCnfLoad - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for omuxsock:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "template")) { - loadModConf->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - if(cs.tplName != NULL) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "omuxsock: warning: default template " - "was already set via legacy directive - may lead to inconsistent " - "results."); - } - } else { - dbgprintf("omuxsock: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.tplName); - cs.tplName = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf - free(pModConf->tplName); -ENDfreeCnf - BEGINcreateInstance CODESTARTcreateInstance pData->sock = INVLD_SOCK; @@ -373,15 +239,16 @@ /* check if a non-standard template is to be applied */ if(*(p-1) == ';') --p; - CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, 0, getDfltTpl())); + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, 0, tplName == NULL ? UCHAR_CONSTANT("RSYSLOG_TraditionalForwardFormat") + : tplName )); - if(cs.sockName == NULL) { + if(sockName == NULL) { errmsg.LogError(0, RS_RET_NO_SOCK_CONFIGURED, "No output socket configured for omuxsock\n"); ABORT_FINALIZE(RS_RET_NO_SOCK_CONFIGURED); } - pData->sockName = cs.sockName; - cs.sockName = NULL; /* pData is now owner and will fee it */ + pData->sockName = sockName; + sockName = NULL; /* pData is now owner and will fee it */ CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -393,10 +260,10 @@ static inline void freeConfigVars(void) { - free(cs.tplName); - cs.tplName = NULL; - free(cs.sockName); - cs.sockName = NULL; + free(tplName); + tplName = NULL; + free(sockName); + sockName = NULL; } @@ -413,8 +280,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES ENDqueryEtryPt @@ -430,14 +295,13 @@ BEGINmodInit() CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(regCfSysLineHdlr((uchar *)"omuxsockdefaulttemplate", 0, eCmdHdlrGetWord, setLegacyDfltTpl, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"omuxsocksocket", 0, eCmdHdlrGetWord, NULL, &cs.sockName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"omuxsockdefaulttemplate", 0, eCmdHdlrGetWord, NULL, &tplName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"omuxsocksocket", 0, eCmdHdlrGetWord, NULL, &sockName, NULL)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/plugins/omzmq3/Makefile.am rsyslog-5.10.1/plugins/omzmq3/Makefile.am --- rsyslog-7.6.0/plugins/omzmq3/Makefile.am 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omzmq3/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -pkglib_LTLIBRARIES = omzmq3.la - -omzmq3_la_SOURCES = omzmq3.c -omzmq3_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(CZMQ_CFLAGS) -omzmq3_la_LDFLAGS = -module -avoid-version -omzmq3_la_LIBADD = $(CZMQ_LIBS) - -EXTRA_DIST = diff -Nru rsyslog-7.6.0/plugins/omzmq3/Makefile.in rsyslog-5.10.1/plugins/omzmq3/Makefile.in --- rsyslog-7.6.0/plugins/omzmq3/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/omzmq3/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = plugins/omzmq3 -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/atomic_operations.m4 \ - $(top_srcdir)/m4/atomic_operations_64bit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(pkglibdir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) -am__DEPENDENCIES_1 = -omzmq3_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_omzmq3_la_OBJECTS = omzmq3_la-omzmq3.lo -omzmq3_la_OBJECTS = $(am_omzmq3_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -omzmq3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(omzmq3_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(omzmq3_la_SOURCES) -DIST_SOURCES = $(omzmq3_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CFLAGS = @CURL_CFLAGS@ -CURL_LIBS = @CURL_LIBS@ -CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DL_LIBS = @DL_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ -HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ -HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ -HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ -IMUDP_LIBS = @IMUDP_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ -LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ -LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_LIBS = @MYSQL_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -ORACLE_CFLAGS = @ORACLE_CFLAGS@ -ORACLE_LIBS = @ORACLE_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PGSQL_CFLAGS = @PGSQL_CFLAGS@ -PGSQL_LIBS = @PGSQL_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ -PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ -RANLIB = @RANLIB@ -RELP_CFLAGS = @RELP_CFLAGS@ -RELP_LIBS = @RELP_LIBS@ -RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ -RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ -RT_LIBS = @RT_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNMP_CFLAGS = @SNMP_CFLAGS@ -SNMP_LIBS = @SNMP_LIBS@ -SOL_LIBS = @SOL_LIBS@ -STRIP = @STRIP@ -UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ -UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -ZLIB_LIBS = @ZLIB_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -have_valgrind = @have_valgrind@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moddirs = @moddirs@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pkglib_LTLIBRARIES = omzmq3.la -omzmq3_la_SOURCES = omzmq3.c -omzmq3_la_CPPFLAGS = $(RSRT_CFLAGS) $(PTHREADS_CFLAGS) $(CZMQ_CFLAGS) -omzmq3_la_LDFLAGS = -module -avoid-version -omzmq3_la_LIBADD = $(CZMQ_LIBS) -EXTRA_DIST = -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/omzmq3/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu plugins/omzmq3/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ - } - -uninstall-pkglibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ - done - -clean-pkglibLTLIBRARIES: - -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) - @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -omzmq3.la: $(omzmq3_la_OBJECTS) $(omzmq3_la_DEPENDENCIES) $(EXTRA_omzmq3_la_DEPENDENCIES) - $(AM_V_CCLD)$(omzmq3_la_LINK) -rpath $(pkglibdir) $(omzmq3_la_OBJECTS) $(omzmq3_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omzmq3_la-omzmq3.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -omzmq3_la-omzmq3.lo: omzmq3.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omzmq3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT omzmq3_la-omzmq3.lo -MD -MP -MF $(DEPDIR)/omzmq3_la-omzmq3.Tpo -c -o omzmq3_la-omzmq3.lo `test -f 'omzmq3.c' || echo '$(srcdir)/'`omzmq3.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/omzmq3_la-omzmq3.Tpo $(DEPDIR)/omzmq3_la-omzmq3.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omzmq3.c' object='omzmq3_la-omzmq3.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(omzmq3_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o omzmq3_la-omzmq3.lo `test -f 'omzmq3.c' || echo '$(srcdir)/'`omzmq3.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pkglibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pkglibLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pkglibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkglibLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru rsyslog-7.6.0/plugins/omzmq3/omzmq3.c rsyslog-5.10.1/plugins/omzmq3/omzmq3.c --- rsyslog-7.6.0/plugins/omzmq3/omzmq3.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omzmq3/omzmq3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,476 +0,0 @@ -/* omzmq3.c - * Copyright 2012 Talksum, Inc - * Using the czmq interface to zeromq, we output - * to a zmq socket. - - -* -* This program is free software: you can redistribute it and/or -* modify it under the terms of the GNU Lesser 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 -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this program. If not, see -* . -* -* Author: David Kelly -* -*/ - - -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "conf.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "template.h" -#include "module-template.h" -#include "errmsg.h" -#include "cfsysline.h" - -#include - -MODULE_TYPE_OUTPUT -MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omzmq3") - -DEF_OMOD_STATIC_DATA -DEFobjCurrIf(errmsg) - -/* convienent symbols to denote a socket we want to bind - vs one we want to just connect to -*/ -#define ACTION_CONNECT 1 -#define ACTION_BIND 2 - - -/* ---------------------------------------------------------------------------- - * structs to describe sockets - */ -struct socket_type { - char* name; - int type; -}; - -/* more overkill, but seems nice to be consistent. */ -struct socket_action { - char* name; - int action; -}; - -typedef struct _instanceData { - void* socket; - uchar* description; - int type; - int action; - int sndHWM; - int rcvHWM; - uchar* identity; - int sndBuf; - int rcvBuf; - int linger; - int backlog; - int sndTimeout; - int rcvTimeout; - int maxMsgSize; - int rate; - int recoveryIVL; - int multicastHops; - int reconnectIVL; - int reconnectIVLMax; - int ipv4Only; - int affinity; - uchar* tplName; -} instanceData; - - -/* ---------------------------------------------------------------------------- - * Static definitions/initializations - */ - -/* only 1 zctx for all the sockets, with an adjustable number of - worker threads which may be useful if we use affinity in particular - sockets -*/ -static zctx_t* s_context = NULL; -static int s_workerThreads = -1; - -static struct socket_type types[] = { - {"PUB", ZMQ_PUB }, - {"PUSH", ZMQ_PUSH }, - {"DEALER", ZMQ_DEALER }, - {"XPUB", ZMQ_XPUB } -}; - -static struct socket_action actions[] = { - {"BIND", ACTION_BIND}, - {"CONNECT", ACTION_CONNECT}, -}; - -static struct cnfparamdescr actpdescr[] = { - { "description", eCmdHdlrGetWord, 0 }, - { "sockType", eCmdHdlrGetWord, 0 }, - { "action", eCmdHdlrGetWord, 0 }, - { "sndHWM", eCmdHdlrInt, 0 }, - { "rcvHWM", eCmdHdlrInt, 0 }, - { "identity", eCmdHdlrGetWord, 0 }, - { "sndBuf", eCmdHdlrInt, 0 }, - { "rcvBuf", eCmdHdlrInt, 0 }, - { "linger", eCmdHdlrInt, 0 }, - { "backlog", eCmdHdlrInt, 0 }, - { "sndTimeout", eCmdHdlrInt, 0 }, - { "rcvTimeout", eCmdHdlrInt, 0 }, - { "maxMsgSize", eCmdHdlrInt, 0 }, - { "rate", eCmdHdlrInt, 0 }, - { "recoveryIVL", eCmdHdlrInt, 0 }, - { "multicastHops", eCmdHdlrInt, 0 }, - { "reconnectIVL", eCmdHdlrInt, 0 }, - { "reconnectIVLMax", eCmdHdlrInt, 0 }, - { "ipv4Only", eCmdHdlrInt, 0 }, - { "affinity", eCmdHdlrInt, 0 }, - { "globalWorkerThreads", eCmdHdlrInt, 0 }, - { "template", eCmdHdlrGetWord, 1 } -}; - -static struct cnfparamblk actpblk = { - CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr -}; - -/* ---------------------------------------------------------------------------- - * Helper Functions - */ - -/* get the name of a socket type, return the ZMQ_XXX type - or -1 if not a supported type (see above) -*/ -int getSocketType(char* name) { - int type = -1; - uint i; - for(i=0; isocket) { - if(pData->socket != NULL) { - zsocket_destroy(s_context, pData->socket); - } - } -} - - -static rsRetVal initZMQ(instanceData* pData) { - DEFiRet; - - /* create the context if necessary. */ - if (NULL == s_context) { - zsys_handler_set(NULL); - s_context = zctx_new(); - if (s_workerThreads > 0) zctx_set_iothreads(s_context, s_workerThreads); - } - - pData->socket = zsocket_new(s_context, pData->type); - if (NULL == pData->socket) { - errmsg.LogError(0, RS_RET_NO_ERRCODE, - "omzmq3: zsocket_new failed for %s: %s", - pData->description, zmq_strerror(errno)); - ABORT_FINALIZE(RS_RET_NO_ERRCODE); - } - /* use czmq defaults for these, unless set to non-default values */ - if(pData->identity) zsocket_set_identity(pData->socket, (char*)pData->identity); - if(pData->sndBuf > -1) zsocket_set_sndbuf(pData->socket, pData->sndBuf); - if(pData->rcvBuf > -1) zsocket_set_sndbuf(pData->socket, pData->rcvBuf); - if(pData->linger > -1) zsocket_set_linger(pData->socket, pData->linger); - if(pData->backlog > -1) zsocket_set_backlog(pData->socket, pData->backlog); - if(pData->sndTimeout > -1) zsocket_set_sndtimeo(pData->socket, pData->sndTimeout); - if(pData->rcvTimeout > -1) zsocket_set_rcvtimeo(pData->socket, pData->rcvTimeout); - if(pData->maxMsgSize > -1) zsocket_set_maxmsgsize(pData->socket, pData->maxMsgSize); - if(pData->rate > -1) zsocket_set_rate(pData->socket, pData->rate); - if(pData->recoveryIVL > -1) zsocket_set_recovery_ivl(pData->socket, pData->recoveryIVL); - if(pData->multicastHops > -1) zsocket_set_multicast_hops(pData->socket, pData->multicastHops); - if(pData->reconnectIVL > -1) zsocket_set_reconnect_ivl(pData->socket, pData->reconnectIVL); - if(pData->reconnectIVLMax > -1) zsocket_set_reconnect_ivl_max(pData->socket, pData->reconnectIVLMax); - if(pData->ipv4Only > -1) zsocket_set_ipv4only(pData->socket, pData->ipv4Only); - if(pData->affinity != 1) zsocket_set_affinity(pData->socket, pData->affinity); - if(pData->rcvHWM > -1) zsocket_set_rcvhwm(pData->socket, pData->rcvHWM); - if(pData->sndHWM > -1) zsocket_set_sndhwm(pData->socket, pData->sndHWM); - - /* bind or connect to it */ - if (pData->action == ACTION_BIND) { - /* bind asserts, so no need to test return val here - which isn't the greatest api -- oh well */ - if(-1 == zsocket_bind(pData->socket, (char*)pData->description)) { - errmsg.LogError(0, RS_RET_NO_ERRCODE, "omzmq3: bind failed for %s: %s", - pData->description, zmq_strerror(errno)); - ABORT_FINALIZE(RS_RET_NO_ERRCODE); - } - DBGPRINTF("omzmq3: bind to %s successful\n",pData->description); - } else { - if(-1 == zsocket_connect(pData->socket, (char*)pData->description)) { - errmsg.LogError(0, RS_RET_NO_ERRCODE, "omzmq3: connect failed for %s: %s", - pData->description, zmq_strerror(errno)); - ABORT_FINALIZE(RS_RET_NO_ERRCODE); - } - DBGPRINTF("omzmq3: connect to %s successful", pData->description); - } - finalize_it: - RETiRet; -} - -rsRetVal writeZMQ(uchar* msg, instanceData* pData) { - DEFiRet; - - /* initialize if necessary */ - if(NULL == pData->socket) - CHKiRet(initZMQ(pData)); - - /* send it */ - int result = zstr_send(pData->socket, (char*)msg); - - /* whine if things went wrong */ - if (result == -1) { - errmsg.LogError(0, NO_ERRCODE, "omzmq3: send of %s failed: %s", msg, zmq_strerror(errno)); - ABORT_FINALIZE(RS_RET_ERR); - } - finalize_it: - RETiRet; -} - -static inline void -setInstParamDefaults(instanceData* pData) { - pData->description = NULL; - pData->socket = NULL; - pData->tplName = NULL; - pData->type = ZMQ_PUB; - pData->action = ACTION_BIND; - pData->sndHWM = -1; - pData->rcvHWM = -1; - pData->identity = NULL; - pData->sndBuf = -1; - pData->rcvBuf = -1; - pData->linger = -1; - pData->backlog = -1; - pData->sndTimeout = -1; - pData->rcvTimeout = -1; - pData->maxMsgSize = -1; - pData->rate = -1; - pData->recoveryIVL = -1; - pData->multicastHops = -1; - pData->reconnectIVL = -1; - pData->reconnectIVLMax = -1; - pData->ipv4Only = -1; - pData->affinity = 1; -} - - -/* ---------------------------------------------------------------------------- - * Output Module Functions - */ - -BEGINcreateInstance -CODESTARTcreateInstance -ENDcreateInstance - -BEGINisCompatibleWithFeature -CODESTARTisCompatibleWithFeature - if(eFeat == sFEATURERepeatedMsgReduction) - iRet = RS_RET_OK; -ENDisCompatibleWithFeature - - -BEGINdbgPrintInstInfo -CODESTARTdbgPrintInstInfo -ENDdbgPrintInstInfo - -BEGINfreeInstance -CODESTARTfreeInstance - closeZMQ(pData); - free(pData->description); - free(pData->tplName); - free(pData->identity); -ENDfreeInstance - -BEGINtryResume -CODESTARTtryResume - if(NULL == pData->socket) - iRet = initZMQ(pData); -ENDtryResume - -BEGINdoAction -CODESTARTdoAction -iRet = writeZMQ(ppString[0], pData); -ENDdoAction - - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - if ((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - -CHKiRet(createInstance(&pData)); -setInstParamDefaults(pData); - -CODE_STD_STRING_REQUESTnewActInst(1) - for (i = 0; i < actpblk.nParams; ++i) { - if (!pvals[i].bUsed) - continue; - if (!strcmp(actpblk.descr[i].name, "description")) { - pData->description = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "sockType")){ - pData->type = getSocketType(es_str2cstr(pvals[i].val.d.estr, NULL)); - } else if (!strcmp(actpblk.descr[i].name, "action")){ - pData->action = getSocketAction(es_str2cstr(pvals[i].val.d.estr, NULL)); - } else if (!strcmp(actpblk.descr[i].name, "sndHWM")) { - pData->sndHWM = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "rcvHWM")) { - pData->rcvHWM = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "identity")){ - pData->identity = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if (!strcmp(actpblk.descr[i].name, "sndBuf")) { - pData->sndBuf = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "rcvBuf")) { - pData->rcvBuf = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "linger")) { - pData->linger = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "backlog")) { - pData->backlog = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "sndTimeout")) { - pData->sndTimeout = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "rcvTimeout")) { - pData->rcvTimeout = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "maxMsgSize")) { - pData->maxMsgSize = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "rate")) { - pData->rate = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "recoveryIVL")) { - pData->recoveryIVL = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "multicastHops")) { - pData->multicastHops = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "reconnectIVL")) { - pData->reconnectIVL = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "reconnectIVLMax")) { - pData->reconnectIVLMax = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "ipv4Only")) { - pData->ipv4Only = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "affinity")) { - pData->affinity = (int) pvals[i].val.d.n; - } else if (!strcmp(actpblk.descr[i].name, "globalWorkerThreads")) { - s_workerThreads = (int) pvals[i].val.d.n; - } else { - errmsg.LogError(0, NO_ERRCODE, "omzmq3: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if (pData->tplName == NULL) { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup("RSYSLOG_ForwardFormat"), OMSR_NO_RQD_TPL_OPTS)); - } else { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)pData->tplName, OMSR_NO_RQD_TPL_OPTS)); - } - if (NULL == pData->description) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "omzmq3: you didn't enter a description"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if (pData->type == -1) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "omzmq3: unknown socket type."); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - if (pData->action == -1) { - errmsg.LogError(0, RS_RET_CONFIG_ERROR, "omzmq3: unknown socket action"); - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - -BEGINparseSelectorAct -CODESTARTparseSelectorAct - -/* tell the engine we only want one template string */ -CODE_STD_STRING_REQUESTparseSelectorAct(1) - if(!strncmp((char*) p, ":omzmq3:", sizeof(":omzmq3:") - 1)) - errmsg.LogError(0, RS_RET_LEGA_ACT_NOT_SUPPORTED, - "omzmq3 supports only v6 config format, use: " - "action(type=\"omzmq3\" serverport=...)"); - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); -CODE_STD_FINALIZERparseSelectorAct -ENDparseSelectorAct - -BEGINinitConfVars /* (re)set config variables to defaults */ -CODESTARTinitConfVars -s_workerThreads = -1; -ENDinitConfVars - -BEGINmodExit -CODESTARTmodExit - if (NULL != s_context) { - zctx_destroy(&s_context); - s_context=NULL; - } -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -ENDqueryEtryPt - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* only supports rsyslog 6 configs */ -CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - INITChkCoreFeature(bCoreSupportsBatching, CORE_FEATURE_BATCHING); - DBGPRINTF("omzmq3: module compiled with rsyslog version %s.\n", VERSION); - -INITLegCnfVars -CHKiRet(omsdRegCFSLineHdlr((uchar *)"omzmq3workerthreads", 0, eCmdHdlrInt, NULL, &s_workerThreads, STD_LOADABLE_MODULE_ID)); -ENDmodInit - - - diff -Nru rsyslog-7.6.0/plugins/omzmq3/README rsyslog-5.10.1/plugins/omzmq3/README --- rsyslog-7.6.0/plugins/omzmq3/README 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/omzmq3/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -ZeroMQ 3.x Output Plugin - -Building this plugin: -Requires libzmq and libczmq. First, download the tarballs of both libzmq -and its supporting libczmq from http://download.zeromq.org. As of this -writing (04/23/2013), the most recent versions of libzmq and czmq are -3.2.2 and 1.3.2 respectively. Configure, build, and then install both libs. - -Omzmq3 allows you to push data out of rsyslog from a zeromq socket. The example -below binds a PUB socket to port 7171, and any message fitting the criteria will -be output to the zmq socket. - -Example Rsyslog.conf snippet (NOTE: v6 format): -------------------------------------------------------------------------------- -if $msg then { - action(type="omzmq3", sockType="PUB", action="BIND", - description="tcp://*:7172) -} -------------------------------------------------------------------------------- diff -Nru rsyslog-7.6.0/plugins/pmaixforwardedfrom/Makefile.in rsyslog-5.10.1/plugins/pmaixforwardedfrom/Makefile.in --- rsyslog-7.6.0/plugins/pmaixforwardedfrom/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmaixforwardedfrom/Makefile.in 2012-10-17 14:42:44.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,20 +69,14 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) pmaixforwardedfrom_la_DEPENDENCIES = am_pmaixforwardedfrom_la_OBJECTS = \ pmaixforwardedfrom_la-pmaixforwardedfrom.lo pmaixforwardedfrom_la_OBJECTS = $(am_pmaixforwardedfrom_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent pmaixforwardedfrom_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -98,21 +92,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(pmaixforwardedfrom_la_SOURCES) DIST_SOURCES = $(pmaixforwardedfrom_la_SOURCES) @@ -135,11 +129,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -153,56 +144,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -210,8 +175,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -231,16 +194,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -252,14 +210,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -293,6 +248,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -381,7 +337,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -pmaixforwardedfrom.la: $(pmaixforwardedfrom_la_OBJECTS) $(pmaixforwardedfrom_la_DEPENDENCIES) $(EXTRA_pmaixforwardedfrom_la_DEPENDENCIES) +pmaixforwardedfrom.la: $(pmaixforwardedfrom_la_OBJECTS) $(pmaixforwardedfrom_la_DEPENDENCIES) $(AM_V_CCLD)$(pmaixforwardedfrom_la_LINK) -rpath $(pkglibdir) $(pmaixforwardedfrom_la_OBJECTS) $(pmaixforwardedfrom_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -395,30 +351,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pmaixforwardedfrom_la-pmaixforwardedfrom.lo: pmaixforwardedfrom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmaixforwardedfrom_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmaixforwardedfrom_la-pmaixforwardedfrom.lo -MD -MP -MF $(DEPDIR)/pmaixforwardedfrom_la-pmaixforwardedfrom.Tpo -c -o pmaixforwardedfrom_la-pmaixforwardedfrom.lo `test -f 'pmaixforwardedfrom.c' || echo '$(srcdir)/'`pmaixforwardedfrom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pmaixforwardedfrom_la-pmaixforwardedfrom.Tpo $(DEPDIR)/pmaixforwardedfrom_la-pmaixforwardedfrom.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmaixforwardedfrom.c' object='pmaixforwardedfrom_la-pmaixforwardedfrom.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmaixforwardedfrom.c' object='pmaixforwardedfrom_la-pmaixforwardedfrom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmaixforwardedfrom_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmaixforwardedfrom_la-pmaixforwardedfrom.lo `test -f 'pmaixforwardedfrom.c' || echo '$(srcdir)/'`pmaixforwardedfrom.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmaixforwardedfrom_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmaixforwardedfrom_la-pmaixforwardedfrom.lo `test -f 'pmaixforwardedfrom.c' || echo '$(srcdir)/'`pmaixforwardedfrom.c mostlyclean-libtool: -rm -f *.lo @@ -525,15 +485,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/pmaixforwardedfrom/pmaixforwardedfrom.c rsyslog-5.10.1/plugins/pmaixforwardedfrom/pmaixforwardedfrom.c --- rsyslog-7.6.0/plugins/pmaixforwardedfrom/pmaixforwardedfrom.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmaixforwardedfrom/pmaixforwardedfrom.c 2012-10-17 14:41:20.000000000 +0000 @@ -42,7 +42,6 @@ MODULE_TYPE_PARSER MODULE_TYPE_NOKEEP -MODULE_CNFNAME("pmaixforwardedfrom") PARSER_NAME("rsyslog.aixforwardedfrom") /* internal structures diff -Nru rsyslog-7.6.0/plugins/pmcisconames/Makefile.in rsyslog-5.10.1/plugins/pmcisconames/Makefile.in --- rsyslog-7.6.0/plugins/pmcisconames/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmcisconames/Makefile.in 2012-10-17 14:42:44.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) pmcisconames_la_DEPENDENCIES = am_pmcisconames_la_OBJECTS = pmcisconames_la-pmcisconames.lo pmcisconames_la_OBJECTS = $(am_pmcisconames_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent pmcisconames_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(pmcisconames_la_SOURCES) DIST_SOURCES = $(pmcisconames_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -pmcisconames.la: $(pmcisconames_la_OBJECTS) $(pmcisconames_la_DEPENDENCIES) $(EXTRA_pmcisconames_la_DEPENDENCIES) +pmcisconames.la: $(pmcisconames_la_OBJECTS) $(pmcisconames_la_DEPENDENCIES) $(AM_V_CCLD)$(pmcisconames_la_LINK) -rpath $(pkglibdir) $(pmcisconames_la_OBJECTS) $(pmcisconames_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pmcisconames_la-pmcisconames.lo: pmcisconames.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmcisconames_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmcisconames_la-pmcisconames.lo -MD -MP -MF $(DEPDIR)/pmcisconames_la-pmcisconames.Tpo -c -o pmcisconames_la-pmcisconames.lo `test -f 'pmcisconames.c' || echo '$(srcdir)/'`pmcisconames.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pmcisconames_la-pmcisconames.Tpo $(DEPDIR)/pmcisconames_la-pmcisconames.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmcisconames.c' object='pmcisconames_la-pmcisconames.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmcisconames.c' object='pmcisconames_la-pmcisconames.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmcisconames_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmcisconames_la-pmcisconames.lo `test -f 'pmcisconames.c' || echo '$(srcdir)/'`pmcisconames.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmcisconames_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmcisconames_la-pmcisconames.lo `test -f 'pmcisconames.c' || echo '$(srcdir)/'`pmcisconames.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/pmcisconames/pmcisconames.c rsyslog-5.10.1/plugins/pmcisconames/pmcisconames.c --- rsyslog-7.6.0/plugins/pmcisconames/pmcisconames.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmcisconames/pmcisconames.c 2012-10-17 14:41:20.000000000 +0000 @@ -42,7 +42,6 @@ MODULE_TYPE_PARSER MODULE_TYPE_NOKEEP -MODULE_CNFNAME("pmcisconames") PARSER_NAME("rsyslog.cisconames") /* internal structures diff -Nru rsyslog-7.6.0/plugins/pmlastmsg/Makefile.in rsyslog-5.10.1/plugins/pmlastmsg/Makefile.in --- rsyslog-7.6.0/plugins/pmlastmsg/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmlastmsg/Makefile.in 2012-10-17 14:42:44.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) pmlastmsg_la_DEPENDENCIES = am_pmlastmsg_la_OBJECTS = pmlastmsg_la-pmlastmsg.lo pmlastmsg_la_OBJECTS = $(am_pmlastmsg_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent pmlastmsg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(pmlastmsg_la_SOURCES) DIST_SOURCES = $(pmlastmsg_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -pmlastmsg.la: $(pmlastmsg_la_OBJECTS) $(pmlastmsg_la_DEPENDENCIES) $(EXTRA_pmlastmsg_la_DEPENDENCIES) +pmlastmsg.la: $(pmlastmsg_la_OBJECTS) $(pmlastmsg_la_DEPENDENCIES) $(AM_V_CCLD)$(pmlastmsg_la_LINK) -rpath $(pkglibdir) $(pmlastmsg_la_OBJECTS) $(pmlastmsg_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pmlastmsg_la-pmlastmsg.lo: pmlastmsg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmlastmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmlastmsg_la-pmlastmsg.lo -MD -MP -MF $(DEPDIR)/pmlastmsg_la-pmlastmsg.Tpo -c -o pmlastmsg_la-pmlastmsg.lo `test -f 'pmlastmsg.c' || echo '$(srcdir)/'`pmlastmsg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pmlastmsg_la-pmlastmsg.Tpo $(DEPDIR)/pmlastmsg_la-pmlastmsg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmlastmsg.c' object='pmlastmsg_la-pmlastmsg.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmlastmsg.c' object='pmlastmsg_la-pmlastmsg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmlastmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmlastmsg_la-pmlastmsg.lo `test -f 'pmlastmsg.c' || echo '$(srcdir)/'`pmlastmsg.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmlastmsg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmlastmsg_la-pmlastmsg.lo `test -f 'pmlastmsg.c' || echo '$(srcdir)/'`pmlastmsg.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/pmlastmsg/pmlastmsg.c rsyslog-5.10.1/plugins/pmlastmsg/pmlastmsg.c --- rsyslog-7.6.0/plugins/pmlastmsg/pmlastmsg.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmlastmsg/pmlastmsg.c 2012-10-17 14:41:20.000000000 +0000 @@ -48,7 +48,6 @@ MODULE_TYPE_PARSER MODULE_TYPE_NOKEEP -MODULE_CNFNAME("pmlastmsg") PARSER_NAME("rsyslog.lastline") /* internal structures @@ -132,7 +131,7 @@ */ DBGPRINTF("pmlastmsg detected a \"last message repeated n times\" message\n"); - setProtocolVersion(pMsg, MSG_LEGACY_PROTOCOL); + setProtocolVersion(pMsg, 0); memcpy(&pMsg->tTIMESTAMP, &pMsg->tRcvdAt, sizeof(struct syslogTime)); MsgSetMSGoffs(pMsg, pMsg->offAfterPRI); /* we don't have a header! */ MsgSetTAG(pMsg, (uchar*)"", 0); diff -Nru rsyslog-7.6.0/plugins/pmrfc3164sd/Makefile.in rsyslog-5.10.1/plugins/pmrfc3164sd/Makefile.in --- rsyslog-7.6.0/plugins/pmrfc3164sd/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmrfc3164sd/Makefile.in 2012-10-17 14:42:44.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) pmrfc3164sd_la_DEPENDENCIES = am_pmrfc3164sd_la_OBJECTS = pmrfc3164sd_la-pmrfc3164sd.lo pmrfc3164sd_la_OBJECTS = $(am_pmrfc3164sd_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent pmrfc3164sd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(pmrfc3164sd_la_SOURCES) DIST_SOURCES = $(pmrfc3164sd_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -380,7 +336,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -pmrfc3164sd.la: $(pmrfc3164sd_la_OBJECTS) $(pmrfc3164sd_la_DEPENDENCIES) $(EXTRA_pmrfc3164sd_la_DEPENDENCIES) +pmrfc3164sd.la: $(pmrfc3164sd_la_OBJECTS) $(pmrfc3164sd_la_DEPENDENCIES) $(AM_V_CCLD)$(pmrfc3164sd_la_LINK) -rpath $(pkglibdir) $(pmrfc3164sd_la_OBJECTS) $(pmrfc3164sd_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -394,30 +350,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pmrfc3164sd_la-pmrfc3164sd.lo: pmrfc3164sd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmrfc3164sd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmrfc3164sd_la-pmrfc3164sd.lo -MD -MP -MF $(DEPDIR)/pmrfc3164sd_la-pmrfc3164sd.Tpo -c -o pmrfc3164sd_la-pmrfc3164sd.lo `test -f 'pmrfc3164sd.c' || echo '$(srcdir)/'`pmrfc3164sd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pmrfc3164sd_la-pmrfc3164sd.Tpo $(DEPDIR)/pmrfc3164sd_la-pmrfc3164sd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmrfc3164sd.c' object='pmrfc3164sd_la-pmrfc3164sd.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmrfc3164sd.c' object='pmrfc3164sd_la-pmrfc3164sd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmrfc3164sd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmrfc3164sd_la-pmrfc3164sd.lo `test -f 'pmrfc3164sd.c' || echo '$(srcdir)/'`pmrfc3164sd.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmrfc3164sd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmrfc3164sd_la-pmrfc3164sd.lo `test -f 'pmrfc3164sd.c' || echo '$(srcdir)/'`pmrfc3164sd.c mostlyclean-libtool: -rm -f *.lo @@ -524,15 +484,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/pmrfc3164sd/pmrfc3164sd.c rsyslog-5.10.1/plugins/pmrfc3164sd/pmrfc3164sd.c --- rsyslog-7.6.0/plugins/pmrfc3164sd/pmrfc3164sd.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmrfc3164sd/pmrfc3164sd.c 2012-10-17 14:41:20.000000000 +0000 @@ -46,7 +46,6 @@ MODULE_TYPE_PARSER MODULE_TYPE_NOKEEP -MODULE_CNFNAME("pmrfc3164sd") PARSER_NAME("contrib.rfc3164sd") /* internal structures @@ -177,7 +176,7 @@ assert(pMsg->pszRawMsg != NULL); lenMsg = pMsg->iLenRawMsg - pMsg->offAfterPRI; /* note: offAfterPRI is already the number of PRI chars (do not add one!) */ p2parse = pMsg->pszRawMsg + pMsg->offAfterPRI; /* point to start of text, after PRI */ - setProtocolVersion(pMsg, MSG_LEGACY_PROTOCOL); + setProtocolVersion(pMsg, 0); /* Check to see if msg contains a timestamp. We start by assuming * that the message timestamp is the time of reception (which we diff -Nru rsyslog-7.6.0/plugins/pmsnare/Makefile.in rsyslog-5.10.1/plugins/pmsnare/Makefile.in --- rsyslog-7.6.0/plugins/pmsnare/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmsnare/Makefile.in 2012-10-17 14:42:45.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) pmsnare_la_DEPENDENCIES = am_pmsnare_la_OBJECTS = pmsnare_la-pmsnare.lo pmsnare_la_OBJECTS = $(am_pmsnare_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent pmsnare_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -96,21 +90,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(pmsnare_la_SOURCES) DIST_SOURCES = $(pmsnare_la_SOURCES) @@ -133,11 +127,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -151,56 +142,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -208,8 +173,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -229,16 +192,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -250,14 +208,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -291,6 +246,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -pmsnare.la: $(pmsnare_la_OBJECTS) $(pmsnare_la_DEPENDENCIES) $(EXTRA_pmsnare_la_DEPENDENCIES) +pmsnare.la: $(pmsnare_la_OBJECTS) $(pmsnare_la_DEPENDENCIES) $(AM_V_CCLD)$(pmsnare_la_LINK) -rpath $(pkglibdir) $(pmsnare_la_OBJECTS) $(pmsnare_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< pmsnare_la-pmsnare.lo: pmsnare.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmsnare_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pmsnare_la-pmsnare.lo -MD -MP -MF $(DEPDIR)/pmsnare_la-pmsnare.Tpo -c -o pmsnare_la-pmsnare.lo `test -f 'pmsnare.c' || echo '$(srcdir)/'`pmsnare.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pmsnare_la-pmsnare.Tpo $(DEPDIR)/pmsnare_la-pmsnare.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmsnare.c' object='pmsnare_la-pmsnare.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmsnare.c' object='pmsnare_la-pmsnare.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmsnare_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmsnare_la-pmsnare.lo `test -f 'pmsnare.c' || echo '$(srcdir)/'`pmsnare.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pmsnare_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pmsnare_la-pmsnare.lo `test -f 'pmsnare.c' || echo '$(srcdir)/'`pmsnare.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/pmsnare/pmsnare.c rsyslog-5.10.1/plugins/pmsnare/pmsnare.c --- rsyslog-7.6.0/plugins/pmsnare/pmsnare.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/pmsnare/pmsnare.c 2012-10-17 14:41:20.000000000 +0000 @@ -59,7 +59,6 @@ MODULE_TYPE_PARSER MODULE_TYPE_NOKEEP -MODULE_CNFNAME("pmsnare") PARSER_NAME("rsyslog.snare") /* internal structures diff -Nru rsyslog-7.6.0/plugins/sm_cust_bindcdr/Makefile.in rsyslog-5.10.1/plugins/sm_cust_bindcdr/Makefile.in --- rsyslog-7.6.0/plugins/sm_cust_bindcdr/Makefile.in 2014-02-12 12:06:37.000000000 +0000 +++ rsyslog-5.10.1/plugins/sm_cust_bindcdr/Makefile.in 2012-10-17 14:42:45.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -69,19 +69,13 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(pkglib_LTLIBRARIES) sm_cust_bindcdr_la_DEPENDENCIES = am_sm_cust_bindcdr_la_OBJECTS = sm_cust_bindcdr_la-sm_cust_bindcdr.lo sm_cust_bindcdr_la_OBJECTS = $(am_sm_cust_bindcdr_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent sm_cust_bindcdr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -97,21 +91,21 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(sm_cust_bindcdr_la_SOURCES) DIST_SOURCES = $(sm_cust_bindcdr_la_SOURCES) @@ -134,11 +128,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -152,56 +143,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -209,8 +174,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -230,16 +193,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -251,14 +209,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -292,6 +247,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -379,7 +335,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -sm_cust_bindcdr.la: $(sm_cust_bindcdr_la_OBJECTS) $(sm_cust_bindcdr_la_DEPENDENCIES) $(EXTRA_sm_cust_bindcdr_la_DEPENDENCIES) +sm_cust_bindcdr.la: $(sm_cust_bindcdr_la_OBJECTS) $(sm_cust_bindcdr_la_DEPENDENCIES) $(AM_V_CCLD)$(sm_cust_bindcdr_la_LINK) -rpath $(pkglibdir) $(sm_cust_bindcdr_la_OBJECTS) $(sm_cust_bindcdr_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -393,30 +349,34 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< sm_cust_bindcdr_la-sm_cust_bindcdr.lo: sm_cust_bindcdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sm_cust_bindcdr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sm_cust_bindcdr_la-sm_cust_bindcdr.lo -MD -MP -MF $(DEPDIR)/sm_cust_bindcdr_la-sm_cust_bindcdr.Tpo -c -o sm_cust_bindcdr_la-sm_cust_bindcdr.lo `test -f 'sm_cust_bindcdr.c' || echo '$(srcdir)/'`sm_cust_bindcdr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sm_cust_bindcdr_la-sm_cust_bindcdr.Tpo $(DEPDIR)/sm_cust_bindcdr_la-sm_cust_bindcdr.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sm_cust_bindcdr.c' object='sm_cust_bindcdr_la-sm_cust_bindcdr.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sm_cust_bindcdr.c' object='sm_cust_bindcdr_la-sm_cust_bindcdr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sm_cust_bindcdr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sm_cust_bindcdr_la-sm_cust_bindcdr.lo `test -f 'sm_cust_bindcdr.c' || echo '$(srcdir)/'`sm_cust_bindcdr.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sm_cust_bindcdr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sm_cust_bindcdr_la-sm_cust_bindcdr.lo `test -f 'sm_cust_bindcdr.c' || echo '$(srcdir)/'`sm_cust_bindcdr.c mostlyclean-libtool: -rm -f *.lo @@ -523,15 +483,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: diff -Nru rsyslog-7.6.0/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c rsyslog-5.10.1/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c --- rsyslog-7.6.0/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/plugins/sm_cust_bindcdr/sm_cust_bindcdr.c 2012-10-17 14:41:20.000000000 +0000 @@ -52,7 +52,6 @@ MODULE_TYPE_STRGEN MODULE_TYPE_NOKEEP -MODULE_CNFNAME("sm_cust_bindcdr") STRGEN_NAME("Custom_BindCDR,sql") /* internal structures diff -Nru rsyslog-7.6.0/README rsyslog-5.10.1/README --- rsyslog-7.6.0/README 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/README 2012-09-25 15:33:56.000000000 +0000 @@ -1 +1,5 @@ -see README.md +This file has been superseeded by the files in the doc folder. +Please see doc/manual.html for futher details. If you are +looking for install information doc/install.html is for you! +If you do not have the doc set, see + http://www.rsyslog.com/doc diff -Nru rsyslog-7.6.0/rsyslog.conf rsyslog-5.10.1/rsyslog.conf --- rsyslog-7.6.0/rsyslog.conf 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/rsyslog.conf 2012-09-25 15:33:56.000000000 +0000 @@ -0,0 +1,60 @@ +# if you experience problems, check +# http://www.rsyslog.com/troubleshoot for assistance + +# rsyslog v3: load input modules +# If you do not load inputs, nothing happens! +# You may need to set the module load path if modules are not found. + +$ModLoad immark # provides --MARK-- message capability +$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) +$ModLoad imklog # kernel logging (formerly provided by rklogd) + +# Log all kernel messages to the console. +# Logging much else clutters up the screen. +#kern.* /dev/console + +# Log anything (except mail) of level info or higher. +# Don't log private authentication messages! +*.info;mail.none;authpriv.none;cron.none -/var/log/messages + +# The authpriv file has restricted access. +authpriv.* /var/log/secure + +# Log all the mail messages in one place. +mail.* -/var/log/maillog + + +# Log cron stuff +cron.* -/var/log/cron + +# Everybody gets emergency messages +*.emerg * + +# Save news errors of level crit and higher in a special file. +uucp,news.crit -/var/log/spooler + +# Save boot messages also to boot.log +local7.* /var/log/boot.log + +# Remote Logging (we use TCP for reliable delivery) +# An on-disk queue is created for this action. If the remote host is +# down, messages are spooled to disk and sent when it is up again. +#$WorkDirectory /rsyslog/spool # where to place spool files +#$ActionQueueFileName uniqName # unique name prefix for spool files +#$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) +#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown +#$ActionQueueType LinkedList # run asynchronously +#$ActionResumeRetryCount -1 # infinite retries if host is down +# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional +#*.* @@remote-host:514 + + +# ######### Receiving Messages from Remote Hosts ########## +# TCP Syslog Server: +# provides TCP syslog reception and GSS-API (if compiled to support it) +#$ModLoad imtcp.so # load module +#$InputTCPServerRun 514 # start up TCP listener at port 514 + +# UDP Syslog Server: +#$ModLoad imudp.so # provides UDP syslog reception +#$UDPServerRun 514 # start a UDP syslog server at standard port 514 diff -Nru rsyslog-7.6.0/rsyslog.service.in rsyslog-5.10.1/rsyslog.service.in --- rsyslog-7.6.0/rsyslog.service.in 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/rsyslog.service.in 2012-10-17 14:41:20.000000000 +0000 @@ -1,10 +1,10 @@ [Unit] Description=System Logging Service -Requires=syslog.socket [Service] -Type=notify -ExecStart=@sbindir@/rsyslogd -n +ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service +ExecStart=@sbindir@/rsyslogd -n -c5 +Sockets=syslog.socket StandardOutput=null [Install] diff -Nru rsyslog-7.6.0/runtime/apc.c rsyslog-5.10.1/runtime/apc.c --- rsyslog-7.6.0/runtime/apc.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/apc.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,402 @@ +/* apc.c - asynchronous procedure call support + * + * An asynchronous procedure call (APC) is a procedure call (guess what) that is potentially run + * asynchronously to its main thread. It can be scheduled to occur at a caller-provided time. + * As long as the procedure has not been called, the APC entry may be modified by the caller + * or deleted. It is the caller's purpose to make sure proper synchronization is in place. + * The APC object only case about APC's own control structures (which *are* properly + * guarded by synchronization primitives). + * + * Module begun 2009-06-15 by Rainer Gerhards + * + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * The rsyslog runtime library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The rsyslog runtime library 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the rsyslog runtime library. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. + */ + +#include "config.h" +#include +#include +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "apc.h" +#include "srUtils.h" +#include "datetime.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(datetime) + +/* following is a used to implement a monotonically increasing id for the apcs. That + * ID can be used to cancel an apc request. Note that the ID is generated with modulo + * arithmetic, so at some point, it will wrap. Howerver, this happens at 2^32-1 at + * earliest, so this is not considered a problem. + */ +apc_id_t apcID = 0; + +/* private data structures */ + +/* the apc list and its entries + * This is a doubly-linked list as we need to be able to do inserts + * and deletes right in the middle of the list. It is inspired by the + * Unix callout mechanism. + * Note that we support two generic caller-provided parameters as + * experience shows that at most two are often used. This causes very + * little overhead, but simplifies caller code in cases where exactly + * two parameters are needed. We hope this is a useful optimizaton. + * rgerhards, 2009-06-15 + */ +typedef struct apc_list_s { + struct apc_list_s *pNext; + struct apc_list_s *pPrev; + apc_id_t id; + apc_t *pApc; /* pointer to the APC object to be scheduled */ +} apc_list_t; + +apc_list_t *apcListRoot = NULL; +apc_list_t *apcListTail = NULL; +pthread_mutex_t listMutex; /* needs to be locked for all list operations */ + + +/* destructor for the apc object */ +BEGINobjDestruct(apc) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(apc) +ENDobjDestruct(apc) + + +/* ------------------------------ APC list handling functions ------------------------------ */ + +/* Function that handles changes to the list root. Most importantly, this function + * needs to schedule a new timer. It is OK to call this function with an empty list. + */ +static rsRetVal +listRootChanged(void) +{ + DEFiRet; + + if(apcListRoot == NULL) + FINALIZE; + + // TODO: implement! + +finalize_it: + RETiRet; +} + + +/* insert an apc entry into the APC list. The same entry MUST NOT already be present! + */ +static rsRetVal +insertApc(apc_t *pThis, apc_id_t *pID) +{ + apc_list_t *pCurr; + apc_list_t *pNew; + DEFiRet; + + CHKmalloc(pNew = (apc_list_t*) calloc(1, sizeof(apc_list_t))); + pNew->pApc = pThis; + pNew->id = *pID = apcID++; +dbgprintf("insert apc %p, id %ld\n", pThis, pNew->id); + + /* find right list location */ + if(apcListRoot == NULL) { + /* no need to search, list is empty */ + apcListRoot = pNew; + apcListTail = pNew; + CHKiRet(listRootChanged()); + } else { + for(pCurr = apcListRoot ; pCurr != NULL ; pCurr = pCurr->pNext) { + if(pCurr->pApc->ttExec > pThis->ttExec) + break; + } + + if(pCurr == NULL) { + /* insert at tail */ + pNew->pPrev = apcListTail; + apcListTail->pNext = pNew; + apcListTail = pNew; + } else { + if(pCurr == apcListRoot) { + /* new first entry */ + pCurr->pPrev = pNew; + pNew->pNext = pCurr; + apcListRoot = pNew; + CHKiRet(listRootChanged()); + } else { + /* in the middle of the list */ + pCurr->pPrev = pNew; + pNew->pNext = pCurr; + } + } + } + + +finalize_it: + RETiRet; +} + + +/* Delete an apc entry from the APC list. It is OK if the entry is not found, + * in this case we assume it already has been processed. + */ +static rsRetVal +deleteApc(apc_id_t id) +{ + apc_list_t *pCurr; + DEFiRet; + +dbgprintf("trying to delete apc %ld\n", id); + for(pCurr = apcListRoot ; pCurr != NULL ; pCurr = pCurr->pNext) { + if(pCurr->id == id) { +RUNLOG_STR("apc id found, now deleting!\n"); + if(pCurr == apcListRoot) { + apcListRoot = pCurr->pNext; + CHKiRet(listRootChanged()); + } else { + pCurr->pPrev->pNext = pCurr->pNext; + } + if(pCurr->pNext == NULL) { + apcListTail = pCurr->pPrev; + } else { + pCurr->pNext->pPrev = pCurr->pPrev; + } + free(pCurr); + pCurr = NULL; + break; + } + } + +finalize_it: + RETiRet; +} + + +/* unlist all elements up to the current timestamp. Return this as a seperate list + * to the caller. Returns an empty (NULL ptr) list if there are no such elements. + * The caller must handle that gracefully. The list is returned in the parameter. + */ +static rsRetVal +unlistCurrent(apc_list_t **ppList) +{ + apc_list_t *pCurr; + time_t tCurr; + DEFiRet; + assert(ppList != NULL); + + datetime.GetTime(&tCurr); + + if(apcListRoot == NULL || apcListRoot->pApc->ttExec > tCurr) { + *ppList = NULL; + FINALIZE; + } + + *ppList = apcListRoot; + /* now search up to which entry we need to execute */ + for(pCurr = apcListRoot ; pCurr != NULL && pCurr->pApc->ttExec <= tCurr ; pCurr = pCurr->pNext) { + /*JUST SKIP TO LAST ELEMENT*/; + } + + if(pCurr == NULL) { + /* all elements can be unlisted */ + apcListRoot = NULL; + apcListTail = NULL; + } else { + /* need to set a new root */ + pCurr->pPrev->pNext = NULL; /* terminate newly unlisted list */ + pCurr->pPrev = NULL; /* we are the new root */ + apcListRoot = pCurr; + } + +finalize_it: + RETiRet; +} + + +/* ------------------------------ END APC list handling functions ------------------------------ */ + + +/* execute all list elements that are currently scheduled for execution. We do this in two phases. + * In the first phase, we look the list mutex and move everything from the head of the queue to + * the current timestamp to a new to-be-executed list. Then we unlock the mutex and do the actual + * exec (which may take some time). + * Note that the caller is responsible for proper + * caller-level synchronization. The caller may schedule another Apc, this module must + * ensure that (and it does so by not locking the list mutex while we call the Apc). + * Note: this function "consumes" the apc_t, so it is no longer existing after this + * function returns. + */ +// TODO make static and associated with our own pthread-based timer +rsRetVal +execScheduled(void) +{ + apc_list_t *pExecList; + apc_list_t *pCurr; + apc_list_t *pNext; + DEFiRet; + + d_pthread_mutex_lock(&listMutex); + iRet = unlistCurrent(&pExecList); + d_pthread_mutex_unlock(&listMutex); + CHKiRet(iRet); + + if(pExecList != NULL) { + DBGPRINTF("running apc scheduler - we have %s to execute\n", + pExecList == NULL ? "nothing" : "something"); + } + + for(pCurr = pExecList ; pCurr != NULL ; pCurr = pNext) { +dbgprintf("executing apc list entry %p, apc %p\n", pCurr, pCurr->pApc); + pNext = pCurr->pNext; + pCurr->pApc->pProc(pCurr->pApc->param1, pCurr->pApc->param2); + apcDestruct(&pCurr->pApc); + free(pCurr); + } + +finalize_it: + RETiRet; +} + + +/* Standard-Constructor + */ +BEGINobjConstruct(apc) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(apc) + + +/* ConstructionFinalizer + * Note that we use a non-standard calling interface: pID returns the current APC + * id. This is the only way to handle the situation without the need for extra + * locking. + * rgerhards, 2008-01-09 + */ +static rsRetVal +apcConstructFinalize(apc_t *pThis, apc_id_t *pID) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, apc); + assert(pID != NULL); + d_pthread_mutex_lock(&listMutex); + insertApc(pThis, pID); + d_pthread_mutex_unlock(&listMutex); + RETiRet; +} + + +/* some set methods */ +static rsRetVal +SetProcedure(apc_t *pThis, void (*pProc)(void*, void*)) +{ + ISOBJ_TYPE_assert(pThis, apc); + pThis->pProc = pProc; + return RS_RET_OK; +} +static rsRetVal +SetParam1(apc_t *pThis, void *param1) +{ + ISOBJ_TYPE_assert(pThis, apc); + pThis->param1 = param1; + return RS_RET_OK; +} +static rsRetVal +SetParam2(apc_t *pThis, void *param2) +{ + ISOBJ_TYPE_assert(pThis, apc); + pThis->param1 = param2; + return RS_RET_OK; +} + + +/* cancel an Apc request, ID is provided. It is OK if the ID can not be found, this may + * happen if the Apc was executed in the mean time. So it is safe to call CancelApc() at + * any time. + */ +static rsRetVal +CancelApc(apc_id_t id) +{ + BEGINfunc + d_pthread_mutex_lock(&listMutex); + deleteApc(id); + d_pthread_mutex_unlock(&listMutex); + ENDfunc + return RS_RET_OK; +} + + +/* debugprint for the apc object */ +BEGINobjDebugPrint(apc) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDebugPrint(apc) + dbgoprint((obj_t*) pThis, "APC module, currently no state info available\n"); +ENDobjDebugPrint(apc) + + +/* queryInterface function + */ +BEGINobjQueryInterface(apc) +CODESTARTobjQueryInterface(apc) + if(pIf->ifVersion != apcCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = apcConstruct; + pIf->ConstructFinalize = apcConstructFinalize; + pIf->Destruct = apcDestruct; + pIf->DebugPrint = apcDebugPrint; + pIf->CancelApc = CancelApc; + pIf->SetProcedure = SetProcedure; + pIf->SetParam1 = SetParam1; + pIf->SetParam2 = SetParam2; +finalize_it: +ENDobjQueryInterface(apc) + + +/* Exit the apc class. + * rgerhards, 2009-04-06 + */ +BEGINObjClassExit(apc, OBJ_IS_CORE_MODULE) /* class, version */ + objRelease(datetime, CORE_COMPONENT); + pthread_mutex_destroy(&listMutex); +ENDObjClassExit(apc) + + +/* Initialize the apc class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(apc, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(datetime, CORE_COMPONENT)); + + /* set our own handlers */ + OBJSetMethodHandler(objMethod_DEBUGPRINT, apcDebugPrint); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, apcConstructFinalize); + + /* do other initializations */ + pthread_mutex_init(&listMutex, NULL); +ENDObjClassInit(apc) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/apc.h rsyslog-5.10.1/runtime/apc.h --- rsyslog-7.6.0/runtime/apc.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/apc.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,56 @@ +/* The apc object. + * + * See apc.c for more information. + * + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * The rsyslog runtime library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The rsyslog runtime library 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the rsyslog runtime library. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. + */ +#ifndef INCLUDED_APC_H +#define INCLUDED_APC_H + +/* the apc object */ +typedef struct apc_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + time_t ttExec; /* when to call procedure (so far seconds...) */ + void (*pProc)(void*, void*); /* which procedure to call */ + void *param1; /* user-supplied parameters */ + void *param2; /* user-supplied parameters */ +} apc_t; + +typedef unsigned long apc_id_t; /* monotonically incrementing apc ID */ + +/* interfaces */ +BEGINinterface(apc) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(apc); + rsRetVal (*Construct)(apc_t **ppThis); + rsRetVal (*ConstructFinalize)(apc_t *pThis, apc_id_t *); + rsRetVal (*Destruct)(apc_t **ppThis); + rsRetVal (*SetProcedure)(apc_t *pThis, void (*pProc)(void*, void*)); + rsRetVal (*SetParam1)(apc_t *pThis, void *); + rsRetVal (*SetParam2)(apc_t *pThis, void *); + rsRetVal (*CancelApc)(apc_id_t); +ENDinterface(apc) +#define apcCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(apc); + +#endif /* #ifndef INCLUDED_APC_H */ diff -Nru rsyslog-7.6.0/runtime/batch.h rsyslog-5.10.1/runtime/batch.h --- rsyslog-7.6.0/runtime/batch.h 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/batch.h 2012-10-17 14:41:20.000000000 +0000 @@ -34,21 +34,24 @@ * main message queue. But over time, it could potentially be useful to split the two. * rgerhad, 2009-05-12 */ -#define BATCH_STATE_RDY 0 /* object ready for processing */ -#define BATCH_STATE_BAD 1 /* unrecoverable failure while processing, do NOT resubmit to same action */ -#define BATCH_STATE_SUB 2 /* message submitted for processing, outcome yet unknown */ -#define BATCH_STATE_COMM 3 /* message successfully commited */ -#define BATCH_STATE_DISC 4 /* discarded - processed OK, but do not submit to any other action */ -typedef unsigned char batch_state_t; +typedef enum { + BATCH_STATE_RDY = 0, /* object ready for processing */ + BATCH_STATE_BAD = 1, /* unrecoverable failure while processing, do NOT resubmit to same action */ + BATCH_STATE_SUB = 2, /* message submitted for processing, outcome yet unknown */ + BATCH_STATE_COMM = 3, /* message successfully commited */ + BATCH_STATE_DISC = 4, /* discarded - processed OK, but do not submit to any other action */ +} batch_state_t; /* an object inside a batch, including any information (state!) needed for it to "life". */ struct batch_obj_s { - msg_t *pMsg; + obj_t *pUsrp; /* pointer to user object (most often message) */ + batch_state_t state; /* associated state */ /* work variables for action processing; these are reused for each action (or block of * actions) */ + sbool bFilterOK; /* work area for filter processing (per action, reused!) */ sbool bPrevWasSuspended; /* following are caches to save allocs if not absolutely necessary */ uchar *staticActStrings[CONF_OMOD_NUMSTRINGS_MAXSIZE]; /**< for strings */ @@ -80,16 +83,8 @@ int iDoneUpTo; /* all messages below this index have state other than RDY */ qDeqID deqID; /* ID of dequeue operation that generated this batch */ int *pbShutdownImmediate;/* end processing of this batch immediately if set to 1 */ - sbool *active; /* which messages are active for processing, NULL=all */ sbool bSingleRuleset; /* do all msgs of this batch use a single ruleset? */ batch_obj_t *pElem; /* batch elements */ - batch_state_t *eltState;/* state (array!) for individual objects. - NOTE: we have moved this out of batch_obj_t because we - get a *much* better cache hit ratio this way. So do not - move it back into this structure! Note that this is really - a HUGE saving, even if it doesn't look so (both profiler - data as well as practical tests indicate that!). - */ }; @@ -102,13 +97,13 @@ /* get the batches ruleset (if we have a single ruleset) */ static inline ruleset_t* batchGetRuleset(batch_t *pBatch) { - return (pBatch->nElem > 0) ? pBatch->pElem[0].pMsg->pRuleset : NULL; + return (pBatch->nElem > 0) ? ((msg_t*) pBatch->pElem[0].pUsrp)->pRuleset : NULL; } /* get the ruleset of a specifc element of the batch (index not verified!) */ static inline ruleset_t* batchElemGetRuleset(batch_t *pBatch, int i) { - return pBatch->pElem[i].pMsg->pRuleset; + return ((msg_t*) pBatch->pElem[i].pUsrp)->pRuleset; } /* get number of msgs for this batch */ @@ -124,8 +119,8 @@ */ static inline void batchSetElemState(batch_t *pBatch, int i, batch_state_t newState) { - if(pBatch->eltState[i] != BATCH_STATE_DISC) - pBatch->eltState[i] = newState; + if(pBatch->pElem[i].state != BATCH_STATE_DISC) + pBatch->pElem[i].state = newState; } @@ -134,8 +129,23 @@ */ static inline int batchIsValidElem(batch_t *pBatch, int i) { - return( (pBatch->eltState[i] != BATCH_STATE_DISC) - && (pBatch->active == NULL || pBatch->active[i])); + return(pBatch->pElem[i].bFilterOK && pBatch->pElem[i].state != BATCH_STATE_DISC); +} + + +/* copy one batch element to another. + * This creates a complete duplicate in those cases where + * it is needed. Use duplication only when absolutely necessary! + * Note that all working fields are reset to zeros. If that were + * not done, we would have potential problems with invalid + * or double pointer frees. + * rgerhards, 2010-06-10 + */ +static inline void +batchCopyElem(batch_obj_t *pDest, batch_obj_t *pSrc) { + memset(pDest, 0, sizeof(batch_obj_t)); + pDest->pUsrp = pSrc->pUsrp; + pDest->state = pSrc->state; } @@ -156,7 +166,6 @@ } } free(pBatch->pElem); - free(pBatch->eltState); } @@ -170,7 +179,6 @@ pBatch->iDoneUpTo = 0; pBatch->maxElem = maxElem; CHKmalloc(pBatch->pElem = calloc((size_t)maxElem, sizeof(batch_obj_t))); - CHKmalloc(pBatch->eltState = calloc((size_t)maxElem, sizeof(batch_state_t))); // TODO: replace calloc by inidividual writes? finalize_it: RETiRet; diff -Nru rsyslog-7.6.0/runtime/cfsysline.c rsyslog-5.10.1/runtime/cfsysline.c --- rsyslog-7.6.0/runtime/cfsysline.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/cfsysline.c 2012-10-17 14:41:20.000000000 +0000 @@ -37,7 +37,6 @@ #include "cfsysline.h" #include "obj.h" -#include "conf.h" #include "errmsg.h" #include "srUtils.h" #include "unicode-helper.h" @@ -350,9 +349,8 @@ struct group gBuf; DEFiRet; uchar szName[256]; - int bufSize = 1024; + int bufSize = 2048; char * stringBuf = NULL; - int err; assert(pp != NULL); assert(*pp != NULL); @@ -362,21 +360,20 @@ ABORT_FINALIZE(RS_RET_NOT_FOUND); } - do { - /* Increase bufsize and try again.*/ - bufSize *= 2; - CHKmalloc(stringBuf = realloc(stringBuf, bufSize)); - err = getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf); - } while((pgBuf == NULL) && (err == ERANGE)); - if(pgBuf == NULL) { - if (err != 0) { - rs_strerror_r(err, stringBuf, bufSize); - errmsg.LogError(0, RS_RET_NOT_FOUND, "Query for group '%s' resulted in an error: %s\n", - (char*)szName, stringBuf); - } else { - errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found", (char*)szName); + CHKmalloc(stringBuf = malloc(bufSize)); + while(pgBuf == NULL) { + errno = 0; + getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf); + if((pgBuf == NULL) && (errno == ERANGE)) { + /* Increase bufsize and try again.*/ + bufSize *= 2; + CHKmalloc(stringBuf = realloc(stringBuf, bufSize)); } + } + + if(pgBuf == NULL) { + errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found or error", (char*)szName); iRet = RS_RET_NOT_FOUND; } else { if(pSetHdlr == NULL) { @@ -563,8 +560,7 @@ * time (TODO). -- rgerhards, 2008-02-14 */ static rsRetVal -doSyslogName(uchar **pp, rsRetVal (*pSetHdlr)(void*, int), - void *pVal, syslogName_t *pNameTable) +doSyslogName(uchar **pp, rsRetVal (*pSetHdlr)(void*, int), void *pVal, syslogName_t *pNameTable) { DEFiRet; cstr_t *pStrB; @@ -606,15 +602,6 @@ } -static rsRetVal -doGoneAway(__attribute__((unused)) uchar **pp, - __attribute__((unused)) rsRetVal (*pSetHdlr)(void*, int), - __attribute__((unused)) void *pVal) -{ - errmsg.LogError(0, RS_RET_CMD_GONE_AWAY, "config directive is no longer supported -- ignored"); - return RS_RET_CMD_GONE_AWAY; -} - /* Implements the severity syntax. * rgerhards, 2008-02-14 */ @@ -688,7 +675,7 @@ /* set data members for this object */ -rsRetVal cslchSetEntry(cslCmdHdlr_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, int *permitted) +rsRetVal cslchSetEntry(cslCmdHdlr_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData) { assert(pThis != NULL); assert(eType != eCmdHdlrInvalid); @@ -696,7 +683,6 @@ pThis->eType = eType; pThis->cslCmdHdlr = pHdlr; pThis->pData = pData; - pThis->permitted = permitted; return RS_RET_OK; } @@ -745,9 +731,6 @@ case eCmdHdlrGetWord: pHdlr = doGetWord; break; - case eCmdHdlrGoneAway: - pHdlr = doGoneAway; - break; default: iRet = RS_RET_NOT_IMPLEMENTED; goto finalize_it; @@ -813,7 +796,7 @@ /* add a handler entry to a known command */ -static rsRetVal cslcAddHdlr(cslCmd_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie, int *permitted) +static rsRetVal cslcAddHdlr(cslCmd_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie) { DEFiRet; cslCmdHdlr_t *pCmdHdlr = NULL; @@ -821,7 +804,7 @@ assert(pThis != NULL); CHKiRet(cslchConstruct(&pCmdHdlr)); - CHKiRet(cslchSetEntry(pCmdHdlr, eType, pHdlr, pData, permitted)); + CHKiRet(cslchSetEntry(pCmdHdlr, eType, pHdlr, pData)); CHKiRet(llAppend(&pThis->llCmdHdlrs, pOwnerCookie, pCmdHdlr)); finalize_it: @@ -839,16 +822,9 @@ * buffer is automatically destroyed when the element is freed, the * caller does not need to take care of that. The caller must, however, * free pCmdName if he allocated it dynamically! -- rgerhards, 2007-08-09 - * Parameter permitted has been added to support the v2 config system. With it, - * we can tell the legacy system (us here!) to check if a config directive is - * still permitted. For example, the v2 system will disable module global - * paramters if the are supplied via the native v2 callbacks. In order not - * to break exisiting modules, we have renamed the rgCfSysLinHdlr routine to - * version 2 and added a new one with the original name. It just calls the - * v2 function and supplies a "don't care (NULL)" pointer as this argument. - * rgerhards, 2012-06-26 */ -rsRetVal regCfSysLineHdlr2(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie, int *permitted) +rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, + void *pOwnerCookie) { DEFiRet; cslCmd_t *pThis; @@ -858,7 +834,7 @@ if(iRet == RS_RET_NOT_FOUND) { /* new command */ CHKiRet(cslcConstruct(&pThis, bChainingPermitted)); - CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie, permitted)) { + CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie)) { cslcDestruct(pThis); FINALIZE; } @@ -878,7 +854,7 @@ if(pThis->bChainingPermitted == 0 || bChainingPermitted == 0) { ABORT_FINALIZE(RS_RET_CHAIN_NOT_PERMITTED); } - CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie, permitted)) { + CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie)) { cslcDestruct(pThis); FINALIZE; } @@ -888,13 +864,6 @@ RETiRet; } -rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie) -{ - DEFiRet; - iRet = regCfSysLineHdlr2(pCmdName, bChainingPermitted, eType, pHdlr, pData, pOwnerCookie, NULL); - RETiRet; -} - rsRetVal unregCfSysLineHdlrs(void) { @@ -960,13 +929,11 @@ uchar *pHdlrP; /* the handler's private p (else we could only call one handler) */ int bWasOnceOK; /* was the result of an handler at least once RS_RET_OK? */ uchar *pOKp = NULL; /* returned conf line pointer when it was OK */ - int bHadScopingErr = 0; /* set if a scoping error occured */ iRet = llFind(&llCmdList, (void *) pCmdName, (void*) &pCmd); if(iRet == RS_RET_NOT_FOUND) { - errmsg.LogError(0, RS_RET_NOT_FOUND, "invalid or yet-unknown config file command '%s' - " - "have you forgotten to load a module?", pCmdName); + errmsg.LogError(0, RS_RET_NOT_FOUND, "invalid or yet-unknown config file command - have you forgotten to load a module?"); } if(iRet != RS_RET_OK) @@ -979,16 +946,11 @@ * reason is that handlers are independent. An error in one * handler does not necessarily mean that another one will * fail, too. Later, we might add a config variable to control - * this behaviour (but I am not sure if that is really + * this behaviour (but I am not sure if that is rally * necessary). -- rgerhards, 2007-07-31 */ pHdlrP = *p; - if(pCmdHdlr->permitted != NULL && !*(pCmdHdlr->permitted)) { - errmsg.LogError(0, RS_RET_PARAM_NOT_PERMITTED, "command '%s' is currently not " - "permitted - did you already set it via a RainerScript command (v6+ config)?", - pCmdName); - ABORT_FINALIZE(RS_RET_PARAM_NOT_PERMITTED); - } else if((iRet = cslchCallHdlr(pCmdHdlr, &pHdlrP)) == RS_RET_OK) { + if((iRet = cslchCallHdlr(pCmdHdlr, &pHdlrP)) == RS_RET_OK) { bWasOnceOK = 1; pOKp = pHdlrP; } @@ -1002,10 +964,6 @@ if(iRetLL != RS_RET_END_OF_LINKEDLIST) iRet = iRetLL; - if(bHadScopingErr) { - iRet = RS_RET_CONF_INVLD_SCOPE; - } - finalize_it: RETiRet; } diff -Nru rsyslog-7.6.0/runtime/cfsysline.h rsyslog-5.10.1/runtime/cfsysline.h --- rsyslog-7.6.0/runtime/cfsysline.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/cfsysline.h 2012-10-17 14:41:20.000000000 +0000 @@ -24,16 +24,31 @@ #include "linkedlist.h" +/* types of configuration handlers + */ +typedef enum cslCmdHdlrType { + eCmdHdlrInvalid = 0, /* invalid handler type - indicates a coding error */ + eCmdHdlrCustomHandler, /* custom handler, just call handler function */ + eCmdHdlrUID, + eCmdHdlrGID, + eCmdHdlrBinary, + eCmdHdlrFileCreateMode, + eCmdHdlrInt, + eCmdHdlrSize, + eCmdHdlrGetChar, + eCmdHdlrFacility, + eCmdHdlrSeverity, + eCmdHdlrGetWord +} ecslCmdHdrlType; + /* this is a single entry for a parse routine. It describes exactly * one entry point/handler. * The short name is cslch (Configfile SysLine CommandHandler) */ struct cslCmdHdlr_s { /* config file sysline parse entry */ - ecslConfObjType __attribute__((deprecated)) eConfObjType; /* which config object is this for? */ ecslCmdHdrlType eType; /* which type of handler is this? */ rsRetVal (*cslCmdHdlr)(); /* function pointer to use with handler (params depending on eType) */ void *pData; /* user-supplied data pointer */ - int *permitted; /* is this parameter currently permitted? (NULL=don't check) */ }; typedef struct cslCmdHdlr_s cslCmdHdlr_t; @@ -50,7 +65,6 @@ /* prototypes */ rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie); -rsRetVal regCfSysLineHdlr2(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie, int *permitted); rsRetVal unregCfSysLineHdlrs(void); rsRetVal unregCfSysLineHdlrs4Owner(void *pOwnerCookie); rsRetVal processCfSysLineCommand(uchar *pCmd, uchar **p); diff -Nru rsyslog-7.6.0/runtime/conf.c rsyslog-5.10.1/runtime/conf.c --- rsyslog-7.6.0/runtime/conf.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/conf.c 2012-10-17 14:41:20.000000000 +0000 @@ -48,6 +48,7 @@ #endif #include "rsyslog.h" +#include "../tools/syslogd.h" /* TODO: this must be removed! */ #include "dirty.h" #include "parse.h" #include "action.h" @@ -61,27 +62,34 @@ #include "srUtils.h" #include "errmsg.h" #include "net.h" +#include "expr.h" +#include "ctok.h" +#include "ctok_token.h" +#include "rule.h" #include "ruleset.h" -#include "rsconf.h" #include "unicode-helper.h" -#include "rainerscript.h" #ifdef OS_SOLARIS # define NAME_MAX MAXNAMELEN #endif /* forward definitions */ +static rsRetVal cfline(uchar *line, rule_t **pfCurr); +static rsRetVal processConfFile(uchar *pConfFile); /* static data */ DEFobjStaticHelpers +DEFobjCurrIf(expr) +DEFobjCurrIf(ctok) +DEFobjCurrIf(ctok_token) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) +DEFobjCurrIf(rule) DEFobjCurrIf(ruleset) -int bConfStrictScoping = 0; /* force strict scoping during config processing? */ - +static int iNbrActions = 0; /* number of currently defined actions */ /* The following module-global variables are used for building * tag and host selector lines during startup and config reload. @@ -90,12 +98,153 @@ * be run in a single thread anyways. So there can be no race conditions. * rgerhards 2005-10-18 */ -EHostnameCmpMode eDfltHostnameCmpMode = HN_NO_COMP; -cstr_t *pDfltHostnameCmp = NULL; -cstr_t *pDfltProgNameCmp = NULL; +static EHostnameCmpMode eDfltHostnameCmpMode = HN_NO_COMP; +static cstr_t *pDfltHostnameCmp = NULL; +static cstr_t *pDfltProgNameCmp = NULL; + + +/* process a directory and include all of its files into + * the current config file. There is no specific order of inclusion, + * files are included in the order they are read from the directory. + * The caller must have make sure that the provided parameter is + * indeed a directory. + * rgerhards, 2007-08-01 + */ +static rsRetVal doIncludeDirectory(uchar *pDirName) +{ + DEFiRet; + int iEntriesDone = 0; + DIR *pDir; + union { + struct dirent d; + char b[offsetof(struct dirent, d_name) + NAME_MAX + 1]; + } u; + struct dirent *res; + size_t iDirNameLen; + size_t iFileNameLen; + uchar szFullFileName[MAXFNAME]; + + ASSERT(pDirName != NULL); + + if((pDir = opendir((char*) pDirName)) == NULL) { + errmsg.LogError(errno, RS_RET_FOPEN_FAILURE, "error opening include directory"); + ABORT_FINALIZE(RS_RET_FOPEN_FAILURE); + } + + /* prepare file name buffer */ + iDirNameLen = strlen((char*) pDirName); + memcpy(szFullFileName, pDirName, iDirNameLen); + + /* now read the directory */ + iEntriesDone = 0; + while(readdir_r(pDir, &u.d, &res) == 0) { + if(res == NULL) + break; /* this also indicates end of directory */ +# ifdef DT_REG + /* TODO: find an alternate way to checking for special files if this is + * not defined. This is currently a known problem on HP UX, but the work- + * around is simple: do not create special files in that directory. So + * fixing this is actually not the most important thing on earth... + * rgerhards, 2008-03-04 + */ + if(res->d_type != DT_REG) + continue; /* we are not interested in special files */ +# endif + if(res->d_name[0] == '.') + continue; /* these files we are also not interested in */ + ++iEntriesDone; + /* construct filename */ + iFileNameLen = strlen(res->d_name); + if (iFileNameLen > NAME_MAX) + iFileNameLen = NAME_MAX; + memcpy(szFullFileName + iDirNameLen, res->d_name, iFileNameLen); + *(szFullFileName + iDirNameLen + iFileNameLen) = '\0'; + dbgprintf("including file '%s'\n", szFullFileName); + processConfFile(szFullFileName); + /* we deliberately ignore the iRet of processConfFile() - this is because + * failure to process one file does not mean all files will fail. By ignoring, + * we retry with the next file, which is the best thing we can do. -- rgerhards, 2007-08-01 + */ + } + + if(iEntriesDone == 0) { + /* I just make it a debug output, because I can think of a lot of cases where it + * makes sense not to have any files. E.g. a system maintainer may place a $Include + * into the config file just in case, when additional modules be installed. When none + * are installed, the directory will be empty, which is fine. -- rgerhards 2007-08-01 + */ + dbgprintf("warning: the include directory contained no files - this may be ok.\n"); + } + +finalize_it: + if(pDir != NULL) + closedir(pDir); + + RETiRet; +} + + +/* process a $include config line. That type of line requires + * inclusion of another file. + * rgerhards, 2007-08-01 + */ +rsRetVal +doIncludeLine(uchar **pp, __attribute__((unused)) void* pVal) +{ + DEFiRet; + char pattern[MAXFNAME]; + uchar *cfgFile; + glob_t cfgFiles; + int result; + size_t i = 0; + struct stat fileInfo; + + ASSERT(pp != NULL); + ASSERT(*pp != NULL); + + if(getSubString(pp, (char*) pattern, sizeof(pattern) / sizeof(char), ' ') != 0) { + errmsg.LogError(0, RS_RET_NOT_FOUND, "could not parse config file name"); + ABORT_FINALIZE(RS_RET_NOT_FOUND); + } + + /* Use GLOB_MARK to append a trailing slash for directories. + * Required by doIncludeDirectory(). + */ + result = glob(pattern, GLOB_MARK, NULL, &cfgFiles); + if(result == GLOB_NOSPACE || result == GLOB_ABORTED) { + char errStr[1024]; + rs_strerror_r(errno, errStr, sizeof(errStr)); + errmsg.LogError(0, RS_RET_FILE_NOT_FOUND, "error accessing config file or directory '%s': %s", + pattern, errStr); + ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); + } + for(i = 0; i < cfgFiles.gl_pathc; i++) { + cfgFile = (uchar*) cfgFiles.gl_pathv[i]; -/* process a $ModLoad config line. */ + if(stat((char*) cfgFile, &fileInfo) != 0) + continue; /* continue with the next file if we can't stat() the file */ + + if(S_ISREG(fileInfo.st_mode)) { /* config file */ + dbgprintf("requested to include config file '%s'\n", cfgFile); + iRet = processConfFile(cfgFile); + } else if(S_ISDIR(fileInfo.st_mode)) { /* config directory */ + dbgprintf("requested to include directory '%s'\n", cfgFile); + iRet = doIncludeDirectory(cfgFile); + } else { /* TODO: shall we handle symlinks or not? */ + dbgprintf("warning: unable to process IncludeConfig directive '%s'\n", cfgFile); + } + } + + globfree(&cfgFiles); + +finalize_it: + RETiRet; +} + + +/* process a $ModLoad config line. + */ rsRetVal doModLoad(uchar **pp, __attribute__((unused)) void* pVal) { @@ -114,38 +263,24 @@ skipWhiteSpace(pp); /* skip over any whitespace */ /* this below is a quick and dirty hack to provide compatibility with the - * $ModLoad MySQL forward compatibility statement. This needs to be supported - * for legacy format. + * $ModLoad MySQL forward compatibility statement. TODO: clean this up + * For the time being, it is clean enough, it just needs to be done + * differently when we have a full design for loadable plug-ins. For the + * time being, we just mangle the names a bit. + * rgerhards, 2007-08-14 */ if(!strcmp((char*) szName, "MySQL")) pModName = (uchar*) "ommysql.so"; else pModName = szName; - CHKiRet(module.Load(pModName, 1, NULL)); + CHKiRet(module.Load(pModName)); finalize_it: RETiRet; } -/* remove leading spaces from name; this "fixes" some anomalies in - * getSubString(), but I was not brave enough to fix the former as - * it has many other callers... -- rgerhards, 2013-05-27 - */ -static inline void -ltrim(char *src) -{ - char *dst = src; - while(isspace(*src)) - ++src; /*SKIP*/; - if(dst != src) { - while(*src != '\0') - *dst++ = *src++; - *dst = '\0'; - } -} - /* parse and interpret a $-config line that starts with * a name (this is common code). It is parsed to the name * and then the proper sub-function is called to handle @@ -172,7 +307,6 @@ errmsg.LogError(0, RS_RET_NOT_FOUND, "Invalid config line: could not extract name - line ignored"); ABORT_FINALIZE(RS_RET_NOT_FOUND); } - ltrim(szName); if(*p == ',') ++p; /* comma was eaten */ @@ -184,7 +318,7 @@ switch(eDir) { case DIR_TEMPLATE: - tplAddLine(loadConf, szName, &p); + tplAddLine(szName, &p); break; case DIR_OUTCHANNEL: ochAddLine(szName, &p); @@ -250,6 +384,128 @@ } + + +/* process a configuration file + * started with code from init() by rgerhards on 2007-07-31 + */ +static rsRetVal +processConfFile(uchar *pConfFile) +{ + int iLnNbr = 0; + FILE *cf; + rule_t *pCurrRule = NULL; + uchar *p; + uchar cbuf[CFGLNSIZ]; + uchar *cline; + int i; + rsRetVal localRet; + int bHadAnError = 0; + uchar *pszOrgLine = NULL; + size_t lenLine; + DEFiRet; + ASSERT(pConfFile != NULL); + + if((cf = fopen((char*)pConfFile, "r")) == NULL) { + ABORT_FINALIZE(RS_RET_FOPEN_FAILURE); + } + + /* Now process the file. + */ + cline = cbuf; + while (fgets((char*)cline, sizeof(cbuf) - (cline - cbuf), cf) != NULL) { + ++iLnNbr; + /* drop LF - TODO: make it better, replace fgets(), but its clean as it is */ + lenLine = ustrlen(cline); + if(cline[lenLine-1] == '\n') { + cline[lenLine-1] = '\0'; + } + free(pszOrgLine); + pszOrgLine = ustrdup(cline); /* save if needed for errmsg, NULL ptr is OK */ + /* check for end-of-section, comments, strip off trailing + * spaces and newline character. + */ + p = cline; + skipWhiteSpace(&p); + if (*p == '\0' || *p == '#') + continue; + + /* we now need to copy the characters to the begin of line. As this overlaps, + * we can not use strcpy(). -- rgerhards, 2008-03-20 + * TODO: review the code at whole - this is highly suspect (but will go away + * once we do the rest of RainerScript). + */ + for( i = 0 ; p[i] != '\0' ; ++i) { + cline[i] = p[i]; + } + cline[i] = '\0'; + + for (p = (uchar*) strchr((char*)cline, '\0'); isspace((int) *--p);) + /*EMPTY*/; + if (*p == '\\') { + if ((p - cbuf) > CFGLNSIZ - 30) { + /* Oops the buffer is full - what now? */ + cline = cbuf; + dbgprintf("buffer overflow extending config file\n"); + errmsg.LogError(0, RS_RET_CONFIG_ERROR, + "error: config file line %d too long", iLnNbr); + } else { + *p = 0; + cline = p; + continue; + } + } else + cline = cbuf; + *++p = '\0'; /* TODO: check this */ + + /* we now have the complete line, and are positioned at the first non-whitespace + * character. So let's process it + */ + if((localRet = cfline(cbuf, &pCurrRule)) != RS_RET_OK) { + /* we log a message, but otherwise ignore the error. After all, the next + * line can be correct. -- rgerhards, 2007-08-02 + */ + uchar szErrLoc[MAXFNAME + 64]; + if(localRet != RS_RET_OK_WARN) { + dbgprintf("config line NOT successfully processed\n"); + bHadAnError = 1; + } + snprintf((char*)szErrLoc, sizeof(szErrLoc) / sizeof(uchar), + "%s, line %d", pConfFile, iLnNbr); + errmsg.LogError(0, NO_ERRCODE, "the last %s occured in %s:\"%s\"", + (localRet == RS_RET_OK_WARN) ? "warning" : "error", + (char*)szErrLoc, (char*)pszOrgLine); + } + } + + /* we probably have one selector left to be added - so let's do that now */ + if(pCurrRule != NULL) { + CHKiRet(ruleset.AddRule(rule.GetAssRuleset(pCurrRule), &pCurrRule)); + } + + /* close the configuration file */ + fclose(cf); + +finalize_it: + if(iRet != RS_RET_OK) { + char errStr[1024]; + if(pCurrRule != NULL) + rule.Destruct(&pCurrRule); + + rs_strerror_r(errno, errStr, sizeof(errStr)); + dbgprintf("error %d processing config file '%s'; os error (if any): %s\n", + iRet, pConfFile, errStr); + } + + free(pszOrgLine); + + if(bHadAnError && (iRet == RS_RET_OK)) { /* a bit dirty, enhance in future releases */ + iRet = RS_RET_NONFATAL_CONFIG_ERR; + } + RETiRet; +} + + /* Helper to cfline() and its helpers. Parses a template name * from an "action" line. Must be called with the Line pointer * pointing to the first character after the semicolon. @@ -342,9 +598,14 @@ } -/* Decode a traditional PRI filter */ +/* Helper to cfline(). This function takes the filter part of a traditional, PRI + * based line and decodes the PRIs given in the selector line. It processed the + * line up to the beginning of the action part. A pointer to that beginnig is + * passed back to the caller. + * rgerhards 2005-09-15 + */ /* GPLv3 - stems back to sysklogd */ -rsRetVal DecodePRIFilter(uchar *pline, uchar pmask[]) +static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register rule_t *pRule) { uchar *p; register uchar *q; @@ -358,15 +619,23 @@ DEFiRet; ASSERT(pline != NULL); + ASSERT(*pline != NULL); + ISOBJ_TYPE_assert(pRule, rule); - dbgprintf("Decoding traditional PRI filter '%s'\n", pline); + dbgprintf(" - traditional PRI filter\n"); + errno = 0; /* keep strerror_r() stuff out of logerror messages */ + pRule->f_filter_type = FILTER_PRI; + /* Note: file structure is pre-initialized to zero because it was + * created with calloc()! + */ for (i = 0; i <= LOG_NFACILITIES; i++) { - pmask[i] = TABLE_NOPRI; + pRule->f_filterData.f_pmask[i] = TABLE_NOPRI; } /* scan through the list of selectors */ - for (p = pline; *p && *p != '\t' && *p != ' ';) { + for (p = *pline; *p && *p != '\t' && *p != ' ';) { + /* find the end of this facility name list */ for (q = p; *q && *q != '\t' && *q++ != '.'; ) continue; @@ -377,10 +646,8 @@ *bp = '\0'; /* skip cruft */ - if(*q) { - while (strchr(",;", *q)) - q++; - } + while (strchr(",;", *q)) + q++; /* decode priority name */ if ( *buf == '!' ) { @@ -415,28 +682,28 @@ for (i = 0; i <= LOG_NFACILITIES; i++) { if ( pri == INTERNAL_NOPRI ) { if ( ignorepri ) - pmask[i] = TABLE_ALLPRI; + pRule->f_filterData.f_pmask[i] = TABLE_ALLPRI; else - pmask[i] = TABLE_NOPRI; + pRule->f_filterData.f_pmask[i] = TABLE_NOPRI; } else if ( singlpri ) { if ( ignorepri ) - pmask[i] &= ~(1<f_filterData.f_pmask[i] &= ~(1<f_filterData.f_pmask[i] |= (1<f_filterData.f_pmask[i] = TABLE_NOPRI; else - pmask[i] = TABLE_ALLPRI; + pRule->f_filterData.f_pmask[i] = TABLE_ALLPRI; } else { if ( ignorepri ) for (i2= 0; i2 <= pri; ++i2) - pmask[i] &= ~(1<f_filterData.f_pmask[i] &= ~(1<f_filterData.f_pmask[i] |= (1<> 3] = TABLE_ALLPRI; + pRule->f_filterData.f_pmask[i >> 3] = TABLE_ALLPRI; else - pmask[i >> 3] = TABLE_NOPRI; + pRule->f_filterData.f_pmask[i >> 3] = TABLE_NOPRI; } else if ( singlpri ) { if ( ignorepri ) - pmask[i >> 3] &= ~(1<f_filterData.f_pmask[i >> 3] &= ~(1<> 3] |= (1<f_filterData.f_pmask[i >> 3] |= (1<> 3] = TABLE_NOPRI; + pRule->f_filterData.f_pmask[i >> 3] = TABLE_NOPRI; else - pmask[i >> 3] = TABLE_ALLPRI; + pRule->f_filterData.f_pmask[i >> 3] = TABLE_ALLPRI; } else { if ( ignorepri ) for (i2= 0; i2 <= pri; ++i2) - pmask[i >> 3] &= ~(1<f_filterData.f_pmask[i >> 3] &= ~(1<> 3] |= (1<f_filterData.f_pmask[i >> 3] |= (1<f_filter_type = FILTER_EXPR; + + /* if we come to over here, pline starts with "if ". We just skip that part. */ + (*pline) += 3; + + /* we first need a tokenizer... */ + CHKiRet(ctok.Construct(&tok)); + CHKiRet(ctok.Setpp(tok, *pline)); + CHKiRet(ctok.ConstructFinalize(tok)); + + /* now construct our expression */ + CHKiRet(expr.Construct(&f->f_filterData.f_expr)); + CHKiRet(expr.ConstructFinalize(f->f_filterData.f_expr)); + + /* ready to go... */ + CHKiRet(expr.Parse(f->f_filterData.f_expr, tok)); + + /* we now need to parse off the "then" - and note an error if it is + * missing... + */ + CHKiRet(ctok.GetToken(tok, &pToken)); + if(pToken->tok != ctok_THEN) { + ctok_token.Destruct(&pToken); + ABORT_FINALIZE(RS_RET_SYNTAX_ERROR); + } + + ctok_token.Destruct(&pToken); /* no longer needed */ + + /* we are done, so we now need to restore things */ + CHKiRet(ctok.Getpp(tok, pline)); + CHKiRet(ctok.Destruct(&tok)); + + /* debug support - print vmprg after construction (uncomment to use) */ + /* vmprgDebugPrint(f->f_filterData.f_expr->pVmprg); */ + + /* we now need to skip whitespace to the action part, else we confuse + * the legacy rsyslog conf parser. -- rgerhards, 2008-02-25 + */ + while(isspace(**pline)) + ++(*pline); + +finalize_it: + if(iRet == RS_RET_SYNTAX_ERROR) { + errmsg.LogError(0, RS_RET_SYNTAX_ERROR, "syntax error in expression"); + } + + RETiRet; +} + + +/* Helper to cfline(). This function takes the filter part of a property + * based filter and decodes it. It processes the line up to the beginning + * of the action part. A pointer to that beginnig is passed back to the caller. + * rgerhards 2005-09-15 + */ +static rsRetVal cflineProcessPropFilter(uchar **pline, register rule_t *f) +{ + rsParsObj *pPars; + cstr_t *pCSCompOp; + cstr_t *pCSPropName; + rsRetVal iRet; + int iOffset; /* for compare operations */ + + ASSERT(pline != NULL); + ASSERT(*pline != NULL); + ASSERT(f != NULL); + + dbgprintf(" - property-based filter\n"); + errno = 0; /* keep strerror_r() stuff out of logerror messages */ + + f->f_filter_type = FILTER_PROP; + + /* create parser object starting with line string without leading colon */ + if((iRet = rsParsConstructFromSz(&pPars, (*pline)+1)) != RS_RET_OK) { + errmsg.LogError(0, iRet, "Error %d constructing parser object - ignoring selector", iRet); + return(iRet); + } + + /* read property */ + iRet = parsDelimCStr(pPars, &pCSPropName, ',', 1, 1, 1); + if(iRet != RS_RET_OK) { + errmsg.LogError(0, iRet, "error %d parsing filter property - ignoring selector", iRet); + rsParsDestruct(pPars); + return(iRet); + } + iRet = propNameToID(pCSPropName, &f->f_filterData.prop.propID); + if(iRet != RS_RET_OK) { + errmsg.LogError(0, iRet, "error %d parsing filter property - ignoring selector", iRet); + rsParsDestruct(pPars); + return(iRet); + } + cstrDestruct(&pCSPropName); + + /* read operation */ + iRet = parsDelimCStr(pPars, &pCSCompOp, ',', 1, 1, 1); + if(iRet != RS_RET_OK) { + errmsg.LogError(0, iRet, "error %d compare operation property - ignoring selector", iRet); + rsParsDestruct(pPars); + return(iRet); + } + + /* we now first check if the condition is to be negated. To do so, we first + * must make sure we have at least one char in the param and then check the + * first one. + * rgerhards, 2005-09-26 + */ + if(rsCStrLen(pCSCompOp) > 0) { + if(*rsCStrGetBufBeg(pCSCompOp) == '!') { + f->f_filterData.prop.isNegated = 1; + iOffset = 1; /* ignore '!' */ + } else { + f->f_filterData.prop.isNegated = 0; + iOffset = 0; + } + } else { + f->f_filterData.prop.isNegated = 0; + iOffset = 0; + } + + if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "contains", 8)) { + f->f_filterData.prop.operation = FIOP_CONTAINS; + } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "isequal", 7)) { + f->f_filterData.prop.operation = FIOP_ISEQUAL; + } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (uchar*) "startswith", 10)) { + f->f_filterData.prop.operation = FIOP_STARTSWITH; + } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (unsigned char*) "regex", 5)) { + f->f_filterData.prop.operation = FIOP_REGEX; + } else if(!rsCStrOffsetSzStrCmp(pCSCompOp, iOffset, (unsigned char*) "ereregex", 8)) { + f->f_filterData.prop.operation = FIOP_EREREGEX; + } else { + errmsg.LogError(0, NO_ERRCODE, "error: invalid compare operation '%s' - ignoring selector", + (char*) rsCStrGetSzStrNoNULL(pCSCompOp)); + } + rsCStrDestruct(&pCSCompOp); /* no longer needed */ + + /* read compare value */ + iRet = parsQuotedCStr(pPars, &f->f_filterData.prop.pCSCompValue); + if(iRet != RS_RET_OK) { + errmsg.LogError(0, iRet, "error %d compare value property - ignoring selector", iRet); + rsParsDestruct(pPars); + return(iRet); + } + + /* skip to action part */ + if((iRet = parsSkipWhitespace(pPars, 1)) != RS_RET_OK) { + errmsg.LogError(0, iRet, "error %d skipping to action part - ignoring selector", iRet); + rsParsDestruct(pPars); + return(iRet); + } + + /* cleanup */ + *pline = *pline + rsParsGetParsePointer(pPars) + 1; + /* we are adding one for the skipped initial ":" */ + + return rsParsDestruct(pPars); +} + + +/* + * Helper to cfline(). This function interprets a BSD host selector line + * from the config file ("+/-hostname"). It stores it for further reference. + * rgerhards 2005-10-19 + */ +static rsRetVal cflineProcessHostSelector(uchar **pline) +{ + DEFiRet; + + ASSERT(pline != NULL); + ASSERT(*pline != NULL); + ASSERT(**pline == '-' || **pline == '+'); + + dbgprintf(" - host selector line\n"); + + /* check include/exclude setting */ + if(**pline == '+') { + eDfltHostnameCmpMode = HN_COMP_MATCH; + } else { /* we do not check for '-', it must be, else we wouldn't be here */ + eDfltHostnameCmpMode = HN_COMP_NOMATCH; + } + (*pline)++; /* eat + or - */ + + /* the below is somewhat of a quick hack, but it is efficient (this is + * why it is in here. "+*" resets the tag selector with BSD syslog. We mimic + * this, too. As it is easy to check that condition, we do not fire up a + * parser process, just make sure we do not address beyond our space. + * Order of conditions in the if-statement is vital! rgerhards 2005-10-18 + */ + if(**pline != '\0' && **pline == '*' && *(*pline+1) == '\0') { + dbgprintf("resetting BSD-like hostname filter\n"); + eDfltHostnameCmpMode = HN_NO_COMP; + if(pDfltHostnameCmp != NULL) { + CHKiRet(rsCStrSetSzStr(pDfltHostnameCmp, NULL)); + } + } else { + dbgprintf("setting BSD-like hostname filter to '%s'\n", *pline); + if(pDfltHostnameCmp == NULL) { + /* create string for parser */ + CHKiRet(rsCStrConstructFromszStr(&pDfltHostnameCmp, *pline)); + } else { /* string objects exists, just update... */ + CHKiRet(rsCStrSetSzStr(pDfltHostnameCmp, *pline)); + } + } + +finalize_it: + RETiRet; +} + + +/* + * Helper to cfline(). This function interprets a BSD tag selector line + * from the config file ("!tagname"). It stores it for further reference. + * rgerhards 2005-10-18 + */ +static rsRetVal cflineProcessTagSelector(uchar **pline) +{ + DEFiRet; + + ASSERT(pline != NULL); + ASSERT(*pline != NULL); + ASSERT(**pline == '!'); + + dbgprintf(" - programname selector line\n"); + + (*pline)++; /* eat '!' */ + + /* the below is somewhat of a quick hack, but it is efficient (this is + * why it is in here. "!*" resets the tag selector with BSD syslog. We mimic + * this, too. As it is easy to check that condition, we do not fire up a + * parser process, just make sure we do not address beyond our space. + * Order of conditions in the if-statement is vital! rgerhards 2005-10-18 + */ + if(**pline != '\0' && **pline == '*' && *(*pline+1) == '\0') { + dbgprintf("resetting programname filter\n"); + if(pDfltProgNameCmp != NULL) { + rsCStrDestruct(&pDfltProgNameCmp); + } + } else { + dbgprintf("setting programname filter to '%s'\n", *pline); + if(pDfltProgNameCmp == NULL) { + /* create string for parser */ + CHKiRet(rsCStrConstructFromszStr(&pDfltProgNameCmp, *pline)); + } else { /* string objects exists, just update... */ + CHKiRet(rsCStrSetSzStr(pDfltProgNameCmp, *pline)); + } + } + +finalize_it: + RETiRet; +} + + +/* read the filter part of a configuration line and store the filter + * in the supplied rule_t + * rgerhards, 2007-08-01 + */ +static rsRetVal cflineDoFilter(uchar **pp, rule_t *f) +{ + DEFiRet; + + ASSERT(pp != NULL); + ISOBJ_TYPE_assert(f, rule); + + /* check which filter we need to pull... */ + switch(**pp) { + case ':': + CHKiRet(cflineProcessPropFilter(pp, f)); + break; + case 'i': /* "if" filter? */ + if(*(*pp+1) && (*(*pp+1) == 'f') && isspace(*(*pp+2))) { + CHKiRet(cflineProcessIfFilter(pp, f)); + break; + } + /*FALLTHROUGH*/ + default: + CHKiRet(cflineProcessTradPRIFilter(pp, f)); + break; + } + + /* we now check if there are some global (BSD-style) filter conditions + * and, if so, we copy them over. rgerhards, 2005-10-18 + */ + if(pDfltProgNameCmp != NULL) { +RUNLOG_STR("dflt ProgNameCmp != NULL, setting opCSProgNameComp"); + CHKiRet(rsCStrConstructFromCStr(&(f->pCSProgNameComp), pDfltProgNameCmp)); + } + + if(eDfltHostnameCmpMode != HN_NO_COMP) { + f->eHostnameCmpMode = eDfltHostnameCmpMode; + CHKiRet(rsCStrConstructFromCStr(&(f->pCSHostnameComp), pDfltHostnameCmp)); + } + +finalize_it: RETiRet; } @@ -489,29 +1076,27 @@ /* process the action part of a selector line * rgerhards, 2007-08-01 */ -rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction) +static rsRetVal cflineDoAction(uchar **p, action_t **ppAction) { + DEFiRet; modInfo_t *pMod; - cfgmodules_etry_t *node; omodStringRequest_t *pOMSR; - int bHadWarning = 0; action_t *pAction = NULL; void *pModData; - DEFiRet; + int bHadWarning = 0; ASSERT(p != NULL); ASSERT(ppAction != NULL); /* loop through all modules and see if one picks up the line */ - node = module.GetNxtCnfType(conf, NULL, eMOD_OUT); - /* Note: clang static analyzer reports that node maybe == NULL. However, this is + pMod = module.GetNxtType(NULL, eMOD_OUT); + /* Note: clang static analyzer reports that pMod mybe == NULL. However, this is * not possible, because we have the built-in output modules which are always * present. Anyhow, we guard this by an assert. -- rgerhards, 2010-12-16 */ - assert(node != NULL); - while(node != NULL) { + assert(pMod != NULL); + while(pMod != NULL) { pOMSR = NULL; - pMod = node->pMod; iRet = pMod->mod.om.parseSelectorAct(p, &pModData, &pOMSR); dbgprintf("tried selector action for %s: %d\n", module.GetName(pMod), iRet); if(iRet == RS_RET_OK_WARN) { @@ -519,15 +1104,20 @@ iRet = RS_RET_OK; } if(iRet == RS_RET_OK || iRet == RS_RET_SUSPENDED) { - if((iRet = addAction(&pAction, pMod, pModData, pOMSR, NULL, NULL, - (iRet == RS_RET_SUSPENDED)? 1 : 0)) == RS_RET_OK) { - /* here check if the module is compatible with select features - * (currently, we have no such features!) */ + if((iRet = addAction(&pAction, pMod, pModData, pOMSR, (iRet == RS_RET_SUSPENDED)? 1 : 0)) == RS_RET_OK) { + /* now check if the module is compatible with select features */ + if(pMod->isCompatibleWithFeature(sFEATURERepeatedMsgReduction) == RS_RET_OK) + pAction->f_ReduceRepeated = bReduceRepeatMsgs; + else { + dbgprintf("module is incompatible with RepeatedMsgReduction - turned off\n"); + pAction->f_ReduceRepeated = 0; + } pAction->eState = ACT_STATE_RDY; /* action is enabled */ - conf->actions.nbrActions++; /* one more active action! */ + iNbrActions++; /* one more active action! */ } break; - } else if(iRet != RS_RET_CONFLINE_UNPROCESSED) { + } + else if(iRet != RS_RET_CONFLINE_UNPROCESSED) { /* In this case, the module would have handled the config * line, but some error occured while doing so. This error should * already by reported by the module. We do not try any other @@ -537,7 +1127,7 @@ dbgprintf("error %d parsing config line\n", (int) iRet); break; } - node = module.GetNxtCnfType(conf, node, eMOD_OUT); + pMod = module.GetNxtType(pMod, eMOD_OUT); } *ppAction = pAction; @@ -547,15 +1137,103 @@ } +/* Process a configuration file line in traditional "filter selector" format + * or one that builds upon this format. Note that ppRule may be a NULL pointer, + * which is valid and happens if there is no previous line (right at the start + * of the master config file!). + */ +static rsRetVal +cflineClassic(uchar *p, rule_t **ppRule) +{ + DEFiRet; + action_t *pAction; + rsRetVal localRet; + int bHadWarning = 0; + + /* lines starting with '&' have no new filters and just add + * new actions to the currently processed selector. + */ + if(*p == '&') { + ++p; /* eat '&' */ + skipWhiteSpace(&p); /* on to command */ + } else { + /* we are finished with the current selector (on previous line). + * So we now need to check + * if it has any actions associated and, if so, link it to the linked + * list. If it has nothing associated with it, we can simply discard + * it. In any case, we create a fresh selector for our new filter. + * We have one special case during initialization: then, the current + * selector is NULL, which means we do not need to care about it at + * all. -- rgerhards, 2007-08-01 + */ + if(*ppRule != NULL) { + CHKiRet(ruleset.AddRule(rule.GetAssRuleset(*ppRule), ppRule)); + } + CHKiRet(rule.Construct(ppRule)); /* create "fresh" selector */ + CHKiRet(rule.SetAssRuleset(*ppRule, ruleset.GetCurrent())); /* create "fresh" selector */ + CHKiRet(rule.ConstructFinalize(*ppRule)); /* create "fresh" selector */ + CHKiRet(cflineDoFilter(&p, *ppRule)); /* pull filters */ + } + + localRet = cflineDoAction(&p, &pAction); + if(localRet == RS_RET_OK_WARN) { + bHadWarning = 1; + } else { + CHKiRet(localRet); + } + CHKiRet(llAppend(&(*ppRule)->llActList, NULL, (void*) pAction)); + +finalize_it: + if(iRet == RS_RET_OK && bHadWarning) + iRet = RS_RET_OK_WARN; + RETiRet; +} + + +/* process a configuration line + * I re-did this functon because it was desperately time to do so + * rgerhards, 2007-08-01 + */ +static rsRetVal +cfline(uchar *line, rule_t **pfCurr) +{ + DEFiRet; + + ASSERT(line != NULL); + + dbgprintf("cfline: '%s'\n", line); + + /* check type of line and call respective processing */ + switch(*line) { + case '!': + iRet = cflineProcessTagSelector(&line); + break; + case '+': + case '-': + iRet = cflineProcessHostSelector(&line); + break; + case '$': + ++line; /* eat '$' */ + iRet = cfsysline(line); + break; + default: + iRet = cflineClassic(line, pfCurr); + break; + } + + RETiRet; +} + + /* return the current number of active actions * rgerhards, 2008-07-28 */ static rsRetVal -GetNbrActActions(rsconf_t *conf, int *piNbrActions) +GetNbrActActions(int *piNbrActions) { DEFiRet; assert(piNbrActions != NULL); - *piNbrActions = conf->actions.nbrActions; + *piNbrActions = iNbrActions; RETiRet; } @@ -577,23 +1255,15 @@ pIf->doNameLine = doNameLine; pIf->cfsysline = cfsysline; pIf->doModLoad = doModLoad; + pIf->doIncludeLine = doIncludeLine; + pIf->cfline = cfline; + pIf->processConfFile = processConfFile; pIf->GetNbrActActions = GetNbrActActions; finalize_it: ENDobjQueryInterface(conf) -/* Reset config variables to default values. - * rgerhards, 2010-07-23 - */ -static rsRetVal -resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - bConfStrictScoping = 0; - return RS_RET_OK; -} - - /* exit our class * rgerhards, 2008-03-11 */ @@ -609,9 +1279,13 @@ } /* release objects we no longer need */ + objRelease(expr, CORE_COMPONENT); + objRelease(ctok, CORE_COMPONENT); + objRelease(ctok_token, CORE_COMPONENT); objRelease(module, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(net, LM_NET_FILENAME); + objRelease(rule, CORE_COMPONENT); objRelease(ruleset, CORE_COMPONENT); ENDObjClassExit(conf) @@ -622,15 +1296,14 @@ */ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANGE class also in END MACRO! */ /* request objects we use */ + CHKiRet(objUse(expr, CORE_COMPONENT)); + CHKiRet(objUse(ctok, CORE_COMPONENT)); + CHKiRet(objUse(ctok_token, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */ + CHKiRet(objUse(rule, CORE_COMPONENT)); CHKiRet(objUse(ruleset, CORE_COMPONENT)); - - /* These commands will NOT be supported -- the new v6.3 config system provides - * far better methods. We will remove the related code soon. -- rgerhards, 2012-01-09 - */ - CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL)); ENDObjClassInit(conf) /* vi:set ai: diff -Nru rsyslog-7.6.0/runtime/conf.h rsyslog-5.10.1/runtime/conf.h --- rsyslog-7.6.0/runtime/conf.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/conf.h 2012-10-17 14:41:20.000000000 +0000 @@ -20,7 +20,6 @@ */ #ifndef INCLUDED_CONF_H #define INCLUDED_CONF_H -#include "action.h" /* definitions used for doNameLine to differentiate between different command types * (with otherwise identical code). This is a left-over from the previous config @@ -28,27 +27,18 @@ * somewhat strange (at least its name). -- rgerhards, 2007-08-01 */ enum eDirective { DIR_TEMPLATE = 0, DIR_OUTCHANNEL = 1, DIR_ALLOWEDSENDER = 2}; -extern ecslConfObjType currConfObj; -extern int bConfStrictScoping; /* force strict scoping during config processing? */ /* interfaces */ BEGINinterface(conf) /* name must also be changed in ENDinterface macro! */ rsRetVal (*doNameLine)(uchar **pp, void* pVal); rsRetVal (*cfsysline)(uchar *p); rsRetVal (*doModLoad)(uchar **pp, __attribute__((unused)) void* pVal); - rsRetVal (*GetNbrActActions)(rsconf_t *conf, int *); - /* version 4 -- 2010-07-23 rgerhards */ - /* "just" added global variables - * FYI: we reconsider repacking as a non-object, as only the core currently - * accesses this module. The current object structure complicates things without - * any real benefit. - */ - /* version 5 -- 2011-04-19 rgerhards */ - /* complete revamp, we now use the rsconf object */ - /* version 6 -- 2011-07-06 rgerhards */ - /* again a complete revamp, using flex/bison based parser now */ + rsRetVal (*doIncludeLine)(uchar **pp, __attribute__((unused)) void* pVal); + rsRetVal (*cfline)(uchar *line, rule_t **pfCurr); + rsRetVal (*processConfFile)(uchar *pConfFile); + rsRetVal (*GetNbrActActions)(int *); ENDinterface(conf) -#define confCURR_IF_VERSION 6 /* increment whenever you change the interface structure! */ +#define confCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */ /* in Version 3, entry point "ReInitConf()" was removed, as we do not longer need * to support restart-type HUP -- rgerhards, 2009-07-15 */ @@ -62,10 +52,5 @@ rsRetVal cflineParseTemplateName(uchar** pp, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *dfltTplName); rsRetVal cflineParseFileName(uchar* p, uchar *pFileName, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *pszTpl); -rsRetVal DecodePRIFilter(uchar *pline, uchar pmask[]); -rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction); -extern EHostnameCmpMode eDfltHostnameCmpMode; -extern cstr_t *pDfltHostnameCmp; -extern cstr_t *pDfltProgNameCmp; #endif /* #ifndef INCLUDED_CONF_H */ diff -Nru rsyslog-7.6.0/runtime/cryprov.h rsyslog-5.10.1/runtime/cryprov.h --- rsyslog-7.6.0/runtime/cryprov.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/cryprov.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* The interface definition for (file) crypto providers. - * - * This is just an abstract driver interface, which needs to be - * implemented by concrete classes. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_CRYPROV_H -#define INCLUDED_CRYPROV_H - -/* we unfortunately need to have two different param names depending on the - * context in which parameters are set. Other than (re/over)engineering the core - * interface, we just define some values to keep track of that. - */ -#define CRYPROV_PARAMTYPE_REGULAR 0 -#define CRYPROV_PARAMTYPE_DISK 1 - -/* interface */ -BEGINinterface(cryprov) /* name must also be changed in ENDinterface macro! */ - rsRetVal (*Construct)(void *ppThis); - rsRetVal (*SetCnfParam)(void *ppThis, struct nvlst *lst, int paramType); - rsRetVal (*Destruct)(void *ppThis); - rsRetVal (*OnFileOpen)(void *pThis, uchar *fn, void *pFileInstData, char openMode); - rsRetVal (*Encrypt)(void *pFileInstData, uchar *buf, size_t *lenBuf); - rsRetVal (*Decrypt)(void *pFileInstData, uchar *buf, size_t *lenBuf); - rsRetVal (*OnFileClose)(void *pFileInstData, off64_t offsLogfile); - rsRetVal (*DeleteStateFiles)(uchar *logfn); - rsRetVal (*GetBytesLeftInBlock)(void *pFileInstData, ssize_t *left); - void (*SetDeleteOnClose)(void *pFileInstData, int val); -ENDinterface(cryprov) -#define cryprovCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */ -#endif /* #ifndef INCLUDED_CRYPROV_H */ diff -Nru rsyslog-7.6.0/runtime/ctok.c rsyslog-5.10.1/runtime/ctok.c --- rsyslog-7.6.0/runtime/ctok.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/ctok.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,624 @@ +/* ctok.c - helper class to tokenize an input stream - which surprisingly + * currently does not work with streams but with string. But that will + * probably change over time ;) This class was originally written to support + * the expression module but may evolve when (if) the expression module is + * expanded (or aggregated) by a full-fledged ctoken based config parser. + * Obviously, this class is used together with config files and not any other + * parse function. + * + * Module begun 2008-02-19 by Rainer Gerhards + * + * Copyright (C) 2008-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include +#include +#include + +#include "rsyslog.h" +#include "template.h" +#include "ctok.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(ctok_token) +DEFobjCurrIf(var) + + +/* Standard-Constructor + */ +BEGINobjConstruct(ctok) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(ctok) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +rsRetVal ctokConstructFinalize(ctok_t __attribute__((unused)) *pThis) +{ + DEFiRet; + RETiRet; +} + + +/* destructor for the ctok object */ +BEGINobjDestruct(ctok) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(ctok) + /* ... then free resources */ +ENDobjDestruct(ctok) + + +/* unget character from input stream. At most one character can be ungotten. + * This funtion is only permitted to be called after at least one character + * has been read from the stream. Right now, we handle the situation simply by + * moving the string "stream" pointer one position backwards. If we work with + * real streams (some time), the strm object will handle the functionality + * itself. -- rgerhards, 2008-02-19 + */ +static rsRetVal +ctokUngetCharFromStream(ctok_t *pThis, uchar __attribute__((unused)) c) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ctok); + --pThis->pp; + + RETiRet; +} + + +/* get the next character from the input "stream". Note that this version + * does NOT look for comment characters as end-of-stream, so it is suitable + * when building constant strings! -- rgerhards, 2010-03-01 + */ +static inline rsRetVal +ctokGetCharFromStreamNoComment(ctok_t *pThis, uchar *pc) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pc != NULL); + + /* end of string or begin of comment terminates the "stream" */ + if(*pThis->pp == '\0') { + ABORT_FINALIZE(RS_RET_EOS); + } else { + *pc = *pThis->pp; + ++pThis->pp; + } + +finalize_it: + RETiRet; +} + + +/* get the next character from the input "stream" (currently just a in-memory + * string...) -- rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetCharFromStream(ctok_t *pThis, uchar *pc) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pc != NULL); + + CHKiRet(ctokGetCharFromStreamNoComment(pThis, pc)); + /* begin of comment terminates the "stream"! */ + if(*pc == '#') { + ABORT_FINALIZE(RS_RET_EOS); + } + +finalize_it: + RETiRet; +} + + +/* skip whitespace in the input "stream". + * rgerhards, 2008-02-19 + */ +static rsRetVal +ctokSkipWhitespaceFromStream(ctok_t *pThis) +{ + DEFiRet; + uchar c; + + ISOBJ_TYPE_assert(pThis, ctok); + + CHKiRet(ctokGetCharFromStream(pThis, &c)); + while(isspace(c)) { + CHKiRet(ctokGetCharFromStream(pThis, &c)); + } + + /* we must unget the one non-whitespace we found */ + CHKiRet(ctokUngetCharFromStream(pThis, c)); + +dbgprintf("skipped whitespace, stream now '%s'\n", pThis->pp); +finalize_it: + RETiRet; +} + + +/* get the next word from the input "stream" (currently just a in-memory + * string...). A word is anything from the current location until the + * first non-alphanumeric character. If the word is longer + * than the provided memory buffer, parsing terminates when buffer length + * has been reached. A buffer of 128 bytes or more should always be by + * far sufficient. -- rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetWordFromStream(ctok_t *pThis, uchar *pWordBuf, size_t lenWordBuf) +{ + DEFiRet; + uchar c; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pWordBuf != NULL); + ASSERT(lenWordBuf > 0); + + CHKiRet(ctokSkipWhitespaceFromStream(pThis)); + + CHKiRet(ctokGetCharFromStream(pThis, &c)); + while((isalnum(c) || c == '_' || c == '-') && lenWordBuf > 1) { + *pWordBuf++ = c; + --lenWordBuf; + CHKiRet(ctokGetCharFromStream(pThis, &c)); + } + *pWordBuf = '\0'; /* there is always space for this - see while() */ + + /* push back the char that we have read too much */ + CHKiRet(ctokUngetCharFromStream(pThis, c)); + +finalize_it: + RETiRet; +} + + +/* read in a constant number + * This is the "number" ABNF element + * rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetNumber(ctok_t *pThis, ctok_token_t *pToken) +{ + DEFiRet; + number_t n; /* the parsed number */ + uchar c; + int valC; + int iBase; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pToken != NULL); + + pToken->tok = ctok_NUMBER; + + CHKiRet(ctokGetCharFromStream(pThis, &c)); + if(c == '0') { /* octal? */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); + if(c == 'x') { /* nope, hex! */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); + c = tolower(c); + iBase = 16; + } else { + iBase = 8; + } + } else { + iBase = 10; + } + + n = 0; + /* this loop is quite simple, a variable name is terminated by whitespace. */ + while(isdigit(c) || (c >= 'a' && c <= 'f')) { + if(isdigit(c)) { + valC = c - '0'; + } else { + valC = c - 'a' + 10; + } + + if(valC >= iBase) { + if(iBase == 8) { + ABORT_FINALIZE(RS_RET_INVALID_OCTAL_DIGIT); + } else { + ABORT_FINALIZE(RS_RET_INVALID_HEX_DIGIT); + } + } + /* we now have the next value and know it is right */ + n = n * iBase + valC; + CHKiRet(ctokGetCharFromStream(pThis, &c)); + c = tolower(c); + } + + /* we need to unget the character that made the loop terminate */ + CHKiRet(ctokUngetCharFromStream(pThis, c)); + + CHKiRet(var.SetNumber(pToken->pVar, n)); + +finalize_it: + RETiRet; +} + + +/* read in a variable + * This covers both msgvar and sysvar from the ABNF. + * rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetVar(ctok_t *pThis, ctok_token_t *pToken) +{ + DEFiRet; + uchar c; + cstr_t *pstrVal = NULL; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pToken != NULL); + + CHKiRet(ctokGetCharFromStream(pThis, &c)); + + if(c == '$') { /* second dollar, we have a system variable */ + pToken->tok = ctok_SYSVAR; + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* "eat" it... */ + } else { + pToken->tok = ctok_MSGVAR; + } + + CHKiRet(cstrConstruct(&pstrVal)); + /* this loop is quite simple, a variable name is terminated when a non-supported + * character is detected. Note that we currently permit a numerical digit as the + * first char, which is not permitted by ABNF. -- rgerhards, 2009-03-10 + */ + while(isalpha(c) || isdigit(c) || (c == '_') || (c == '-')) { + CHKiRet(cstrAppendChar(pstrVal, tolower(c))); + CHKiRet(ctokGetCharFromStream(pThis, &c)); + } + CHKiRet(ctokUngetCharFromStream(pThis, c)); /* put not processed char back */ + + CHKiRet(cstrFinalize(pstrVal)); + + CHKiRet(var.SetString(pToken->pVar, pstrVal)); + pstrVal = NULL; + +finalize_it: + if(iRet != RS_RET_OK) { + if(pstrVal != NULL) { + cstrDestruct(&pstrVal); + } + } + + RETiRet; +} + + +/* read in a simple string (simpstr in ABNF) + * rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetSimpStr(ctok_t *pThis, ctok_token_t *pToken) +{ + DEFiRet; + uchar c; + int bInEsc = 0; + cstr_t *pstrVal; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pToken != NULL); + + pToken->tok = ctok_SIMPSTR; + + CHKiRet(cstrConstruct(&pstrVal)); + CHKiRet(ctokGetCharFromStreamNoComment(pThis, &c)); + /* while we are in escape mode (had a backslash), no sequence + * terminates the loop. If outside, it is terminated by a single quote. + */ + while(bInEsc || c != '\'') { + if(bInEsc) { + CHKiRet(cstrAppendChar(pstrVal, c)); + bInEsc = 0; + } else { + if(c == '\\') { + bInEsc = 1; + } else { + CHKiRet(cstrAppendChar(pstrVal, c)); + } + } + CHKiRet(ctokGetCharFromStreamNoComment(pThis, &c)); + } + CHKiRet(cstrFinalize(pstrVal)); + + CHKiRet(var.SetString(pToken->pVar, pstrVal)); + pstrVal = NULL; + +finalize_it: + if(iRet != RS_RET_OK) { + if(pstrVal != NULL) { + cstrDestruct(&pstrVal); + } + } + + RETiRet; +} + + +/* Unget a token. The token ungotten will be returned the next time + * ctokGetToken() is called. Only one token can be ungotten at a time. + * If a second token is ungotten, the first is lost. This is considered + * a programming error. + * rgerhards, 2008-02-20 + */ +static rsRetVal +ctokUngetToken(ctok_t *pThis, ctok_token_t *pToken) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(pToken != NULL); + ASSERT(pThis->pUngotToken == NULL); + + pThis->pUngotToken = pToken; + + RETiRet; +} + + +/* skip an inine comment (just like a C-comment) + * rgerhards, 2008-02-20 + */ +static rsRetVal +ctokSkipInlineComment(ctok_t *pThis) +{ + DEFiRet; + uchar c; + int bHadAsterisk = 0; + + ISOBJ_TYPE_assert(pThis, ctok); + + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a charater */ + while(!(bHadAsterisk && c == '/')) { + bHadAsterisk = (c == '*') ? 1 : 0; + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read next */ + } + +finalize_it: + RETiRet; +} + + + +/* Get the *next* token from the input stream. This parses the next token and + * ignores any whitespace in between. End of stream is communicated via iRet. + * The returned token must either be destructed by the caller OR being passed + * back to ctokUngetToken(). + * rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetToken(ctok_t *pThis, ctok_token_t **ppToken) +{ + DEFiRet; + ctok_token_t *pToken; + uchar c; + uchar szWord[128]; + int bRetry = 0; /* retry parse? Only needed for inline comments... */ + cstr_t *pstrVal; + + ISOBJ_TYPE_assert(pThis, ctok); + ASSERT(ppToken != NULL); + + /* first check if we have an ungotten token and, if so, provide that + * one back (without any parsing). -- rgerhards, 2008-02-20 + */ + if(pThis->pUngotToken != NULL) { + *ppToken = pThis->pUngotToken; + pThis->pUngotToken = NULL; + FINALIZE; + } + + /* setup the stage - create our token */ + CHKiRet(ctok_token.Construct(&pToken)); + CHKiRet(ctok_token.ConstructFinalize(pToken)); + + /* find the next token. We may loop when we have inline comments */ + do { + bRetry = 0; + CHKiRet(ctokSkipWhitespaceFromStream(pThis)); + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a charater */ + switch(c) { + case '=': /* == */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a character */ + pToken->tok = (c == '=')? ctok_CMP_EQ : ctok_INVALID; + break; + case '!': /* != */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a character */ + pToken->tok = (c == '=')? ctok_CMP_NEQ : ctok_INVALID; + break; + case '<': /* <, <=, <> */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a character */ + if(c == '=') { + pToken->tok = ctok_CMP_LTEQ; + } else if(c == '>') { + pToken->tok = ctok_CMP_NEQ; + } else { + pToken->tok = ctok_CMP_LT; + } + break; + case '>': /* >, >= */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a character */ + if(c == '=') { + pToken->tok = ctok_CMP_GTEQ; + } else { + pToken->tok = ctok_CMP_GT; + } + break; + case '+': + pToken->tok = ctok_PLUS; + break; + case '-': + pToken->tok = ctok_MINUS; + break; + case '*': + pToken->tok = ctok_TIMES; + break; + case '/': /* /, /.* ... *./ (comments, mungled here for obvious reasons...) */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a charater */ + if(c == '*') { + /* we have a comment and need to skip it */ + ctokSkipInlineComment(pThis); + bRetry = 1; + } else { + CHKiRet(ctokUngetCharFromStream(pThis, c)); /* put back, not processed */ + } + pToken->tok = ctok_DIV; + break; + case '%': + pToken->tok = ctok_MOD; + break; + case '(': + pToken->tok = ctok_LPAREN; + break; + case ')': + pToken->tok = ctok_RPAREN; + break; + case ',': + pToken->tok = ctok_COMMA; + break; + case '&': + pToken->tok = ctok_STRADD; + break; + case '$': + CHKiRet(ctokGetVar(pThis, pToken)); + break; + case '\'': /* simple string, this is somewhat more elaborate */ + CHKiRet(ctokGetSimpStr(pThis, pToken)); + break; + case '"': + /* TODO: template string parser */ + ABORT_FINALIZE(RS_RET_NOT_IMPLEMENTED); + break; + default: + CHKiRet(ctokUngetCharFromStream(pThis, c)); /* push back, we need it in any case */ + if(isdigit(c)) { + CHKiRet(ctokGetNumber(pThis, pToken)); + } else { /* now we check if we have a multi-char sequence */ + CHKiRet(ctokGetWordFromStream(pThis, szWord, sizeof(szWord)/sizeof(uchar))); + if(!strcasecmp((char*)szWord, "and")) { + pToken->tok = ctok_AND; + } else if(!strcasecmp((char*)szWord, "or")) { + pToken->tok = ctok_OR; + } else if(!strcasecmp((char*)szWord, "not")) { + pToken->tok = ctok_NOT; + } else if(!strcasecmp((char*)szWord, "contains")) { + pToken->tok = ctok_CMP_CONTAINS; + } else if(!strcasecmp((char*)szWord, "contains_i")) { + pToken->tok = ctok_CMP_CONTAINSI; + } else if(!strcasecmp((char*)szWord, "startswith")) { + pToken->tok = ctok_CMP_STARTSWITH; + } else if(!strcasecmp((char*)szWord, "startswith_i")) { + pToken->tok = ctok_CMP_STARTSWITHI; + } else if(!strcasecmp((char*)szWord, "then")) { + pToken->tok = ctok_THEN; + } else { + /* finally, we check if it is a function */ + CHKiRet(ctokGetCharFromStream(pThis, &c)); /* read a charater */ + if(c == '(') { + /* push c back, higher level parser needs it */ + CHKiRet(ctokUngetCharFromStream(pThis, c)); + pToken->tok = ctok_FUNCTION; + /* fill function name */ + CHKiRet(cstrConstruct(&pstrVal)); + CHKiRet(rsCStrSetSzStr(pstrVal, szWord)); + CHKiRet(cstrFinalize(pstrVal)); + CHKiRet(var.SetString(pToken->pVar, pstrVal)); + } else { /* give up... */ + dbgprintf("parser has an invalid word (token) '%s'\n", szWord); + pToken->tok = ctok_INVALID; + } + } + } + break; + } + } while(bRetry); /* warning: do ... while()! */ + + *ppToken = pToken; + dbgoprint((obj_t*) pToken, "token: %d\n", pToken->tok); + +finalize_it: +/*dbgprintf("ctokGetToken, returns %d, returns token %d, addr %p\n", iRet, (*ppToken)->tok, &((*ppToken)->tok));*/ + if(iRet != RS_RET_OK) { + if(pToken != NULL) + ctok_token.Destruct(&pToken); + } + + RETiRet; +} + + +/* property set methods */ +/* simple ones first */ +DEFpropSetMeth(ctok, pp, uchar*) + +/* return the current position of pp - most important as currently we do only + * partial parsing, so the rest must know where to start from... + * rgerhards, 2008-02-19 + */ +static rsRetVal +ctokGetpp(ctok_t *pThis, uchar **pp) +{ + DEFiRet; + ASSERT(pp != NULL); + *pp = pThis->pp; + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(ctok) +CODESTARTobjQueryInterface(ctok) + if(pIf->ifVersion != ctokCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = ctokConstruct; + pIf->ConstructFinalize = ctokConstructFinalize; + pIf->Destruct = ctokDestruct; + pIf->Getpp = ctokGetpp; + pIf->GetToken = ctokGetToken; + pIf->UngetToken = ctokUngetToken; + pIf->Setpp = ctokSetpp; +finalize_it: +ENDobjQueryInterface(ctok) + + + +BEGINObjClassInit(ctok, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(ctok_token, CORE_COMPONENT)); + CHKiRet(objUse(var, CORE_COMPONENT)); + + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, ctokConstructFinalize); +ENDObjClassInit(ctok) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/ctok.h rsyslog-5.10.1/runtime/ctok.h --- rsyslog-7.6.0/runtime/ctok.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/ctok.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,54 @@ +/* The ctok object (implements a config file tokenizer). + * + * Copyright 2008-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_CTOK_H +#define INCLUDED_CTOK_H + +#include "obj.h" +#include "stringbuf.h" +#include "ctok_token.h" + +/* the ctokession object */ +typedef struct ctok_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + uchar *pp; /* this points to the next unread character, it is a reminescent of pp in + the config parser code ;) */ + ctok_token_t *pUngotToken; /* buffer for ctokUngetToken(), NULL if not set */ +} ctok_t; + + +/* interfaces */ +BEGINinterface(ctok) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(ctok); + INTERFACEpropSetMeth(ctok, pp, uchar*); + rsRetVal (*Construct)(ctok_t **ppThis); + rsRetVal (*ConstructFinalize)(ctok_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(ctok_t **ppThis); + rsRetVal (*Getpp)(ctok_t *pThis, uchar **pp); + rsRetVal (*GetToken)(ctok_t *pThis, ctok_token_t **ppToken); + rsRetVal (*UngetToken)(ctok_t *pThis, ctok_token_t *pToken); +ENDinterface(ctok) +#define ctokCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(ctok); + +#endif /* #ifndef INCLUDED_CTOK_H */ diff -Nru rsyslog-7.6.0/runtime/ctok_token.c rsyslog-5.10.1/runtime/ctok_token.c --- rsyslog-7.6.0/runtime/ctok_token.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/ctok_token.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,127 @@ +/* ctok_token - implements the token_t class. + * + * Module begun 2008-02-20 by Rainer Gerhards + * + * Copyright 2008-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include +#include +#include + +#include "rsyslog.h" +#include "template.h" +#include "ctok_token.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(var) + + +/* Standard-Constructor + */ +BEGINobjConstruct(ctok_token) /* be sure to specify the object type also in END macro! */ + /* TODO: we may optimize the code below and alloc var only if actually + * needed (but we need it quite often) + */ + CHKiRet(var.Construct(&pThis->pVar)); + CHKiRet(var.ConstructFinalize(pThis->pVar)); +finalize_it: +ENDobjConstruct(ctok_token) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +rsRetVal ctok_tokenConstructFinalize(ctok_token_t __attribute__((unused)) *pThis) +{ + DEFiRet; + RETiRet; +} + + +/* destructor for the ctok object */ +BEGINobjDestruct(ctok_token) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(ctok_token) + if(pThis->pVar != NULL) { + var.Destruct(&pThis->pVar); + } +ENDobjDestruct(ctok_token) + + +/* get the cstr_t from the token, but do not destruct it. This is meant to + * be used by a caller who passes on the string to some other function. The + * caller is responsible for destructing it. + * rgerhards, 2008-02-20 + */ +static rsRetVal +ctok_tokenUnlinkVar(ctok_token_t *pThis, var_t **ppVar) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ctok_token); + ASSERT(ppVar != NULL); + + *ppVar = pThis->pVar; + pThis->pVar = NULL; + + RETiRet; +} + + +/* tell the caller if the supplied token is a compare operation */ +static int ctok_tokenIsCmpOp(ctok_token_t *pThis) +{ + return(pThis->tok >= ctok_CMP_EQ && pThis->tok <= ctok_CMP_GTEQ); +} + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(ctok_token) +CODESTARTobjQueryInterface(ctok_token) + if(pIf->ifVersion != ctok_tokenCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = ctok_tokenConstruct; + pIf->ConstructFinalize = ctok_tokenConstructFinalize; + pIf->Destruct = ctok_tokenDestruct; + pIf->UnlinkVar = ctok_tokenUnlinkVar; + pIf->IsCmpOp = ctok_tokenIsCmpOp; +finalize_it: +ENDobjQueryInterface(ctok_token) + + +BEGINObjClassInit(ctok_token, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(var, CORE_COMPONENT)); + + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, ctok_tokenConstructFinalize); +ENDObjClassInit(ctok_token) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/ctok_token.h rsyslog-5.10.1/runtime/ctok_token.h --- rsyslog-7.6.0/runtime/ctok_token.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/ctok_token.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,85 @@ +/* The ctok_token object + * + * Copyright 2008-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_CTOK_TOKEN_H +#define INCLUDED_CTOK_TOKEN_H + +#include "obj.h" +#include "var.h" + +/* the tokens... I use numbers below so that the tokens can be easier + * identified in debug output. These ID's are also partly resused as opcodes. + * As such, they should be kept below 1,000 so that they do not interfer + * with the rest of the opcodes. + */ +typedef struct { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + enum { + ctok_INVALID = 0, + ctok_OR = 1, + ctok_AND = 2, + ctok_PLUS = 3, + ctok_MINUS = 4, + ctok_TIMES = 5, /* "*" */ + ctok_DIV = 6, + ctok_MOD = 7, + ctok_NOT = 8, + ctok_RPAREN = 9, + ctok_LPAREN = 10, + ctok_COMMA = 11, + ctok_SYSVAR = 12, + ctok_MSGVAR = 13, + ctok_SIMPSTR = 14, + ctok_TPLSTR = 15, + ctok_NUMBER = 16, + ctok_FUNCTION = 17, + ctok_THEN = 18, + ctok_STRADD = 19, + ctok_CMP_EQ = 100, /* all compare operations must be in a row */ + ctok_CMP_NEQ = 101, + ctok_CMP_LT = 102, + ctok_CMP_GT = 103, + ctok_CMP_LTEQ = 104, + ctok_CMP_CONTAINS = 105, + ctok_CMP_STARTSWITH = 106, + ctok_CMP_CONTAINSI = 107, + ctok_CMP_STARTSWITHI = 108, + ctok_CMP_GTEQ = 109 /* end compare operations */ + } tok; + var_t *pVar; +} ctok_token_t; + + +/* interfaces */ +BEGINinterface(ctok_token) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(ctok_token); + rsRetVal (*Construct)(ctok_token_t **ppThis); + rsRetVal (*ConstructFinalize)(ctok_token_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(ctok_token_t **ppThis); + rsRetVal (*UnlinkVar)(ctok_token_t *pThis, var_t **ppVar); + int (*IsCmpOp)(ctok_token_t *pThis); +ENDinterface(ctok_token) +#define ctok_tokenCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(ctok_token); + +#endif /* #ifndef INCLUDED_CTOK_TOKEN_H */ diff -Nru rsyslog-7.6.0/runtime/datetime.c rsyslog-5.10.1/runtime/datetime.c --- rsyslog-7.6.0/runtime/datetime.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/datetime.c 2012-10-17 14:41:20.000000000 +0000 @@ -38,6 +38,7 @@ #include "obj.h" #include "modules.h" #include "datetime.h" +#include "sysvar.h" #include "srUtils.h" #include "stringbuf.h" #include "errmsg.h" @@ -61,10 +62,8 @@ struct tm *tm; struct tm tmBuf; long lBias; - time_t secs; - secs = tp->tv_sec; - tm = localtime_r(&secs, &tmBuf); + tm = localtime_r((time_t*) &(tp->tv_sec), &tmBuf); t->year = tm->tm_year + 1900; t->month = tm->tm_mon + 1; @@ -79,7 +78,7 @@ /* Solaris uses a different method of exporting the time zone. * It is UTC - localtime, which is the opposite sign of mins east of GMT. */ - lBias = -(tm->tm_isdst ? altzone : timezone); + lBias = -(daylight ? altzone : timezone); # elif defined(__hpux) lBias = tz.tz_dsttime ? - tz.tz_minuteswest : 0; # else @@ -182,13 +181,12 @@ * the method always returns zero. * \retval The number parsed. */ -static inline int -srSLMGParseInt32(uchar** ppsz, int *pLenStr) +static int srSLMGParseInt32(uchar** ppsz, int *pLenStr) { register int i; i = 0; - while(*pLenStr > 0 && **ppsz >= '0' && **ppsz <= '9') { + while(*pLenStr > 0 && isdigit((int) **ppsz)) { i = i * 10 + **ppsz - '0'; ++(*ppsz); --(*pLenStr); @@ -306,10 +304,8 @@ if(OffsetHour < 0 || OffsetHour > 23) ABORT_FINALIZE(RS_RET_INVLD_TIME); - if(lenStr == 0 || *pszTS != ':') + if(lenStr == 0 || *pszTS++ != ':') ABORT_FINALIZE(RS_RET_INVLD_TIME); - --lenStr; - pszTS++; OffsetMinute = srSLMGParseInt32(&pszTS, &lenStr); if(OffsetMinute < 0 || OffsetMinute > 59) ABORT_FINALIZE(RS_RET_INVLD_TIME); @@ -626,15 +622,6 @@ RETiRet; } -void -applyDfltTZ(struct syslogTime *pTime, char *tz) -{ - pTime->OffsetMode = tz[0]; - pTime->OffsetHour = (tz[1] - '0') * 10 + (tz[2] - '0'); - pTime->OffsetMinute = (tz[4] - '0') * 10 + (tz[5] - '0'); - -} - /******************************************************************* * END CODE-LIBLOGGING * *******************************************************************/ @@ -864,131 +851,6 @@ } -/** - * convert syslog timestamp to time_t - */ -time_t syslogTime2time_t(struct syslogTime *ts) -{ - long MonthInDays, NumberOfYears, NumberOfDays, i; - int utcOffset; - time_t TimeInUnixFormat; - - /* Counting how many Days have passed since the 01.01 of the - * selected Year (Month level), according to the selected Month*/ - - switch(ts->month) - { - case 1: - MonthInDays = 0; //until 01 of January - break; - case 2: - MonthInDays = 31; //until 01 of February - leap year handling down below! - break; - case 3: - MonthInDays = 59; //until 01 of March - break; - case 4: - MonthInDays = 90; //until 01 of April - break; - case 5: - MonthInDays = 120; //until 01 of Mai - break; - case 6: - MonthInDays = 151; //until 01 of June - break; - case 7: - MonthInDays = 181; //until 01 of July - break; - case 8: - MonthInDays = 212; //until 01 of August - break; - case 9: - MonthInDays = 243; //until 01 of September - break; - case 10: - MonthInDays = 273; //until 01 of Oktober - break; - case 11: - MonthInDays = 304; //until 01 of November - break; - case 12: - MonthInDays = 334; //until 01 of December - break; - default: /* this cannot happen (and would be a program error) - * but we need the code to keep the compiler silent. - */ - MonthInDays = 0; /* any value fits ;) */ - break; - } - - - /* 1) Counting how many Years have passed since 1970 - 2) Counting how many Days have passed since the 01.01 of the selected Year - (Day level) according to the Selected Month and Day. Last day doesn't count, - it should be until last day - 3) Calculating this period (NumberOfDays) in seconds*/ - - NumberOfYears = ts->year - 1970; - NumberOfDays = MonthInDays + ts->day - 1; - TimeInUnixFormat = NumberOfYears * 31536000 + NumberOfDays * 86400; - - /* Now we need to adjust the number of years for leap - * year processing. If we are in Jan or Feb, this year - * will never be considered - because we haven't arrived - * at then end of Feb right now. [Feb, 29th in a leap year - * is handled correctly, because the day (29) is correctly - * added to the date serial] - */ - if(ts->month < 3) - NumberOfYears--; - - /*...AND ADDING ONE DAY FOR EACH YEAR WITH 366 DAYS - * note that we do not handle 2000 any special, as it was a - * leap year. The current code works OK until 2100, when it will - * break. As we do not process future dates, we accept that fate... - * the whole thing could be refactored by a table-based approach. - */ - for(i = 1;i <= NumberOfYears; i++) - { - /* If i = 2 we have 1972, which was a Year with 366 Days - and if (i + 2) Mod (4) = 0 we have a Year after 1972 - which is also a Year with 366 Days (repeated every 4 Years) */ - if ((i == 2) || (((i + 2) % 4) == 0)) - { /*Year with 366 Days!!!*/ - TimeInUnixFormat += 86400; - } - } - - /*Add Hours, minutes and seconds */ - TimeInUnixFormat += ts->hour*60*60; - TimeInUnixFormat += ts->minute*60; - TimeInUnixFormat += ts->second; - /* do UTC offset */ - utcOffset = ts->OffsetHour*3600 + ts->OffsetMinute*60; - if(ts->OffsetMode == '+') - utcOffset *= -1; /* if timestamp is ahead, we need to "go back" to UTC */ - TimeInUnixFormat += utcOffset; - return TimeInUnixFormat; -} - - -/** - * format a timestamp as a UNIX timestamp; subsecond resolution is - * discarded. - * Note that this code can use some refactoring. I decided to use it - * because mktime() requires an upfront TZ update as it works on local - * time. In any case, it is worth reconsidering to move to mktime() or - * some other method. - * Important: pBuf must point to a buffer of at least 11 bytes. - * rgerhards, 2012-03-29 - */ -int formatTimestampUnix(struct syslogTime *ts, char *pBuf) -{ - snprintf(pBuf, 11, "%u", (unsigned) syslogTime2time_t(ts)); - return 11; -} - - /* queryInterface function * rgerhards, 2008-03-05 */ @@ -1013,8 +875,6 @@ pIf->formatTimestampSecFrac = formatTimestampSecFrac; pIf->formatTimestamp3339 = formatTimestamp3339; pIf->formatTimestamp3164 = formatTimestamp3164; - pIf->formatTimestampUnix = formatTimestampUnix; - pIf->syslogTime2time_t = syslogTime2time_t; finalize_it: ENDobjQueryInterface(datetime) diff -Nru rsyslog-7.6.0/runtime/datetime.h rsyslog-5.10.1/runtime/datetime.h --- rsyslog-7.6.0/runtime/datetime.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/datetime.h 2012-10-17 14:41:20.000000000 +0000 @@ -44,11 +44,8 @@ time_t (*GetTime)(time_t *ttSeconds); /* v6, 2011-06-20 */ void (*timeval2syslogTime)(struct timeval *tp, struct syslogTime *t); - /* v7, 2012-03-29 */ - int (*formatTimestampUnix)(struct syslogTime *ts, char*pBuf); - time_t (*syslogTime2time_t)(struct syslogTime *ts); ENDinterface(datetime) -#define datetimeCURR_IF_VERSION 7 /* increment whenever you change the interface structure! */ +#define datetimeCURR_IF_VERSION 6 /* increment whenever you change the interface structure! */ /* interface changes: * 1 - initial version * 2 - not compatible to 1 - bugfix required ParseTIMESTAMP3164 to accept char ** as @@ -62,6 +59,5 @@ /* prototypes */ PROTOTYPEObj(datetime); -void applyDfltTZ(struct syslogTime *pTime, char *tz); #endif /* #ifndef INCLUDED_DATETIME_H */ diff -Nru rsyslog-7.6.0/runtime/debug.c rsyslog-5.10.1/runtime/debug.c --- rsyslog-7.6.0/runtime/debug.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/debug.c 2012-10-17 14:41:20.000000000 +0000 @@ -44,9 +44,6 @@ #include #include #include -#ifdef HAVE_SYS_SYSCALL_H -# include -#endif #if _POSIX_TIMERS <= 0 #include #endif @@ -60,7 +57,7 @@ /* static data (some time to be replaced) */ DEFobjCurrIf(obj) -int Debug = DEBUG_OFF; /* debug flag - read-only after startup */ +int Debug; /* debug flag - read-only after startup */ int debugging_on = 0; /* read-only, except on sig USR1 */ static int bLogFuncFlow = 0; /* shall the function entry and exit be logged to the debug log? */ static int bLogAllocFree = 0; /* shall calls to (m/c)alloc and free be logged to the debug log? */ @@ -69,9 +66,8 @@ static int bPrintTime = 1; /* print a timestamp together with debug message */ static int bPrintAllDebugOnExit = 0; static int bAbortTrace = 1; /* print a trace after SIGABRT or SIGSEGV */ -static int bOutputTidToStderr = 0;/* output TID to stderr on thread creation */ -char *pszAltDbgFileName = NULL; /* if set, debug output is *also* sent to here */ -int altdbg = -1; /* and the handle for alternate debug output */ +static char *pszAltDbgFileName = NULL; /* if set, debug output is *also* sent to here */ +static int altdbg = -1; /* and the handle for alternate debug output */ int stddbg = 1; /* the handle for regular debug output, set to stdout if not forking, -1 otherwise */ /* list of files/objects that should be printed */ @@ -297,21 +293,6 @@ /* ------------------------- END FuncDB utility functions ------------------------- */ -/* output the current thread ID to "relevant" places - * (what "relevant" means is determinded by various ways) - */ -void -dbgOutputTID(char* name) -{ -# if defined(HAVE_SYSCALL) && defined(HAVE_SYS_gettid) - if(bOutputTidToStderr) - fprintf(stderr, "thread tid %u, name '%s'\n", - (unsigned)syscall(SYS_gettid), name); - DBGPRINTF("thread created, tid %u, name '%s'\n", - (unsigned)syscall(SYS_gettid), name); -# endif -} - /* ########################################################################### * IMPORTANT NOTE * Mutex instrumentation reduces the code's concurrency and thus affects its @@ -860,15 +841,12 @@ static int bWasNL = 0; char pszThrdName[64]; /* 64 is to be on the safe side, anything over 20 is bad... */ char pszWriteBuf[32*1024]; - size_t lenCopy; - size_t offsWriteBuf = 0; size_t lenWriteBuf; struct timespec t; # if _POSIX_TIMERS <= 0 struct timeval tv; # endif -#if 1 /* The bWasNL handler does not really work. It works if no thread * switching occurs during non-NL messages. Else, things are messed * up. Anyhow, it works well enough to provide useful help during @@ -879,8 +857,8 @@ */ if(ptLastThrdID != pthread_self()) { if(!bWasNL) { - pszWriteBuf[0] = '\n'; - offsWriteBuf = 1; + if(stddbg != -1) write(stddbg, "\n", 1); + if(altdbg != -1) write(altdbg, "\n", 1); bWasNL = 1; } ptLastThrdID = pthread_self(); @@ -901,32 +879,25 @@ t.tv_sec = tv.tv_sec; t.tv_nsec = tv.tv_usec * 1000; # endif - lenWriteBuf = snprintf(pszWriteBuf+offsWriteBuf, sizeof(pszWriteBuf) - offsWriteBuf, + lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "%4.4ld.%9.9ld:", (long) (t.tv_sec % 10000), t.tv_nsec); - offsWriteBuf += lenWriteBuf; + if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf); + if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf); } - lenWriteBuf = snprintf(pszWriteBuf + offsWriteBuf, sizeof(pszWriteBuf) - offsWriteBuf, "%s: ", pszThrdName); - offsWriteBuf += lenWriteBuf; + lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "%s: ", pszThrdName); + // use for testing: lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "{%ld}%s: ", (long) syscall(SYS_gettid), pszThrdName); + if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf); + if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf); /* print object name header if we have an object */ if(pszObjName != NULL) { - lenWriteBuf = snprintf(pszWriteBuf + offsWriteBuf, sizeof(pszWriteBuf) - offsWriteBuf, "%s: ", pszObjName); - offsWriteBuf += lenWriteBuf; + lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "%s: ", pszObjName); + if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf); + if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf); } } -#endif - if(lenMsg > sizeof(pszWriteBuf) - offsWriteBuf) - lenCopy = sizeof(pszWriteBuf) - offsWriteBuf; - else - lenCopy = lenMsg; - memcpy(pszWriteBuf + offsWriteBuf, pszMsg, lenCopy); - offsWriteBuf += lenCopy; - /* the write is included in an "if" just to silence compiler - * warnings. Here, we really don't care if the write fails, we - * have no good response to that in any case... -- rgerhards, 2012-11-28 - */ - if(stddbg != -1) if(write(stddbg, pszWriteBuf, offsWriteBuf)){}; - if(altdbg != -1) if(write(altdbg, pszWriteBuf, offsWriteBuf)){}; + if(stddbg != -1) write(stddbg, pszMsg, lenMsg); + if(altdbg != -1) write(altdbg, pszMsg, lenMsg); bWasNL = (pszMsg[lenMsg - 1] == '\n') ? 1 : 0; } @@ -1315,15 +1286,6 @@ } -/* report fd used for debug log. This is needed in case of - * auto-backgrounding, where the debug log shall not be closed. - */ -int -dbgGetDbglogFd(void) -{ - return altdbg; -} - /* read in the runtime options * rgerhards, 2008-02-28 */ @@ -1353,7 +1315,6 @@ "PrintAllDebugInfoOnExit (not yet implemented)\n" "NoLogTimestamp\n" "Nostdoout\n" - "OutputTidToStderr\n" "filetrace=file (may be provided multiple times)\n" "DebugOnDemand - enables debugging on USR1, but does not turn on output\n" "\nSee debug.html in your doc set or http://www.rsyslog.com for details\n"); @@ -1387,8 +1348,6 @@ stddbg = -1; } else if(!strcasecmp((char*)optname, "noaborttrace")) { bAbortTrace = 0; - } else if(!strcasecmp((char*)optname, "outputtidtostderr")) { - bOutputTidToStderr = 1; } else if(!strcasecmp((char*)optname, "filetrace")) { if(*optval == '\0') { fprintf(stderr, "rsyslogd " VERSION " error: logfile debug option requires filename, " @@ -1407,30 +1366,10 @@ } -void -dbgSetDebugLevel(int level) -{ - Debug = level; - debugging_on = (level == DEBUG_FULL) ? 1 : 0; -} - -void -dbgSetDebugFile(uchar *fn) -{ - if(altdbg != -1) { - dbgprintf("switching to debug file %s\n", fn); - close(altdbg); - } - if((altdbg = open((char*)fn, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, S_IRUSR|S_IWUSR)) == -1) { - fprintf(stderr, "alternate debug file could not be opened, ignoring. Error: %s\n", strerror(errno)); - } -} - /* end support system to set debug options at runtime */ rsRetVal dbgClassInit(void) { - pthread_mutexattr_t mutAttr; rsRetVal iRet; /* do not use DEFiRet, as this makes calls into the debug system! */ struct sigaction sigAct; @@ -1438,16 +1377,14 @@ (void) pthread_key_create(&keyCallStack, dbgCallStackDestruct); /* MUST be the first action done! */ - /* the mutexes must be recursive, because it may be called from within - * signal handlers, which can lead to a hang if the signal interrupted dbgprintf - * (yes, we have really seen that situation in practice!). -- rgerhards, 2013-05-17 + /* we initialize all Mutexes with code, as some platforms seem to have + * bugs in the static initializer macros. So better be on the safe side... + * rgerhards, 2008-03-06 */ - pthread_mutexattr_init(&mutAttr); - pthread_mutexattr_settype(&mutAttr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutFuncDBList, &mutAttr); - pthread_mutex_init(&mutMutLog, &mutAttr); - pthread_mutex_init(&mutCallStack, &mutAttr); - pthread_mutex_init(&mutdbgprint, &mutAttr); + pthread_mutex_init(&mutFuncDBList, NULL); + pthread_mutex_init(&mutMutLog, NULL); + pthread_mutex_init(&mutCallStack, NULL); + pthread_mutex_init(&mutdbgprint, NULL); /* while we try not to use any of the real rsyslog code (to avoid infinite loops), we * need to have the ability to query object names. Thus, we need to obtain a pointer to diff -Nru rsyslog-7.6.0/runtime/debug.h rsyslog-5.10.1/runtime/debug.h --- rsyslog-7.6.0/runtime/debug.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/debug.h 2012-10-17 14:41:20.000000000 +0000 @@ -89,8 +89,6 @@ /* prototypes */ rsRetVal dbgClassInit(void); rsRetVal dbgClassExit(void); -void dbgSetDebugFile(uchar *fn); -void dbgSetDebugLevel(int level); void sigsegvHdlr(int signum); void dbgoprint(obj_t *pObj, char *fmt, ...) __attribute__((format(printf, 2, 3))); void dbgprintf(char *fmt, ...) __attribute__((format(printf, 1, 2))); @@ -106,21 +104,10 @@ void dbgSetThrdName(uchar *pszName); void dbgPrintAllDebugInfo(void); void *dbgmalloc(size_t size); -void dbgOutputTID(char* name); -int dbgGetDbglogFd(void); - -/* external data */ -extern char *pszAltDbgFileName; /* if set, debug output is *also* sent to here */ -extern int altdbg; /* and the handle for alternate debug output */ /* macros */ -#ifdef DEBUGLESS -# define DBGPRINTF(...) {} -# define DBGOPRINT(...) {} -#else -# define DBGPRINTF(...) if(Debug) { dbgprintf(__VA_ARGS__); } -# define DBGOPRINT(...) if(Debug) { dbgoprint(__VA_ARGS__); } -#endif +#define DBGPRINTF(...) if(Debug) { dbgprintf(__VA_ARGS__); } +#define DBGOPRINT(...) if(Debug) { dbgoprint(__VA_ARGS__); } #ifdef RTINST # define BEGINfunc static dbgFuncDB_t *pdbgFuncDB; int dbgCALLStaCK_POP_POINT = dbgEntrFunc(&pdbgFuncDB, __FILE__, __func__, __LINE__); # define ENDfunc dbgExitFunc(pdbgFuncDB, dbgCALLStaCK_POP_POINT, RS_RET_NO_IRET); diff -Nru rsyslog-7.6.0/runtime/dnscache.c rsyslog-5.10.1/runtime/dnscache.c --- rsyslog-7.6.0/runtime/dnscache.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/dnscache.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,465 +0,0 @@ -/* dnscache.c - * Implementation of a real DNS cache - * - * File begun on 2011-06-06 by RGerhards - * The initial implementation is far from being optimal. The idea is to - * first get somethting that'S functionally OK, and then evolve the algorithm. - * In any case, even the initial implementaton is far faster than what we had - * before. -- rgerhards, 2011-06-06 - * - * Copyright 2011-2013 by Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" - -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include - -#include "syslogd-types.h" -#include "glbl.h" -#include "errmsg.h" -#include "obj.h" -#include "unicode-helper.h" -#include "net.h" -#include "hashtable.h" -#include "prop.h" -#include "dnscache.h" - -/* module data structures */ -struct dnscache_entry_s { - struct sockaddr_storage addr; - prop_t *fqdn; - prop_t *fqdnLowerCase; - prop_t *localName; /* only local name, without domain part (if configured so) */ - prop_t *ip; - struct dnscache_entry_s *next; - unsigned nUsed; -}; -typedef struct dnscache_entry_s dnscache_entry_t; -struct dnscache_s { - pthread_rwlock_t rwlock; - struct hashtable *ht; - unsigned nEntries; -}; -typedef struct dnscache_s dnscache_t; - - -/* static data */ -DEFobjStaticHelpers -DEFobjCurrIf(glbl) -DEFobjCurrIf(errmsg) -DEFobjCurrIf(prop) -static dnscache_t dnsCache; -static prop_t *staticErrValue; - - -/* Our hash function. - * TODO: check how well it performs on socket addresses! - */ -unsigned int -hash_from_key_fn(void *k) -{ - int len; - uchar *rkey = (uchar*) k; /* we treat this as opaque bytes */ - unsigned hashval = 1; - - len = SALEN((struct sockaddr*)k); - while(len--) - hashval = hashval * 33 + *rkey++; - - return hashval; -} - -static int -key_equals_fn(void *key1, void *key2) -{ - return (SALEN((struct sockaddr*)key1) == SALEN((struct sockaddr*) key2) - && !memcmp(key1, key2, SALEN((struct sockaddr*) key1))); -} - -/* destruct a cache entry. - * Precondition: entry must already be unlinked from list - */ -static void -entryDestruct(dnscache_entry_t *etry) -{ - if(etry->fqdn != NULL) - prop.Destruct(&etry->fqdn); - if(etry->fqdnLowerCase != NULL) - prop.Destruct(&etry->fqdnLowerCase); - if(etry->localName != NULL) - prop.Destruct(&etry->localName); - if(etry->ip != NULL) - prop.Destruct(&etry->ip); - free(etry); -} - -/* init function (must be called once) */ -rsRetVal -dnscacheInit(void) -{ - DEFiRet; - if((dnsCache.ht = create_hashtable(100, hash_from_key_fn, key_equals_fn, - (void(*)(void*))entryDestruct)) == NULL) { - DBGPRINTF("dnscache: error creating hash table!\n"); - ABORT_FINALIZE(RS_RET_ERR); // TODO: make this degrade, but run! - } - dnsCache.nEntries = 0; - pthread_rwlock_init(&dnsCache.rwlock, NULL); - CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */ - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); - - prop.Construct(&staticErrValue); - prop.SetString(staticErrValue, (uchar*)"???", 3); - prop.ConstructFinalize(staticErrValue); -finalize_it: - RETiRet; -} - -/* deinit function (must be called once) */ -rsRetVal -dnscacheDeinit(void) -{ - DEFiRet; - prop.Destruct(&staticErrValue); - hashtable_destroy(dnsCache.ht, 1); /* 1 => free all values automatically */ - pthread_rwlock_destroy(&dnsCache.rwlock); - objRelease(glbl, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); - RETiRet; -} - - -static inline dnscache_entry_t* -findEntry(struct sockaddr_storage *addr) -{ - return((dnscache_entry_t*) hashtable_search(dnsCache.ht, addr)); -} - - -/* This is a cancel-safe getnameinfo() version, because we learned - * (via drd/valgrind) that getnameinfo() seems to have some issues - * when being cancelled, at least if the module was dlloaded. - * rgerhards, 2008-09-30 - */ -static inline int -mygetnameinfo(const struct sockaddr *sa, socklen_t salen, - char *host, size_t hostlen, - char *serv, size_t servlen, int flags) -{ - int iCancelStateSave; - int i; - - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); - i = getnameinfo(sa, salen, host, hostlen, serv, servlen, flags); - pthread_setcancelstate(iCancelStateSave, NULL); - return i; -} - - -/* get only the local part of the hostname and set it in cache entry */ -static inline void -setLocalHostName(dnscache_entry_t *etry) -{ - uchar *fqdnLower; - uchar *p; - int count; - int i; - uchar hostbuf[NI_MAXHOST]; - - if(glbl.GetPreserveFQDN()) { - prop.AddRef(etry->fqdnLowerCase); - etry->localName = etry->fqdnLowerCase; - goto done; - } - - /* strip domain, if configured for this entry */ - fqdnLower = propGetSzStr(etry->fqdnLowerCase); - p = (uchar*)strchr((char*)fqdnLower, '.'); /* find start of domain name "machine.example.com" */ - if(p == NULL) { /* do we have a domain part? */ - prop.AddRef(etry->fqdnLowerCase); /* no! */ - etry->localName = etry->fqdnLowerCase; - goto done; - } - - i = p - fqdnLower; /* length of hostname */ - memcpy(hostbuf, fqdnLower, i); - /* now check if we belong to any of the domain names that were specified - * in the -s command line option. If so, remove and we are done. - */ - if(glbl.GetStripDomains() != NULL) { - count=0; - while(glbl.GetStripDomains()[count]) { - if(strcmp((char*)(p + 1), glbl.GetStripDomains()[count]) == 0) { - prop.CreateStringProp(&etry->localName, hostbuf, i); - goto done; - } - count++; - } - } - /* if we reach this point, we have not found any domain we should strip. Now - * we try and see if the host itself is listed in the -l command line option - * and so should be stripped also. If so, we do it and return. Please note that - * -l list FQDNs, not just the hostname part. If it did just list the hostname, the - * door would be wide-open for all kinds of mixing up of hosts. Because of this, - * you'll see comparison against the full string (pszHostFQDN) below. - */ - if(glbl.GetLocalHosts() != NULL) { - count=0; - while(glbl.GetLocalHosts()[count]) { - if(!strcmp((char*)fqdnLower, (char*)glbl.GetLocalHosts()[count])) { - prop.CreateStringProp(&etry->localName, hostbuf, i); - goto done; - } - count++; - } - } - - /* at this point, we have not found anything, so we again use the - * already-created complete full name property. - */ - prop.AddRef(etry->fqdnLowerCase); - etry->localName = etry->fqdnLowerCase; -done: return; -} - - -/* resolve an address. - * - * Please see http://www.hmug.org/man/3/getnameinfo.php (under Caveats) - * for some explanation of the code found below. We do by default not - * discard message where we detected malicouos DNS PTR records. However, - * there is a user-configurabel option that will tell us if - * we should abort. For this, the return value tells the caller if the - * message should be processed (1) or discarded (0). - */ -static rsRetVal -resolveAddr(struct sockaddr_storage *addr, dnscache_entry_t *etry) -{ - DEFiRet; - int error; - sigset_t omask, nmask; - struct addrinfo hints, *res; - char szIP[80]; /* large enough for IPv6 */ - char fqdnBuf[NI_MAXHOST]; - rs_size_t fqdnLen; - rs_size_t i; - - error = mygetnameinfo((struct sockaddr *)addr, SALEN((struct sockaddr *)addr), - (char*) szIP, sizeof(szIP), NULL, 0, NI_NUMERICHOST); - if(error) { - dbgprintf("Malformed from address %s\n", gai_strerror(error)); - ABORT_FINALIZE(RS_RET_INVALID_SOURCE); - } - - if(!glbl.GetDisableDNS()) { - sigemptyset(&nmask); - sigaddset(&nmask, SIGHUP); - pthread_sigmask(SIG_BLOCK, &nmask, &omask); - - error = mygetnameinfo((struct sockaddr *)addr, SALEN((struct sockaddr *) addr), - fqdnBuf, NI_MAXHOST, NULL, 0, NI_NAMEREQD); - - if(error == 0) { - memset (&hints, 0, sizeof (struct addrinfo)); - hints.ai_flags = AI_NUMERICHOST; - - /* we now do a lookup once again. This one should fail, - * because we should not have obtained a non-numeric address. If - * we got a numeric one, someone messed with DNS! - */ - if(getaddrinfo (fqdnBuf, NULL, &hints, &res) == 0) { - uchar szErrMsg[1024]; - freeaddrinfo (res); - /* OK, we know we have evil. The question now is what to do about - * it. One the one hand, the message might probably be intended - * to harm us. On the other hand, losing the message may also harm us. - * Thus, the behaviour is controlled by the $DropMsgsWithMaliciousDnsPTRRecords - * option. If it tells us we should discard, we do so, else we proceed, - * but log an error message together with it. - * time being, we simply drop the name we obtained and use the IP - that one - * is OK in any way. We do also log the error message. rgerhards, 2007-07-16 - */ - if(glbl.GetDropMalPTRMsgs() == 1) { - snprintf((char*)szErrMsg, sizeof(szErrMsg) / sizeof(uchar), - "Malicious PTR record, message dropped " - "IP = \"%s\" HOST = \"%s\"", - szIP, fqdnBuf); - errmsg.LogError(0, RS_RET_MALICIOUS_ENTITY, "%s", szErrMsg); - pthread_sigmask(SIG_SETMASK, &omask, NULL); - ABORT_FINALIZE(RS_RET_MALICIOUS_ENTITY); - } - - /* Please note: we deal with a malicous entry. Thus, we have crafted - * the snprintf() below so that all text is in front of the entry - maybe - * it contains characters that make the message unreadable - * (OK, I admit this is more or less impossible, but I am paranoid...) - * rgerhards, 2007-07-16 - */ - snprintf((char*)szErrMsg, sizeof(szErrMsg) / sizeof(uchar), - "Malicious PTR record (message accepted, but used IP " - "instead of PTR name: IP = \"%s\" HOST = \"%s\"", - szIP, fqdnBuf); - errmsg.LogError(0, NO_ERRCODE, "%s", szErrMsg); - - error = 1; /* that will trigger using IP address below. */ - } else {/* we have a valid entry, so let's create the respective properties */ - fqdnLen = strlen(fqdnBuf); - prop.CreateStringProp(&etry->fqdn, (uchar*)fqdnBuf, fqdnLen); - for(i = 0 ; i < fqdnLen ; ++i) - fqdnBuf[i] = tolower(fqdnBuf[i]); - prop.CreateStringProp(&etry->fqdnLowerCase, (uchar*)fqdnBuf, fqdnLen); - } - } - pthread_sigmask(SIG_SETMASK, &omask, NULL); - } - - -finalize_it: - if(iRet != RS_RET_OK) { - strcpy(szIP, "?error.obtaining.ip?"); - error = 1; /* trigger hostname copies below! */ - } - - /* we need to create the inputName property (only once during our lifetime) */ - prop.CreateStringProp(&etry->ip, (uchar*)szIP, strlen(szIP)); - - if(error || glbl.GetDisableDNS()) { - dbgprintf("Host name for your address (%s) unknown\n", szIP); - prop.AddRef(etry->ip); - etry->fqdn = etry->ip; - prop.AddRef(etry->ip); - etry->fqdnLowerCase = etry->ip; - } - - setLocalHostName(etry); - - RETiRet; -} - - -static inline rsRetVal -addEntry(struct sockaddr_storage *addr, dnscache_entry_t **pEtry) -{ - int r; - struct sockaddr_storage *keybuf; - dnscache_entry_t *etry = NULL; - DEFiRet; - - CHKmalloc(etry = MALLOC(sizeof(dnscache_entry_t))); - CHKiRet(resolveAddr(addr, etry)); - memcpy(&etry->addr, addr, SALEN((struct sockaddr*) addr)); - etry->nUsed = 0; - *pEtry = etry; - - CHKmalloc(keybuf = malloc(sizeof(struct sockaddr_storage))); - memcpy(keybuf, addr, sizeof(struct sockaddr_storage)); - - pthread_rwlock_unlock(&dnsCache.rwlock); /* release read lock */ - pthread_rwlock_wrlock(&dnsCache.rwlock); /* and re-aquire for writing */ - r = hashtable_insert(dnsCache.ht, keybuf, *pEtry); - if(r == 0) { - DBGPRINTF("dnscache: inserting element failed\n"); - } - pthread_rwlock_unlock(&dnsCache.rwlock); - pthread_rwlock_rdlock(&dnsCache.rwlock); /* we need this again */ - -finalize_it: - if(iRet != RS_RET_OK && etry != NULL) { - /* Note: sub-fields cannot be populated in this case */ - free(etry); - } - RETiRet; -} - - -/* validate if an entry is still valid and, if not, re-query it. - * In the initial implementation, this is a dummy! - * TODO: implement! - */ -static inline rsRetVal -validateEntry(dnscache_entry_t __attribute__((unused)) *etry, struct sockaddr_storage __attribute__((unused)) *addr) -{ - return RS_RET_OK; -} - - -/* This is the main function: it looks up an entry and returns it's name - * and IP address. If the entry is not yet inside the cache, it is added. - * If the entry can not be resolved, an error is reported back. If fqdn - * or fqdnLowerCase are NULL, they are not set. - */ -rsRetVal -dnscacheLookup(struct sockaddr_storage *addr, prop_t **fqdn, prop_t **fqdnLowerCase, - prop_t **localName, prop_t **ip) -{ - dnscache_entry_t *etry; - DEFiRet; - - pthread_rwlock_rdlock(&dnsCache.rwlock); /* TODO: optimize this! */ - etry = findEntry(addr); - dbgprintf("dnscache: entry %p found\n", etry); - if(etry == NULL) { - CHKiRet(addEntry(addr, &etry)); - } else { - CHKiRet(validateEntry(etry, addr)); - } - prop.AddRef(etry->ip); - *ip = etry->ip; - if(fqdn != NULL) { - prop.AddRef(etry->fqdn); - *fqdn = etry->fqdn; - } - if(fqdnLowerCase != NULL) { - prop.AddRef(etry->fqdnLowerCase); - *fqdnLowerCase = etry->fqdnLowerCase; - } - if(localName != NULL) { - prop.AddRef(etry->localName); - *localName = etry->localName; - } - -finalize_it: - pthread_rwlock_unlock(&dnsCache.rwlock); - if(iRet != RS_RET_OK && iRet != RS_RET_ADDRESS_UNKNOWN) { - DBGPRINTF("dnscacheLookup failed with iRet %d\n", iRet); - prop.AddRef(staticErrValue); - *ip = staticErrValue; - if(fqdn != NULL) { - prop.AddRef(staticErrValue); - *fqdn = staticErrValue; - } - if(fqdnLowerCase != NULL) { - prop.AddRef(staticErrValue); - *fqdnLowerCase = staticErrValue; - } - if(localName != NULL) { - prop.AddRef(staticErrValue); - *localName = staticErrValue; - } - } - RETiRet; -} diff -Nru rsyslog-7.6.0/runtime/dnscache.h rsyslog-5.10.1/runtime/dnscache.h --- rsyslog-7.6.0/runtime/dnscache.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/dnscache.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* Definitions for dnscache module. - * - * Copyright 2011-2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef INCLUDED_DNSCACHE_H -#define INCLUDED_DNSCACHE_H - -rsRetVal dnscacheInit(void); -rsRetVal dnscacheDeinit(void); -rsRetVal dnscacheLookup(struct sockaddr_storage *addr, prop_t **fqdn, prop_t **fqdnLowerCase, prop_t **localName, prop_t **ip); - -#endif /* #ifndef INCLUDED_DNSCACHE_H */ diff -Nru rsyslog-7.6.0/runtime/errmsg.c rsyslog-5.10.1/runtime/errmsg.c --- rsyslog-7.6.0/runtime/errmsg.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/errmsg.c 2012-10-17 14:41:20.000000000 +0000 @@ -7,7 +7,7 @@ * to take further case, as the code now boils to be either my own or, a few lines, * of the original BSD-licenses sysklogd code. rgerhards, 2012-01-16 * - * Copyright 2008-2013 Adiscon GmbH. + * Copyright 2008-2012 Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -36,6 +36,7 @@ #include "rsyslog.h" #include "obj.h" #include "errmsg.h" +#include "sysvar.h" #include "srUtils.h" #include "stringbuf.h" @@ -56,90 +57,51 @@ * maps to a specific error event). * rgerhards, 2008-06-27 */ -static void -doLogMsg(const int iErrno, const int iErrCode, const int severity, const char *msg) +static void __attribute__((format(printf, 3, 4))) +LogError(int iErrno, int iErrCode, char *fmt, ... ) { - char buf[2048]; + va_list ap; + char buf[1024]; + char msg[1024]; char errStr[1024]; + size_t lenBuf; + + BEGINfunc + assert(fmt != NULL); + /* Format parameters */ + va_start(ap, fmt); + lenBuf = vsnprintf(buf, sizeof(buf), fmt, ap); + if(lenBuf >= sizeof(buf)) { + /* if our buffer was too small, we simply truncate. */ + lenBuf--; + } + va_end(ap); - dbgprintf("Called LogMsg, msg: %s\n", msg); + /* Log the error now */ + buf[sizeof(buf)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */ + + dbgprintf("Called LogError, msg: %s\n", buf); if(iErrno != 0) { rs_strerror_r(iErrno, errStr, sizeof(errStr)); if(iErrCode == NO_ERRCODE || iErrCode == RS_RET_ERR) { - snprintf(buf, sizeof(buf), "%s: %s", msg, errStr); + snprintf(msg, sizeof(msg), "%s: %s", buf, errStr); } else { - snprintf(buf, sizeof(buf), "%s: %s [try http://www.rsyslog.com/e/%d ]", msg, errStr, iErrCode * -1); + snprintf(msg, sizeof(msg), "%s: %s [try http://www.rsyslog.com/e/%d ]", buf, errStr, iErrCode * -1); } } else { if(iErrCode == NO_ERRCODE || iErrCode == RS_RET_ERR) { - snprintf(buf, sizeof(buf), "%s", msg); + snprintf(msg, sizeof(msg), "%s", buf); } else { - snprintf(buf, sizeof(buf), "%s [try http://www.rsyslog.com/e/%d ]", msg, iErrCode * -1); + snprintf(msg, sizeof(msg), "%s [try http://www.rsyslog.com/e/%d ]", buf, iErrCode * -1); } } - buf[sizeof(buf)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */ + msg[sizeof(msg)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */ errno = 0; - glblErrLogger(severity, iErrCode, (uchar*)buf); -} - -/* We now receive three parameters: one is the internal error code - * which will also become the error message number, the second is - * errno - if it is non-zero, the corresponding error message is included - * in the text and finally the message text itself. Note that it is not - * 100% clean to use the internal errcode, as it may be reached from - * multiple actual error causes. However, it is much better than having - * no error code at all (and in most cases, a single internal error code - * maps to a specific error event). - * rgerhards, 2008-06-27 - */ -static void __attribute__((format(printf, 3, 4))) -LogError(const int iErrno, const int iErrCode, const char *fmt, ... ) -{ - va_list ap; - char buf[2048]; - size_t lenBuf; - - va_start(ap, fmt); - lenBuf = vsnprintf(buf, sizeof(buf), fmt, ap); - if(lenBuf >= sizeof(buf)) { - /* if our buffer was too small, we simply truncate. */ - lenBuf--; - } - va_end(ap); - buf[sizeof(buf)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */ - - doLogMsg(iErrno, iErrCode, LOG_ERR, buf); -} + glblErrLogger(iErrCode, (uchar*)msg); -/* We now receive three parameters: one is the internal error code - * which will also become the error message number, the second is - * errno - if it is non-zero, the corresponding error message is included - * in the text and finally the message text itself. Note that it is not - * 100% clean to use the internal errcode, as it may be reached from - * multiple actual error causes. However, it is much better than having - * no error code at all (and in most cases, a single internal error code - * maps to a specific error event). - * rgerhards, 2008-06-27 - */ -static void __attribute__((format(printf, 4, 5))) -LogMsg(const int iErrno, const int iErrCode, const int severity, const char *fmt, ... ) -{ - va_list ap; - char buf[2048]; - size_t lenBuf; - - va_start(ap, fmt); - lenBuf = vsnprintf(buf, sizeof(buf), fmt, ap); - if(lenBuf >= sizeof(buf)) { - /* if our buffer was too small, we simply truncate. */ - lenBuf--; - } - va_end(ap); - buf[sizeof(buf)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */ - - doLogMsg(iErrno, iErrCode, severity, buf); + ENDfunc } @@ -158,7 +120,6 @@ * of course, also affects the "if" above). */ pIf->LogError = LogError; - pIf->LogMsg = LogMsg; finalize_it: ENDobjQueryInterface(errmsg) diff -Nru rsyslog-7.6.0/runtime/errmsg.h rsyslog-5.10.1/runtime/errmsg.h --- rsyslog-7.6.0/runtime/errmsg.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/errmsg.h 2012-09-23 10:29:49.000000000 +0000 @@ -1,6 +1,6 @@ /* The errmsg object. It is used to emit error message inside rsyslog. * - * Copyright 2008-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -23,6 +23,7 @@ #include "errmsg.h" +/* TODO: define error codes */ #define NO_ERRCODE -1 /* the errmsg object */ @@ -33,11 +34,9 @@ /* interfaces */ BEGINinterface(errmsg) /* name must also be changed in ENDinterface macro! */ - void __attribute__((format(printf, 3, 4))) (*LogError)(const int iErrno, const int iErrCode, const char *pszErrFmt, ... ); - /* v2, 2013-11-29 */ - void __attribute__((format(printf, 4, 5))) (*LogMsg)(const int iErrno, const int iErrCode, const int severity, const char *pszErrFmt, ... ); + void __attribute__((format(printf, 3, 4))) (*LogError)(int iErrno, int iErrCode, char *pszErrFmt, ... ); ENDinterface(errmsg) -#define errmsgCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ +#define errmsgCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ /* prototypes */ diff -Nru rsyslog-7.6.0/runtime/expr.c rsyslog-5.10.1/runtime/expr.c --- rsyslog-7.6.0/runtime/expr.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/expr.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,475 @@ +/* expr.c - an expression class. + * This module contains all code needed to represent expressions. Most + * importantly, that means code to parse and execute them. Expressions + * heavily depend on (loadable) functions, so it works in conjunction + * with the function manager. + * + * Module begun 2007-11-30 by Rainer Gerhards + * + * Copyright 2007-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include + +#include "rsyslog.h" +#include "template.h" +#include "expr.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(vmprg) +DEFobjCurrIf(var) +DEFobjCurrIf(ctok_token) +DEFobjCurrIf(ctok) + + +/* ------------------------------ parser functions ------------------------------ */ +/* the following functions implement the parser. They are all static. For + * simplicity, the function names match their ABNF definition. The ABNF is defined + * in the doc set. See file expression.html for details. I do *not* reproduce it + * here in an effort to keep both files in sync. + * + * All functions receive the current expression object as parameter as well as the + * current tokenizer. + * + * rgerhards, 2008-02-19 + */ + +/* forward definition - thanks to recursive ABNF, we can not avoid at least one ;) */ +static rsRetVal expr(expr_t *pThis, ctok_t *tok); + + +static rsRetVal +function(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken = NULL; + int iNumArgs = 0; + var_t *pVar; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(ctok.GetToken(tok, &pToken)); + /* note: pToken is destructed in finalize_it */ + + if(pToken->tok == ctok_LPAREN) { + CHKiRet(ctok_token.Destruct(&pToken)); /* token processed, "eat" it */ + CHKiRet(ctok.GetToken(tok, &pToken)); /* get next one */ + } else + ABORT_FINALIZE(RS_RET_FUNC_NO_LPAREN); + + /* we first push all the params on the stack. Then we call the function */ + while(pToken->tok != ctok_RPAREN) { + ++iNumArgs; + CHKiRet(ctok.UngetToken(tok, pToken)); /* not for us, so let others process it */ + CHKiRet(expr(pThis, tok)); + CHKiRet(ctok.GetToken(tok, &pToken)); /* get next one, needed for while() check */ + if(pToken->tok == ctok_COMMA) { + CHKiRet(ctok_token.Destruct(&pToken)); /* token processed, "eat" it */ + CHKiRet(ctok.GetToken(tok, &pToken)); /* get next one */ + if(pToken->tok == ctok_RPAREN) { + ABORT_FINALIZE(RS_RET_FUNC_MISSING_EXPR); + } + } + } + + + /* now push number of arguments - this must be on top of the stack */ + CHKiRet(var.Construct(&pVar)); + CHKiRet(var.ConstructFinalize(pVar)); + CHKiRet(var.SetNumber(pVar, iNumArgs)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_PUSHCONSTANT, pVar)); /* add to program */ + + +finalize_it: + if(pToken != NULL) { + ctok_token.Destruct(&pToken); /* "eat" processed token */ + } + + RETiRet; +} + + +static rsRetVal +terminal(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken = NULL; + var_t *pVar; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(ctok.GetToken(tok, &pToken)); + /* note: pToken is destructed in finalize_it */ + + switch(pToken->tok) { + case ctok_SIMPSTR: + dbgoprint((obj_t*) pThis, "simpstr\n"); + CHKiRet(ctok_token.UnlinkVar(pToken, &pVar)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_PUSHCONSTANT, pVar)); /* add to program */ + break; + case ctok_NUMBER: + dbgoprint((obj_t*) pThis, "number\n"); + CHKiRet(ctok_token.UnlinkVar(pToken, &pVar)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_PUSHCONSTANT, pVar)); /* add to program */ + break; + case ctok_FUNCTION: + dbgoprint((obj_t*) pThis, "function\n"); + CHKiRet(function(pThis, tok)); /* this creates the stack call frame */ + /* ... but we place the call instruction onto the stack ourselfs (because + * we have all relevant information) + */ + CHKiRet(ctok_token.UnlinkVar(pToken, &pVar)); + CHKiRet(var.ConvToString(pVar)); /* make sure we have a string */ + CHKiRet(vmprg.AddCallOperation(pThis->pVmprg, pVar->val.pStr)); /* add to program */ + CHKiRet(var.Destruct(&pVar)); + break; + case ctok_MSGVAR: + dbgoprint((obj_t*) pThis, "MSGVAR\n"); + CHKiRet(ctok_token.UnlinkVar(pToken, &pVar)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_PUSHMSGVAR, pVar)); /* add to program */ + break; + case ctok_SYSVAR: + dbgoprint((obj_t*) pThis, "SYSVAR\n"); + CHKiRet(ctok_token.UnlinkVar(pToken, &pVar)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_PUSHSYSVAR, pVar)); /* add to program */ + break; + case ctok_LPAREN: + dbgoprint((obj_t*) pThis, "expr\n"); + CHKiRet(ctok_token.Destruct(&pToken)); /* "eat" processed token */ + CHKiRet(expr(pThis, tok)); + CHKiRet(ctok.GetToken(tok, &pToken)); /* get next one */ + if(pToken->tok != ctok_RPAREN) + ABORT_FINALIZE(RS_RET_SYNTAX_ERROR); + break; + default: + dbgoprint((obj_t*) pThis, "invalid token %d\n", pToken->tok); + ABORT_FINALIZE(RS_RET_SYNTAX_ERROR); + break; + } + +finalize_it: + if(pToken != NULL) { + ctok_token.Destruct(&pToken); /* "eat" processed token */ + } + + RETiRet; +} + +static rsRetVal +factor(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken; + int bWasNot; + int bWasUnaryMinus; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(ctok.GetToken(tok, &pToken)); + if(pToken->tok == ctok_NOT) { + dbgprintf("not\n"); + bWasNot = 1; + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + CHKiRet(ctok.GetToken(tok, &pToken)); /* get new one for next check */ + } else { + bWasNot = 0; + } + + if(pToken->tok == ctok_MINUS) { + dbgprintf("unary minus\n"); + bWasUnaryMinus = 1; + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + } else { + bWasUnaryMinus = 0; + /* we could not process the token, so push it back */ + CHKiRet(ctok.UngetToken(tok, pToken)); + } + + CHKiRet(terminal(pThis, tok)); + + /* warning: the order if the two following ifs is important. Do not change them, this + * would change the semantics of the expression! + */ + if(bWasUnaryMinus) { + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_UNARY_MINUS, NULL)); /* add to program */ + } + + if(bWasNot == 1) { + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_NOT, NULL)); /* add to program */ + } + +finalize_it: + RETiRet; +} + + +static rsRetVal +term(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(factor(pThis, tok)); + + /* *(("*" / "/" / "%") factor) part */ + CHKiRet(ctok.GetToken(tok, &pToken)); + while(pToken->tok == ctok_TIMES || pToken->tok == ctok_DIV || pToken->tok == ctok_MOD) { + dbgoprint((obj_t*) pThis, "/,*,%%\n"); + CHKiRet(factor(pThis, tok)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, (opcode_t) pToken->tok, NULL)); /* add to program */ + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + CHKiRet(ctok.GetToken(tok, &pToken)); + } + + /* unget the token that made us exit the loop - it's obviously not one + * we can process. + */ + CHKiRet(ctok.UngetToken(tok, pToken)); + +finalize_it: + RETiRet; +} + +static rsRetVal +val(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(term(pThis, tok)); + + /* *(("+" / "-") term) part */ + CHKiRet(ctok.GetToken(tok, &pToken)); + while(pToken->tok == ctok_PLUS || pToken->tok == ctok_MINUS || pToken->tok == ctok_STRADD) { + dbgoprint((obj_t*) pThis, "+/-/&\n"); + CHKiRet(term(pThis, tok)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, (opcode_t) pToken->tok, NULL)); /* add to program */ + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + CHKiRet(ctok.GetToken(tok, &pToken)); + } + + /* unget the token that made us exit the loop - it's obviously not one + * we can process. + */ + CHKiRet(ctok.UngetToken(tok, pToken)); + +finalize_it: + RETiRet; +} + + +static rsRetVal +e_cmp(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(val(pThis, tok)); + + /* 0*1(cmp_op val) part */ + CHKiRet(ctok.GetToken(tok, &pToken)); + if(ctok_token.IsCmpOp(pToken)) { + dbgoprint((obj_t*) pThis, "cmp\n"); + CHKiRet(val(pThis, tok)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, (opcode_t) pToken->tok, NULL)); /* add to program */ + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + } else { + /* we could not process the token, so push it back */ + CHKiRet(ctok.UngetToken(tok, pToken)); + } + + +finalize_it: + RETiRet; +} + + +static rsRetVal +e_and(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(e_cmp(pThis, tok)); + + /* *("and" e_cmp) part */ + CHKiRet(ctok.GetToken(tok, &pToken)); + while(pToken->tok == ctok_AND) { + dbgoprint((obj_t*) pThis, "and\n"); + CHKiRet(e_cmp(pThis, tok)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_AND, NULL)); /* add to program */ + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + CHKiRet(ctok.GetToken(tok, &pToken)); + } + + /* unget the token that made us exit the loop - it's obviously not one + * we can process. + */ + CHKiRet(ctok.UngetToken(tok, pToken)); + +finalize_it: + RETiRet; +} + + +static rsRetVal +expr(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + ctok_token_t *pToken; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + CHKiRet(e_and(pThis, tok)); + + /* *("or" e_and) part */ + CHKiRet(ctok.GetToken(tok, &pToken)); + while(pToken->tok == ctok_OR) { + dbgoprint((obj_t*) pThis, "found OR\n"); + CHKiRet(e_and(pThis, tok)); + CHKiRet(vmprg.AddVarOperation(pThis->pVmprg, opcode_OR, NULL)); /* add to program */ + CHKiRet(ctok_token.Destruct(&pToken)); /* no longer needed */ + CHKiRet(ctok.GetToken(tok, &pToken)); + } + + /* unget the token that made us exit the loop - it's obviously not one + * we can process. + */ + CHKiRet(ctok.UngetToken(tok, pToken)); + +finalize_it: + RETiRet; +} + + +/* ------------------------------ end parser functions ------------------------------ */ + + +/* ------------------------------ actual expr object functions ------------------------------ */ + +/* Standard-Constructor + * rgerhards, 2008-02-09 (a rainy Tenerife return flight day ;)) + */ +BEGINobjConstruct(expr) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(expr) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +rsRetVal exprConstructFinalize(expr_t __attribute__((unused)) *pThis) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, expr); + + RETiRet; +} + + +/* destructor for the expr object */ +BEGINobjDestruct(expr) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(expr) + if(pThis->pVmprg != NULL) + vmprg.Destruct(&pThis->pVmprg); +ENDobjDestruct(expr) + + +/* parse an expression object based on a given tokenizer + * rgerhards, 2008-02-19 + */ +rsRetVal +exprParse(expr_t *pThis, ctok_t *tok) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, expr); + ISOBJ_TYPE_assert(tok, ctok); + + /* first, we need to make sure we have a program where we can add to what we parse... */ + CHKiRet(vmprg.Construct(&pThis->pVmprg)); + CHKiRet(vmprg.ConstructFinalize(pThis->pVmprg)); + + /* happy parsing... */ + CHKiRet(expr(pThis, tok)); + dbgoprint((obj_t*) pThis, "successfully parsed/created expression\n"); + +finalize_it: + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(expr) +CODESTARTobjQueryInterface(expr) + if(pIf->ifVersion != exprCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = exprConstruct; + pIf->ConstructFinalize = exprConstructFinalize; + pIf->Destruct = exprDestruct; + pIf->Parse = exprParse; +finalize_it: +ENDobjQueryInterface(expr) + + +/* Initialize the expr class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(expr, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(var, CORE_COMPONENT)); + CHKiRet(objUse(vmprg, CORE_COMPONENT)); + CHKiRet(objUse(var, CORE_COMPONENT)); + CHKiRet(objUse(ctok_token, CORE_COMPONENT)); + CHKiRet(objUse(ctok, CORE_COMPONENT)); + + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, exprConstructFinalize); +ENDObjClassInit(expr) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/expr.h rsyslog-5.10.1/runtime/expr.h --- rsyslog-7.6.0/runtime/expr.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/expr.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,55 @@ +/* The expr object. + * + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_EXPR_H +#define INCLUDED_EXPR_H + +#include "obj.h" +#include "ctok.h" +#include "vmprg.h" +#include "stringbuf.h" + +/* a node inside an expression tree */ +typedef struct exprNode_s { + char dummy; +} exprNode_t; + + +/* the expression object */ +typedef struct expr_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + vmprg_t *pVmprg; /* the expression in vmprg format - ready to execute */ +} expr_t; + + +/* interfaces */ +BEGINinterface(expr) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(expr); + rsRetVal (*Construct)(expr_t **ppThis); + rsRetVal (*ConstructFinalize)(expr_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(expr_t **ppThis); + rsRetVal (*Parse)(expr_t *pThis, ctok_t *ctok); +ENDinterface(expr) +#define exprCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ + +/* prototypes */ +PROTOTYPEObj(expr); + +#endif /* #ifndef INCLUDED_EXPR_H */ diff -Nru rsyslog-7.6.0/runtime/glbl.c rsyslog-5.10.1/runtime/glbl.c --- rsyslog-7.6.0/runtime/glbl.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/glbl.c 2012-10-17 14:41:20.000000000 +0000 @@ -7,7 +7,7 @@ * * Module begun 2008-04-16 by Rainer Gerhards * - * Copyright 2008-2014 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -31,9 +31,7 @@ #include #include #include -#include #include -#include #include #include "rsyslog.h" @@ -44,8 +42,6 @@ #include "prop.h" #include "atomic.h" #include "errmsg.h" -#include "action.h" -#include "rainerscript.h" #include "net.h" /* some defaults */ @@ -63,25 +59,17 @@ * For this object, these variables are obviously what makes the "meat" of the * class... */ -int glblDebugOnShutdown = 0; /* start debug log when we are shut down */ - -static struct cnfobj *mainqCnfObj = NULL;/* main queue object, to be used later in startup sequence */ -int bProcessInternalMessages = 1; /* Should rsyslog itself process internal messages? - * 1 - yes - * 0 - send them to libstdlog (e.g. to push to journal) - */ static uchar *pszWorkDir = NULL; static int bOptimizeUniProc = 1; /* enable uniprocessor optimizations */ static int bParseHOSTNAMEandTAG = 1; /* parser modification (based on startup params!) */ static int bPreserveFQDN = 0; /* should FQDNs always be preserved? */ -static int iMaxLine = 8096; /* maximum length of a syslog message */ +static int iMaxLine = 2048; /* maximum length of a syslog message */ static int iDefPFFamily = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ static int bDropMalPTRMsgs = 0;/* Drop messages which have malicious PTR records during DNS lookup */ static int option_DisallowWarning = 1; /* complain if message from disallowed sender is received */ static int bDisableDNS = 0; /* don't look up IP addresses of remote messages */ static prop_t *propLocalIPIF = NULL;/* IP address to report for the local host (default is 127.0.0.1) */ static prop_t *propLocalHostName = NULL;/* our hostname as FQDN - read-only after startup */ -static prop_t *propLocalHostNameToDelete = NULL;/* see GenerateLocalHostName function hdr comment! */ static uchar *LocalHostName = NULL;/* our hostname - read-only after startup, except HUP */ static uchar *LocalHostNameOverride = NULL;/* user-overridden hostname - read-only after startup */ static uchar *LocalFQDNName = NULL;/* our hostname as FQDN - read-only after startup, except HUP */ @@ -93,42 +81,13 @@ static uchar *pszDfltNetstrmDrvrKeyFile = NULL; /* default key file for the netstrm driver (server) */ static uchar *pszDfltNetstrmDrvrCertFile = NULL; /* default cert file for the netstrm driver (server) */ static int bTerminateInputs = 0; /* global switch that inputs shall terminate ASAP (1=> terminate) */ -pid_t glbl_ourpid; #ifndef HAVE_ATOMIC_BUILTINS static DEF_ATOMIC_HELPER_MUT(mutTerminateInputs); #endif #ifdef USE_UNLIMITED_SELECT static int iFdSetSize = howmany(FD_SETSIZE, __NFDBITS) * sizeof (fd_mask); /* size of select() bitmask in bytes */ #endif -static uchar *SourceIPofLocalClient = NULL; /* [ar] Source IP for local client to be used on multihomed host */ - -/* tables for interfacing with the v6 config system */ -static struct cnfparamdescr cnfparamdescr[] = { - { "workdirectory", eCmdHdlrString, 0 }, - { "dropmsgswithmaliciousdnsptrrecords", eCmdHdlrBinary, 0 }, - { "localhostname", eCmdHdlrGetWord, 0 }, - { "preservefqdn", eCmdHdlrBinary, 0 }, - { "debug.onshutdown", eCmdHdlrBinary, 0 }, - { "debug.logfile", eCmdHdlrString, 0 }, - { "defaultnetstreamdrivercafile", eCmdHdlrString, 0 }, - { "defaultnetstreamdriverkeyfile", eCmdHdlrString, 0 }, - { "defaultnetstreamdriver", eCmdHdlrString, 0 }, - { "maxmessagesize", eCmdHdlrSize, 0 }, - { "action.reportsuspension", eCmdHdlrBinary, 0 }, - { "processinternalmessages", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk paramblk = - { CNFPARAMBLK_VERSION, - sizeof(cnfparamdescr)/sizeof(struct cnfparamdescr), - cnfparamdescr - }; - -static struct cnfparamvals *cnfparamvals = NULL; -/* we need to support multiple calls into our param block, so we need - * to persist the current settings. Note that this must be re-set - * each time a new config load begins (TODO: create interface?) - */ /* define a macro for the simple properties' set and get functions * (which are always the same). This is only suitable for pretty @@ -152,7 +111,6 @@ SIMP_PROP(ParseHOSTNAMEandTAG, bParseHOSTNAMEandTAG, int) SIMP_PROP(OptimizeUniProc, bOptimizeUniProc, int) SIMP_PROP(PreserveFQDN, bPreserveFQDN, int) -SIMP_PROP(mainqCnfObj, mainqCnfObj, struct cnfobj *) SIMP_PROP(MaxLine, iMaxLine, int) SIMP_PROP(DefPFFamily, iDefPFFamily, int) /* note that in the future we may check the family argument */ SIMP_PROP(DropMalPTRMsgs, bDropMalPTRMsgs, int) @@ -183,7 +141,7 @@ } -/* set global termination state to "terminate". Note that this is a +/* set global termiantion state to "terminate". Note that this is a * "once in a lifetime" action which can not be undone. -- gerhards, 2009-07-20 */ static void SetGlobalInputTermination(void) @@ -228,7 +186,7 @@ if(propLocalIPIF != NULL) { errmsg.LogError(0, RS_RET_ERR, "$LocalHostIPIF is already set " "and cannot be reset; place it at TOP OF rsyslog.conf!"); - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_ERR_WRKDIR); } localRet = net.GetIFIPAddr(pNewVal, AF_UNSPEC, myIP, (int) sizeof(myIP)); @@ -296,28 +254,6 @@ RETiRet; } - -static rsRetVal -setDebugFile(void __attribute__((unused)) *pVal, uchar *pNewVal) -{ - DEFiRet; - dbgSetDebugFile(pNewVal); - free(pNewVal); - RETiRet; -} - - -static rsRetVal -setDebugLevel(void __attribute__((unused)) *pVal, int level) -{ - DEFiRet; - dbgSetDebugLevel(level); - dbgprintf("debug level %d set via config file\n", level); - dbgprintf("This is rsyslog version " VERSION "\n"); - RETiRet; -} - - /* return our local IP. * If no local IP is set, "127.0.0.1" is selected *and* set. This * is an intensional side effect that we do in order to keep things @@ -396,31 +332,17 @@ /* generate the local hostname property. This must be done after the hostname info * has been set as well as PreserveFQDN. * rgerhards, 2009-06-30 - * NOTE: This function tries to avoid locking by not destructing the previous value - * immediately. This is so that current readers can continue to use the previous name. - * Otherwise, we would need to use read/write locks to protect the update process. - * In order to do so, we save the previous value and delete it when we are called again - * the next time. Note that this in theory is racy and can lead to a double-free. - * In practice, however, the window of exposure to trigger this is extremely short - * and as this functions is very infrequently being called (on HUP), the trigger - * condition for this bug is so highly unlikely that it never occurs in practice. - * Probably if you HUP rsyslog every few milliseconds, but who does that... - * To further reduce risk potential, we do only update the property when there - * actually is a hostname change, which makes it even less likely. - * rgerhards, 2013-10-28 */ static rsRetVal GenerateLocalHostNameProperty(void) { - uchar *pszPrev; - int lenPrev; - prop_t *hostnameNew; - uchar *pszName; DEFiRet; + uchar *pszName; - if(propLocalHostNameToDelete != NULL) - prop.Destruct(&propLocalHostNameToDelete); + if(propLocalHostName != NULL) + prop.Destruct(&propLocalHostName); + CHKiRet(prop.Construct(&propLocalHostName)); if(LocalHostNameOverride == NULL) { if(LocalHostName == NULL) pszName = (uchar*) "[localhost]"; @@ -434,20 +356,8 @@ pszName = LocalHostNameOverride; } DBGPRINTF("GenerateLocalHostName uses '%s'\n", pszName); - - if(propLocalHostName == NULL) - pszPrev = (uchar*)""; /* make sure strcmp() below does not match */ - else - prop.GetString(propLocalHostName, &pszPrev, &lenPrev); - - if(ustrcmp(pszPrev, pszName)) { - /* we need to update */ - CHKiRet(prop.Construct(&hostnameNew)); - CHKiRet(prop.SetString(hostnameNew, pszName, ustrlen(pszName))); - CHKiRet(prop.ConstructFinalize(hostnameNew)); - propLocalHostNameToDelete = propLocalHostName; - propLocalHostName = hostnameNew; - } + CHKiRet(prop.SetString(propLocalHostName, pszName, ustrlen(pszName))); + CHKiRet(prop.ConstructFinalize(propLocalHostName)); finalize_it: RETiRet; @@ -488,14 +398,6 @@ return(pszWorkDir == NULL ? (uchar*) "" : pszWorkDir); } -/* return the "raw" working directory, which means - * NULL if unset. - */ -const uchar * -glblGetWorkDirRaw(void) -{ - return pszWorkDir; -} /* return the current default netstream driver */ static uchar* @@ -529,23 +431,6 @@ } -/* [ar] Source IP for local client to be used on multihomed host */ -static rsRetVal -SetSourceIPofLocalClient(uchar *newname) -{ - if(SourceIPofLocalClient != NULL) { - free(SourceIPofLocalClient); } - SourceIPofLocalClient = newname; - return RS_RET_OK; -} - -static uchar* -GetSourceIPofLocalClient(void) -{ - return(SourceIPofLocalClient); -} - - /* queryInterface function * rgerhards, 2008-02-21 */ @@ -566,8 +451,6 @@ pIf->GetLocalHostIP = GetLocalHostIP; pIf->SetGlobalInputTermination = SetGlobalInputTermination; pIf->GetGlobalInputTermState = GetGlobalInputTermState; - pIf->GetSourceIPofLocalClient = GetSourceIPofLocalClient; /* [ar] */ - pIf->SetSourceIPofLocalClient = SetSourceIPofLocalClient; /* [ar] */ #define SIMP_PROP(name) \ pIf->Get##name = Get##name; \ pIf->Set##name = Set##name; @@ -579,7 +462,6 @@ SIMP_PROP(DropMalPTRMsgs); SIMP_PROP(Option_DisallowWarning); SIMP_PROP(DisableDNS); - SIMP_PROP(mainqCnfObj); SIMP_PROP(LocalFQDNName) SIMP_PROP(LocalHostName) SIMP_PROP(LocalDomain) @@ -617,7 +499,6 @@ bDropMalPTRMsgs = 0; bOptimizeUniProc = 1; bPreserveFQDN = 0; - iMaxLine = 8192; #ifdef USE_UNLIMITED_SELECT iFdSetSize = howmany(FD_SETSIZE, __NFDBITS) * sizeof (fd_mask); #endif @@ -625,140 +506,6 @@ } -/* Prepare for new config - */ -void -glblPrepCnf(void) -{ - free(mainqCnfObj); - mainqCnfObj = NULL; - free(cnfparamvals); - cnfparamvals = NULL; -} - -/* handle a global config object. Note that multiple global config statements - * are permitted (because of plugin support), so once we got a param block, - * we need to hold to it. - * rgerhards, 2011-07-19 - */ -void -glblProcessCnf(struct cnfobj *o) -{ - int i; - - cnfparamvals = nvlstGetParams(o->nvlst, ¶mblk, cnfparamvals); - dbgprintf("glbl param blk after glblProcessCnf:\n"); - cnfparamsPrint(¶mblk, cnfparamvals); - - /* The next thing is a bit hackish and should be changed in higher - * versions. There are a select few parameters which we need to - * act on immediately. These are processed here. - */ - for(i = 0 ; i < paramblk.nParams ; ++i) { - if(!cnfparamvals[i].bUsed) - continue; - if(!strcmp(paramblk.descr[i].name, "processinternalmessages")) { - bProcessInternalMessages = (int) cnfparamvals[i].val.d.n; - } - } -} - -/* Set mainq parameters. Note that when this is not called, we'll use the - * legacy parameter config. mainq parameters can only be set once. - */ -void -glblProcessMainQCnf(struct cnfobj *o) -{ - if(mainqCnfObj == NULL) { - mainqCnfObj = o; - } else { - errmsg.LogError(0, RS_RET_ERR, "main_queue() object can only be specified " - "once - all but first ignored\n"); - } -} - -/* destruct the main q cnf object after it is no longer needed. This is - * also used to do some final checks. - */ -void -glblDestructMainqCnfObj() -{ - /* Only destruct if not NULL! */ - if (mainqCnfObj != NULL) { - nvlstChkUnused(mainqCnfObj->nvlst); - } - cnfobjDestruct(mainqCnfObj); - mainqCnfObj = NULL; -} - - -/* This processes the "regular" parameters which are to be set after the - * config has been fully loaded. - */ -void -glblDoneLoadCnf(void) -{ - int i; - unsigned char *cstr; - - if(cnfparamvals == NULL) - goto finalize_it; - - for(i = 0 ; i < paramblk.nParams ; ++i) { - if(!cnfparamvals[i].bUsed) - continue; - if(!strcmp(paramblk.descr[i].name, "workdirectory")) { - cstr = (uchar*) es_str2cstr(cnfparamvals[i].val.d.estr, NULL); - setWorkDir(NULL, cstr); - } else if(!strcmp(paramblk.descr[i].name, "localhostname")) { - free(LocalHostNameOverride); - LocalHostNameOverride = (uchar*) - es_str2cstr(cnfparamvals[i].val.d.estr, NULL); - } else if(!strcmp(paramblk.descr[i].name, "defaultnetstreamdriverkeyfile")) { - free(pszDfltNetstrmDrvrKeyFile); - pszDfltNetstrmDrvrKeyFile = (uchar*) - es_str2cstr(cnfparamvals[i].val.d.estr, NULL); - } else if(!strcmp(paramblk.descr[i].name, "defaultnetstreamdrivercafile")) { - free(pszDfltNetstrmDrvrCAF); - pszDfltNetstrmDrvrCAF = (uchar*) - es_str2cstr(cnfparamvals[i].val.d.estr, NULL); - } else if(!strcmp(paramblk.descr[i].name, "defaultnetstreamdriver")) { - free(pszDfltNetstrmDrvr); - pszDfltNetstrmDrvr = (uchar*) - es_str2cstr(cnfparamvals[i].val.d.estr, NULL); - } else if(!strcmp(paramblk.descr[i].name, "preservefqdn")) { - bPreserveFQDN = (int) cnfparamvals[i].val.d.n; - } else if(!strcmp(paramblk.descr[i].name, - "dropmsgswithmaliciousdnsptrrecords")) { - bDropMalPTRMsgs = (int) cnfparamvals[i].val.d.n; - } else if(!strcmp(paramblk.descr[i].name, "action.reportsuspension")) { - bActionReportSuspension = (int) cnfparamvals[i].val.d.n; - } else if(!strcmp(paramblk.descr[i].name, "maxmessagesize")) { - iMaxLine = (int) cnfparamvals[i].val.d.n; - } else if(!strcmp(paramblk.descr[i].name, "debug.onshutdown")) { - glblDebugOnShutdown = (int) cnfparamvals[i].val.d.n; - errmsg.LogError(0, RS_RET_OK, "debug: onShutdown set to %d", glblDebugOnShutdown); - } else if(!strcmp(paramblk.descr[i].name, "debug.logfile")) { - if(pszAltDbgFileName == NULL) { - pszAltDbgFileName = es_str2cstr(cnfparamvals[i].val.d.estr, NULL); - if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, S_IRUSR|S_IWUSR)) == -1) { - errmsg.LogError(0, RS_RET_ERR, "debug log file '%s' could not be opened", pszAltDbgFileName); - } - } - errmsg.LogError(0, RS_RET_OK, "debug log file is '%s', fd %d", pszAltDbgFileName, altdbg); - } else { - dbgprintf("glblDoneLoadCnf: program error, non-handled " - "param '%s'\n", paramblk.descr[i].name); - } - } - - if(glblDebugOnShutdown && Debug != DEBUG_FULL) { - Debug = DEBUG_ONDEMAND; - stddbg = -1; - } -finalize_it: return; -} - /* Initialize the glbl class. Must be called as the very first method * before anything else is called inside this class. @@ -770,8 +517,6 @@ CHKiRet(objUse(errmsg, CORE_COMPONENT)); /* config handlers are never unregistered and need not be - we are always loaded ;) */ - CHKiRet(regCfSysLineHdlr((uchar *)"debugfile", 0, eCmdHdlrGetWord, setDebugFile, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"debuglevel", 0, eCmdHdlrInt, setDebugLevel, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, setWorkDir, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"dropmsgswithmaliciousdnsptrrecords", 0, eCmdHdlrBinary, NULL, &bDropMalPTRMsgs, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"defaultnetstreamdriver", 0, eCmdHdlrGetWord, NULL, &pszDfltNetstrmDrvr, NULL)); @@ -782,8 +527,6 @@ CHKiRet(regCfSysLineHdlr((uchar *)"localhostipif", 0, eCmdHdlrGetWord, setLocalHostIPIF, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"optimizeforuniprocessor", 0, eCmdHdlrBinary, NULL, &bOptimizeUniProc, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"preservefqdn", 0, eCmdHdlrBinary, NULL, &bPreserveFQDN, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"maxmessagesize", 0, eCmdHdlrSize, - NULL, &iMaxLine, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL)); INIT_ATOMIC_HELPER_MUT(mutTerminateInputs); @@ -804,12 +547,8 @@ free(LocalHostNameOverride); free(LocalFQDNName); objRelease(prop, CORE_COMPONENT); - if(propLocalHostNameToDelete != NULL) - prop.Destruct(&propLocalHostNameToDelete); DESTROY_ATOMIC_HELPER_MUT(mutTerminateInputs); ENDObjClassExit(glbl) -void glblProcessCnf(struct cnfobj *o); - /* vi:set ai: */ diff -Nru rsyslog-7.6.0/runtime/glbl.h rsyslog-5.10.1/runtime/glbl.h --- rsyslog-7.6.0/runtime/glbl.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/glbl.h 2012-10-17 14:41:20.000000000 +0000 @@ -8,7 +8,7 @@ * Please note that there currently is no glbl.c file as we do not yet * have any implementations. * - * Copyright 2008-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -30,15 +30,10 @@ #ifndef GLBL_H_INCLUDED #define GLBL_H_INCLUDED -#include -#include "rainerscript.h" #include "prop.h" #define glblGetIOBufSize() 4096 /* size of the IO buffer, e.g. for strm class */ -extern pid_t glbl_ourpid; -extern int bProcessInternalMessages; - /* interfaces */ BEGINinterface(glbl) /* name must also be changed in ENDinterface macro! */ uchar* (*GetWorkDir)(void); @@ -53,7 +48,6 @@ SIMP_PROP(Option_DisallowWarning, int) SIMP_PROP(DisableDNS, int) SIMP_PROP(LocalFQDNName, uchar*) - SIMP_PROP(mainqCnfObj, struct cnfobj*) SIMP_PROP(LocalHostName, uchar*) SIMP_PROP(LocalDomain, uchar*) SIMP_PROP(StripDomains, char**) @@ -80,11 +74,9 @@ */ SIMP_PROP(FdSetSize, int) /* v7: was neeeded to mean v5+v6 - do NOT add anything else for that version! */ - /* next change is v9! */ + /* next change is v8! */ /* v8 - 2012-03-21 */ prop_t* (*GetLocalHostIP)(void); - uchar* (*GetSourceIPofLocalClient)(void); /* [ar] */ - rsRetVal (*SetSourceIPofLocalClient)(uchar*); /* [ar] */ #undef SIMP_PROP ENDinterface(glbl) #define glblCURR_IF_VERSION 7 /* increment whenever you change the interface structure! */ @@ -93,16 +85,4 @@ /* the remaining prototypes */ PROTOTYPEObj(glbl); -extern int glblDebugOnShutdown; /* start debug log when we are shut down */ - -static inline pid_t glblGetOurPid(void) { return glbl_ourpid; } -static inline void glblSetOurPid(pid_t pid) { glbl_ourpid = pid; } - -void glblPrepCnf(void); -void glblProcessCnf(struct cnfobj *o); -void glblProcessMainQCnf(struct cnfobj *o); -void glblDestructMainqCnfObj(); -void glblDoneLoadCnf(void); -const uchar * glblGetWorkDirRaw(void); - #endif /* #ifndef GLBL_H_INCLUDED */ diff -Nru rsyslog-7.6.0/runtime/hashtable.c rsyslog-5.10.1/runtime/hashtable.c --- rsyslog-7.6.0/runtime/hashtable.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/hashtable.c 2012-09-18 15:03:57.000000000 +0000 @@ -263,7 +263,7 @@ /* some generic hash functions */ -/* one provided by Aaaron Wiebe based on perl's hashing algorithm +/* one provided by Aaaron Wiebe based on perl's hashng algorithm * (so probably pretty generic). Not for excessively large strings! */ unsigned int diff -Nru rsyslog-7.6.0/runtime/im-helper.h rsyslog-5.10.1/runtime/im-helper.h --- rsyslog-7.6.0/runtime/im-helper.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/im-helper.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* im-helper.h - * This file contains helper constructs that save time writing input modules. It - * assumes some common field names and plumbing. It is intended to be used together - * with module-template.h - * - * File begun on 2011-05-04 by RGerhards - * - * Copyright 2011 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * The rsyslog runtime library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The rsyslog runtime library 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the rsyslog runtime library. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. - */ -#ifndef IM_HELPER_H_INCLUDED -#define IM_HELPER_H_INCLUDED 1 - - -/* The following function provides a complete implementation to check a - * ruleset and set the actual ruleset pointer. The macro assumes that - * standard field names are used. A functon std_checkRuleset_genErrMsg() - * must be defined to generate error messages in case the ruleset cannot - * be found. - */ -static inline void std_checkRuleset_genErrMsg(modConfData_t *modConf, instanceConf_t *inst); -static inline rsRetVal -std_checkRuleset(modConfData_t *modConf, instanceConf_t *inst) -{ - ruleset_t *pRuleset; - rsRetVal localRet; - DEFiRet; - - inst->pBindRuleset = NULL; /* assume default ruleset */ - - if(inst->pszBindRuleset == NULL) - FINALIZE; - - localRet = ruleset.GetRuleset(modConf->pConf, &pRuleset, inst->pszBindRuleset); - if(localRet == RS_RET_NOT_FOUND) { - std_checkRuleset_genErrMsg(modConf, inst); - } - CHKiRet(localRet); - inst->pBindRuleset = pRuleset; - -finalize_it: - RETiRet; -} - -#endif /* #ifndef IM_HELPER_H_INCLUDED */ - -/* vim:set ai: - */ diff -Nru rsyslog-7.6.0/runtime/libgcry.c rsyslog-5.10.1/runtime/libgcry.c --- rsyslog-7.6.0/runtime/libgcry.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/libgcry.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,716 +0,0 @@ -/* gcry.c - rsyslog's libgcrypt based crypto provider - * - * Copyright 2013 Adiscon GmbH. - * - * We need to store some additional information in support of encryption. - * For this, we create a side-file, which is named like the actual log - * file, but with the suffix ".encinfo" appended. It contains the following - * records: - * IV: The initial vector used at block start. Also indicates start - * start of block. - * END: The end offset of the block, as uint64_t in decimal notation. - * This is used during encryption to know when the current - * encryption block ends. - * For the current implementation, there must always be an IV record - * followed by an END record. Each records is LF-terminated. Record - * types can simply be extended in the future by specifying new - * types (like "IV") before the colon. - * To identify a file as rsyslog encryption info file, it must start with - * the line "FILETYPE:rsyslog-enrcyption-info" - * There are some size constraints: the recordtype must be 31 bytes at - * most and the actual value (between : and LF) must be 1023 bytes at most. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#if HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" -#include "srUtils.h" -#include "libgcry.h" - -#define READBUF_SIZE 4096 /* size of the read buffer */ - -static rsRetVal rsgcryBlkBegin(gcryfile gf); - -static rsRetVal -eiWriteRec(gcryfile gf, char *recHdr, size_t lenRecHdr, char *buf, size_t lenBuf) -{ - struct iovec iov[3]; - ssize_t nwritten, towrite; - DEFiRet; - - iov[0].iov_base = recHdr; - iov[0].iov_len = lenRecHdr; - iov[1].iov_base = buf; - iov[1].iov_len = lenBuf; - iov[2].iov_base = "\n"; - iov[2].iov_len = 1; - towrite = iov[0].iov_len + iov[1].iov_len + iov[2].iov_len; - nwritten = writev(gf->fd, iov, sizeof(iov)/sizeof(struct iovec)); - if(nwritten != towrite) { - DBGPRINTF("eiWrite%s: error writing file, towrite %d, " - "nwritten %d\n", recHdr, (int) towrite, (int) nwritten); - ABORT_FINALIZE(RS_RET_EI_WR_ERR); - } - DBGPRINTF("encryption info file %s: written %s, len %d\n", - recHdr, gf->eiName, (int) nwritten); -finalize_it: - RETiRet; -} - -static rsRetVal -eiOpenRead(gcryfile gf) -{ - DEFiRet; - gf->fd = open((char*)gf->eiName, O_RDONLY|O_NOCTTY|O_CLOEXEC); - if(gf->fd == -1) { - ABORT_FINALIZE(errno == ENOENT ? RS_RET_EI_NO_EXISTS : RS_RET_EI_OPN_ERR); - } -finalize_it: - RETiRet; -} - -static rsRetVal -eiRead(gcryfile gf) -{ - ssize_t nRead; - DEFiRet; - - if(gf->readBuf == NULL) { - CHKmalloc(gf->readBuf = malloc(READBUF_SIZE)); - } - - nRead = read(gf->fd, gf->readBuf, READBUF_SIZE); - if(nRead <= 0) { /* TODO: provide specific EOF case? */ - ABORT_FINALIZE(RS_RET_ERR); - } - gf->readBufMaxIdx = (int16_t) nRead; - gf->readBufIdx = 0; - -finalize_it: - RETiRet; -} - - -/* returns EOF on any kind of error */ -static int -eiReadChar(gcryfile gf) -{ - int c; - - if(gf->readBufIdx >= gf->readBufMaxIdx) { - if(eiRead(gf) != RS_RET_OK) { - c = EOF; - goto finalize_it; - } - } - c = gf->readBuf[gf->readBufIdx++]; -finalize_it: - return c; -} - - -static rsRetVal -eiCheckFiletype(gcryfile gf) -{ - char hdrBuf[128]; - size_t toRead, didRead; - sbool bNeedClose = 0; - DEFiRet; - - if(gf->fd == -1) { - bNeedClose = 1; - CHKiRet(eiOpenRead(gf)); - } - - if(Debug) memset(hdrBuf, 0, sizeof(hdrBuf)); /* for dbgprintf below! */ - toRead = sizeof("FILETYPE:")-1 + sizeof(RSGCRY_FILETYPE_NAME)-1 + 1; - didRead = read(gf->fd, hdrBuf, toRead); - if(bNeedClose) { - close(gf->fd); - gf->fd = -1; - } - DBGPRINTF("eiCheckFiletype read %d bytes: '%s'\n", didRead, hdrBuf); - if( didRead != toRead - || strncmp(hdrBuf, "FILETYPE:" RSGCRY_FILETYPE_NAME "\n", toRead)) - iRet = RS_RET_EI_INVLD_FILE; -finalize_it: - RETiRet; -} - -/* rectype/value must be EIF_MAX_*_LEN+1 long! - * returns 0 on success or something else on error/EOF - */ -static rsRetVal -eiGetRecord(gcryfile gf, char *rectype, char *value) -{ - unsigned short i, j; - int c; - DEFiRet; - - c = eiReadChar(gf); - if(c == EOF) { ABORT_FINALIZE(RS_RET_NO_DATA); } - for(i = 0 ; i < EIF_MAX_RECTYPE_LEN ; ++i) { - if(c == ':' || c == EOF) - break; - rectype[i] = c; - c = eiReadChar(gf); - } - if(c != ':') { ABORT_FINALIZE(RS_RET_ERR); } - rectype[i] = '\0'; - j = 0; - for(++i ; i < EIF_MAX_VALUE_LEN ; ++i, ++j) { - c = eiReadChar(gf); - if(c == '\n' || c == EOF) - break; - value[j] = c; - } - if(c != '\n') { ABORT_FINALIZE(RS_RET_ERR); } - value[j] = '\0'; -finalize_it: - RETiRet; -} - -static rsRetVal -eiGetIV(gcryfile gf, uchar *iv, size_t leniv) -{ - char rectype[EIF_MAX_RECTYPE_LEN+1]; - char value[EIF_MAX_VALUE_LEN+1]; - size_t valueLen; - unsigned short i, j; - unsigned char nibble; - DEFiRet; - - CHKiRet(eiGetRecord(gf, rectype, value)); - if(strcmp(rectype, "IV")) { - DBGPRINTF("no IV record found when expected, record type " - "seen is '%s'\n", rectype); - ABORT_FINALIZE(RS_RET_ERR); - } - valueLen = strlen(value); - if(valueLen/2 != leniv) { - DBGPRINTF("length of IV is %d, expected %d\n", - valueLen/2, leniv); - ABORT_FINALIZE(RS_RET_ERR); - } - - for(i = j = 0 ; i < valueLen ; ++i) { - if(value[i] >= '0' && value[i] <= '9') - nibble = value[i] - '0'; - else if(value[i] >= 'a' && value[i] <= 'f') - nibble = value[i] - 'a' + 10; - else { - DBGPRINTF("invalid IV '%s'\n", value); - ABORT_FINALIZE(RS_RET_ERR); - } - if(i % 2 == 0) - iv[j] = nibble << 4; - else - iv[j++] |= nibble; - } -finalize_it: - RETiRet; -} - -static rsRetVal -eiGetEND(gcryfile gf, off64_t *offs) -{ - char rectype[EIF_MAX_RECTYPE_LEN+1]; - char value[EIF_MAX_VALUE_LEN+1]; - DEFiRet; - - CHKiRet(eiGetRecord(gf, rectype, value)); - if(strcmp(rectype, "END")) { - DBGPRINTF("no END record found when expected, record type " - "seen is '%s'\n", rectype); - ABORT_FINALIZE(RS_RET_ERR); - } - *offs = atoll(value); -finalize_it: - RETiRet; -} - -static rsRetVal -eiOpenAppend(gcryfile gf) -{ - rsRetVal localRet; - DEFiRet; - localRet = eiCheckFiletype(gf); - if(localRet == RS_RET_OK) { - gf->fd = open((char*)gf->eiName, - O_WRONLY|O_APPEND|O_NOCTTY|O_CLOEXEC, 0600); - if(gf->fd == -1) { - ABORT_FINALIZE(RS_RET_EI_OPN_ERR); - } - } else if(localRet == RS_RET_EI_NO_EXISTS) { - /* looks like we need to create a new file */ - gf->fd = open((char*)gf->eiName, - O_WRONLY|O_CREAT|O_NOCTTY|O_CLOEXEC, 0600); - if(gf->fd == -1) { - ABORT_FINALIZE(RS_RET_EI_OPN_ERR); - } - CHKiRet(eiWriteRec(gf, "FILETYPE:", 9, RSGCRY_FILETYPE_NAME, - sizeof(RSGCRY_FILETYPE_NAME)-1)); - } else { - gf->fd = -1; - ABORT_FINALIZE(localRet); - } - DBGPRINTF("encryption info file %s: opened as #%d\n", - gf->eiName, gf->fd); -finalize_it: - RETiRet; -} - -static rsRetVal -eiWriteIV(gcryfile gf, uchar *iv) -{ - static const char hexchars[16] = - {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; - unsigned iSrc, iDst; - char hex[4096]; - DEFiRet; - - if(gf->blkLength > sizeof(hex)/2) { - DBGPRINTF("eiWriteIV: crypto block len way too large, aborting " - "write"); - ABORT_FINALIZE(RS_RET_ERR); - } - - for(iSrc = iDst = 0 ; iSrc < gf->blkLength ; ++iSrc) { - hex[iDst++] = hexchars[iv[iSrc]>>4]; - hex[iDst++] = hexchars[iv[iSrc]&0x0f]; - } - - iRet = eiWriteRec(gf, "IV:", 3, hex, gf->blkLength*2); -finalize_it: - RETiRet; -} - -/* we do not return an error state, as we MUST close the file, - * no matter what happens. - */ -static void -eiClose(gcryfile gf, off64_t offsLogfile) -{ - char offs[21]; - size_t len; - if(gf->fd == -1) - return; - if(gf->openMode == 'w') { - /* 2^64 is 20 digits, so the snprintf buffer is large enough */ - len = snprintf(offs, sizeof(offs), "%lld", offsLogfile); - eiWriteRec(gf, "END:", 4, offs, len); - } - gcry_cipher_close(gf->chd); - free(gf->readBuf); - close(gf->fd); - gf->fd = -1; - DBGPRINTF("encryption info file %s: closed\n", gf->eiName); -} - -/* this returns the number of bytes left inside the block or -1, if the block - * size is unbounded. The function automatically handles end-of-block and begins - * to read the next block in this case. - */ -rsRetVal -gcryfileGetBytesLeftInBlock(gcryfile gf, ssize_t *left) -{ - DEFiRet; - if(gf->bytesToBlkEnd == 0) { - DBGPRINTF("libgcry: end of current crypto block\n"); - gcry_cipher_close(gf->chd); - CHKiRet(rsgcryBlkBegin(gf)); - } - *left = gf->bytesToBlkEnd; -finalize_it: - // TODO: remove once this code is sufficiently well-proven - DBGPRINTF("gcryfileGetBytesLeftInBlock returns %lld, iRet %d\n", (long long) *left, iRet); - RETiRet; -} - -/* this is a special functon for use by the rsyslog disk queue subsystem. It - * needs to have the capability to delete state when a queue file is rolled - * over. This simply generates the file name and deletes it. It must take care - * of "all" state files, which currently happens to be a single one. - */ -rsRetVal -gcryfileDeleteState(uchar *logfn) -{ - char fn[MAXFNAME+1]; - DEFiRet; - snprintf(fn, sizeof(fn), "%s%s", logfn, ENCINFO_SUFFIX); - fn[MAXFNAME] = '\0'; /* be on save side */ - DBGPRINTF("crypto provider deletes state file '%s' on request\n", fn); - unlink(fn); - RETiRet; -} - -static rsRetVal -gcryfileConstruct(gcryctx ctx, gcryfile *pgf, uchar *logfn) -{ - char fn[MAXFNAME+1]; - gcryfile gf; - DEFiRet; - - CHKmalloc(gf = calloc(1, sizeof(struct gcryfile_s))); - gf->ctx = ctx; - gf->fd = -1; - snprintf(fn, sizeof(fn), "%s%s", logfn, ENCINFO_SUFFIX); - fn[MAXFNAME] = '\0'; /* be on save side */ - gf->eiName = (uchar*) strdup(fn); - *pgf = gf; -finalize_it: - RETiRet; -} - - -gcryctx -gcryCtxNew(void) -{ - gcryctx ctx; - ctx = calloc(1, sizeof(struct gcryctx_s)); - ctx->algo = GCRY_CIPHER_AES128; - ctx->mode = GCRY_CIPHER_MODE_CBC; - return ctx; -} - -int -gcryfileDestruct(gcryfile gf, off64_t offsLogfile) -{ - int r = 0; - if(gf == NULL) - goto done; - - DBGPRINTF("libgcry: close file %s\n", gf->eiName); - eiClose(gf, offsLogfile); - if(gf->bDeleteOnClose) { - DBGPRINTF("unlink file '%s' due to bDeleteOnClose set\n", gf->eiName); - unlink((char*)gf->eiName); - } - free(gf->eiName); - free(gf); -done: return r; -} -void -rsgcryCtxDel(gcryctx ctx) -{ - if(ctx != NULL) { - free(ctx); - } -} - -static inline void -addPadding(gcryfile pF, uchar *buf, size_t *plen) -{ - unsigned i; - size_t nPad; - nPad = (pF->blkLength - *plen % pF->blkLength) % pF->blkLength; - DBGPRINTF("libgcry: addPadding %d chars, blkLength %d, mod %d, pad %d\n", - *plen, pF->blkLength, *plen % pF->blkLength, nPad); - for(i = 0 ; i < nPad ; ++i) - buf[(*plen)+i] = 0x00; - (*plen)+= nPad; -} - -static inline void -removePadding(uchar *buf, size_t *plen) -{ - unsigned len = (unsigned) *plen; - unsigned iSrc, iDst; - uchar *frstNUL; - - frstNUL = (uchar*)strchr((char*)buf, 0x00); - if(frstNUL == NULL) - goto done; - iDst = iSrc = frstNUL - buf; - - while(iSrc < len) { - if(buf[iSrc] != 0x00) - buf[iDst++] = buf[iSrc]; - ++iSrc; - } - - *plen = iDst; -done: return; -} - -/* returns 0 on succes, positive if key length does not match and key - * of return value size is required. - */ -int -rsgcrySetKey(gcryctx ctx, unsigned char *key, uint16_t keyLen) -{ - uint16_t reqKeyLen; - int r; - - reqKeyLen = gcry_cipher_get_algo_keylen(ctx->algo); - if(keyLen != reqKeyLen) { - r = reqKeyLen; - goto done; - } - ctx->keyLen = keyLen; - ctx->key = malloc(keyLen); - memcpy(ctx->key, key, keyLen); - r = 0; -done: return r; -} - -rsRetVal -rsgcrySetMode(gcryctx ctx, uchar *modename) -{ - int mode; - DEFiRet; - - mode = rsgcryModename2Mode((char *)modename); - if(mode == GCRY_CIPHER_MODE_NONE) { - ABORT_FINALIZE(RS_RET_CRY_INVLD_MODE); - } - ctx->mode = mode; -finalize_it: - RETiRet; -} - -rsRetVal -rsgcrySetAlgo(gcryctx ctx, uchar *algoname) -{ - int algo; - DEFiRet; - - algo = rsgcryAlgoname2Algo((char *)algoname); - if(algo == GCRY_CIPHER_NONE) { - ABORT_FINALIZE(RS_RET_CRY_INVLD_ALGO); - } - ctx->algo = algo; -finalize_it: - RETiRet; -} - -/* As of some Linux and security expert I spoke to, /dev/urandom - * provides very strong random numbers, even if it runs out of - * entropy. As far as he knew, this is save for all applications - * (and he had good proof that I currently am not permitted to - * reproduce). -- rgerhards, 2013-03-04 - */ -void -seedIV(gcryfile gf, uchar **iv) -{ - int fd; - - *iv = malloc(gf->blkLength); /* do NOT zero-out! */ - /* if we cannot obtain data from /dev/urandom, we use whatever - * is present at the current memory location as random data. Of - * course, this is very weak and we should consider a different - * option, especially when not running under Linux (for Linux, - * unavailability of /dev/urandom is just a theoretic thing, it - * will always work...). -- TODO -- rgerhards, 2013-03-06 - */ - if((fd = open("/dev/urandom", O_RDONLY)) > 0) { - if(read(fd, *iv, gf->blkLength)) {}; /* keep compiler happy */ - close(fd); - } -} - -static inline rsRetVal -readIV(gcryfile gf, uchar **iv) -{ - rsRetVal localRet; - DEFiRet; - - if(gf->fd == -1) { - while(gf->fd == -1) { - localRet = eiOpenRead(gf); - if(localRet == RS_RET_EI_NO_EXISTS) { - /* wait until it is created */ - srSleep(0, 10000); - } else { - CHKiRet(localRet); - } - } - CHKiRet(eiCheckFiletype(gf)); - } - *iv = malloc(gf->blkLength); /* do NOT zero-out! */ - CHKiRet(eiGetIV(gf, *iv, (size_t) gf->blkLength)); -finalize_it: - RETiRet; -} - -/* this tries to read the END record. HOWEVER, no such record may be - * present, which is the case if we handle a currently-written to queue - * file. On the other hand, the queue file may contain multiple blocks. So - * what we do is try to see if there is a block end or not - and set the - * status accordingly. Note that once we found no end-of-block, we will never - * retry. This is because that case can never happen under current queue - * implementations. -- gerhards, 2013-05-16 - */ -static inline rsRetVal -readBlkEnd(gcryfile gf) -{ - off64_t blkEnd; - DEFiRet; - - iRet = eiGetEND(gf, &blkEnd); - if(iRet == RS_RET_OK) { - gf->bytesToBlkEnd = (ssize_t) blkEnd; - } else if(iRet == RS_RET_NO_DATA) { - gf->bytesToBlkEnd = -1; - } else { - FINALIZE; - } - -finalize_it: - RETiRet; -} - - -/* Read the block begin metadata and set our state variables accordingly. Can also - * be used to init the first block in write case. - */ -static rsRetVal -rsgcryBlkBegin(gcryfile gf) -{ - gcry_error_t gcryError; - uchar *iv = NULL; - DEFiRet; - - gcryError = gcry_cipher_open(&gf->chd, gf->ctx->algo, gf->ctx->mode, 0); - if (gcryError) { - DBGPRINTF("gcry_cipher_open failed: %s/%s\n", - gcry_strsource(gcryError), gcry_strerror(gcryError)); - ABORT_FINALIZE(RS_RET_ERR); - } - - gcryError = gcry_cipher_setkey(gf->chd, gf->ctx->key, gf->ctx->keyLen); - if (gcryError) { - DBGPRINTF("gcry_cipher_setkey failed: %s/%s\n", - gcry_strsource(gcryError), gcry_strerror(gcryError)); - ABORT_FINALIZE(RS_RET_ERR); - } - - if(gf->openMode == 'r') { - readIV(gf, &iv); - readBlkEnd(gf); - } else { - seedIV(gf, &iv); - } - - gcryError = gcry_cipher_setiv(gf->chd, iv, gf->blkLength); - if (gcryError) { - DBGPRINTF("gcry_cipher_setiv failed: %s/%s\n", - gcry_strsource(gcryError), gcry_strerror(gcryError)); - ABORT_FINALIZE(RS_RET_ERR); - } - - if(gf->openMode == 'w') { - CHKiRet(eiOpenAppend(gf)); - CHKiRet(eiWriteIV(gf, iv)); - } -finalize_it: - free(iv); - RETiRet; -} - -rsRetVal -rsgcryInitCrypt(gcryctx ctx, gcryfile *pgf, uchar *fname, char openMode) -{ - gcryfile gf = NULL; - DEFiRet; - - CHKiRet(gcryfileConstruct(ctx, &gf, fname)); - gf->openMode = openMode; - gf->blkLength = gcry_cipher_get_algo_blklen(ctx->algo); - CHKiRet(rsgcryBlkBegin(gf)); - *pgf = gf; -finalize_it: - if(iRet != RS_RET_OK && gf != NULL) - gcryfileDestruct(gf, -1); - RETiRet; -} - -rsRetVal -rsgcryEncrypt(gcryfile pF, uchar *buf, size_t *len) -{ - int gcryError; - DEFiRet; - - if(*len == 0) - FINALIZE; - - addPadding(pF, buf, len); - gcryError = gcry_cipher_encrypt(pF->chd, buf, *len, NULL, 0); - if(gcryError) { - dbgprintf("gcry_cipher_encrypt failed: %s/%s\n", - gcry_strsource(gcryError), - gcry_strerror(gcryError)); - ABORT_FINALIZE(RS_RET_ERR); - } -finalize_it: - RETiRet; -} - -/* TODO: handle multiple blocks - * test-read END record; if present, store offset, else unbounded (current active block) - * when decrypting, check if bound is reached. If yes, split into two blocks, get new IV for - * second one. - */ -rsRetVal -rsgcryDecrypt(gcryfile pF, uchar *buf, size_t *len) -{ - gcry_error_t gcryError; - DEFiRet; - - if(pF->bytesToBlkEnd != -1) - pF->bytesToBlkEnd -= *len; - gcryError = gcry_cipher_decrypt(pF->chd, buf, *len, NULL, 0); - if(gcryError) { - DBGPRINTF("gcry_cipher_decrypt failed: %s/%s\n", - gcry_strsource(gcryError), - gcry_strerror(gcryError)); - ABORT_FINALIZE(RS_RET_ERR); - } - removePadding(buf, len); - // TODO: remove dbgprintf once things are sufficently stable -- rgerhards, 2013-05-16 - dbgprintf("libgcry: decrypted, bytesToBlkEnd %lld, buffer is now '%50.50s'\n", (long long) pF->bytesToBlkEnd, buf); - -finalize_it: - RETiRet; -} - - - -/* module-init dummy for potential later use */ -int -rsgcryInit(void) -{ - return 0; -} - -/* module-deinit dummy for potential later use */ -void -rsgcryExit(void) -{ - return; -} diff -Nru rsyslog-7.6.0/runtime/libgcry_common.c rsyslog-5.10.1/runtime/libgcry_common.c --- rsyslog-7.6.0/runtime/libgcry_common.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/libgcry_common.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ -/* libgcry_common.c - * This file hosts functions both being used by the rsyslog runtime as - * well as tools who do not use the runtime (so we can maintain the - * code at a single place). - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#if HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" /* we need data typedefs */ -#include "libgcry.h" - - -/* read a key from a key file - * @param[out] key - key buffer, must be freed by caller - * @param[out] keylen - length of buffer - * @returns 0 if OK, something else otherwise (we do not use - * iRet as this is also called from non-rsyslog w/o runtime) - * The key length is limited to 64KiB to prevent DoS. - * Note well: key is a blob, not a C string (NUL may be present!) - */ -int -gcryGetKeyFromFile(char *fn, char **key, unsigned *keylen) -{ - struct stat sb; - int fd; - int r; - - if(stat(fn, &sb) == -1) { - r = 1; goto done; - } - if((sb.st_mode & S_IFMT) != S_IFREG) { - r = 2; goto done; - } - if(sb.st_size > 64*1024) { - r = 3; goto done; - } - if((*key = malloc(sb.st_size)) == NULL) { - r = -1; goto done; - } - if((fd = open(fn, O_RDONLY)) < 0) { - r = 4; goto done; - } - if(read(fd, *key, sb.st_size) != sb.st_size) { - r = 5; goto done; - } - *keylen = sb.st_size; - close(fd); - r = 0; -done: return r; -} - - -/* execute the child process (must be called in child context - * after fork). - */ - -static void -execKeyScript(char *cmd, int pipefd[]) -{ - char *newargv[] = { NULL }; - char *newenviron[] = { NULL }; - - dup2(pipefd[0], STDIN_FILENO); - dup2(pipefd[1], STDOUT_FILENO); - - /* finally exec child */ -fprintf(stderr, "pre execve: %s\n", cmd); - execve(cmd, newargv, newenviron); - /* switch to? - execlp((char*)program, (char*) program, (char*)arg, NULL); - */ - - /* we should never reach this point, but if we do, we terminate */ - return; -} - - -static int -openPipe(char *cmd, int *fd) -{ - int pipefd[2]; - pid_t cpid; - int r; - - if(pipe(pipefd) == -1) { - r = 1; goto done; - } - - cpid = fork(); - if(cpid == -1) { - r = 1; goto done; - } - - if(cpid == 0) { - /* we are the child */ - execKeyScript(cmd, pipefd); - exit(1); - } - - close(pipefd[1]); - *fd = pipefd[0]; - r = 0; -done: return r; -} - - -/* Read a character from the program's output. */ -// TODO: highly unoptimized version, should be used in buffered -// mode -static int -readProgChar(int fd, char *c) -{ - int r; - if(read(fd, c, 1) != 1) { - r = 1; goto done; - } - r = 0; -done: return r; -} - -/* Read a line from the script. Line is terminated by LF, which - * is NOT put into the buffer. - * buf must be 64KiB - */ -static int -readProgLine(int fd, char *buf) -{ - char c; - int r; - unsigned i; - - for(i = 0 ; i < 64*1024 ; ++i) { - if((r = readProgChar(fd, &c)) != 0) goto done; - if(c == '\n') - break; - buf[i] = c; - }; - if(i >= 64*1024) { - r = 1; goto done; - } - buf[i] = '\0'; - r = 0; -done: return r; -} -static int -readProgKey(int fd, char *buf, unsigned keylen) -{ - char c; - int r; - unsigned i; - - for(i = 0 ; i < keylen ; ++i) { - if((r = readProgChar(fd, &c)) != 0) goto done; - buf[i] = c; - }; - r = 0; -done: return r; -} - -int -gcryGetKeyFromProg(char *cmd, char **key, unsigned *keylen) -{ - int r; - int fd; - char rcvBuf[64*1024]; - - if((r = openPipe(cmd, &fd)) != 0) goto done; - if((r = readProgLine(fd, rcvBuf)) != 0) goto done; - if(strcmp(rcvBuf, "RSYSLOG-KEY-PROVIDER:0")) { - r = 2; goto done; - } - if((r = readProgLine(fd, rcvBuf)) != 0) goto done; - *keylen = atoi(rcvBuf); - if((*key = malloc(*keylen)) == NULL) { - r = -1; goto done; - } - if((r = readProgKey(fd, *key, *keylen)) != 0) goto done; -done: return r; -} diff -Nru rsyslog-7.6.0/runtime/libgcry.h rsyslog-5.10.1/runtime/libgcry.h --- rsyslog-7.6.0/runtime/libgcry.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/libgcry.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/* libgcry.h - rsyslog's guardtime support library - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_LIBGCRY_H -#define INCLUDED_LIBGCRY_H -#include -#include - -struct gcryctx_s { - uchar *key; - size_t keyLen; - int algo; - int mode; -}; -typedef struct gcryctx_s *gcryctx; -typedef struct gcryfile_s *gcryfile; - -/* this describes a file, as far as libgcry is concerned */ -struct gcryfile_s { - gcry_cipher_hd_t chd; /* cypher handle */ - size_t blkLength; /* size of low-level crypto block */ - uchar *eiName; /* name of .encinfo file */ - int fd; /* descriptor of .encinfo file (-1 if not open) */ - char openMode; /* 'r': read, 'w': write */ - gcryctx ctx; - uchar *readBuf; - int16_t readBufIdx; - int16_t readBufMaxIdx; - int8_t bDeleteOnClose; /* for queue support, similar to stream subsys */ - ssize_t bytesToBlkEnd; /* number of bytes remaining in current crypto block - -1 means -> no end (still being writen to, queue files), - 0 means -> end of block, new one must be started. */ -}; - -int gcryGetKeyFromFile(char *fn, char **key, unsigned *keylen); -int rsgcryInit(void); -void rsgcryExit(void); -int rsgcrySetKey(gcryctx ctx, unsigned char *key, uint16_t keyLen); -rsRetVal rsgcrySetMode(gcryctx ctx, uchar *algoname); -rsRetVal rsgcrySetAlgo(gcryctx ctx, uchar *modename); -gcryctx gcryCtxNew(void); -void rsgcryCtxDel(gcryctx ctx); -int gcryfileDestruct(gcryfile gf, off64_t offsLogfile); -rsRetVal rsgcryInitCrypt(gcryctx ctx, gcryfile *pgf, uchar *fname, char openMode); -rsRetVal rsgcryEncrypt(gcryfile pF, uchar *buf, size_t *len); -rsRetVal rsgcryDecrypt(gcryfile pF, uchar *buf, size_t *len); -int gcryGetKeyFromProg(char *cmd, char **key, unsigned *keylen); -rsRetVal gcryfileDeleteState(uchar *fn); -rsRetVal gcryfileGetBytesLeftInBlock(gcryfile gf, ssize_t *left); - -/* error states */ -#define RSGCRYE_EI_OPEN 1 /* error opening .encinfo file */ -#define RSGCRYE_OOM 4 /* ran out of memory */ - -#define EIF_MAX_RECTYPE_LEN 31 /* max length of record types */ -#define EIF_MAX_VALUE_LEN 1023 /* max length of value types */ -#define RSGCRY_FILETYPE_NAME "rsyslog-enrcyption-info" -#define ENCINFO_SUFFIX ".encinfo" - -/* Note: gf may validly be NULL, e.g. if file has not yet been opened! */ -static inline void -gcryfileSetDeleteOnClose(gcryfile gf, int val) -{ - if(gf != NULL) - gf->bDeleteOnClose = val; -} - -static inline int -rsgcryAlgoname2Algo(char *algoname) { - if(!strcmp((char*)algoname, "3DES")) return GCRY_CIPHER_3DES; - if(!strcmp((char*)algoname, "CAST5")) return GCRY_CIPHER_CAST5; - if(!strcmp((char*)algoname, "BLOWFISH")) return GCRY_CIPHER_BLOWFISH; - if(!strcmp((char*)algoname, "AES128")) return GCRY_CIPHER_AES128; - if(!strcmp((char*)algoname, "AES192")) return GCRY_CIPHER_AES192; - if(!strcmp((char*)algoname, "AES256")) return GCRY_CIPHER_AES256; - if(!strcmp((char*)algoname, "TWOFISH")) return GCRY_CIPHER_TWOFISH; - if(!strcmp((char*)algoname, "TWOFISH128")) return GCRY_CIPHER_TWOFISH128; - if(!strcmp((char*)algoname, "ARCFOUR")) return GCRY_CIPHER_ARCFOUR; - if(!strcmp((char*)algoname, "DES")) return GCRY_CIPHER_DES; - if(!strcmp((char*)algoname, "SERPENT128")) return GCRY_CIPHER_SERPENT128; - if(!strcmp((char*)algoname, "SERPENT192")) return GCRY_CIPHER_SERPENT192; - if(!strcmp((char*)algoname, "SERPENT256")) return GCRY_CIPHER_SERPENT256; - if(!strcmp((char*)algoname, "RFC2268_40")) return GCRY_CIPHER_RFC2268_40; - if(!strcmp((char*)algoname, "SEED")) return GCRY_CIPHER_SEED; - if(!strcmp((char*)algoname, "CAMELLIA128")) return GCRY_CIPHER_CAMELLIA128; - if(!strcmp((char*)algoname, "CAMELLIA192")) return GCRY_CIPHER_CAMELLIA192; - if(!strcmp((char*)algoname, "CAMELLIA256")) return GCRY_CIPHER_CAMELLIA256; - return GCRY_CIPHER_NONE; -} - -static inline int -rsgcryModename2Mode(char *modename) { - if(!strcmp((char*)modename, "ECB")) return GCRY_CIPHER_MODE_ECB; - if(!strcmp((char*)modename, "CFB")) return GCRY_CIPHER_MODE_CFB; - if(!strcmp((char*)modename, "CBC")) return GCRY_CIPHER_MODE_CBC; - if(!strcmp((char*)modename, "STREAM")) return GCRY_CIPHER_MODE_STREAM; - if(!strcmp((char*)modename, "OFB")) return GCRY_CIPHER_MODE_OFB; - if(!strcmp((char*)modename, "CTR")) return GCRY_CIPHER_MODE_CTR; -# ifdef GCRY_CIPHER_MODE_AESWRAP - if(!strcmp((char*)modename, "AESWRAP")) return GCRY_CIPHER_MODE_AESWRAP; -# endif - return GCRY_CIPHER_MODE_NONE; -} -#endif /* #ifndef INCLUDED_LIBGCRY_H */ diff -Nru rsyslog-7.6.0/runtime/librsgt.c rsyslog-5.10.1/runtime/librsgt.c --- rsyslog-7.6.0/runtime/librsgt.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/librsgt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,849 +0,0 @@ -/* librsgt.c - rsyslog's guardtime support library - * - * Regarding the online algorithm for Merkle tree signing. Expected - * calling sequence is: - * - * sigblkConstruct - * for each signature block: - * sigblkInit - * for each record: - * sigblkAddRecord - * sigblkFinish - * sigblkDestruct - * - * Obviously, the next call after sigblkFinsh must either be to - * sigblkInit or sigblkDestruct (if no more signature blocks are - * to be emitted, e.g. on file close). sigblkDestruct saves state - * information (most importantly last block hash) and sigblkConstruct - * reads (or initilizes if not present) it. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define MAXFNAME 1024 - -#include - -#include "librsgt.h" - -typedef unsigned char uchar; -#ifndef VERSION -#define VERSION "no-version" -#endif - - -static void -reportErr(gtctx ctx, char *errmsg) -{ - if(ctx->errFunc == NULL) - goto done; - ctx->errFunc(ctx->usrptr, (uchar*)errmsg); -done: return; -} - -static void -reportGTAPIErr(gtctx ctx, gtfile gf, char *apiname, int ecode) -{ - char errbuf[4096]; - snprintf(errbuf, sizeof(errbuf), "%s[%s:%d]: %s", - (gf == NULL) ? (uchar*)"" : gf->sigfilename, - apiname, ecode, GTHTTP_getErrorString(ecode)); - errbuf[sizeof(errbuf)-1] = '\0'; - reportErr(ctx, errbuf); -} - -void -rsgtsetErrFunc(gtctx ctx, void (*func)(void*, uchar *), void *usrptr) -{ - ctx->usrptr = usrptr; - ctx->errFunc = func; -} - -imprint_t * -rsgtImprintFromGTDataHash(GTDataHash *hash) -{ - imprint_t *imp; - - if((imp = calloc(1, sizeof(imprint_t))) == NULL) { - goto done; - } - imp->hashID = hashIdentifier(hash->algorithm), - imp->len = hash->digest_length; - if((imp->data = (uint8_t*)malloc(imp->len)) == NULL) { - free(imp); imp = NULL; goto done; - } - memcpy(imp->data, hash->digest, imp->len); -done: return imp; -} - -void -rsgtimprintDel(imprint_t *imp) -{ - if(imp != NULL) { - free(imp->data), - free(imp); - } -} - -int -rsgtInit(char *usragent) -{ - int r = 0; - int ret = GT_OK; - - ret = GT_init(); - if(ret != GT_OK) { - r = 1; - goto done; - } - ret = GTHTTP_init(usragent, 1); - if(ret != GT_OK) { - r = 1; - goto done; - } -done: return r; -} - -void -rsgtExit(void) -{ - GTHTTP_finalize(); - GT_finalize(); -} - - -static inline gtfile -rsgtfileConstruct(gtctx ctx) -{ - gtfile gf; - if((gf = calloc(1, sizeof(struct gtfile_s))) == NULL) - goto done; - gf->ctx = ctx; - gf->hashAlg = ctx->hashAlg; - gf->blockSizeLimit = ctx->blockSizeLimit; - gf->bKeepRecordHashes = ctx->bKeepRecordHashes; - gf->bKeepTreeHashes = ctx->bKeepTreeHashes; - gf->x_prev = NULL; - -done: return gf; -} - -static inline int -tlvbufPhysWrite(gtfile gf) -{ - ssize_t lenBuf; - ssize_t iTotalWritten; - ssize_t iWritten; - char *pWriteBuf; - int r = 0; - - lenBuf = gf->tlvIdx; - pWriteBuf = gf->tlvBuf; - iTotalWritten = 0; - do { - iWritten = write(gf->fd, pWriteBuf, lenBuf); - if(iWritten < 0) { - iWritten = 0; /* we have written NO bytes! */ - if(errno == EINTR) { - /*NO ERROR, just continue */; - } else { - reportErr(gf->ctx, "signature file write error"); - r = RSGTE_IO; - goto finalize_it; - } - } - /* advance buffer to next write position */ - iTotalWritten += iWritten; - lenBuf -= iWritten; - pWriteBuf += iWritten; - } while(lenBuf > 0); /* Warning: do..while()! */ - -finalize_it: - gf->tlvIdx = 0; - return r; -} - -static inline int -tlvbufChkWrite(gtfile gf) -{ - if(gf->tlvIdx == sizeof(gf->tlvBuf)) { - return tlvbufPhysWrite(gf); - } - return 0; -} - - -/* write to TLV file buffer. If buffer is full, an actual call occurs. Else - * output is written only on flush or close. - */ -static inline int -tlvbufAddOctet(gtfile gf, int8_t octet) -{ - int r; - r = tlvbufChkWrite(gf); - if(r != 0) goto done; - gf->tlvBuf[gf->tlvIdx++] = octet; -done: return r; -} -static inline int -tlvbufAddOctetString(gtfile gf, uint8_t *octet, int size) -{ - int i, r = 0; - for(i = 0 ; i < size ; ++i) { - r = tlvbufAddOctet(gf, octet[i]); - if(r != 0) goto done; - } -done: return r; -} -/* return the actual length in to-be-written octets of an integer */ -static inline uint8_t -tlvbufGetInt64OctetSize(uint64_t val) -{ - if(val >> 56) - return 8; - if((val >> 48) & 0xff) - return 7; - if((val >> 40) & 0xff) - return 6; - if((val >> 32) & 0xff) - return 5; - if((val >> 24) & 0xff) - return 4; - if((val >> 16) & 0xff) - return 3; - if((val >> 8) & 0xff) - return 2; - return 1; -} -static inline int -tlvbufAddInt64(gtfile gf, uint64_t val) -{ - uint8_t doWrite = 0; - int r; - if(val >> 56) { - r = tlvbufAddOctet(gf, (val >> 56) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - if(doWrite || ((val >> 48) & 0xff)) { - r = tlvbufAddOctet(gf, (val >> 48) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - if(doWrite || ((val >> 40) & 0xff)) { - r = tlvbufAddOctet(gf, (val >> 40) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - if(doWrite || ((val >> 32) & 0xff)) { - r = tlvbufAddOctet(gf, (val >> 32) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - if(doWrite || ((val >> 24) & 0xff)) { - r = tlvbufAddOctet(gf, (val >> 24) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - if(doWrite || ((val >> 16) & 0xff)) { - r = tlvbufAddOctet(gf, (val >> 16) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - if(doWrite || ((val >> 8) & 0xff)) { - r = tlvbufAddOctet(gf, (val >> 8) & 0xff), doWrite = 1; - if(r != 0) goto done; - } - r = tlvbufAddOctet(gf, val & 0xff); -done: return r; -} - - -int -tlv8Write(gtfile gf, int flags, int tlvtype, int len) -{ - int r; - assert((flags & RSGT_TYPE_MASK) == 0); - assert((tlvtype & RSGT_TYPE_MASK) == tlvtype); - r = tlvbufAddOctet(gf, (flags & ~RSGT_FLAG_TLV16) | tlvtype); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, len & 0xff); -done: return r; -} - -int -tlv16Write(gtfile gf, int flags, int tlvtype, uint16_t len) -{ - uint16_t typ; - int r; - assert((flags & RSGT_TYPE_MASK) == 0); - assert((tlvtype >> 8 & RSGT_TYPE_MASK) == (tlvtype >> 8)); - typ = ((flags | RSGT_FLAG_TLV16) << 8) | tlvtype; - r = tlvbufAddOctet(gf, typ >> 8); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, typ & 0xff); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, (len >> 8) & 0xff); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, len & 0xff); -done: return r; -} - -int -tlvFlush(gtfile gf) -{ - return (gf->tlvIdx == 0) ? 0 : tlvbufPhysWrite(gf); -} - -int -tlvWriteHash(gtfile gf, uint16_t tlvtype, GTDataHash *rec) -{ - unsigned tlvlen; - int r; - tlvlen = 1 + rec->digest_length; - r = tlv16Write(gf, 0x00, tlvtype, tlvlen); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, hashIdentifier(gf->hashAlg)); - if(r != 0) goto done; - r = tlvbufAddOctetString(gf, rec->digest, rec->digest_length); -done: return r; -} - -int -tlvWriteBlockSig(gtfile gf, uchar *der, uint16_t lenDer) -{ - unsigned tlvlen; - uint8_t tlvlenRecords; - int r; - - tlvlenRecords = tlvbufGetInt64OctetSize(gf->nRecords); - tlvlen = 2 + 1 /* hash algo TLV */ + - 2 + hashOutputLengthOctets(gf->hashAlg) /* iv */ + - 2 + 1 + gf->lenBlkStrtHash /* last hash */ + - 2 + tlvlenRecords /* rec-count */ + - 4 + lenDer /* rfc-3161 */; - /* write top-level TLV object (block-sig */ - r = tlv16Write(gf, 0x00, 0x0902, tlvlen); - if(r != 0) goto done; - /* and now write the children */ - //FIXME: flags??? - /* hash-algo */ - r = tlv8Write(gf, 0x00, 0x00, 1); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, hashIdentifier(gf->hashAlg)); - if(r != 0) goto done; - /* block-iv */ - r = tlv8Write(gf, 0x00, 0x01, hashOutputLengthOctets(gf->hashAlg)); - if(r != 0) goto done; - r = tlvbufAddOctetString(gf, gf->IV, hashOutputLengthOctets(gf->hashAlg)); - if(r != 0) goto done; - /* last-hash */ - r = tlv8Write(gf, 0x00, 0x02, gf->lenBlkStrtHash+1); - if(r != 0) goto done; - r = tlvbufAddOctet(gf, hashIdentifier(gf->hashAlg)); - if(r != 0) goto done; - r = tlvbufAddOctetString(gf, gf->blkStrtHash, gf->lenBlkStrtHash); - if(r != 0) goto done; - /* rec-count */ - r = tlv8Write(gf, 0x00, 0x03, tlvlenRecords); - if(r != 0) goto done; - r = tlvbufAddInt64(gf, gf->nRecords); - if(r != 0) goto done; - /* rfc-3161 */ - r = tlv16Write(gf, 0x00, 0x906, lenDer); - if(r != 0) goto done; - r = tlvbufAddOctetString(gf, der, lenDer); -done: return r; -} - -/* support for old platforms - graceful degrade */ -#ifndef O_CLOEXEC -#define O_CLOEXEC 0 -#endif -/* read rsyslog log state file; if we cannot access it or the - * contents looks invalid, we flag it as non-present (and thus - * begin a new hash chain). - * The context is initialized accordingly. - */ -static void -readStateFile(gtfile gf) -{ - int fd; - struct rsgtstatefile sf; - - fd = open((char*)gf->statefilename, O_RDONLY|O_NOCTTY|O_CLOEXEC, 0600); - if(fd == -1) goto err; - - if(read(fd, &sf, sizeof(sf)) != sizeof(sf)) goto err; - if(strncmp(sf.hdr, "GTSTAT10", 8)) goto err; - - gf->lenBlkStrtHash = sf.lenHash; - gf->blkStrtHash = calloc(1, gf->lenBlkStrtHash); - if(read(fd, gf->blkStrtHash, gf->lenBlkStrtHash) - != gf->lenBlkStrtHash) { - free(gf->blkStrtHash); - goto err; - } -return; - -err: - gf->lenBlkStrtHash = hashOutputLengthOctets(gf->hashAlg); - gf->blkStrtHash = calloc(1, gf->lenBlkStrtHash); -} - -/* persist all information that we need to re-open and append - * to a log signature file. - */ -static void -writeStateFile(gtfile gf) -{ - int fd; - struct rsgtstatefile sf; - - fd = open((char*)gf->statefilename, - O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0600); - if(fd == -1) - goto done; - - memcpy(sf.hdr, "GTSTAT10", 8); - sf.hashID = hashIdentifier(gf->hashAlg); - sf.lenHash = gf->x_prev->len; - /* if the write fails, we cannot do anything against that. We check - * the condition just to keep the compiler happy. - */ - if(write(fd, &sf, sizeof(sf))){}; - if(write(fd, gf->x_prev->data, gf->x_prev->len)){}; - close(fd); -done: return; -} - - -int -tlvClose(gtfile gf) -{ - int r; - r = tlvFlush(gf); - close(gf->fd); - gf->fd = -1; - writeStateFile(gf); - return r; -} - - -/* note: if file exists, the last hash for chaining must - * be read from file. - */ -int -tlvOpen(gtfile gf, char *hdr, unsigned lenHdr) -{ - int r = 0; - gf->fd = open((char*)gf->sigfilename, - O_WRONLY|O_APPEND|O_NOCTTY|O_CLOEXEC, 0600); - if(gf->fd == -1) { - /* looks like we need to create a new file */ - gf->fd = open((char*)gf->sigfilename, - O_WRONLY|O_CREAT|O_NOCTTY|O_CLOEXEC, 0600); - if(gf->fd == -1) { - r = RSGTE_IO; - goto done; - } - memcpy(gf->tlvBuf, hdr, lenHdr); - gf->tlvIdx = lenHdr; - } else { - gf->tlvIdx = 0; /* header already present! */ - } - /* we now need to obtain the last previous hash, so that - * we can continue the hash chain. We do not check for error - * as a state file error can be recovered by graceful degredation. - */ - readStateFile(gf); -done: return r; -} - -/* - * As of some Linux and security expert I spoke to, /dev/urandom - * provides very strong random numbers, even if it runs out of - * entropy. As far as he knew, this is save for all applications - * (and he had good proof that I currently am not permitted to - * reproduce). -- rgerhards, 2013-03-04 - */ -void -seedIV(gtfile gf) -{ - int hashlen; - int fd; - - hashlen = hashOutputLengthOctets(gf->hashAlg); - gf->IV = malloc(hashlen); /* do NOT zero-out! */ - /* if we cannot obtain data from /dev/urandom, we use whatever - * is present at the current memory location as random data. Of - * course, this is very weak and we should consider a different - * option, especially when not running under Linux (for Linux, - * unavailability of /dev/urandom is just a theoretic thing, it - * will always work...). -- TODO -- rgerhards, 2013-03-06 - */ - if((fd = open("/dev/urandom", O_RDONLY)) > 0) { - if(read(fd, gf->IV, hashlen)) {}; /* keep compiler happy */ - close(fd); - } -} - -gtctx -rsgtCtxNew(void) -{ - gtctx ctx; - ctx = calloc(1, sizeof(struct gtctx_s)); - ctx->hashAlg = GT_HASHALG_SHA256; - ctx->errFunc = NULL; - ctx->usrptr = NULL; - ctx->timestamper = strdup( - "http://stamper.guardtime.net/gt-signingservice"); - return ctx; -} - -/* either returns gtfile object or NULL if something went wrong */ -gtfile -rsgtCtxOpenFile(gtctx ctx, unsigned char *logfn) -{ - gtfile gf; - char fn[MAXFNAME+1]; - - if((gf = rsgtfileConstruct(ctx)) == NULL) - goto done; - - snprintf(fn, sizeof(fn), "%s.gtsig", logfn); - fn[MAXFNAME] = '\0'; /* be on save side */ - gf->sigfilename = (uchar*) strdup(fn); - snprintf(fn, sizeof(fn), "%s.gtstate", logfn); - fn[MAXFNAME] = '\0'; /* be on save side */ - gf->statefilename = (uchar*) strdup(fn); - if(tlvOpen(gf, LOGSIGHDR, sizeof(LOGSIGHDR)-1) != 0) { - reportErr(ctx, "signature file open failed"); - gf = NULL; - } -done: return gf; -} - - -/* returns 0 on succes, 1 if algo is unknown */ -int -rsgtSetHashFunction(gtctx ctx, char *algName) -{ - int r = 0; - if(!strcmp(algName, "SHA2-256")) - ctx->hashAlg = GT_HASHALG_SHA256; - else if(!strcmp(algName, "SHA2-384")) - ctx->hashAlg = GT_HASHALG_SHA384; - else if(!strcmp(algName, "SHA2-512")) - ctx->hashAlg = GT_HASHALG_SHA512; - else if(!strcmp(algName, "SHA1")) - ctx->hashAlg = GT_HASHALG_SHA1; - else if(!strcmp(algName, "RIPEMD-160")) - ctx->hashAlg = GT_HASHALG_RIPEMD160; - else if(!strcmp(algName, "SHA2-224")) - ctx->hashAlg = GT_HASHALG_SHA224; - else - r = 1; - return r; -} - -int -rsgtfileDestruct(gtfile gf) -{ - int r = 0; - if(gf == NULL) - goto done; - - if(!gf->disabled && gf->bInBlk) { - r = sigblkFinish(gf); - if(r != 0) gf->disabled = 1; - } - if(!gf->disabled) - r = tlvClose(gf); - free(gf->sigfilename); - free(gf->statefilename); - free(gf->IV); - free(gf->blkStrtHash); - rsgtimprintDel(gf->x_prev); - free(gf); -done: return r; -} - -void -rsgtCtxDel(gtctx ctx) -{ - if(ctx != NULL) { - free(ctx->timestamper); - free(ctx); - } -} - -/* new sigblk is initialized, but maybe in existing ctx */ -void -sigblkInit(gtfile gf) -{ - if(gf == NULL) goto done; - seedIV(gf); - memset(gf->roots_valid, 0, sizeof(gf->roots_valid)/sizeof(char)); - gf->nRoots = 0; - gf->nRecords = 0; - gf->bInBlk = 1; -done: return; -} - - -/* concat: add IV to buffer */ -static inline void -bufAddIV(gtfile gf, uchar *buf, size_t *len) -{ - memcpy(buf+*len, gf->IV, hashOutputLengthOctets(gf->hashAlg)); - *len += sizeof(gf->IV); -} - - -/* concat: add imprint to buffer */ -static inline void -bufAddImprint(gtfile gf, uchar *buf, size_t *len, imprint_t *imp) -{ - if(imp == NULL) { - /* TODO: how to get the REAL HASH ID? --> add field? */ - buf[*len] = hashIdentifier(gf->hashAlg); - ++(*len); - memcpy(buf+*len, gf->blkStrtHash, gf->lenBlkStrtHash); - *len += gf->lenBlkStrtHash; - } else { - buf[*len] = imp->hashID; - ++(*len); - memcpy(buf+*len, imp->data, imp->len); - *len += imp->len; - } -} -/* concat: add hash to buffer */ -static inline void -bufAddHash(gtfile gf, uchar *buf, size_t *len, GTDataHash *hash) -{ - buf[*len] = hashIdentifier(gf->hashAlg); - ++(*len); - memcpy(buf+*len, hash->digest, hash->digest_length); - *len += hash->digest_length; -} -/* concat: add tree level to buffer */ -static inline void -bufAddLevel(uchar *buf, size_t *len, uint8_t level) -{ - memcpy(buf+*len, &level, sizeof(level)); - *len += sizeof(level); -} - - -int -hash_m(gtfile gf, GTDataHash **m) -{ - int rgt; - uchar concatBuf[16*1024]; - size_t len = 0; - int r = 0; - - bufAddImprint(gf, concatBuf, &len, gf->x_prev); - bufAddIV(gf, concatBuf, &len); - rgt = GTDataHash_create(gf->hashAlg, concatBuf, len, m); - if(rgt != GT_OK) { - reportGTAPIErr(gf->ctx, gf, "GTDataHash_create", rgt); - r = RSGTE_HASH_CREATE; - goto done; - } -done: return r; -} - -int -hash_r(gtfile gf, GTDataHash **r, const uchar *rec, const size_t len) -{ - int ret = 0, rgt; - rgt = GTDataHash_create(gf->hashAlg, rec, len, r); - if(rgt != GT_OK) { - reportGTAPIErr(gf->ctx, gf, "GTDataHash_create", rgt); - ret = RSGTE_HASH_CREATE; - goto done; - } -done: return ret; -} - - -int -hash_node(gtfile gf, GTDataHash **node, GTDataHash *m, GTDataHash *rec, - uint8_t level) -{ - int r = 0, rgt; - uchar concatBuf[16*1024]; - size_t len = 0; - - bufAddHash(gf, concatBuf, &len, m); - bufAddHash(gf, concatBuf, &len, rec); - bufAddLevel(concatBuf, &len, level); - rgt = GTDataHash_create(gf->hashAlg, concatBuf, len, node); - if(rgt != GT_OK) { - reportGTAPIErr(gf->ctx, gf, "GTDataHash_create", rgt); - r = RSGTE_HASH_CREATE; - goto done; - } -done: return r; -} - - -int -sigblkAddRecord(gtfile gf, const uchar *rec, const size_t len) -{ - GTDataHash *x; /* current hash */ - GTDataHash *m, *r, *t, *t_del; - uint8_t j; - int ret = 0; - - if(gf == NULL || gf->disabled) goto done; - if((ret = hash_m(gf, &m)) != 0) goto done; - if((ret = hash_r(gf, &r, rec, len)) != 0) goto done; - if(gf->bKeepRecordHashes) - tlvWriteHash(gf, 0x0900, r); - if((ret = hash_node(gf, &x, m, r, 1)) != 0) goto done; /* hash leaf */ - /* persists x here if Merkle tree needs to be persisted! */ - if(gf->bKeepTreeHashes) - tlvWriteHash(gf, 0x0901, x); - rsgtimprintDel(gf->x_prev); - gf->x_prev = rsgtImprintFromGTDataHash(x); - /* add x to the forest as new leaf, update roots list */ - t = x; - for(j = 0 ; j < gf->nRoots ; ++j) { - if(gf->roots_valid[j] == 0) { - gf->roots_hash[j] = t; - gf->roots_valid[j] = 1; - t = NULL; - break; - } else if(t != NULL) { - /* hash interim node */ - t_del = t; - ret = hash_node(gf, &t, gf->roots_hash[j], t_del, j+2); - gf->roots_valid[j] = 0; - GTDataHash_free(gf->roots_hash[j]); - GTDataHash_free(t_del); - if(ret != 0) goto done; - if(gf->bKeepTreeHashes) - tlvWriteHash(gf, 0x0901, t); - } - } - if(t != NULL) { - /* new level, append "at the top" */ - gf->roots_hash[gf->nRoots] = t; - gf->roots_valid[gf->nRoots] = 1; - ++gf->nRoots; - assert(gf->nRoots < MAX_ROOTS); - t = NULL; - } - ++gf->nRecords; - - /* cleanup (x is cleared as part of the roots array) */ - GTDataHash_free(m); - GTDataHash_free(r); - - if(gf->nRecords == gf->blockSizeLimit) { - ret = sigblkFinish(gf); - if(ret != 0) goto done; - sigblkInit(gf); - } -done: - if(ret != 0) { - gf->disabled = 1; - } - return ret; -} - -static int -timestampIt(gtfile gf, GTDataHash *hash) -{ - unsigned char *der = NULL; - size_t lenDer; - int r = GT_OK; - int ret = 0; - GTTimestamp *timestamp = NULL; - - /* Get the timestamp. */ - r = GTHTTP_createTimestampHash(hash, gf->ctx->timestamper, ×tamp); - - if(r != GT_OK) { - reportGTAPIErr(gf->ctx, gf, "GTHTTP_createTimestampHash", r); - ret = 1; - goto done; - } - - /* Encode timestamp. */ - r = GTTimestamp_getDEREncoded(timestamp, &der, &lenDer); - if(r != GT_OK) { - reportGTAPIErr(gf->ctx, gf, "GTTimestamp_getDEREncoded", r); - ret = 1; - goto done; - } - - tlvWriteBlockSig(gf, der, lenDer); - -done: - GT_free(der); - GTTimestamp_free(timestamp); - return ret; -} - - -int -sigblkFinish(gtfile gf) -{ - GTDataHash *root, *rootDel; - int8_t j; - int ret = 0; - - if(gf->nRecords == 0) - goto done; - - root = NULL; - for(j = 0 ; j < gf->nRoots ; ++j) { - if(root == NULL) { - root = gf->roots_valid[j] ? gf->roots_hash[j] : NULL; - gf->roots_valid[j] = 0; - } else if(gf->roots_valid[j]) { - rootDel = root; - ret = hash_node(gf, &root, gf->roots_hash[j], rootDel, j+2); - gf->roots_valid[j] = 0; - GTDataHash_free(gf->roots_hash[j]); - GTDataHash_free(rootDel); - if(ret != 0) goto done; /* checks hash_node() result! */ - } - } - if((ret = timestampIt(gf, root)) != 0) goto done; - - GTDataHash_free(root); - free(gf->blkStrtHash); - gf->lenBlkStrtHash = gf->x_prev->len; - gf->blkStrtHash = malloc(gf->lenBlkStrtHash); - memcpy(gf->blkStrtHash, gf->x_prev->data, gf->x_prev->len); -done: - gf->bInBlk = 0; - return ret; -} diff -Nru rsyslog-7.6.0/runtime/librsgt.h rsyslog-5.10.1/runtime/librsgt.h --- rsyslog-7.6.0/runtime/librsgt.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/librsgt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,391 +0,0 @@ -/* librsgt.h - rsyslog's guardtime support library - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_LIBRSGT_H -#define INCLUDED_LIBRSGT_H -#include - -/* Max number of roots inside the forest. This permits blocks of up to - * 2^MAX_ROOTS records. We assume that 64 is sufficient for all use - * cases ;) [and 64 is not really a waste of memory, so we do not even - * try to work with reallocs and such...] - */ -#define MAX_ROOTS 64 -#define LOGSIGHDR "LOGSIG10" - -/* context for gt calls. This primarily serves as a container for the - * config settings. The actual file-specific data is kept in gtfile. - */ -struct gtctx_s { - enum GTHashAlgorithm hashAlg; - uint8_t bKeepRecordHashes; - uint8_t bKeepTreeHashes; - uint64_t blockSizeLimit; - char *timestamper; - void (*errFunc)(void *, unsigned char*); - void *usrptr; /* for error function */ -}; -typedef struct gtctx_s *gtctx; -typedef struct gtfile_s *gtfile; -typedef struct gterrctx_s gterrctx_t; -typedef struct imprint_s imprint_t; -typedef struct block_sig_s block_sig_t; -typedef struct tlvrecord_s tlvrecord_t; - -/* this describes a file, as far as librsgt is concerned */ -struct gtfile_s { - /* the following data items are mirrored from gtctx to - * increase cache hit ratio (they are frequently accesed). - */ - enum GTHashAlgorithm hashAlg; - uint8_t bKeepRecordHashes; - uint8_t bKeepTreeHashes; - /* end mirrored properties */ - uint8_t disabled; /* permits to disable this file --> set to 1 */ - uint64_t blockSizeLimit; - uint8_t *IV; /* initial value for blinding masks */ - imprint_t *x_prev; /* last leaf hash (maybe of previous block) --> preserve on term */ - unsigned char *sigfilename; - unsigned char *statefilename; - int fd; - unsigned char *blkStrtHash; /* last hash from previous block */ - uint16_t lenBlkStrtHash; - uint64_t nRecords; /* current number of records in current block */ - uint64_t bInBlk; /* are we currently inside a blk --> need to finish on close */ - int8_t nRoots; - /* algo engineering: roots structure is split into two arrays - * in order to improve cache hits. - */ - int8_t roots_valid[MAX_ROOTS]; - GTDataHash *roots_hash[MAX_ROOTS]; - /* data members for the associated TLV file */ - char tlvBuf[4096]; - int tlvIdx; /* current index into tlvBuf */ - gtctx ctx; -}; - -struct tlvrecord_s { - uint16_t tlvtype; - uint16_t tlvlen; - uint8_t hdr[4]; /* the raw header (as persisted to file) */ - uint8_t lenHdr; /* length of raw header */ - uint8_t data[64*1024]; /* the actual data part (of length tlvlen) */ -}; - -/* The following structure describes the "error context" to be used - * for verification and similiar reader functions. While verifying, - * we need some information (like filenames or block numbers) that - * is not readily available from the other objects (or not even known - * to librsgt). In order to provide meaningful error messages, this - * information must be passed in from the external callers. In order - * to centralize information (and make it more manageable), we use - * ths error context here, which contains everything needed to - * generate good error messages. Members of this structure are - * maintained both by library users (the callers) as well as - * the library itself. Who does what simply depends on who has - * the relevant information. - */ -struct gterrctx_s { - FILE *fp; /**< file for error messages */ - char *filename; - uint8_t verbose; - uint64_t recNumInFile; - uint64_t recNum; - uint64_t blkNum; - uint8_t treeLevel; - GTDataHash *computedHash; - GTDataHash *lefthash, *righthash; /* hashes to display if tree hash fails */ - imprint_t *fileHash; - int gtstate; /* status from last relevant GT.*() function call */ - char *errRec; - char *frstRecInBlk; /* This holds the first message seen inside the current block */ -}; - -struct imprint_s { - uint8_t hashID; - int len; - uint8_t *data; -}; - -#define SIGID_RFC3161 0 -struct block_sig_s { - uint8_t hashID; - uint8_t sigID; /* what type of *signature*? */ - uint8_t *iv; - imprint_t lastHash; - uint64_t recCount; - struct { - struct { - uint8_t *data; - size_t len; /* must be size_t due to GT API! */ - } der; - } sig; -}; - - -/* the following defines the gtstate file record. Currently, this record - * is fixed, we may change that over time. - */ -struct rsgtstatefile { - char hdr[8]; /* must be "GTSTAT10" */ - uint8_t hashID; - uint8_t lenHash; - /* after that, the hash value is contained within the file */ -}; - -/* Flags and record types for TLV handling */ -#define RSGT_FLAG_NONCRIT 0x80 -#define RSGT_FLAG_FORWARD 0x40 -#define RSGT_FLAG_TLV16 0x20 -#define RSGT_TYPE_MASK 0x1f - -/* error states */ -#define RSGTE_IO 1 /* any kind of io error */ -#define RSGTE_FMT 2 /* data fromat error */ -#define RSGTE_INVLTYP 3 /* invalid TLV type record (unexcpected at this point) */ -#define RSGTE_OOM 4 /* ran out of memory */ -#define RSGTE_LEN 5 /* error related to length records */ -#define RSGTE_TS_EXTEND 6/* error extending timestamp */ -#define RSGTE_INVLD_RECCNT 7/* mismatch between actual records and records - given in block-sig record */ -#define RSGTE_INVLHDR 8/* invalid file header */ -#define RSGTE_EOF 9 /* specific EOF */ -#define RSGTE_MISS_REC_HASH 10 /* record hash missing when expected */ -#define RSGTE_MISS_TREE_HASH 11 /* tree hash missing when expected */ -#define RSGTE_INVLD_REC_HASH 12 /* invalid record hash (failed verification) */ -#define RSGTE_INVLD_TREE_HASH 13 /* invalid tree hash (failed verification) */ -#define RSGTE_INVLD_REC_HASHID 14 /* invalid record hash ID (failed verification) */ -#define RSGTE_INVLD_TREE_HASHID 15 /* invalid tree hash ID (failed verification) */ -#define RSGTE_MISS_BLOCKSIG 16 /* block signature record missing when expected */ -#define RSGTE_INVLD_TIMESTAMP 17 /* RFC3161 timestamp is invalid */ -#define RSGTE_TS_DERDECODE 18 /* error DER-Decoding a timestamp */ -#define RSGTE_TS_DERENCODE 19 /* error DER-Encoding a timestamp */ -#define RSGTE_HASH_CREATE 20 /* error creating a hash */ - -/* the following function maps RSGTE_* state to a string - must be updated - * whenever a new state is added. - * Note: it is thread-safe to call this function, as it returns a pointer - * into constant memory pool. - */ -static inline char * -RSGTE2String(int err) -{ - switch(err) { - case 0: - return "success"; - case RSGTE_IO: - return "i/o error"; - case RSGTE_FMT: - return "data format error"; - case RSGTE_INVLTYP: - return "invalid/unexpected tlv record type"; - case RSGTE_OOM: - return "out of memory"; - case RSGTE_LEN: - return "length record problem"; - case RSGTE_TS_EXTEND: - return "error extending timestamp"; - case RSGTE_INVLD_RECCNT: - return "mismatch between actual record count and number in block signature record"; - case RSGTE_INVLHDR: - return "invalid file header"; - case RSGTE_EOF: - return "EOF"; - case RSGTE_MISS_REC_HASH: - return "record hash missing"; - case RSGTE_MISS_TREE_HASH: - return "tree hash missing"; - case RSGTE_INVLD_REC_HASH: - return "record hash mismatch"; - case RSGTE_INVLD_TREE_HASH: - return "tree hash mismatch"; - case RSGTE_INVLD_REC_HASHID: - return "invalid record hash ID"; - case RSGTE_INVLD_TREE_HASHID: - return "invalid tree hash ID"; - case RSGTE_MISS_BLOCKSIG: - return "missing block signature record"; - case RSGTE_INVLD_TIMESTAMP: - return "RFC3161 timestamp invalid"; - case RSGTE_TS_DERDECODE: - return "error DER-decoding RFC3161 timestamp"; - case RSGTE_TS_DERENCODE: - return "error DER-encoding RFC3161 timestamp"; - case RSGTE_HASH_CREATE: - return "error creating hash"; - default: - return "unknown error"; - } -} - - -static inline uint16_t -hashOutputLengthOctets(uint8_t hashID) -{ - switch(hashID) { - case GT_HASHALG_SHA1: /* paper: SHA1 */ - return 20; - case GT_HASHALG_RIPEMD160: /* paper: RIPEMD-160 */ - return 20; - case GT_HASHALG_SHA224: /* paper: SHA2-224 */ - return 28; - case GT_HASHALG_SHA256: /* paper: SHA2-256 */ - return 32; - case GT_HASHALG_SHA384: /* paper: SHA2-384 */ - return 48; - case GT_HASHALG_SHA512: /* paper: SHA2-512 */ - return 64; - default:return 32; - } -} - -static inline uint8_t -hashIdentifier(enum GTHashAlgorithm hashID) -{ - switch(hashID) { - case GT_HASHALG_SHA1: /* paper: SHA1 */ - return 0x00; - case GT_HASHALG_RIPEMD160: /* paper: RIPEMD-160 */ - return 0x02; - case GT_HASHALG_SHA224: /* paper: SHA2-224 */ - return 0x03; - case GT_HASHALG_SHA256: /* paper: SHA2-256 */ - return 0x01; - case GT_HASHALG_SHA384: /* paper: SHA2-384 */ - return 0x04; - case GT_HASHALG_SHA512: /* paper: SHA2-512 */ - return 0x05; - default:return 0xff; - } -} -static inline char * -hashAlgName(uint8_t hashID) -{ - switch(hashID) { - case GT_HASHALG_SHA1: - return "SHA1"; - case GT_HASHALG_RIPEMD160: - return "RIPEMD-160"; - case GT_HASHALG_SHA224: - return "SHA2-224"; - case GT_HASHALG_SHA256: - return "SHA2-256"; - case GT_HASHALG_SHA384: - return "SHA2-384"; - case GT_HASHALG_SHA512: - return "SHA2-512"; - default:return "[unknown]"; - } -} -static inline enum GTHashAlgorithm -hashID2Alg(uint8_t hashID) -{ - switch(hashID) { - case 0x00: - return GT_HASHALG_SHA1; - case 0x02: - return GT_HASHALG_RIPEMD160; - case 0x03: - return GT_HASHALG_SHA224; - case 0x01: - return GT_HASHALG_SHA256; - case 0x04: - return GT_HASHALG_SHA384; - case 0x05: - return GT_HASHALG_SHA512; - default: - return 0xff; - } -} -static inline char * -sigTypeName(uint8_t sigID) -{ - switch(sigID) { - case SIGID_RFC3161: - return "RFC3161"; - default:return "[unknown]"; - } -} -static inline uint16_t -getIVLen(block_sig_t *bs) -{ - return hashOutputLengthOctets(bs->hashID); -} -static inline void -rsgtSetTimestamper(gtctx ctx, char *timestamper) -{ - free(ctx->timestamper); - ctx->timestamper = strdup(timestamper); -} -static inline void -rsgtSetBlockSizeLimit(gtctx ctx, uint64_t limit) -{ - ctx->blockSizeLimit = limit; -} -static inline void -rsgtSetKeepRecordHashes(gtctx ctx, int val) -{ - ctx->bKeepRecordHashes = val; -} -static inline void -rsgtSetKeepTreeHashes(gtctx ctx, int val) -{ - ctx->bKeepTreeHashes = val; -} - -int rsgtSetHashFunction(gtctx ctx, char *algName); -int rsgtInit(char *usragent); -void rsgtExit(void); -gtctx rsgtCtxNew(void); -void rsgtsetErrFunc(gtctx ctx, void (*func)(void*, unsigned char *), void *usrptr); -gtfile rsgtCtxOpenFile(gtctx ctx, unsigned char *logfn); -int rsgtfileDestruct(gtfile gf); -void rsgtCtxDel(gtctx ctx); -void sigblkInit(gtfile gf); -int sigblkAddRecord(gtfile gf, const unsigned char *rec, const size_t len); -int sigblkFinish(gtfile gf); -imprint_t * rsgtImprintFromGTDataHash(GTDataHash *hash); -void rsgtimprintDel(imprint_t *imp); -/* reader functions */ -int rsgt_tlvrdHeader(FILE *fp, unsigned char *hdr); -int rsgt_tlvrd(FILE *fp, tlvrecord_t *rec, void *obj); -void rsgt_tlvprint(FILE *fp, uint16_t tlvtype, void *obj, uint8_t verbose); -void rsgt_printBLOCK_SIG(FILE *fp, block_sig_t *bs, uint8_t verbose); -int rsgt_getBlockParams(FILE *fp, uint8_t bRewind, block_sig_t **bs, uint8_t *bHasRecHashes, uint8_t *bHasIntermedHashes); -int rsgt_chkFileHdr(FILE *fp, char *expect); -gtfile rsgt_vrfyConstruct_gf(void); -void rsgt_vrfyBlkInit(gtfile gf, block_sig_t *bs, uint8_t bHasRecHashes, uint8_t bHasIntermedHashes); -int rsgt_vrfy_nextRec(block_sig_t *bs, gtfile gf, FILE *sigfp, FILE *nsigfp, unsigned char *rec, size_t len, gterrctx_t *ectx); -int verifyBLOCK_SIG(block_sig_t *bs, gtfile gf, FILE *sigfp, FILE *nsigfp, uint8_t bExtend, gterrctx_t *ectx); -void rsgt_errctxInit(gterrctx_t *ectx); -void rsgt_errctxExit(gterrctx_t *ectx); -void rsgt_errctxSetErrRec(gterrctx_t *ectx, char *rec); -void rsgt_errctxFrstRecInBlk(gterrctx_t *ectx, char *rec); -void rsgt_objfree(uint16_t tlvtype, void *obj); - - -/* TODO: replace these? */ -int hash_m(gtfile gf, GTDataHash **m); -int hash_r(gtfile gf, GTDataHash **r, const unsigned char *rec, const size_t len); -int hash_node(gtfile gf, GTDataHash **node, GTDataHash *m, GTDataHash *r, uint8_t level); -extern char *rsgt_read_puburl; /**< url of publication server */ -extern uint8_t rsgt_read_showVerified; - -#endif /* #ifndef INCLUDED_LIBRSGT_H */ diff -Nru rsyslog-7.6.0/runtime/librsgt_read.c rsyslog-5.10.1/runtime/librsgt_read.c --- rsyslog-7.6.0/runtime/librsgt_read.c 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/runtime/librsgt_read.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1092 +0,0 @@ -/* librsgt_read.c - rsyslog's guardtime support library - * This includes functions used for reading signature (and - * other related) files. Well, actually it also contains - * some writing functionality, but only as far as rsyslog - * itself is not concerned, but "just" the utility programs. - * - * This part of the library uses C stdio and expects that the - * caller will open and close the file to be read itself. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "librsgt.h" - -typedef unsigned char uchar; -#ifndef VERSION -#define VERSION "no-version" -#endif -#define MAXFNAME 1024 - -static int rsgt_read_debug = 0; -char *rsgt_read_puburl = "http://verify.guardtime.com/gt-controlpublications.bin"; -char *rsgt_extend_puburl = "http://verifier.guardtime.net/gt-extendingservice"; -uint8_t rsgt_read_showVerified = 0; - -/* macro to obtain next char from file including error tracking */ -#define NEXTC if((c = fgetc(fp)) == EOF) { \ - r = feof(fp) ? RSGTE_EOF : RSGTE_IO; \ - goto done; \ - } - -/* check return state of operation and abort, if non-OK */ -#define CHKr(code) if((r = code) != 0) goto done - - -/* if verbose==0, only the first and last two octets are shown, - * otherwise everything. - */ -static void -outputHexBlob(FILE *fp, uint8_t *blob, uint16_t len, uint8_t verbose) -{ - unsigned i; - if(verbose || len <= 8) { - for(i = 0 ; i < len ; ++i) - fprintf(fp, "%2.2x", blob[i]); - } else { - fprintf(fp, "%2.2x%2.2x%2.2x[...]%2.2x%2.2x%2.2x", - blob[0], blob[1], blob[2], - blob[len-3], blob[len-2], blob[len-1]); - } -} - -static inline void -outputHash(FILE *fp, char *hdr, uint8_t *data, uint16_t len, uint8_t verbose) -{ - fprintf(fp, "%s", hdr); - outputHexBlob(fp, data, len, verbose); - fputc('\n', fp); -} - -void -rsgt_errctxInit(gterrctx_t *ectx) -{ - ectx->fp = NULL; - ectx->filename = NULL; - ectx->recNum = 0; - ectx->gtstate = 0; - ectx->recNumInFile = 0; - ectx->blkNum = 0; - ectx->verbose = 0; - ectx->errRec = NULL; - ectx->frstRecInBlk = NULL; - ectx->fileHash = NULL; - ectx->lefthash = ectx->righthash = ectx->computedHash = NULL; -} -void -rsgt_errctxExit(gterrctx_t *ectx) -{ - free(ectx->filename); - free(ectx->frstRecInBlk); -} - -/* note: we do not copy the record, so the caller MUST not destruct - * it before processing of the record is completed. To remove the - * current record without setting a new one, call this function - * with rec==NULL. - */ -void -rsgt_errctxSetErrRec(gterrctx_t *ectx, char *rec) -{ - ectx->errRec = strdup(rec); -} -/* This stores the block's first record. Here we copy the data, - * as the caller will usually not preserve it long enough. - */ -void -rsgt_errctxFrstRecInBlk(gterrctx_t *ectx, char *rec) -{ - free(ectx->frstRecInBlk); - ectx->frstRecInBlk = strdup(rec); -} - -static void -reportError(int errcode, gterrctx_t *ectx) -{ - if(ectx->fp != NULL) { - fprintf(ectx->fp, "%s[%llu:%llu:%llu]: error[%u]: %s\n", - ectx->filename, - (long long unsigned) ectx->blkNum, (long long unsigned) ectx->recNum, - (long long unsigned) ectx->recNumInFile, - errcode, RSGTE2String(errcode)); - if(ectx->frstRecInBlk != NULL) - fprintf(ectx->fp, "\tBlock Start Record.: '%s'\n", ectx->frstRecInBlk); - if(ectx->errRec != NULL) - fprintf(ectx->fp, "\tRecord in Question.: '%s'\n", ectx->errRec); - if(ectx->computedHash != NULL) { - outputHash(ectx->fp, "\tComputed Hash......: ", ectx->computedHash->digest, - ectx->computedHash->digest_length, ectx->verbose); - } - if(ectx->fileHash != NULL) { - outputHash(ectx->fp, "\tSignature File Hash: ", ectx->fileHash->data, - ectx->fileHash->len, ectx->verbose); - } - if(errcode == RSGTE_INVLD_TREE_HASH || - errcode == RSGTE_INVLD_TREE_HASHID) { - fprintf(ectx->fp, "\tTree Level.........: %d\n", (int) ectx->treeLevel); - outputHash(ectx->fp, "\tTree Left Hash.....: ", ectx->lefthash->digest, - ectx->lefthash->digest_length, ectx->verbose); - outputHash(ectx->fp, "\tTree Right Hash....: ", ectx->righthash->digest, - ectx->righthash->digest_length, ectx->verbose); - } - if(errcode == RSGTE_INVLD_TIMESTAMP || - errcode == RSGTE_TS_DERDECODE) { - fprintf(ectx->fp, "\tPublication Server.: %s\n", rsgt_read_puburl); - fprintf(ectx->fp, "\tGT Verify Timestamp: [%u]%s\n", - ectx->gtstate, GTHTTP_getErrorString(ectx->gtstate)); - } - if(errcode == RSGTE_TS_EXTEND || - errcode == RSGTE_TS_DERDECODE) { - fprintf(ectx->fp, "\tExtending Server...: %s\n", rsgt_extend_puburl); - fprintf(ectx->fp, "\tGT Extend Timestamp: [%u]%s\n", - ectx->gtstate, GTHTTP_getErrorString(ectx->gtstate)); - } - if(errcode == RSGTE_TS_DERENCODE) { - fprintf(ectx->fp, "\tAPI return state...: [%u]%s\n", - ectx->gtstate, GTHTTP_getErrorString(ectx->gtstate)); - } - } -} - -/* obviously, this is not an error-reporting function. We still use - * ectx, as it has most information we need. - */ -static void -reportVerifySuccess(gterrctx_t *ectx, GTVerificationInfo *vrfyInf) -{ - if(ectx->fp != NULL) { - fprintf(ectx->fp, "%s[%llu:%llu:%llu]: block signature successfully verified\n", - ectx->filename, - (long long unsigned) ectx->blkNum, (long long unsigned) ectx->recNum, - (long long unsigned) ectx->recNumInFile); - if(ectx->frstRecInBlk != NULL) - fprintf(ectx->fp, "\tBlock Start Record.: '%s'\n", ectx->frstRecInBlk); - if(ectx->errRec != NULL) - fprintf(ectx->fp, "\tBlock End Record...: '%s'\n", ectx->errRec); - fprintf(ectx->fp, "\tGT Verify Timestamp: [%u]%s\n", - ectx->gtstate, GTHTTP_getErrorString(ectx->gtstate)); - GTVerificationInfo_print(ectx->fp, 0, vrfyInf); - } -} - -/** - * Write the provided record to the current file position. - * - * @param[in] fp file pointer for writing - * @param[out] rec tlvrecord to write - * - * @returns 0 if ok, something else otherwise - */ -static int -rsgt_tlvwrite(FILE *fp, tlvrecord_t *rec) -{ - int r = RSGTE_IO; - if(fwrite(rec->hdr, (size_t) rec->lenHdr, 1, fp) != 1) goto done; - if(fwrite(rec->data, (size_t) rec->tlvlen, 1, fp) != 1) goto done; - r = 0; -done: return r; -} - -/** - * Read a header from a binary file. - * @param[in] fp file pointer for processing - * @param[in] hdr buffer for the header. Must be 9 bytes - * (8 for header + NUL byte) - * @returns 0 if ok, something else otherwise - */ -int -rsgt_tlvrdHeader(FILE *fp, uchar *hdr) -{ - int r; - if(fread(hdr, 8, 1, fp) != 1) { - r = RSGTE_IO; - goto done; - } - hdr[8] = '\0'; - r = 0; -done: return r; -} - -/* read type a complete tlv record - */ -static int -rsgt_tlvRecRead(FILE *fp, tlvrecord_t *rec) -{ - int r = 1; - int c; - - NEXTC; - rec->hdr[0] = c; - rec->tlvtype = c & 0x1f; - if(c & RSGT_FLAG_TLV16) { /* tlv16? */ - rec->lenHdr = 4; - NEXTC; - rec->hdr[1] = c; - rec->tlvtype = (rec->tlvtype << 8) | c; - NEXTC; - rec->hdr[2] = c; - rec->tlvlen = c << 8; - NEXTC; - rec->hdr[3] = c; - rec->tlvlen |= c; - } else { - NEXTC; - rec->lenHdr = 2; - rec->hdr[1] = c; - rec->tlvlen = c; - } - if(fread(rec->data, (size_t) rec->tlvlen, 1, fp) != 1) { - r = feof(fp) ? RSGTE_EOF : RSGTE_IO; - goto done; - } - - if(rsgt_read_debug) - printf("read tlvtype %4.4x, len %u\n", (unsigned) rec->tlvtype, - (unsigned) rec->tlvlen); - r = 0; -done: return r; -} - -/* decode a sub-tlv record from an existing record's memory buffer - */ -static int -rsgt_tlvDecodeSUBREC(tlvrecord_t *rec, uint16_t *stridx, tlvrecord_t *newrec) -{ - int r = 1; - int c; - - if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;} - c = rec->data[(*stridx)++]; - newrec->hdr[0] = c; - newrec->tlvtype = c & 0x1f; - if(c & RSGT_FLAG_TLV16) { /* tlv16? */ - newrec->lenHdr = 4; - if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;} - c = rec->data[(*stridx)++]; - newrec->hdr[1] = c; - newrec->tlvtype = (newrec->tlvtype << 8) | c; - if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;} - c = rec->data[(*stridx)++]; - newrec->hdr[2] = c; - newrec->tlvlen = c << 8; - if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;} - c = rec->data[(*stridx)++]; - newrec->hdr[3] = c; - newrec->tlvlen |= c; - } else { - if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;} - c = rec->data[(*stridx)++]; - newrec->lenHdr = 2; - newrec->hdr[1] = c; - newrec->tlvlen = c; - } - if(rec->tlvlen < *stridx + newrec->tlvlen) {r=RSGTE_LEN; goto done;} - memcpy(newrec->data, (rec->data)+(*stridx), newrec->tlvlen); - *stridx += newrec->tlvlen; - - if(rsgt_read_debug) - printf("read sub-tlv: tlvtype %4.4x, len %u\n", - (unsigned) newrec->tlvtype, - (unsigned) newrec->tlvlen); - r = 0; -done: return r; -} - - -static int -rsgt_tlvDecodeIMPRINT(tlvrecord_t *rec, imprint_t **imprint) -{ - int r = 1; - imprint_t *imp; - - if((imp = calloc(1, sizeof(imprint_t))) == NULL) { - r = RSGTE_OOM; - goto done; - } - - imp->hashID = rec->data[0]; - if(rec->tlvlen != 1 + hashOutputLengthOctets(imp->hashID)) { - r = RSGTE_LEN; - goto done; - } - imp->len = rec->tlvlen - 1; - if((imp->data = (uint8_t*)malloc(imp->len)) == NULL) {r=RSGTE_OOM;goto done;} - memcpy(imp->data, rec->data+1, imp->len); - *imprint = imp; - r = 0; -done: return r; -} - -static int -rsgt_tlvDecodeHASH_ALGO(tlvrecord_t *rec, uint16_t *strtidx, uint8_t *hashAlg) -{ - int r = 1; - tlvrecord_t subrec; - - CHKr(rsgt_tlvDecodeSUBREC(rec, strtidx, &subrec)); - if(!(subrec.tlvtype == 0x00 && subrec.tlvlen == 1)) { - r = RSGTE_FMT; - goto done; - } - *hashAlg = subrec.data[0]; - r = 0; -done: return r; -} -static int -rsgt_tlvDecodeBLOCK_IV(tlvrecord_t *rec, uint16_t *strtidx, uint8_t **iv) -{ - int r = 1; - tlvrecord_t subrec; - - CHKr(rsgt_tlvDecodeSUBREC(rec, strtidx, &subrec)); - if(!(subrec.tlvtype == 0x01)) { - r = RSGTE_INVLTYP; - goto done; - } - if((*iv = (uint8_t*)malloc(subrec.tlvlen)) == NULL) {r=RSGTE_OOM;goto done;} - memcpy(*iv, subrec.data, subrec.tlvlen); - r = 0; -done: return r; -} -static int -rsgt_tlvDecodeLAST_HASH(tlvrecord_t *rec, uint16_t *strtidx, imprint_t *imp) -{ - int r = 1; - tlvrecord_t subrec; - - CHKr(rsgt_tlvDecodeSUBREC(rec, strtidx, &subrec)); - if(!(subrec.tlvtype == 0x02)) { r = RSGTE_INVLTYP; goto done; } - imp->hashID = subrec.data[0]; - if(subrec.tlvlen != 1 + hashOutputLengthOctets(imp->hashID)) { - r = RSGTE_LEN; - goto done; - } - imp->len = subrec.tlvlen - 1; - if((imp->data = (uint8_t*)malloc(imp->len)) == NULL) {r=RSGTE_OOM;goto done;} - memcpy(imp->data, subrec.data+1, subrec.tlvlen-1); - r = 0; -done: return r; -} -static int -rsgt_tlvDecodeREC_COUNT(tlvrecord_t *rec, uint16_t *strtidx, uint64_t *cnt) -{ - int r = 1; - int i; - uint64_t val; - tlvrecord_t subrec; - - CHKr(rsgt_tlvDecodeSUBREC(rec, strtidx, &subrec)); - if(!(subrec.tlvtype == 0x03 && subrec.tlvlen <= 8)) { r = RSGTE_INVLTYP; goto done; } - val = 0; - for(i = 0 ; i < subrec.tlvlen ; ++i) { - val = (val << 8) + subrec.data[i]; - } - *cnt = val; - r = 0; -done: return r; -} -static int -rsgt_tlvDecodeSIG(tlvrecord_t *rec, uint16_t *strtidx, block_sig_t *bs) -{ - int r = 1; - tlvrecord_t subrec; - - CHKr(rsgt_tlvDecodeSUBREC(rec, strtidx, &subrec)); - if(!(subrec.tlvtype == 0x0906)) { r = RSGTE_INVLTYP; goto done; } - bs->sig.der.len = subrec.tlvlen; - bs->sigID = SIGID_RFC3161; - if((bs->sig.der.data = (uint8_t*)malloc(bs->sig.der.len)) == NULL) {r=RSGTE_OOM;goto done;} - memcpy(bs->sig.der.data, subrec.data, bs->sig.der.len); - r = 0; -done: return r; -} - -static int -rsgt_tlvDecodeBLOCK_SIG(tlvrecord_t *rec, block_sig_t **blocksig) -{ - int r = 1; - uint16_t strtidx = 0; - block_sig_t *bs; - if((bs = calloc(1, sizeof(block_sig_t))) == NULL) { - r = RSGTE_OOM; - goto done; - } - CHKr(rsgt_tlvDecodeHASH_ALGO(rec, &strtidx, &(bs->hashID))); - CHKr(rsgt_tlvDecodeBLOCK_IV(rec, &strtidx, &(bs->iv))); - CHKr(rsgt_tlvDecodeLAST_HASH(rec, &strtidx, &(bs->lastHash))); - CHKr(rsgt_tlvDecodeREC_COUNT(rec, &strtidx, &(bs->recCount))); - CHKr(rsgt_tlvDecodeSIG(rec, &strtidx, bs)); - if(strtidx != rec->tlvlen) { - r = RSGTE_LEN; - goto done; - } - *blocksig = bs; - r = 0; -done: return r; -} -static int -rsgt_tlvRecDecode(tlvrecord_t *rec, void *obj) -{ - int r = 1; - switch(rec->tlvtype) { - case 0x0900: - case 0x0901: - r = rsgt_tlvDecodeIMPRINT(rec, obj); - if(r != 0) goto done; - break; - case 0x0902: - r = rsgt_tlvDecodeBLOCK_SIG(rec, obj); - if(r != 0) goto done; - break; - } -done: - return r; -} - -static int -rsgt_tlvrdRecHash(FILE *fp, FILE *outfp, imprint_t **imp) -{ - int r; - tlvrecord_t rec; - - if((r = rsgt_tlvrd(fp, &rec, imp)) != 0) goto done; - if(rec.tlvtype != 0x0900) { - r = RSGTE_MISS_REC_HASH; - rsgt_objfree(rec.tlvtype, *imp); - goto done; - } - if(outfp != NULL) - if((r = rsgt_tlvwrite(outfp, &rec)) != 0) goto done; - r = 0; -done: return r; -} - -static int -rsgt_tlvrdTreeHash(FILE *fp, FILE *outfp, imprint_t **imp) -{ - int r; - tlvrecord_t rec; - - if((r = rsgt_tlvrd(fp, &rec, imp)) != 0) goto done; - if(rec.tlvtype != 0x0901) { - r = RSGTE_MISS_TREE_HASH; - rsgt_objfree(rec.tlvtype, *imp); - goto done; - } - if(outfp != NULL) - if((r = rsgt_tlvwrite(outfp, &rec)) != 0) goto done; - r = 0; -done: return r; -} - -/* read BLOCK_SIG during verification phase */ -static int -rsgt_tlvrdVrfyBlockSig(FILE *fp, block_sig_t **bs, tlvrecord_t *rec) -{ - int r; - - if((r = rsgt_tlvrd(fp, rec, bs)) != 0) goto done; - if(rec->tlvtype != 0x0902) { - r = RSGTE_MISS_BLOCKSIG; - rsgt_objfree(rec->tlvtype, *bs); - goto done; - } - r = 0; -done: return r; -} - -/** - * Read the next "object" from file. This usually is - * a single TLV, but may be something larger, for - * example in case of a block-sig TLV record. - * Unknown type records are ignored (or run aborted - * if we are not permitted to skip). - * - * @param[in] fp file pointer for processing - * @param[out] tlvtype type of tlv record (top-level for - * structured objects. - * @param[out] tlvlen length of the tlv record value - * @param[out] obj pointer to object; This is a proper - * tlv record structure, which must be casted - * by the caller according to the reported type. - * The object must be freed by the caller (TODO: better way?) - * - * @returns 0 if ok, something else otherwise - */ -int -rsgt_tlvrd(FILE *fp, tlvrecord_t *rec, void *obj) -{ - int r; - if((r = rsgt_tlvRecRead(fp, rec)) != 0) goto done; - r = rsgt_tlvRecDecode(rec, obj); -done: return r; -} - - -/* return if a blob is all zero */ -static inline int -blobIsZero(uint8_t *blob, uint16_t len) -{ - int i; - for(i = 0 ; i < len ; ++i) - if(blob[i] != 0) - return 0; - return 1; -} - -static void -rsgt_printIMPRINT(FILE *fp, char *name, imprint_t *imp, uint8_t verbose) -{ - fprintf(fp, "%s", name); - outputHexBlob(fp, imp->data, imp->len, verbose); - fputc('\n', fp); -} - -static void -rsgt_printREC_HASH(FILE *fp, imprint_t *imp, uint8_t verbose) -{ - rsgt_printIMPRINT(fp, "[0x0900]Record hash: ", - imp, verbose); -} - -static void -rsgt_printINT_HASH(FILE *fp, imprint_t *imp, uint8_t verbose) -{ - rsgt_printIMPRINT(fp, "[0x0901]Tree hash..: ", - imp, verbose); -} - -/** - * Output a human-readable representation of a block_sig_t - * to proviced file pointer. This function is mainly inteded for - * debugging purposes or dumping tlv files. - * - * @param[in] fp file pointer to send output to - * @param[in] bsig ponter to block_sig_t to output - * @param[in] verbose if 0, abbreviate blob hexdump, else complete - */ -void -rsgt_printBLOCK_SIG(FILE *fp, block_sig_t *bs, uint8_t verbose) -{ - fprintf(fp, "[0x0902]Block Signature Record:\n"); - fprintf(fp, "\tPrevious Block Hash:\n"); - fprintf(fp, "\t Algorithm..: %s\n", hashAlgName(bs->lastHash.hashID)); - fprintf(fp, "\t Hash.......: "); - outputHexBlob(fp, bs->lastHash.data, bs->lastHash.len, verbose); - fputc('\n', fp); - if(blobIsZero(bs->lastHash.data, bs->lastHash.len)) - fprintf(fp, "\t NOTE: New Hash Chain Start!\n"); - fprintf(fp, "\tHash Algorithm: %s\n", hashAlgName(bs->hashID)); - fprintf(fp, "\tIV............: "); - outputHexBlob(fp, bs->iv, getIVLen(bs), verbose); - fputc('\n', fp); - fprintf(fp, "\tRecord Count..: %llu\n", bs->recCount); - fprintf(fp, "\tSignature Type: %s\n", sigTypeName(bs->sigID)); - fprintf(fp, "\tSignature Len.: %u\n", bs->sig.der.len); - fprintf(fp, "\tSignature.....: "); - outputHexBlob(fp, bs->sig.der.data, bs->sig.der.len, verbose); - fputc('\n', fp); -} - - -/** - * Output a human-readable representation of a tlv object. - * - * @param[in] fp file pointer to send output to - * @param[in] tlvtype type of tlv object (record) - * @param[in] verbose if 0, abbreviate blob hexdump, else complete - */ -void -rsgt_tlvprint(FILE *fp, uint16_t tlvtype, void *obj, uint8_t verbose) -{ - switch(tlvtype) { - case 0x0900: - rsgt_printREC_HASH(fp, obj, verbose); - break; - case 0x0901: - rsgt_printINT_HASH(fp, obj, verbose); - break; - case 0x0902: - rsgt_printBLOCK_SIG(fp, obj, verbose); - break; - default:fprintf(fp, "unknown tlv record %4.4x\n", tlvtype); - break; - } -} - -/** - * Free the provided object. - * - * @param[in] tlvtype type of tlv object (record) - * @param[in] obj the object to be destructed - */ -void -rsgt_objfree(uint16_t tlvtype, void *obj) -{ - switch(tlvtype) { - case 0x0900: - case 0x0901: - free(((imprint_t*)obj)->data); - break; - case 0x0902: - free(((block_sig_t*)obj)->iv); - free(((block_sig_t*)obj)->lastHash.data); - free(((block_sig_t*)obj)->sig.der.data); - break; - default:fprintf(stderr, "rsgt_objfree: unknown tlv record %4.4x\n", - tlvtype); - break; - } - free(obj); -} - -/** - * Read block parameters. This detects if the block contains the - * individual log hashes, the intermediate hashes and the overall - * block paramters (from the signature block). As we do not have any - * begin of block record, we do not know e.g. the hash algorithm or IV - * until reading the block signature record. And because the file is - * purely sequential and variable size, we need to read all records up to - * the next signature record. - * If a caller intends to verify a log file based on the parameters, - * he must re-read the file from the begining (we could keep things - * in memory, but this is impractical for large blocks). In order - * to facitate this, the function permits to rewind to the original - * read location when it is done. - * - * @param[in] fp file pointer of tlv file - * @param[in] bRewind 0 - do not rewind at end of procesing, 1 - do so - * @param[out] bs block signature record - * @param[out] bHasRecHashes 0 if record hashes are present, 1 otherwise - * @param[out] bHasIntermedHashes 0 if intermediate hashes are present, - * 1 otherwise - * - * @returns 0 if ok, something else otherwise - */ -int -rsgt_getBlockParams(FILE *fp, uint8_t bRewind, block_sig_t **bs, - uint8_t *bHasRecHashes, uint8_t *bHasIntermedHashes) -{ - int r; - uint64_t nRecs = 0; - uint8_t bDone = 0; - off_t rewindPos = 0; - void *obj; - tlvrecord_t rec; - - if(bRewind) - rewindPos = ftello(fp); - *bHasRecHashes = 0; - *bHasIntermedHashes = 0; - *bs = NULL; - - while(!bDone) { /* we will err out on EOF */ - if((r = rsgt_tlvrd(fp, &rec, &obj)) != 0) goto done; - switch(rec.tlvtype) { - case 0x0900: - ++nRecs; - *bHasRecHashes = 1; - break; - case 0x0901: - *bHasIntermedHashes = 1; - break; - case 0x0902: - *bs = (block_sig_t*) obj; - bDone = 1; - break; - default:fprintf(fp, "unknown tlv record %4.4x\n", rec.tlvtype); - break; - } - if(!bDone) - rsgt_objfree(rec.tlvtype, obj); - } - - if(*bHasRecHashes && (nRecs != (*bs)->recCount)) { - r = RSGTE_INVLD_RECCNT; - goto done; - } - - if(bRewind) { - if(fseeko(fp, rewindPos, SEEK_SET) != 0) { - r = RSGTE_IO; - goto done; - } - } -done: - return r; -} - - -/** - * Read the file header and compare it to the expected value. - * The file pointer is placed right after the header. - * @param[in] fp file pointer of tlv file - * @param[in] excpect expected header (e.g. "LOGSIG10") - * @returns 0 if ok, something else otherwise - */ -int -rsgt_chkFileHdr(FILE *fp, char *expect) -{ - int r; - char hdr[9]; - - if((r = rsgt_tlvrdHeader(fp, (uchar*)hdr)) != 0) goto done; - if(strcmp(hdr, expect)) - r = RSGTE_INVLHDR; - else - r = 0; -done: - return r; -} - -gtfile -rsgt_vrfyConstruct_gf(void) -{ - gtfile gf; - if((gf = calloc(1, sizeof(struct gtfile_s))) == NULL) - goto done; - gf->x_prev = NULL; - -done: return gf; -} - -void -rsgt_vrfyBlkInit(gtfile gf, block_sig_t *bs, uint8_t bHasRecHashes, uint8_t bHasIntermedHashes) -{ - gf->hashAlg = hashID2Alg(bs->hashID); - gf->bKeepRecordHashes = bHasRecHashes; - gf->bKeepTreeHashes = bHasIntermedHashes; - free(gf->IV); - gf->IV = malloc(getIVLen(bs)); - memcpy(gf->IV, bs->iv, getIVLen(bs)); - free(gf->blkStrtHash); - gf->lenBlkStrtHash = bs->lastHash.len; - gf->blkStrtHash = malloc(gf->lenBlkStrtHash); - memcpy(gf->blkStrtHash, bs->lastHash.data, gf->lenBlkStrtHash); -} - -static int -rsgt_vrfy_chkRecHash(gtfile gf, FILE *sigfp, FILE *nsigfp, - GTDataHash *recHash, gterrctx_t *ectx) -{ - int r = 0; - imprint_t *imp = NULL; - - if((r = rsgt_tlvrdRecHash(sigfp, nsigfp, &imp)) != 0) - reportError(r, ectx); - goto done; - if(imp->hashID != hashIdentifier(gf->hashAlg)) { - reportError(r, ectx); - r = RSGTE_INVLD_REC_HASHID; - goto done; - } - if(memcmp(imp->data, recHash->digest, - hashOutputLengthOctets(imp->hashID))) { - r = RSGTE_INVLD_REC_HASH; - ectx->computedHash = recHash; - ectx->fileHash = imp; - reportError(r, ectx); - ectx->computedHash = NULL, ectx->fileHash = NULL; - goto done; - } - r = 0; -done: - if(imp != NULL) - rsgt_objfree(0x0900, imp); - return r; -} - -static int -rsgt_vrfy_chkTreeHash(gtfile gf, FILE *sigfp, FILE *nsigfp, - GTDataHash *hash, gterrctx_t *ectx) -{ - int r = 0; - imprint_t *imp = NULL; - - if((r = rsgt_tlvrdTreeHash(sigfp, nsigfp, &imp)) != 0) { - reportError(r, ectx); - goto done; - } - if(imp->hashID != hashIdentifier(gf->hashAlg)) { - reportError(r, ectx); - r = RSGTE_INVLD_TREE_HASHID; - goto done; - } - if(memcmp(imp->data, hash->digest, - hashOutputLengthOctets(imp->hashID))) { - r = RSGTE_INVLD_TREE_HASH; - ectx->computedHash = hash; - ectx->fileHash = imp; - reportError(r, ectx); - ectx->computedHash = NULL, ectx->fileHash = NULL; - goto done; - } - r = 0; -done: - if(imp != NULL) - rsgt_objfree(0x0901, imp); - return r; -} - -int -rsgt_vrfy_nextRec(block_sig_t *bs, gtfile gf, FILE *sigfp, FILE *nsigfp, - unsigned char *rec, size_t len, gterrctx_t *ectx) -{ - int r = 0; - GTDataHash *x; /* current hash */ - GTDataHash *m, *recHash = NULL, *t, *t_del; - uint8_t j; - - hash_m(gf, &m); - hash_r(gf, &recHash, rec, len); - if(gf->bKeepRecordHashes) { - r = rsgt_vrfy_chkRecHash(gf, sigfp, nsigfp, recHash, ectx); - if(r != 0) goto done; - } - hash_node(gf, &x, m, recHash, 1); /* hash leaf */ - if(gf->bKeepTreeHashes) { - ectx->treeLevel = 0; - ectx->lefthash = m; - ectx->righthash = recHash; - r = rsgt_vrfy_chkTreeHash(gf, sigfp, nsigfp, x, ectx); - if(r != 0) goto done; - } - rsgtimprintDel(gf->x_prev); - gf->x_prev = rsgtImprintFromGTDataHash(x); - /* add x to the forest as new leaf, update roots list */ - t = x; - for(j = 0 ; j < gf->nRoots ; ++j) { - if(gf->roots_valid[j] == 0) { - gf->roots_hash[j] = t; - gf->roots_valid[j] = 1; - t = NULL; - break; - } else if(t != NULL) { - /* hash interim node */ - ectx->treeLevel = j+1; - ectx->righthash = t; - t_del = t; - hash_node(gf, &t, gf->roots_hash[j], t_del, j+2); - gf->roots_valid[j] = 0; - if(gf->bKeepTreeHashes) { - ectx->lefthash = gf->roots_hash[j]; - r = rsgt_vrfy_chkTreeHash(gf, sigfp, nsigfp, t, ectx); - if(r != 0) goto done; /* mem leak ok, we terminate! */ - } - GTDataHash_free(gf->roots_hash[j]); - GTDataHash_free(t_del); - } - } - if(t != NULL) { - /* new level, append "at the top" */ - gf->roots_hash[gf->nRoots] = t; - gf->roots_valid[gf->nRoots] = 1; - ++gf->nRoots; - assert(gf->nRoots < MAX_ROOTS); - t = NULL; - } - ++gf->nRecords; - - /* cleanup */ - GTDataHash_free(m); -done: - if(recHash != NULL) - GTDataHash_free(recHash); - return r; -} - - -/* TODO: think about merging this with the writer. The - * same applies to the other computation algos. - */ -static int -verifySigblkFinish(gtfile gf, GTDataHash **pRoot) -{ - GTDataHash *root, *rootDel; - int8_t j; - int r; - - if(gf->nRecords == 0) - goto done; - - root = NULL; - for(j = 0 ; j < gf->nRoots ; ++j) { - if(root == NULL) { - root = gf->roots_valid[j] ? gf->roots_hash[j] : NULL; - gf->roots_valid[j] = 0; /* guess this is redundant with init, maybe del */ - } else if(gf->roots_valid[j]) { - rootDel = root; - hash_node(gf, &root, gf->roots_hash[j], root, j+2); - gf->roots_valid[j] = 0; /* guess this is redundant with init, maybe del */ - GTDataHash_free(rootDel); - } - } - - free(gf->blkStrtHash); - gf->blkStrtHash = NULL; - *pRoot = root; - r = 0; -done: - gf->bInBlk = 0; - return r; -} - - -/* helper for rsgt_extendSig: */ -#define COPY_SUBREC_TO_NEWREC \ - memcpy(newrec.data+iWr, subrec.hdr, subrec.lenHdr); \ - iWr += subrec.lenHdr; \ - memcpy(newrec.data+iWr, subrec.data, subrec.tlvlen); \ - iWr += subrec.tlvlen; -static inline int -rsgt_extendSig(GTTimestamp *timestamp, tlvrecord_t *rec, gterrctx_t *ectx) -{ - GTTimestamp *out_timestamp; - uint8_t *der; - size_t lenDer; - int r, rgt; - tlvrecord_t newrec, subrec; - uint16_t iRd, iWr; - - rgt = GTHTTP_extendTimestamp(timestamp, rsgt_extend_puburl, &out_timestamp); - if(rgt != GT_OK) { - ectx->gtstate = rgt; - r = RSGTE_TS_EXTEND; - goto done; - } - r = GTTimestamp_getDEREncoded(out_timestamp, &der, &lenDer); - if(r != GT_OK) { - r = RSGTE_TS_DERENCODE; - ectx->gtstate = rgt; - goto done; - } - /* update block_sig tlv record with new extended timestamp */ - /* we now need to copy all tlv records before the actual der - * encoded part. - */ - iRd = iWr = 0; - // TODO; check tlvtypes at comment places below! - if ((r = rsgt_tlvDecodeSUBREC(rec, &iRd, &subrec)) != 0) goto done; - /* HASH_ALGO */ - COPY_SUBREC_TO_NEWREC - if ((r = rsgt_tlvDecodeSUBREC(rec, &iRd, &subrec)) != 0) goto done; - /* BLOCK_IV */ - COPY_SUBREC_TO_NEWREC - if ((r = rsgt_tlvDecodeSUBREC(rec, &iRd, &subrec)) != 0) goto done; - /* LAST_HASH */ - COPY_SUBREC_TO_NEWREC - if ((r = rsgt_tlvDecodeSUBREC(rec, &iRd, &subrec)) != 0) goto done; - /* REC_COUNT */ - COPY_SUBREC_TO_NEWREC - if ((r = rsgt_tlvDecodeSUBREC(rec, &iRd, &subrec)) != 0) goto done; - /* actual sig! */ - newrec.data[iWr++] = 0x09 | RSGT_FLAG_TLV16; - newrec.data[iWr++] = 0x06; - newrec.data[iWr++] = (lenDer >> 8) & 0xff; - newrec.data[iWr++] = lenDer & 0xff; - /* now we know how large the new main record is */ - newrec.tlvlen = (uint16_t) iWr+lenDer; - newrec.tlvtype = rec->tlvtype; - newrec.hdr[0] = rec->hdr[0]; - newrec.hdr[1] = rec->hdr[1]; - newrec.hdr[2] = (newrec.tlvlen >> 8) & 0xff; - newrec.hdr[3] = newrec.tlvlen & 0xff; - newrec.lenHdr = 4; - memcpy(newrec.data+iWr, der, lenDer); - /* and finally copy back new record to existing one */ - memcpy(rec, &newrec, sizeof(newrec)-sizeof(newrec.data)+newrec.tlvlen+4); - r = 0; -done: - return r; -} - - -/* verify the root hash. This also means we need to compute the - * Merkle tree root for the current block. - */ -int -verifyBLOCK_SIG(block_sig_t *bs, gtfile gf, FILE *sigfp, FILE *nsigfp, - uint8_t bExtend, gterrctx_t *ectx) -{ - int r; - int gtstate; - block_sig_t *file_bs = NULL; - GTTimestamp *timestamp = NULL; - GTVerificationInfo *vrfyInf; - GTDataHash *root = NULL; - tlvrecord_t rec; - - if((r = verifySigblkFinish(gf, &root)) != 0) - goto done; - if((r = rsgt_tlvrdVrfyBlockSig(sigfp, &file_bs, &rec)) != 0) - goto done; - if(ectx->recNum != bs->recCount) { - r = RSGTE_INVLD_RECCNT; - goto done; - } - - gtstate = GTTimestamp_DERDecode(file_bs->sig.der.data, - file_bs->sig.der.len, ×tamp); - if(gtstate != GT_OK) { - r = RSGTE_TS_DERDECODE; - ectx->gtstate = gtstate; - goto done; - } - - gtstate = GTHTTP_verifyTimestampHash(timestamp, root, NULL, - NULL, NULL, rsgt_read_puburl, 0, &vrfyInf); - if(! (gtstate == GT_OK - && vrfyInf->verification_errors == GT_NO_FAILURES) ) { - r = RSGTE_INVLD_TIMESTAMP; - ectx->gtstate = gtstate; - goto done; - } - - if(rsgt_read_showVerified) - reportVerifySuccess(ectx, vrfyInf); - if(bExtend) - if((r = rsgt_extendSig(timestamp, &rec, ectx)) != 0) goto done; - - if(nsigfp != NULL) - if((r = rsgt_tlvwrite(nsigfp, &rec)) != 0) goto done; - r = 0; -done: - if(file_bs != NULL) - rsgt_objfree(0x0902, file_bs); - if(r != 0) - reportError(r, ectx); - if(timestamp != NULL) - GTTimestamp_free(timestamp); - return r; -} diff -Nru rsyslog-7.6.0/runtime/lmcry_gcry.c rsyslog-5.10.1/runtime/lmcry_gcry.c --- rsyslog-7.6.0/runtime/lmcry_gcry.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/lmcry_gcry.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,337 +0,0 @@ -/* lmcry_gcry.c - * - * An implementation of the cryprov interface for libgcrypt. - * - * Copyright 2013 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" - -#include "rsyslog.h" -#include -#include -#include - -#include "module-template.h" -#include "glbl.h" -#include "errmsg.h" -#include "cryprov.h" -#include "libgcry.h" -#include "lmcry_gcry.h" - -MODULE_TYPE_LIB -MODULE_TYPE_NOKEEP - -/* static data */ -DEFobjStaticHelpers -DEFobjCurrIf(errmsg) -DEFobjCurrIf(glbl) - -/* tables for interfacing with the v6 config system */ -static struct cnfparamdescr cnfpdescrRegular[] = { - { "cry.key", eCmdHdlrGetWord, 0 }, - { "cry.keyfile", eCmdHdlrGetWord, 0 }, - { "cry.keyprogram", eCmdHdlrGetWord, 0 }, - { "cry.mode", eCmdHdlrGetWord, 0 }, /* CBC, ECB, etc */ - { "cry.algo", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk pblkRegular = - { CNFPARAMBLK_VERSION, - sizeof(cnfpdescrRegular)/sizeof(struct cnfparamdescr), - cnfpdescrRegular - }; - -static struct cnfparamdescr cnfpdescrQueue[] = { - { "queue.cry.key", eCmdHdlrGetWord, 0 }, - { "queue.cry.keyfile", eCmdHdlrGetWord, 0 }, - { "queue.cry.keyprogram", eCmdHdlrGetWord, 0 }, - { "queue.cry.mode", eCmdHdlrGetWord, 0 }, /* CBC, ECB, etc */ - { "queue.cry.algo", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk pblkQueue = - { CNFPARAMBLK_VERSION, - sizeof(cnfpdescrQueue)/sizeof(struct cnfparamdescr), - cnfpdescrQueue - }; - - -#if 0 -static void -errfunc(__attribute__((unused)) void *usrptr, uchar *emsg) -{ - errmsg.LogError(0, RS_RET_CRYPROV_ERR, "Crypto Provider" - "Error: %s - disabling encryption", emsg); -} -#endif - -/* Standard-Constructor - */ -BEGINobjConstruct(lmcry_gcry) - pThis->ctx = gcryCtxNew(); -ENDobjConstruct(lmcry_gcry) - - -/* destructor for the lmcry_gcry object */ -BEGINobjDestruct(lmcry_gcry) /* be sure to specify the object type also in END and CODESTART macros! */ -CODESTARTobjDestruct(lmcry_gcry) - rsgcryCtxDel(pThis->ctx); -ENDobjDestruct(lmcry_gcry) - - -/* apply all params from param block to us. This must be called - * after construction, but before the OnFileOpen() entry point. - * Defaults are expected to have been set during construction. - */ -static rsRetVal -SetCnfParam(void *pT, struct nvlst *lst, int paramType) -{ - lmcry_gcry_t *pThis = (lmcry_gcry_t*) pT; - int i, r; - unsigned keylen; - uchar *key = NULL; - uchar *keyfile = NULL; - uchar *keyprogram = NULL; - uchar *algo = NULL; - uchar *mode = NULL; - int nKeys; /* number of keys (actually methods) specified */ - struct cnfparamvals *pvals; - struct cnfparamblk *pblk; - DEFiRet; - - pblk = (paramType == CRYPROV_PARAMTYPE_REGULAR ) ? &pblkRegular : &pblkQueue; - nKeys = 0; - pvals = nvlstGetParams(lst, pblk, NULL); - if(Debug) { - dbgprintf("param blk in lmcry_gcry:\n"); - cnfparamsPrint(pblk, pvals); - } - - for(i = 0 ; i < pblk->nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblk->descr[i].name, "cry.key") || - !strcmp(pblk->descr[i].name, "queue.cry.key")) { - key = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - ++nKeys; - } else if(!strcmp(pblk->descr[i].name, "cry.keyfile") || - !strcmp(pblk->descr[i].name, "queue.cry.keyfile")) { - keyfile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - ++nKeys; - } else if(!strcmp(pblk->descr[i].name, "cry.keyprogram") || - !strcmp(pblk->descr[i].name, "queue.cry.keyprogram")) { - keyprogram = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - ++nKeys; - } else if(!strcmp(pblk->descr[i].name, "cry.mode") || - !strcmp(pblk->descr[i].name, "queue.cry.mode")) { - mode = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblk->descr[i].name, "cry.algo") || - !strcmp(pblk->descr[i].name, "queue.cry.algo")) { - algo = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - DBGPRINTF("lmcry_gcry: program error, non-handled " - "param '%s'\n", pblk->descr[i].name); - } - } - if(algo != NULL) { - iRet = rsgcrySetAlgo(pThis->ctx, algo); - if(iRet != RS_RET_OK) { - errmsg.LogError(0, iRet, "cry.algo '%s' is not know/supported", algo); - FINALIZE; - } - } - if(mode != NULL) { - iRet = rsgcrySetMode(pThis->ctx, mode); - if(iRet != RS_RET_OK) { - errmsg.LogError(0, iRet, "cry.mode '%s' is not know/supported", mode); - FINALIZE; - } - } - /* note: key must be set AFTER algo/mode is set (as it depends on them) */ - if(nKeys != 1) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "excactly one of the following " - "parameters can be specified: cry.key, cry.keyfile, cry.keyprogram\n"); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - if(key != NULL) { - errmsg.LogError(0, RS_RET_ERR, "Note: specifying an actual key directly from the " - "config file is highly insecure - DO NOT USE FOR PRODUCTION"); - keylen = strlen((char*)key); - } - if(keyfile != NULL) { - r = gcryGetKeyFromFile((char*)keyfile, (char**)&key, &keylen); - if(r != 0) { - errmsg.LogError(0, RS_RET_ERR, "error %d reading keyfile %s\n", - r, keyfile); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - } - if(keyprogram != NULL) { - r = gcryGetKeyFromProg((char*)keyprogram, (char**)&key, &keylen); - if(r != 0) { - errmsg.LogError(0, RS_RET_ERR, "error %d obtaining key from program %s\n", - r, keyprogram); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - } - - /* if we reach this point, we have a valid key */ - r = rsgcrySetKey(pThis->ctx, key, keylen); - if(r > 0) { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "Key length %d expected, but " - "key of length %d given", r, keylen); - ABORT_FINALIZE(RS_RET_INVALID_PARAMS); - } - - cnfparamvalsDestruct(pvals, pblk); - if(key != NULL) { - memset(key, 0, strlen((char*)key)); - free(key); - } - free(keyfile); - free(algo); - free(mode); -finalize_it: - RETiRet; -} - -static void -SetDeleteOnClose(void *pF, int val) -{ - gcryfileSetDeleteOnClose(pF, val); -} - -static rsRetVal -GetBytesLeftInBlock(void *pF, ssize_t *left) -{ - return gcryfileGetBytesLeftInBlock((gcryfile) pF, left); -} - -static rsRetVal -DeleteStateFiles(uchar *logfn) -{ - return gcryfileDeleteState(logfn); -} - -static rsRetVal -OnFileOpen(void *pT, uchar *fn, void *pGF, char openMode) -{ - lmcry_gcry_t *pThis = (lmcry_gcry_t*) pT; - gcryfile *pgf = (gcryfile*) pGF; - DEFiRet; - DBGPRINTF("lmcry_gcry: open file '%s', mode '%c'\n", fn, openMode); - - CHKiRet(rsgcryInitCrypt(pThis->ctx, pgf, fn, openMode)); -finalize_it: - /* TODO: enable this error message (need to cleanup loop first ;)) - errmsg.LogError(0, iRet, "Encryption Provider" - "Error: cannot open .encinfo file - disabling log file"); - */ - RETiRet; -} - -static rsRetVal -Decrypt(void *pF, uchar *rec, size_t *lenRec) -{ - DEFiRet; - iRet = rsgcryDecrypt(pF, rec, lenRec); - - RETiRet; -} - - -static rsRetVal -Encrypt(void *pF, uchar *rec, size_t *lenRec) -{ - DEFiRet; - iRet = rsgcryEncrypt(pF, rec, lenRec); - - RETiRet; -} - -static rsRetVal -OnFileClose(void *pF, off64_t offsLogfile) -{ - DEFiRet; - gcryfileDestruct(pF, offsLogfile); - - RETiRet; -} - -BEGINobjQueryInterface(lmcry_gcry) -CODESTARTobjQueryInterface(lmcry_gcry) - if(pIf->ifVersion != cryprovCURR_IF_VERSION) {/* check for current version, increment on each change */ - ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); - } - pIf->Construct = (rsRetVal(*)(void*)) lmcry_gcryConstruct; - pIf->SetCnfParam = SetCnfParam; - pIf->SetDeleteOnClose = SetDeleteOnClose; - pIf->Destruct = (rsRetVal(*)(void*)) lmcry_gcryDestruct; - pIf->OnFileOpen = OnFileOpen; - pIf->Encrypt = Encrypt; - pIf->Decrypt = Decrypt; - pIf->OnFileClose = OnFileClose; - pIf->DeleteStateFiles = DeleteStateFiles; - pIf->GetBytesLeftInBlock = GetBytesLeftInBlock; -finalize_it: -ENDobjQueryInterface(lmcry_gcry) - - -BEGINObjClassExit(lmcry_gcry, OBJ_IS_LOADABLE_MODULE) /* CHANGE class also in END MACRO! */ -CODESTARTObjClassExit(lmcry_gcry) - /* release objects we no longer need */ - objRelease(errmsg, CORE_COMPONENT); - objRelease(glbl, CORE_COMPONENT); - - rsgcryExit(); -ENDObjClassExit(lmcry_gcry) - - -BEGINObjClassInit(lmcry_gcry, 1, OBJ_IS_LOADABLE_MODULE) /* class, version */ - /* request objects we use */ - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - - if(rsgcryInit() != 0) { - errmsg.LogError(0, RS_RET_CRYPROV_ERR, "error initializing " - "crypto provider - cannot encrypt"); - ABORT_FINALIZE(RS_RET_CRYPROV_ERR); - } -ENDObjClassInit(lmcry_gcry) - - -/* --------------- here now comes the plumbing that makes as a library module --------------- */ - - -BEGINmodExit -CODESTARTmodExit - lmcry_gcryClassExit(); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_LIB_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ - /* Initialize all classes that are in our module - this includes ourselfs */ - CHKiRet(lmcry_gcryClassInit(pModInfo)); /* must be done after tcps_sess, as we use it */ -ENDmodInit diff -Nru rsyslog-7.6.0/runtime/lmcry_gcry.h rsyslog-5.10.1/runtime/lmcry_gcry.h --- rsyslog-7.6.0/runtime/lmcry_gcry.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/lmcry_gcry.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* An implementation of the cryprov interface for libgcrypt. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_LMCRY_GCRY_H -#define INCLUDED_LMCRY_GCRY_H -#include "cryprov.h" - -/* interface is defined in cryprov.h, we just implement it! */ -#define lmcry_gcryCURR_IF_VERSION cryprovCURR_IF_VERSION -typedef cryprov_if_t lmcry_gcry_if_t; - -/* the lmcry_gcry object */ -struct lmcry_gcry_s { - BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ - gcryctx ctx; -}; -typedef struct lmcry_gcry_s lmcry_gcry_t; - -/* prototypes */ -PROTOTYPEObj(lmcry_gcry); - -#endif /* #ifndef INCLUDED_LMCRY_GCRY_H */ diff -Nru rsyslog-7.6.0/runtime/lmsig_gt.c rsyslog-5.10.1/runtime/lmsig_gt.c --- rsyslog-7.6.0/runtime/lmsig_gt.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/lmsig_gt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,233 +0,0 @@ -/* lmsig_gt.c - * - * An implementation of the sigprov interface for GuardTime. - * - * Copyright 2013 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" - -#include "rsyslog.h" -#include -#include -#include - -#include "module-template.h" -#include "glbl.h" -#include "errmsg.h" -#include "sigprov.h" -#include "lmsig_gt.h" - -MODULE_TYPE_LIB -MODULE_TYPE_NOKEEP - -/* static data */ -DEFobjStaticHelpers -DEFobjCurrIf(errmsg) -DEFobjCurrIf(glbl) - -/* tables for interfacing with the v6 config system */ -static struct cnfparamdescr cnfpdescr[] = { - { "sig.hashfunction", eCmdHdlrGetWord, 0 }, - { "sig.timestampservice", eCmdHdlrGetWord, 0 }, - { "sig.block.sizelimit", eCmdHdlrSize, 0 }, - { "sig.keeprecordhashes", eCmdHdlrBinary, 0 }, - { "sig.keeptreehashes", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk pblk = - { CNFPARAMBLK_VERSION, - sizeof(cnfpdescr)/sizeof(struct cnfparamdescr), - cnfpdescr - }; - - -static void -errfunc(__attribute__((unused)) void *usrptr, uchar *emsg) -{ - errmsg.LogError(0, RS_RET_SIGPROV_ERR, "Signature Provider" - "Error: %s - disabling signatures", emsg); -} - -/* Standard-Constructor - */ -BEGINobjConstruct(lmsig_gt) - pThis->ctx = rsgtCtxNew(); - rsgtsetErrFunc(pThis->ctx, errfunc, NULL); -ENDobjConstruct(lmsig_gt) - - -/* destructor for the lmsig_gt object */ -BEGINobjDestruct(lmsig_gt) /* be sure to specify the object type also in END and CODESTART macros! */ -CODESTARTobjDestruct(lmsig_gt) - rsgtCtxDel(pThis->ctx); -ENDobjDestruct(lmsig_gt) - - -/* apply all params from param block to us. This must be called - * after construction, but before the OnFileOpen() entry point. - * Defaults are expected to have been set during construction. - */ -rsRetVal -SetCnfParam(void *pT, struct nvlst *lst) -{ - lmsig_gt_t *pThis = (lmsig_gt_t*) pT; - int i; - uchar *cstr; - struct cnfparamvals *pvals; - DEFiRet; - pvals = nvlstGetParams(lst, &pblk, NULL); - if(pvals == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - if(Debug) { - dbgprintf("sig param blk in lmsig_gt:\n"); - cnfparamsPrint(&pblk, pvals); - } - - for(i = 0 ; i < pblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblk.descr[i].name, "sig.hashfunction")) { - cstr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - if(rsgtSetHashFunction(pThis->ctx, (char*)cstr) != 0) { - errmsg.LogError(0, RS_RET_ERR, "Hash function " - "'%s' unknown - using default", cstr); - } - free(cstr); - } else if(!strcmp(pblk.descr[i].name, "sig.timestampservice")) { - cstr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - rsgtSetTimestamper(pThis->ctx, (char*) cstr); - free(cstr); - } else if(!strcmp(pblk.descr[i].name, "sig.block.sizelimit")) { - rsgtSetBlockSizeLimit(pThis->ctx, pvals[i].val.d.n); - } else if(!strcmp(pblk.descr[i].name, "sig.keeprecordhashes")) { - rsgtSetKeepRecordHashes(pThis->ctx, pvals[i].val.d.n); - } else if(!strcmp(pblk.descr[i].name, "sig.keeptreehashes")) { - rsgtSetKeepTreeHashes(pThis->ctx, pvals[i].val.d.n); - } else { - DBGPRINTF("lmsig_gt: program error, non-handled " - "param '%s'\n", pblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &pblk); - RETiRet; -} - - -static rsRetVal -OnFileOpen(void *pT, uchar *fn, void *pGF) -{ - lmsig_gt_t *pThis = (lmsig_gt_t*) pT; - gtfile *pgf = (gtfile*) pGF; - DEFiRet; - DBGPRINTF("lmsig_gt: onFileOpen: %s\n", fn); - /* note: if *pgf is set to NULL, this auto-disables GT functions */ - *pgf = rsgtCtxOpenFile(pThis->ctx, fn); - sigblkInit(*pgf); - RETiRet; -} - -/* Note: we assume that the record is terminated by a \n. - * As of the GuardTime paper, \n is not part of the signed - * message, so we subtract one from the record size. This - * may cause issues with non-standard formats, but let's - * see how things evolve (the verifier will not work in - * any case when the records are not \n delimited...). - * rgerhards, 2013-03-17 - */ -static rsRetVal -OnRecordWrite(void *pF, uchar *rec, rs_size_t lenRec) -{ - DEFiRet; - DBGPRINTF("lmsig_gt: onRecordWrite (%d): %s\n", lenRec-1, rec); - sigblkAddRecord(pF, rec, lenRec-1); - - RETiRet; -} - -static rsRetVal -OnFileClose(void *pF) -{ - DEFiRet; - DBGPRINTF("lmsig_gt: onFileClose\n"); - rsgtfileDestruct(pF); - - RETiRet; -} - -BEGINobjQueryInterface(lmsig_gt) -CODESTARTobjQueryInterface(lmsig_gt) - if(pIf->ifVersion != sigprovCURR_IF_VERSION) {/* check for current version, increment on each change */ - ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); - } - pIf->Construct = (rsRetVal(*)(void*)) lmsig_gtConstruct; - pIf->SetCnfParam = SetCnfParam; - pIf->Destruct = (rsRetVal(*)(void*)) lmsig_gtDestruct; - pIf->OnFileOpen = OnFileOpen; - pIf->OnRecordWrite = OnRecordWrite; - pIf->OnFileClose = OnFileClose; -finalize_it: -ENDobjQueryInterface(lmsig_gt) - - -BEGINObjClassExit(lmsig_gt, OBJ_IS_LOADABLE_MODULE) /* CHANGE class also in END MACRO! */ -CODESTARTObjClassExit(lmsig_gt) - /* release objects we no longer need */ - objRelease(errmsg, CORE_COMPONENT); - objRelease(glbl, CORE_COMPONENT); - - rsgtExit(); -ENDObjClassExit(lmsig_gt) - - -BEGINObjClassInit(lmsig_gt, 1, OBJ_IS_LOADABLE_MODULE) /* class, version */ - /* request objects we use */ - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - - if(rsgtInit("rsyslogd " VERSION) != 0) { - errmsg.LogError(0, RS_RET_SIGPROV_ERR, "error initializing " - "signature provider - cannot sign"); - ABORT_FINALIZE(RS_RET_SIGPROV_ERR); - } -ENDObjClassInit(lmsig_gt) - - -/* --------------- here now comes the plumbing that makes as a library module --------------- */ - - -BEGINmodExit -CODESTARTmodExit - lmsig_gtClassExit(); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_LIB_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ - /* Initialize all classes that are in our module - this includes ourselfs */ - CHKiRet(lmsig_gtClassInit(pModInfo)); /* must be done after tcps_sess, as we use it */ -ENDmodInit diff -Nru rsyslog-7.6.0/runtime/lmsig_gt.h rsyslog-5.10.1/runtime/lmsig_gt.h --- rsyslog-7.6.0/runtime/lmsig_gt.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/lmsig_gt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* An implementation of the sigprov interface for GuardTime. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_LMSIG_GT_H -#define INCLUDED_LMSIG_GT_H -#include "sigprov.h" -#include "librsgt.h" - -/* interface is defined in sigprov.h, we just implement it! */ -#define lmsig_gtCURR_IF_VERSION sigprovCURR_IF_VERSION -typedef sigprov_if_t lmsig_gt_if_t; - -/* the lmsig_gt object */ -struct lmsig_gt_s { - BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ - gtctx ctx; /* librsgt context - contains all we need */ -}; -typedef struct lmsig_gt_s lmsig_gt_t; - -/* prototypes */ -PROTOTYPEObj(lmsig_gt); - -#endif /* #ifndef INCLUDED_LMSIG_GT_H */ diff -Nru rsyslog-7.6.0/runtime/lookup.c rsyslog-5.10.1/runtime/lookup.c --- rsyslog-7.6.0/runtime/lookup.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/lookup.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,375 +0,0 @@ -/* lookup.c - * Support for lookup tables in RainerScript. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" -#include "srUtils.h" -#include "errmsg.h" -#include "lookup.h" -#include "msg.h" -#include "rsconf.h" -#include "dirty.h" -#include "unicode-helper.h" - -/* definitions for objects we access */ -DEFobjStaticHelpers -DEFobjCurrIf(errmsg) -DEFobjCurrIf(glbl) - -/* forward definitions */ -static rsRetVal lookupReadFile(lookup_t *pThis); - -/* static data */ -/* tables for interfacing with the v6 config system (as far as we need to) */ -static struct cnfparamdescr modpdescr[] = { - { "name", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "file", eCmdHdlrString, CNFPARAM_REQUIRED } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - - -/* create a new lookup table object AND include it in our list of - * lookup tables. - */ -rsRetVal -lookupNew(lookup_t **ppThis) -{ - lookup_t *pThis = NULL; - DEFiRet; - - CHKmalloc(pThis = malloc(sizeof(lookup_t))); - pthread_rwlock_init(&pThis->rwlock, NULL); - pThis->name = NULL; - - if(loadConf->lu_tabs.root == NULL) { - loadConf->lu_tabs.root = pThis; - pThis->next = NULL; - } else { - pThis->next = loadConf->lu_tabs.last; - } - loadConf->lu_tabs.last = pThis; - - *ppThis = pThis; -finalize_it: - if(iRet != RS_RET_OK) { - free(pThis); - } - RETiRet; -} -void -lookupDestruct(lookup_t *pThis) -{ - pthread_rwlock_destroy(&pThis->rwlock); - free(pThis->name); - free(pThis); -} - -void -lookupInitCnf(lookup_tables_t *lu_tabs) -{ - lu_tabs->root = NULL; - lu_tabs->last = NULL; -} - - -/* comparison function for qsort() and string array compare - * this is for the string lookup table type - */ -static int -qs_arrcmp_strtab(const void *s1, const void *s2) -{ - return ustrcmp(((lookup_string_tab_etry_t*)s1)->key, ((lookup_string_tab_etry_t*)s2)->key); -} -/* comparison function for bsearch() and string array compare - * this is for the string lookup table type - */ -static int -bs_arrcmp_strtab(const void *s1, const void *s2) -{ - return strcmp((char*)s1, (char*)((lookup_string_tab_etry_t*)s2)->key); -} - -rsRetVal -lookupBuildTable(lookup_t *pThis, struct json_object *jroot) -{ - struct json_object *jversion, *jnomatch, *jtype, *jtab; - struct json_object *jrow, *jindex, *jvalue; - uint32_t i; - uint32_t maxStrSize; - DEFiRet; - - jversion = json_object_object_get(jroot, "version"); - jnomatch = json_object_object_get(jroot, "nomatch"); - jtype = json_object_object_get(jroot, "type"); - jtab = json_object_object_get(jroot, "table"); - pThis->nmemb = json_object_array_length(jtab); - CHKmalloc(pThis->d.strtab = malloc(pThis->nmemb * sizeof(lookup_string_tab_etry_t))); - - maxStrSize = 0; - for(i = 0 ; i < pThis->nmemb ; ++i) { - jrow = json_object_array_get_idx(jtab, i); - jindex = json_object_object_get(jrow, "index"); - jvalue = json_object_object_get(jrow, "value"); - CHKmalloc(pThis->d.strtab[i].key = (uchar*) strdup(json_object_get_string(jindex))); - CHKmalloc(pThis->d.strtab[i].val = (uchar*) strdup(json_object_get_string(jvalue))); - maxStrSize += ustrlen(pThis->d.strtab[i].val); - } - - qsort(pThis->d.strtab, pThis->nmemb, sizeof(lookup_string_tab_etry_t), qs_arrcmp_strtab); -dbgprintf("DDDD: table loaded (max size %u):\n", maxStrSize); -for(i = 0 ; i < pThis->nmemb ; ++i) - dbgprintf("key: '%s', val: '%s'\n", pThis->d.strtab[i].key, pThis->d.strtab[i].val); - -finalize_it: - RETiRet; -} - - -/* find a lookup table. This is a naive O(n) algo, but this really - * doesn't matter as it is called only a few times during config - * load. The function returns either a pointer to the requested - * table or NULL, if not found. - */ -lookup_t * -lookupFindTable(uchar *name) -{ - lookup_t *curr; - - for(curr = loadConf->lu_tabs.root ; curr != NULL ; curr = curr->next) { - if(!ustrcmp(curr->name, name)) - break; - } - return curr; -} - - -/* this reloads a lookup table. This is done while the engine is running, - * as such the function must ensure proper locking and proper order of - * operations (so that nothing can interfere). If the table cannot be loaded, - * the old table is continued to be used. - */ -static rsRetVal -lookupReload(lookup_t *pThis) -{ - uint32_t i; - lookup_t newlu; /* dummy to be able to use support functions without - affecting current settings. */ - DEFiRet; - - DBGPRINTF("reload requested for lookup table '%s'\n", pThis->name); - memset(&newlu, 0, sizeof(newlu)); - CHKmalloc(newlu.name = ustrdup(pThis->name)); - CHKmalloc(newlu.filename = ustrdup(pThis->filename)); - CHKiRet(lookupReadFile(&newlu)); - /* all went well, copy over data members */ - pthread_rwlock_wrlock(&pThis->rwlock); - for(i = 0 ; i < pThis->nmemb ; ++i) { - free(pThis->d.strtab[i].key), /* we don't care about exec order of frees */ - free(pThis->d.strtab[i].val); - } - free(pThis->d.strtab); - pThis->d.strtab = newlu.d.strtab; /* hand table AND ALL STRINGS over! */ - pthread_rwlock_unlock(&pThis->rwlock); - errmsg.LogError(0, RS_RET_OK, "lookup table '%s' reloaded from file '%s'", - pThis->name, pThis->filename); -finalize_it: - free(newlu.name); - free(newlu.filename); - RETiRet; -} - - -/* reload all lookup tables on HUP */ -void -lookupDoHUP() -{ - lookup_t *lu; - for(lu = loadConf->lu_tabs.root ; lu != NULL ; lu = lu->next) { - lookupReload(lu); - } -} - - -/* returns either a pointer to the value (read only!) or NULL - * if either the key could not be found or an error occured. - * Note that an estr_t object is returned. The caller is - * responsible for freeing it. - */ -es_str_t * -lookupKey_estr(lookup_t *pThis, uchar *key) -{ - lookup_string_tab_etry_t *etry; - char *r; - es_str_t *estr; - - pthread_rwlock_rdlock(&pThis->rwlock); - etry = bsearch(key, pThis->d.strtab, pThis->nmemb, sizeof(lookup_string_tab_etry_t), bs_arrcmp_strtab); - if(etry == NULL) { - r = ""; // TODO: use set default - } else { - r = (char*)etry->val; - } - estr = es_newStrFromCStr(r, strlen(r)); - pthread_rwlock_unlock(&pThis->rwlock); - return estr; -} - - -/* note: widely-deployed json_c 0.9 does NOT support incremental - * parsing. In order to keep compatible with e.g. Ubuntu 12.04LTS, - * we read the file into one big memory buffer and parse it at once. - * While this is not very elegant, it will not pose any real issue - * for "reasonable" lookup tables (and "unreasonably" large ones - * will probably have other issues as well...). - */ -static rsRetVal -lookupReadFile(lookup_t *pThis) -{ - struct json_tokener *tokener = NULL; - struct json_object *json = NULL; - int eno = errno; - char errStr[1024]; - char *iobuf = NULL; - int fd; - ssize_t nread; - struct stat sb; - DEFiRet; - - - if(stat((char*)pThis->filename, &sb) == -1) { - eno = errno; - errmsg.LogError(0, RS_RET_FILE_NOT_FOUND, - "lookup table file '%s' stat failed: %s", - pThis->filename, rs_strerror_r(eno, errStr, sizeof(errStr))); - ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); - } - - CHKmalloc(iobuf = malloc(sb.st_size)); - - if((fd = open((const char*) pThis->filename, O_RDONLY)) == -1) { - eno = errno; - errmsg.LogError(0, RS_RET_FILE_NOT_FOUND, - "lookup table file '%s' could not be opened: %s", - pThis->filename, rs_strerror_r(eno, errStr, sizeof(errStr))); - ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); - } - - tokener = json_tokener_new(); - nread = read(fd, iobuf, sb.st_size); - if(nread != (ssize_t) sb.st_size) { - eno = errno; - errmsg.LogError(0, RS_RET_READ_ERR, - "lookup table file '%s' read error: %s", - pThis->filename, rs_strerror_r(eno, errStr, sizeof(errStr))); - ABORT_FINALIZE(RS_RET_READ_ERR); - } - - json = json_tokener_parse_ex(tokener, iobuf, sb.st_size); - if(json == NULL) { - errmsg.LogError(0, RS_RET_JSON_PARSE_ERR, - "lookup table file '%s' json parsing error", - pThis->filename); - ABORT_FINALIZE(RS_RET_JSON_PARSE_ERR); - } - free(iobuf); /* early free to sever resources*/ - iobuf = NULL; /* make sure no double-free */ - - /* got json object, now populate our own in-memory structure */ - CHKiRet(lookupBuildTable(pThis, json)); - -finalize_it: - free(iobuf); - if(tokener != NULL) - json_tokener_free(tokener); - if(json != NULL) - json_object_put(json); - RETiRet; -} - - -rsRetVal -lookupProcessCnf(struct cnfobj *o) -{ - struct cnfparamvals *pvals; - lookup_t *lu; - short i; - DEFiRet; - - pvals = nvlstGetParams(o->nvlst, &modpblk, NULL); - if(pvals == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - DBGPRINTF("lookupProcessCnf params:\n"); - cnfparamsPrint(&modpblk, pvals); - - CHKiRet(lookupNew(&lu)); - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "file")) { - CHKmalloc(lu->filename = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL)); - } else if(!strcmp(modpblk.descr[i].name, "name")) { - CHKmalloc(lu->name = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL)); - } else { - dbgprintf("lookup_table: program error, non-handled " - "param '%s'\n", modpblk.descr[i].name); - } - } - CHKiRet(lookupReadFile(lu)); - DBGPRINTF("lookup table '%s' loaded from file '%s'\n", lu->name, lu->filename); - -finalize_it: - cnfparamvalsDestruct(pvals, &modpblk); - RETiRet; -} - -void -lookupClassExit(void) -{ - objRelease(glbl, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); -} - -rsRetVal -lookupClassInit(void) -{ - DEFiRet; - CHKiRet(objGetObjInterface(&obj)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -finalize_it: - RETiRet; -} diff -Nru rsyslog-7.6.0/runtime/lookup.h rsyslog-5.10.1/runtime/lookup.h --- rsyslog-7.6.0/runtime/lookup.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/lookup.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* header for lookup.c - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_LOOKUP_H -#define INCLUDED_LOOKUP_H -#include - -struct lookup_tables_s { - lookup_t *root; /* the root of the template list */ - lookup_t *last; /* points to the last element of the template list */ -}; - -struct lookup_string_tab_etry_s { - uchar *key; - uchar *val; -}; - -/* a single lookup table */ -struct lookup_s { - pthread_rwlock_t rwlock; /* protect us in case of dynamic reloads */ - uchar *name; - uchar *filename; - uint32_t nmemb; - union { - lookup_string_tab_etry_t *strtab; - } d; - lookup_t *next; -}; - -/* prototypes */ -void lookupInitCnf(lookup_tables_t *lu_tabs); -rsRetVal lookupProcessCnf(struct cnfobj *o); -lookup_t *lookupFindTable(uchar *name); -es_str_t * lookupKey_estr(lookup_t *pThis, uchar *key); -void lookupDestruct(lookup_t *pThis); -void lookupClassExit(void); -void lookupDoHUP(); -rsRetVal lookupClassInit(void); - -#endif /* #ifndef INCLUDED_LOOKUP_H */ diff -Nru rsyslog-7.6.0/runtime/Makefile.am rsyslog-5.10.1/runtime/Makefile.am --- rsyslog-7.6.0/runtime/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -8,25 +8,18 @@ rsyslog.c \ rsyslog.h \ typedefs.h \ - dnscache.c \ - dnscache.h \ unicode-helper.h \ atomic.h \ batch.h \ syslogd-types.h \ module-template.h \ - im-helper.h \ obj-types.h \ - sigprov.h \ - cryprov.h \ nsd.h \ glbl.h \ glbl.c \ unlimited_select.h \ conf.c \ conf.h \ - rsconf.c \ - rsconf.h \ parser.h \ parser.c \ strgen.h \ @@ -51,8 +44,18 @@ obj.h \ modules.c \ modules.h \ + apc.c \ + apc.h \ statsobj.c \ statsobj.h \ + sync.c \ + sync.h \ + expr.c \ + expr.h \ + ctok.c \ + ctok.h \ + ctok_token.c \ + ctok_token.h \ stream.c \ stream.h \ var.c \ @@ -61,21 +64,30 @@ wtp.h \ wti.c \ wti.h \ + sysvar.c \ + sysvar.h \ + vm.c \ + vm.h \ + vmstk.c \ + vmstk.h \ + vmprg.c \ + vmprg.h \ + vmop.c \ + vmop.h \ queue.c \ queue.h \ ruleset.c \ ruleset.h \ + rule.c \ + rule.h \ prop.c \ prop.h \ - ratelimit.c \ - ratelimit.h \ - lookup.c \ - lookup.h \ cfsysline.c \ cfsysline.h \ sd-daemon.c \ sd-daemon.h \ \ + \ ../action.h \ ../action.c \ ../threads.c \ @@ -96,16 +108,14 @@ ../template.h # the files with ../ we need to work on - so that they either become part of the # runtime or will no longer be needed. -- rgerhards, 2008-06-13 -# if WITH_MODDIRS -librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" +librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" $(PTHREADS_CFLAGS) else -librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/\" -I\$(top_srcdir) -I\$(top_srcdir)/grammar +librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/\" -I$(top_srcdir) $(PTHREADS_CFLAGS) endif #librsyslog_la_LDFLAGS = -module -avoid-version -librsyslog_la_CPPFLAGS += $(PTHREADS_CFLAGS) $(LIBUUID_CFLAGS) $(JSON_C_CFLAGS) -I\$(top_srcdir)/tools -librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS) $(LIBUUID_LIBS) $(JSON_C_LIBS) +librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS) # # regular expression support @@ -136,7 +146,7 @@ # lmnet_la_SOURCES = net.c net.h lmnet_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -lmnet_la_LDFLAGS = -module -avoid-version ../compat/compat_la-getifaddrs.lo +lmnet_la_LDFLAGS = -module -avoid-version lmnet_la_LIBADD = # network stream master class and stream factory @@ -178,35 +188,6 @@ lmnsd_gtls_la_LIBADD = $(GNUTLS_LIBS) endif -# -# support library for libgcrypt -# -if ENABLE_LIBGCRYPT - noinst_LTLIBRARIES += libgcry.la - libgcry_la_SOURCES = libgcry.c libgcry_common.c libgcry.h - libgcry_la_CPPFLAGS = $(RSRT_CFLAGS) $(LIBGCRYPT_CFLAGS) - pkglib_LTLIBRARIES += lmcry_gcry.la - lmcry_gcry_la_SOURCES = lmcry_gcry.c lmcry_gcry.h - lmcry_gcry_la_CPPFLAGS = $(RSRT_CFLAGS) $(LIBGCRYPT_CFLAGS) - lmcry_gcry_la_LDFLAGS = -module -avoid-version - lmcry_gcry_la_LIBADD = libgcry.la $(LIBGCRYPT_LIBS) -endif - - -# -# support library for guardtime -# -if ENABLE_GUARDTIME - noinst_LTLIBRARIES += librsgt.la - librsgt_la_SOURCES = librsgt.c librsgt_read.c librsgt.h - pkglib_LTLIBRARIES += lmsig_gt.la - lmsig_gt_la_SOURCES = lmsig_gt.c lmsig_gt.h - lmsig_gt_la_CPPFLAGS = $(RSRT_CFLAGS) $(GUARDTIME_CFLAGS) - lmsig_gt_la_LDFLAGS = -module -avoid-version - lmsig_gt_la_LIBADD = librsgt.la $(GUARDTIME_LIBS) -endif - - update-systemd: - curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > sd-daemon.c - curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > sd-daemon.h + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h diff -Nru rsyslog-7.6.0/runtime/Makefile.in rsyslog-5.10.1/runtime/Makefile.in --- rsyslog-7.6.0/runtime/Makefile.in 2014-02-12 12:06:38.000000000 +0000 +++ rsyslog-5.10.1/runtime/Makefile.in 2012-10-17 14:42:45.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -59,18 +59,6 @@ # GnuTLS netstream driver # @ENABLE_GNUTLS_TRUE@am__append_4 = lmnsd_gtls.la - -# -# support library for libgcrypt -# -@ENABLE_LIBGCRYPT_TRUE@am__append_5 = libgcry.la -@ENABLE_LIBGCRYPT_TRUE@am__append_6 = lmcry_gcry.la - -# -# support library for guardtime -# -@ENABLE_GUARDTIME_TRUE@am__append_7 = librsgt.la -@ENABLE_GUARDTIME_TRUE@am__append_8 = lmsig_gt.la subdir = runtime DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -106,62 +94,37 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(sbindir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) -libgcry_la_LIBADD = -am__libgcry_la_SOURCES_DIST = libgcry.c libgcry_common.c libgcry.h -@ENABLE_LIBGCRYPT_TRUE@am_libgcry_la_OBJECTS = libgcry_la-libgcry.lo \ -@ENABLE_LIBGCRYPT_TRUE@ libgcry_la-libgcry_common.lo -libgcry_la_OBJECTS = $(am_libgcry_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -@ENABLE_LIBGCRYPT_TRUE@am_libgcry_la_rpath = -librsgt_la_LIBADD = -am__librsgt_la_SOURCES_DIST = librsgt.c librsgt_read.c librsgt.h -@ENABLE_GUARDTIME_TRUE@am_librsgt_la_OBJECTS = librsgt.lo \ -@ENABLE_GUARDTIME_TRUE@ librsgt_read.lo -librsgt_la_OBJECTS = $(am_librsgt_la_OBJECTS) -@ENABLE_GUARDTIME_TRUE@am_librsgt_la_rpath = am__DEPENDENCIES_1 = librsyslog_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_librsyslog_la_OBJECTS = librsyslog_la-rsyslog.lo \ - librsyslog_la-dnscache.lo librsyslog_la-glbl.lo \ - librsyslog_la-conf.lo librsyslog_la-rsconf.lo \ + librsyslog_la-glbl.lo librsyslog_la-conf.lo \ librsyslog_la-parser.lo librsyslog_la-strgen.lo \ librsyslog_la-msg.lo librsyslog_la-linkedlist.lo \ librsyslog_la-objomsr.lo librsyslog_la-stringbuf.lo \ librsyslog_la-datetime.lo librsyslog_la-srutils.lo \ librsyslog_la-errmsg.lo librsyslog_la-debug.lo \ librsyslog_la-obj.lo librsyslog_la-modules.lo \ - librsyslog_la-statsobj.lo librsyslog_la-stream.lo \ - librsyslog_la-var.lo librsyslog_la-wtp.lo librsyslog_la-wti.lo \ - librsyslog_la-queue.lo librsyslog_la-ruleset.lo \ - librsyslog_la-prop.lo librsyslog_la-ratelimit.lo \ - librsyslog_la-lookup.lo librsyslog_la-cfsysline.lo \ + librsyslog_la-apc.lo librsyslog_la-statsobj.lo \ + librsyslog_la-sync.lo librsyslog_la-expr.lo \ + librsyslog_la-ctok.lo librsyslog_la-ctok_token.lo \ + librsyslog_la-stream.lo librsyslog_la-var.lo \ + librsyslog_la-wtp.lo librsyslog_la-wti.lo \ + librsyslog_la-sysvar.lo librsyslog_la-vm.lo \ + librsyslog_la-vmstk.lo librsyslog_la-vmprg.lo \ + librsyslog_la-vmop.lo librsyslog_la-queue.lo \ + librsyslog_la-ruleset.lo librsyslog_la-rule.lo \ + librsyslog_la-prop.lo librsyslog_la-cfsysline.lo \ librsyslog_la-sd-daemon.lo librsyslog_la-action.lo \ librsyslog_la-threads.lo librsyslog_la-parse.lo \ librsyslog_la-hashtable.lo librsyslog_la-hashtable_itr.lo \ librsyslog_la-outchannel.lo librsyslog_la-template.lo librsyslog_la_OBJECTS = $(am_librsyslog_la_OBJECTS) -@ENABLE_LIBGCRYPT_TRUE@lmcry_gcry_la_DEPENDENCIES = libgcry.la \ -@ENABLE_LIBGCRYPT_TRUE@ $(am__DEPENDENCIES_1) -am__lmcry_gcry_la_SOURCES_DIST = lmcry_gcry.c lmcry_gcry.h -@ENABLE_LIBGCRYPT_TRUE@am_lmcry_gcry_la_OBJECTS = \ -@ENABLE_LIBGCRYPT_TRUE@ lmcry_gcry_la-lmcry_gcry.lo -lmcry_gcry_la_OBJECTS = $(am_lmcry_gcry_la_OBJECTS) -lmcry_gcry_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(lmcry_gcry_la_LDFLAGS) $(LDFLAGS) -o $@ -@ENABLE_LIBGCRYPT_TRUE@am_lmcry_gcry_la_rpath = -rpath $(pkglibdir) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent lmnet_la_DEPENDENCIES = am__lmnet_la_SOURCES_DIST = net.c net.h @ENABLE_INET_TRUE@am_lmnet_la_OBJECTS = lmnet_la-net.lo @@ -215,16 +178,6 @@ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lmregexp_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_REGEXP_TRUE@am_lmregexp_la_rpath = -rpath $(pkglibdir) -@ENABLE_GUARDTIME_TRUE@lmsig_gt_la_DEPENDENCIES = librsgt.la \ -@ENABLE_GUARDTIME_TRUE@ $(am__DEPENDENCIES_1) -am__lmsig_gt_la_SOURCES_DIST = lmsig_gt.c lmsig_gt.h -@ENABLE_GUARDTIME_TRUE@am_lmsig_gt_la_OBJECTS = \ -@ENABLE_GUARDTIME_TRUE@ lmsig_gt_la-lmsig_gt.lo -lmsig_gt_la_OBJECTS = $(am_lmsig_gt_la_OBJECTS) -lmsig_gt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(lmsig_gt_la_LDFLAGS) $(LDFLAGS) -o $@ -@ENABLE_GUARDTIME_TRUE@am_lmsig_gt_la_rpath = -rpath $(pkglibdir) lmstrmsrv_la_DEPENDENCIES = am__lmstrmsrv_la_SOURCES_DIST = strmsrv.c strmsrv.h strms_sess.c \ strms_sess.h @@ -254,36 +207,31 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libgcry_la_SOURCES) $(librsgt_la_SOURCES) \ - $(librsyslog_la_SOURCES) $(lmcry_gcry_la_SOURCES) \ - $(lmnet_la_SOURCES) $(lmnetstrms_la_SOURCES) \ - $(lmnsd_gtls_la_SOURCES) $(lmnsd_ptcp_la_SOURCES) \ - $(lmregexp_la_SOURCES) $(lmsig_gt_la_SOURCES) \ +SOURCES = $(librsyslog_la_SOURCES) $(lmnet_la_SOURCES) \ + $(lmnetstrms_la_SOURCES) $(lmnsd_gtls_la_SOURCES) \ + $(lmnsd_ptcp_la_SOURCES) $(lmregexp_la_SOURCES) \ $(lmstrmsrv_la_SOURCES) $(lmzlibw_la_SOURCES) -DIST_SOURCES = $(am__libgcry_la_SOURCES_DIST) \ - $(am__librsgt_la_SOURCES_DIST) $(librsyslog_la_SOURCES) \ - $(am__lmcry_gcry_la_SOURCES_DIST) $(am__lmnet_la_SOURCES_DIST) \ +DIST_SOURCES = $(librsyslog_la_SOURCES) $(am__lmnet_la_SOURCES_DIST) \ $(am__lmnetstrms_la_SOURCES_DIST) \ $(am__lmnsd_gtls_la_SOURCES_DIST) \ $(am__lmnsd_ptcp_la_SOURCES_DIST) \ $(am__lmregexp_la_SOURCES_DIST) \ - $(am__lmsig_gt_la_SOURCES_DIST) \ $(am__lmstrmsrv_la_SOURCES_DIST) \ $(am__lmzlibw_la_SOURCES_DIST) ETAGS = etags @@ -305,11 +253,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -323,56 +268,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -380,8 +299,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -401,16 +318,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -422,14 +334,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -463,6 +372,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -481,33 +391,26 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man_MANS = -noinst_LTLIBRARIES = librsyslog.la $(am__append_5) $(am__append_7) +noinst_LTLIBRARIES = librsyslog.la pkglib_LTLIBRARIES = $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) $(am__append_6) $(am__append_8) + $(am__append_4) #pkglib_LTLIBRARIES = librsyslog.la librsyslog_la_SOURCES = \ rsyslog.c \ rsyslog.h \ typedefs.h \ - dnscache.c \ - dnscache.h \ unicode-helper.h \ atomic.h \ batch.h \ syslogd-types.h \ module-template.h \ - im-helper.h \ obj-types.h \ - sigprov.h \ - cryprov.h \ nsd.h \ glbl.h \ glbl.c \ unlimited_select.h \ conf.c \ conf.h \ - rsconf.c \ - rsconf.h \ parser.h \ parser.c \ strgen.h \ @@ -532,8 +435,18 @@ obj.h \ modules.c \ modules.h \ + apc.c \ + apc.h \ statsobj.c \ statsobj.h \ + sync.c \ + sync.h \ + expr.c \ + expr.h \ + ctok.c \ + ctok.h \ + ctok_token.c \ + ctok_token.h \ stream.c \ stream.h \ var.c \ @@ -542,21 +455,30 @@ wtp.h \ wti.c \ wti.h \ + sysvar.c \ + sysvar.h \ + vm.c \ + vm.h \ + vmstk.c \ + vmstk.h \ + vmprg.c \ + vmprg.h \ + vmop.c \ + vmop.h \ queue.c \ queue.h \ ruleset.c \ ruleset.h \ + rule.c \ + rule.h \ prop.c \ prop.h \ - ratelimit.c \ - ratelimit.h \ - lookup.c \ - lookup.h \ cfsysline.c \ cfsysline.h \ sd-daemon.c \ sd-daemon.h \ \ + \ ../action.h \ ../action.c \ ../threads.c \ @@ -576,21 +498,12 @@ ../template.c \ ../template.h -#librsyslog_la_LDFLAGS = -module -avoid-version -@WITH_MODDIRS_FALSE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS \ -@WITH_MODDIRS_FALSE@ -D_PATH_MODDIR=\"$(pkglibdir)/\" \ -@WITH_MODDIRS_FALSE@ -I\$(top_srcdir) -I\$(top_srcdir)/grammar \ -@WITH_MODDIRS_FALSE@ $(PTHREADS_CFLAGS) $(LIBUUID_CFLAGS) \ -@WITH_MODDIRS_FALSE@ $(JSON_C_CFLAGS) -I\$(top_srcdir)/tools +@WITH_MODDIRS_FALSE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/\" -I$(top_srcdir) $(PTHREADS_CFLAGS) # the files with ../ we need to work on - so that they either become part of the # runtime or will no longer be needed. -- rgerhards, 2008-06-13 -# +@WITH_MODDIRS_TRUE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" $(PTHREADS_CFLAGS) #librsyslog_la_LDFLAGS = -module -avoid-version -@WITH_MODDIRS_TRUE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS \ -@WITH_MODDIRS_TRUE@ -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" \ -@WITH_MODDIRS_TRUE@ $(PTHREADS_CFLAGS) $(LIBUUID_CFLAGS) \ -@WITH_MODDIRS_TRUE@ $(JSON_C_CFLAGS) -I\$(top_srcdir)/tools -librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS) $(LIBUUID_LIBS) $(JSON_C_LIBS) +librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS) @ENABLE_REGEXP_TRUE@lmregexp_la_SOURCES = regexp.c regexp.h @ENABLE_REGEXP_TRUE@lmregexp_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) @ENABLE_REGEXP_TRUE@lmregexp_la_LDFLAGS = -module -avoid-version @@ -604,7 +517,7 @@ # @ENABLE_INET_TRUE@lmnet_la_SOURCES = net.c net.h @ENABLE_INET_TRUE@lmnet_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -@ENABLE_INET_TRUE@lmnet_la_LDFLAGS = -module -avoid-version ../compat/compat_la-getifaddrs.lo +@ENABLE_INET_TRUE@lmnet_la_LDFLAGS = -module -avoid-version @ENABLE_INET_TRUE@lmnet_la_LIBADD = # network stream master class and stream factory @@ -631,17 +544,6 @@ @ENABLE_GNUTLS_TRUE@lmnsd_gtls_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(GNUTLS_CFLAGS) @ENABLE_GNUTLS_TRUE@lmnsd_gtls_la_LDFLAGS = -module -avoid-version @ENABLE_GNUTLS_TRUE@lmnsd_gtls_la_LIBADD = $(GNUTLS_LIBS) -@ENABLE_LIBGCRYPT_TRUE@libgcry_la_SOURCES = libgcry.c libgcry_common.c libgcry.h -@ENABLE_LIBGCRYPT_TRUE@libgcry_la_CPPFLAGS = $(RSRT_CFLAGS) $(LIBGCRYPT_CFLAGS) -@ENABLE_LIBGCRYPT_TRUE@lmcry_gcry_la_SOURCES = lmcry_gcry.c lmcry_gcry.h -@ENABLE_LIBGCRYPT_TRUE@lmcry_gcry_la_CPPFLAGS = $(RSRT_CFLAGS) $(LIBGCRYPT_CFLAGS) -@ENABLE_LIBGCRYPT_TRUE@lmcry_gcry_la_LDFLAGS = -module -avoid-version -@ENABLE_LIBGCRYPT_TRUE@lmcry_gcry_la_LIBADD = libgcry.la $(LIBGCRYPT_LIBS) -@ENABLE_GUARDTIME_TRUE@librsgt_la_SOURCES = librsgt.c librsgt_read.c librsgt.h -@ENABLE_GUARDTIME_TRUE@lmsig_gt_la_SOURCES = lmsig_gt.c lmsig_gt.h -@ENABLE_GUARDTIME_TRUE@lmsig_gt_la_CPPFLAGS = $(RSRT_CFLAGS) $(GUARDTIME_CFLAGS) -@ENABLE_GUARDTIME_TRUE@lmsig_gt_la_LDFLAGS = -module -avoid-version -@ENABLE_GUARDTIME_TRUE@lmsig_gt_la_LIBADD = librsgt.la $(GUARDTIME_LIBS) all: all-am .SUFFIXES: @@ -716,29 +618,21 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libgcry.la: $(libgcry_la_OBJECTS) $(libgcry_la_DEPENDENCIES) $(EXTRA_libgcry_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libgcry_la_rpath) $(libgcry_la_OBJECTS) $(libgcry_la_LIBADD) $(LIBS) -librsgt.la: $(librsgt_la_OBJECTS) $(librsgt_la_DEPENDENCIES) $(EXTRA_librsgt_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_librsgt_la_rpath) $(librsgt_la_OBJECTS) $(librsgt_la_LIBADD) $(LIBS) -librsyslog.la: $(librsyslog_la_OBJECTS) $(librsyslog_la_DEPENDENCIES) $(EXTRA_librsyslog_la_DEPENDENCIES) +librsyslog.la: $(librsyslog_la_OBJECTS) $(librsyslog_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(librsyslog_la_OBJECTS) $(librsyslog_la_LIBADD) $(LIBS) -lmcry_gcry.la: $(lmcry_gcry_la_OBJECTS) $(lmcry_gcry_la_DEPENDENCIES) $(EXTRA_lmcry_gcry_la_DEPENDENCIES) - $(AM_V_CCLD)$(lmcry_gcry_la_LINK) $(am_lmcry_gcry_la_rpath) $(lmcry_gcry_la_OBJECTS) $(lmcry_gcry_la_LIBADD) $(LIBS) -lmnet.la: $(lmnet_la_OBJECTS) $(lmnet_la_DEPENDENCIES) $(EXTRA_lmnet_la_DEPENDENCIES) +lmnet.la: $(lmnet_la_OBJECTS) $(lmnet_la_DEPENDENCIES) $(AM_V_CCLD)$(lmnet_la_LINK) $(am_lmnet_la_rpath) $(lmnet_la_OBJECTS) $(lmnet_la_LIBADD) $(LIBS) -lmnetstrms.la: $(lmnetstrms_la_OBJECTS) $(lmnetstrms_la_DEPENDENCIES) $(EXTRA_lmnetstrms_la_DEPENDENCIES) +lmnetstrms.la: $(lmnetstrms_la_OBJECTS) $(lmnetstrms_la_DEPENDENCIES) $(AM_V_CCLD)$(lmnetstrms_la_LINK) $(am_lmnetstrms_la_rpath) $(lmnetstrms_la_OBJECTS) $(lmnetstrms_la_LIBADD) $(LIBS) -lmnsd_gtls.la: $(lmnsd_gtls_la_OBJECTS) $(lmnsd_gtls_la_DEPENDENCIES) $(EXTRA_lmnsd_gtls_la_DEPENDENCIES) +lmnsd_gtls.la: $(lmnsd_gtls_la_OBJECTS) $(lmnsd_gtls_la_DEPENDENCIES) $(AM_V_CCLD)$(lmnsd_gtls_la_LINK) $(am_lmnsd_gtls_la_rpath) $(lmnsd_gtls_la_OBJECTS) $(lmnsd_gtls_la_LIBADD) $(LIBS) -lmnsd_ptcp.la: $(lmnsd_ptcp_la_OBJECTS) $(lmnsd_ptcp_la_DEPENDENCIES) $(EXTRA_lmnsd_ptcp_la_DEPENDENCIES) +lmnsd_ptcp.la: $(lmnsd_ptcp_la_OBJECTS) $(lmnsd_ptcp_la_DEPENDENCIES) $(AM_V_CCLD)$(lmnsd_ptcp_la_LINK) $(am_lmnsd_ptcp_la_rpath) $(lmnsd_ptcp_la_OBJECTS) $(lmnsd_ptcp_la_LIBADD) $(LIBS) -lmregexp.la: $(lmregexp_la_OBJECTS) $(lmregexp_la_DEPENDENCIES) $(EXTRA_lmregexp_la_DEPENDENCIES) +lmregexp.la: $(lmregexp_la_OBJECTS) $(lmregexp_la_DEPENDENCIES) $(AM_V_CCLD)$(lmregexp_la_LINK) $(am_lmregexp_la_rpath) $(lmregexp_la_OBJECTS) $(lmregexp_la_LIBADD) $(LIBS) -lmsig_gt.la: $(lmsig_gt_la_OBJECTS) $(lmsig_gt_la_DEPENDENCIES) $(EXTRA_lmsig_gt_la_DEPENDENCIES) - $(AM_V_CCLD)$(lmsig_gt_la_LINK) $(am_lmsig_gt_la_rpath) $(lmsig_gt_la_OBJECTS) $(lmsig_gt_la_LIBADD) $(LIBS) -lmstrmsrv.la: $(lmstrmsrv_la_OBJECTS) $(lmstrmsrv_la_DEPENDENCIES) $(EXTRA_lmstrmsrv_la_DEPENDENCIES) +lmstrmsrv.la: $(lmstrmsrv_la_OBJECTS) $(lmstrmsrv_la_DEPENDENCIES) $(AM_V_CCLD)$(lmstrmsrv_la_LINK) $(am_lmstrmsrv_la_rpath) $(lmstrmsrv_la_OBJECTS) $(lmstrmsrv_la_LIBADD) $(LIBS) -lmzlibw.la: $(lmzlibw_la_OBJECTS) $(lmzlibw_la_DEPENDENCIES) $(EXTRA_lmzlibw_la_DEPENDENCIES) +lmzlibw.la: $(lmzlibw_la_OBJECTS) $(lmzlibw_la_DEPENDENCIES) $(AM_V_CCLD)$(lmzlibw_la_LINK) $(am_lmzlibw_la_rpath) $(lmzlibw_la_OBJECTS) $(lmzlibw_la_LIBADD) $(LIBS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @@ -790,22 +684,20 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgcry_la-libgcry.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgcry_la-libgcry_common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsgt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsgt_read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-action.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-apc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-cfsysline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-conf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-ctok.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-ctok_token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-datetime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-debug.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-dnscache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-errmsg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-expr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-glbl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-hashtable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-hashtable_itr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-linkedlist.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-lookup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-modules.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-obj.Plo@am__quote@ @@ -815,9 +707,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-prop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-queue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-ratelimit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-rsconf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-rsyslog.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-rule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-ruleset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-sd-daemon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-srutils.Plo@am__quote@ @@ -825,12 +716,17 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-strgen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-stringbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-sync.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-sysvar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-template.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-threads.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-var.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-vm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-vmop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-vmprg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-vmstk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-wti.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librsyslog_la-wtp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmcry_gcry_la-lmcry_gcry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmnet_la-net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmnetstrms_la-netstrm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmnetstrms_la-netstrms.Plo@am__quote@ @@ -842,7 +738,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmnsd_ptcp_la-nsdpoll_ptcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmnsd_ptcp_la-nsdsel_ptcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmregexp_la-regexp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmsig_gt_la-lmsig_gt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmstrmsrv_la-strms_sess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmstrmsrv_la-strmsrv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lmzlibw_la-zlibw.Plo@am__quote@ @@ -850,401 +745,482 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -libgcry_la-libgcry.lo: libgcry.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgcry_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgcry_la-libgcry.lo -MD -MP -MF $(DEPDIR)/libgcry_la-libgcry.Tpo -c -o libgcry_la-libgcry.lo `test -f 'libgcry.c' || echo '$(srcdir)/'`libgcry.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgcry_la-libgcry.Tpo $(DEPDIR)/libgcry_la-libgcry.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libgcry.c' object='libgcry_la-libgcry.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgcry_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgcry_la-libgcry.lo `test -f 'libgcry.c' || echo '$(srcdir)/'`libgcry.c - -libgcry_la-libgcry_common.lo: libgcry_common.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgcry_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgcry_la-libgcry_common.lo -MD -MP -MF $(DEPDIR)/libgcry_la-libgcry_common.Tpo -c -o libgcry_la-libgcry_common.lo `test -f 'libgcry_common.c' || echo '$(srcdir)/'`libgcry_common.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgcry_la-libgcry_common.Tpo $(DEPDIR)/libgcry_la-libgcry_common.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libgcry_common.c' object='libgcry_la-libgcry_common.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgcry_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgcry_la-libgcry_common.lo `test -f 'libgcry_common.c' || echo '$(srcdir)/'`libgcry_common.c +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< librsyslog_la-rsyslog.lo: rsyslog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-rsyslog.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-rsyslog.Tpo -c -o librsyslog_la-rsyslog.lo `test -f 'rsyslog.c' || echo '$(srcdir)/'`rsyslog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-rsyslog.Tpo $(DEPDIR)/librsyslog_la-rsyslog.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rsyslog.c' object='librsyslog_la-rsyslog.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-rsyslog.lo `test -f 'rsyslog.c' || echo '$(srcdir)/'`rsyslog.c - -librsyslog_la-dnscache.lo: dnscache.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-dnscache.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-dnscache.Tpo -c -o librsyslog_la-dnscache.lo `test -f 'dnscache.c' || echo '$(srcdir)/'`dnscache.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-dnscache.Tpo $(DEPDIR)/librsyslog_la-dnscache.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnscache.c' object='librsyslog_la-dnscache.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rsyslog.c' object='librsyslog_la-rsyslog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-dnscache.lo `test -f 'dnscache.c' || echo '$(srcdir)/'`dnscache.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-rsyslog.lo `test -f 'rsyslog.c' || echo '$(srcdir)/'`rsyslog.c librsyslog_la-glbl.lo: glbl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-glbl.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-glbl.Tpo -c -o librsyslog_la-glbl.lo `test -f 'glbl.c' || echo '$(srcdir)/'`glbl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-glbl.Tpo $(DEPDIR)/librsyslog_la-glbl.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glbl.c' object='librsyslog_la-glbl.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='glbl.c' object='librsyslog_la-glbl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-glbl.lo `test -f 'glbl.c' || echo '$(srcdir)/'`glbl.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-glbl.lo `test -f 'glbl.c' || echo '$(srcdir)/'`glbl.c librsyslog_la-conf.lo: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-conf.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-conf.Tpo -c -o librsyslog_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-conf.Tpo $(DEPDIR)/librsyslog_la-conf.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='librsyslog_la-conf.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='conf.c' object='librsyslog_la-conf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c - -librsyslog_la-rsconf.lo: rsconf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-rsconf.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-rsconf.Tpo -c -o librsyslog_la-rsconf.lo `test -f 'rsconf.c' || echo '$(srcdir)/'`rsconf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-rsconf.Tpo $(DEPDIR)/librsyslog_la-rsconf.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rsconf.c' object='librsyslog_la-rsconf.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-rsconf.lo `test -f 'rsconf.c' || echo '$(srcdir)/'`rsconf.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c librsyslog_la-parser.lo: parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-parser.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-parser.Tpo -c -o librsyslog_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-parser.Tpo $(DEPDIR)/librsyslog_la-parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser.c' object='librsyslog_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser.c' object='librsyslog_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c librsyslog_la-strgen.lo: strgen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-strgen.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-strgen.Tpo -c -o librsyslog_la-strgen.lo `test -f 'strgen.c' || echo '$(srcdir)/'`strgen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-strgen.Tpo $(DEPDIR)/librsyslog_la-strgen.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strgen.c' object='librsyslog_la-strgen.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strgen.c' object='librsyslog_la-strgen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-strgen.lo `test -f 'strgen.c' || echo '$(srcdir)/'`strgen.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-strgen.lo `test -f 'strgen.c' || echo '$(srcdir)/'`strgen.c librsyslog_la-msg.lo: msg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-msg.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-msg.Tpo -c -o librsyslog_la-msg.lo `test -f 'msg.c' || echo '$(srcdir)/'`msg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-msg.Tpo $(DEPDIR)/librsyslog_la-msg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msg.c' object='librsyslog_la-msg.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='msg.c' object='librsyslog_la-msg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-msg.lo `test -f 'msg.c' || echo '$(srcdir)/'`msg.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-msg.lo `test -f 'msg.c' || echo '$(srcdir)/'`msg.c librsyslog_la-linkedlist.lo: linkedlist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-linkedlist.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-linkedlist.Tpo -c -o librsyslog_la-linkedlist.lo `test -f 'linkedlist.c' || echo '$(srcdir)/'`linkedlist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-linkedlist.Tpo $(DEPDIR)/librsyslog_la-linkedlist.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linkedlist.c' object='librsyslog_la-linkedlist.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='linkedlist.c' object='librsyslog_la-linkedlist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-linkedlist.lo `test -f 'linkedlist.c' || echo '$(srcdir)/'`linkedlist.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-linkedlist.lo `test -f 'linkedlist.c' || echo '$(srcdir)/'`linkedlist.c librsyslog_la-objomsr.lo: objomsr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-objomsr.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-objomsr.Tpo -c -o librsyslog_la-objomsr.lo `test -f 'objomsr.c' || echo '$(srcdir)/'`objomsr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-objomsr.Tpo $(DEPDIR)/librsyslog_la-objomsr.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='objomsr.c' object='librsyslog_la-objomsr.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='objomsr.c' object='librsyslog_la-objomsr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-objomsr.lo `test -f 'objomsr.c' || echo '$(srcdir)/'`objomsr.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-objomsr.lo `test -f 'objomsr.c' || echo '$(srcdir)/'`objomsr.c librsyslog_la-stringbuf.lo: stringbuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-stringbuf.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-stringbuf.Tpo -c -o librsyslog_la-stringbuf.lo `test -f 'stringbuf.c' || echo '$(srcdir)/'`stringbuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-stringbuf.Tpo $(DEPDIR)/librsyslog_la-stringbuf.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stringbuf.c' object='librsyslog_la-stringbuf.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stringbuf.c' object='librsyslog_la-stringbuf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-stringbuf.lo `test -f 'stringbuf.c' || echo '$(srcdir)/'`stringbuf.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-stringbuf.lo `test -f 'stringbuf.c' || echo '$(srcdir)/'`stringbuf.c librsyslog_la-datetime.lo: datetime.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-datetime.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-datetime.Tpo -c -o librsyslog_la-datetime.lo `test -f 'datetime.c' || echo '$(srcdir)/'`datetime.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-datetime.Tpo $(DEPDIR)/librsyslog_la-datetime.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='datetime.c' object='librsyslog_la-datetime.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='datetime.c' object='librsyslog_la-datetime.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-datetime.lo `test -f 'datetime.c' || echo '$(srcdir)/'`datetime.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-datetime.lo `test -f 'datetime.c' || echo '$(srcdir)/'`datetime.c librsyslog_la-srutils.lo: srutils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-srutils.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-srutils.Tpo -c -o librsyslog_la-srutils.lo `test -f 'srutils.c' || echo '$(srcdir)/'`srutils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-srutils.Tpo $(DEPDIR)/librsyslog_la-srutils.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='srutils.c' object='librsyslog_la-srutils.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='srutils.c' object='librsyslog_la-srutils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-srutils.lo `test -f 'srutils.c' || echo '$(srcdir)/'`srutils.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-srutils.lo `test -f 'srutils.c' || echo '$(srcdir)/'`srutils.c librsyslog_la-errmsg.lo: errmsg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-errmsg.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-errmsg.Tpo -c -o librsyslog_la-errmsg.lo `test -f 'errmsg.c' || echo '$(srcdir)/'`errmsg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-errmsg.Tpo $(DEPDIR)/librsyslog_la-errmsg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='errmsg.c' object='librsyslog_la-errmsg.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='errmsg.c' object='librsyslog_la-errmsg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-errmsg.lo `test -f 'errmsg.c' || echo '$(srcdir)/'`errmsg.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-errmsg.lo `test -f 'errmsg.c' || echo '$(srcdir)/'`errmsg.c librsyslog_la-debug.lo: debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-debug.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-debug.Tpo -c -o librsyslog_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-debug.Tpo $(DEPDIR)/librsyslog_la-debug.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='librsyslog_la-debug.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='debug.c' object='librsyslog_la-debug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c librsyslog_la-obj.lo: obj.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-obj.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-obj.Tpo -c -o librsyslog_la-obj.lo `test -f 'obj.c' || echo '$(srcdir)/'`obj.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-obj.Tpo $(DEPDIR)/librsyslog_la-obj.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obj.c' object='librsyslog_la-obj.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='obj.c' object='librsyslog_la-obj.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-obj.lo `test -f 'obj.c' || echo '$(srcdir)/'`obj.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-obj.lo `test -f 'obj.c' || echo '$(srcdir)/'`obj.c librsyslog_la-modules.lo: modules.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-modules.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-modules.Tpo -c -o librsyslog_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-modules.Tpo $(DEPDIR)/librsyslog_la-modules.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='modules.c' object='librsyslog_la-modules.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='modules.c' object='librsyslog_la-modules.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c + +librsyslog_la-apc.lo: apc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-apc.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-apc.Tpo -c -o librsyslog_la-apc.lo `test -f 'apc.c' || echo '$(srcdir)/'`apc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-apc.Tpo $(DEPDIR)/librsyslog_la-apc.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='apc.c' object='librsyslog_la-apc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-apc.lo `test -f 'apc.c' || echo '$(srcdir)/'`apc.c librsyslog_la-statsobj.lo: statsobj.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-statsobj.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-statsobj.Tpo -c -o librsyslog_la-statsobj.lo `test -f 'statsobj.c' || echo '$(srcdir)/'`statsobj.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-statsobj.Tpo $(DEPDIR)/librsyslog_la-statsobj.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statsobj.c' object='librsyslog_la-statsobj.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='statsobj.c' object='librsyslog_la-statsobj.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-statsobj.lo `test -f 'statsobj.c' || echo '$(srcdir)/'`statsobj.c + +librsyslog_la-sync.lo: sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-sync.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-sync.Tpo -c -o librsyslog_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-sync.Tpo $(DEPDIR)/librsyslog_la-sync.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sync.c' object='librsyslog_la-sync.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c + +librsyslog_la-expr.lo: expr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-expr.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-expr.Tpo -c -o librsyslog_la-expr.lo `test -f 'expr.c' || echo '$(srcdir)/'`expr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-expr.Tpo $(DEPDIR)/librsyslog_la-expr.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='expr.c' object='librsyslog_la-expr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-expr.lo `test -f 'expr.c' || echo '$(srcdir)/'`expr.c + +librsyslog_la-ctok.lo: ctok.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-ctok.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-ctok.Tpo -c -o librsyslog_la-ctok.lo `test -f 'ctok.c' || echo '$(srcdir)/'`ctok.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-ctok.Tpo $(DEPDIR)/librsyslog_la-ctok.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ctok.c' object='librsyslog_la-ctok.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-ctok.lo `test -f 'ctok.c' || echo '$(srcdir)/'`ctok.c + +librsyslog_la-ctok_token.lo: ctok_token.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-ctok_token.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-ctok_token.Tpo -c -o librsyslog_la-ctok_token.lo `test -f 'ctok_token.c' || echo '$(srcdir)/'`ctok_token.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-ctok_token.Tpo $(DEPDIR)/librsyslog_la-ctok_token.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ctok_token.c' object='librsyslog_la-ctok_token.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-statsobj.lo `test -f 'statsobj.c' || echo '$(srcdir)/'`statsobj.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-ctok_token.lo `test -f 'ctok_token.c' || echo '$(srcdir)/'`ctok_token.c librsyslog_la-stream.lo: stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-stream.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-stream.Tpo -c -o librsyslog_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-stream.Tpo $(DEPDIR)/librsyslog_la-stream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stream.c' object='librsyslog_la-stream.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stream.c' object='librsyslog_la-stream.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c librsyslog_la-var.lo: var.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-var.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-var.Tpo -c -o librsyslog_la-var.lo `test -f 'var.c' || echo '$(srcdir)/'`var.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-var.Tpo $(DEPDIR)/librsyslog_la-var.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='var.c' object='librsyslog_la-var.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='var.c' object='librsyslog_la-var.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-var.lo `test -f 'var.c' || echo '$(srcdir)/'`var.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-var.lo `test -f 'var.c' || echo '$(srcdir)/'`var.c librsyslog_la-wtp.lo: wtp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-wtp.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-wtp.Tpo -c -o librsyslog_la-wtp.lo `test -f 'wtp.c' || echo '$(srcdir)/'`wtp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-wtp.Tpo $(DEPDIR)/librsyslog_la-wtp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wtp.c' object='librsyslog_la-wtp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wtp.c' object='librsyslog_la-wtp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-wtp.lo `test -f 'wtp.c' || echo '$(srcdir)/'`wtp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-wtp.lo `test -f 'wtp.c' || echo '$(srcdir)/'`wtp.c librsyslog_la-wti.lo: wti.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-wti.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-wti.Tpo -c -o librsyslog_la-wti.lo `test -f 'wti.c' || echo '$(srcdir)/'`wti.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-wti.Tpo $(DEPDIR)/librsyslog_la-wti.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wti.c' object='librsyslog_la-wti.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='wti.c' object='librsyslog_la-wti.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-wti.lo `test -f 'wti.c' || echo '$(srcdir)/'`wti.c + +librsyslog_la-sysvar.lo: sysvar.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-sysvar.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-sysvar.Tpo -c -o librsyslog_la-sysvar.lo `test -f 'sysvar.c' || echo '$(srcdir)/'`sysvar.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-sysvar.Tpo $(DEPDIR)/librsyslog_la-sysvar.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sysvar.c' object='librsyslog_la-sysvar.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-sysvar.lo `test -f 'sysvar.c' || echo '$(srcdir)/'`sysvar.c + +librsyslog_la-vm.lo: vm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-vm.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-vm.Tpo -c -o librsyslog_la-vm.lo `test -f 'vm.c' || echo '$(srcdir)/'`vm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-vm.Tpo $(DEPDIR)/librsyslog_la-vm.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vm.c' object='librsyslog_la-vm.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-vm.lo `test -f 'vm.c' || echo '$(srcdir)/'`vm.c + +librsyslog_la-vmstk.lo: vmstk.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-vmstk.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-vmstk.Tpo -c -o librsyslog_la-vmstk.lo `test -f 'vmstk.c' || echo '$(srcdir)/'`vmstk.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-vmstk.Tpo $(DEPDIR)/librsyslog_la-vmstk.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vmstk.c' object='librsyslog_la-vmstk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-vmstk.lo `test -f 'vmstk.c' || echo '$(srcdir)/'`vmstk.c + +librsyslog_la-vmprg.lo: vmprg.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-vmprg.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-vmprg.Tpo -c -o librsyslog_la-vmprg.lo `test -f 'vmprg.c' || echo '$(srcdir)/'`vmprg.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-vmprg.Tpo $(DEPDIR)/librsyslog_la-vmprg.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vmprg.c' object='librsyslog_la-vmprg.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-vmprg.lo `test -f 'vmprg.c' || echo '$(srcdir)/'`vmprg.c + +librsyslog_la-vmop.lo: vmop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-vmop.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-vmop.Tpo -c -o librsyslog_la-vmop.lo `test -f 'vmop.c' || echo '$(srcdir)/'`vmop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-vmop.Tpo $(DEPDIR)/librsyslog_la-vmop.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='vmop.c' object='librsyslog_la-vmop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-wti.lo `test -f 'wti.c' || echo '$(srcdir)/'`wti.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-vmop.lo `test -f 'vmop.c' || echo '$(srcdir)/'`vmop.c librsyslog_la-queue.lo: queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-queue.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-queue.Tpo -c -o librsyslog_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-queue.Tpo $(DEPDIR)/librsyslog_la-queue.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='queue.c' object='librsyslog_la-queue.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='queue.c' object='librsyslog_la-queue.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-queue.lo `test -f 'queue.c' || echo '$(srcdir)/'`queue.c librsyslog_la-ruleset.lo: ruleset.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-ruleset.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-ruleset.Tpo -c -o librsyslog_la-ruleset.lo `test -f 'ruleset.c' || echo '$(srcdir)/'`ruleset.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-ruleset.Tpo $(DEPDIR)/librsyslog_la-ruleset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ruleset.c' object='librsyslog_la-ruleset.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ruleset.c' object='librsyslog_la-ruleset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-ruleset.lo `test -f 'ruleset.c' || echo '$(srcdir)/'`ruleset.c + +librsyslog_la-rule.lo: rule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-rule.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-rule.Tpo -c -o librsyslog_la-rule.lo `test -f 'rule.c' || echo '$(srcdir)/'`rule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-rule.Tpo $(DEPDIR)/librsyslog_la-rule.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rule.c' object='librsyslog_la-rule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-ruleset.lo `test -f 'ruleset.c' || echo '$(srcdir)/'`ruleset.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-rule.lo `test -f 'rule.c' || echo '$(srcdir)/'`rule.c librsyslog_la-prop.lo: prop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-prop.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-prop.Tpo -c -o librsyslog_la-prop.lo `test -f 'prop.c' || echo '$(srcdir)/'`prop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-prop.Tpo $(DEPDIR)/librsyslog_la-prop.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prop.c' object='librsyslog_la-prop.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prop.c' object='librsyslog_la-prop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-prop.lo `test -f 'prop.c' || echo '$(srcdir)/'`prop.c - -librsyslog_la-ratelimit.lo: ratelimit.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-ratelimit.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-ratelimit.Tpo -c -o librsyslog_la-ratelimit.lo `test -f 'ratelimit.c' || echo '$(srcdir)/'`ratelimit.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-ratelimit.Tpo $(DEPDIR)/librsyslog_la-ratelimit.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ratelimit.c' object='librsyslog_la-ratelimit.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-ratelimit.lo `test -f 'ratelimit.c' || echo '$(srcdir)/'`ratelimit.c - -librsyslog_la-lookup.lo: lookup.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-lookup.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-lookup.Tpo -c -o librsyslog_la-lookup.lo `test -f 'lookup.c' || echo '$(srcdir)/'`lookup.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-lookup.Tpo $(DEPDIR)/librsyslog_la-lookup.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lookup.c' object='librsyslog_la-lookup.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-lookup.lo `test -f 'lookup.c' || echo '$(srcdir)/'`lookup.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-prop.lo `test -f 'prop.c' || echo '$(srcdir)/'`prop.c librsyslog_la-cfsysline.lo: cfsysline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-cfsysline.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-cfsysline.Tpo -c -o librsyslog_la-cfsysline.lo `test -f 'cfsysline.c' || echo '$(srcdir)/'`cfsysline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-cfsysline.Tpo $(DEPDIR)/librsyslog_la-cfsysline.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cfsysline.c' object='librsyslog_la-cfsysline.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cfsysline.c' object='librsyslog_la-cfsysline.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-cfsysline.lo `test -f 'cfsysline.c' || echo '$(srcdir)/'`cfsysline.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-cfsysline.lo `test -f 'cfsysline.c' || echo '$(srcdir)/'`cfsysline.c librsyslog_la-sd-daemon.lo: sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-sd-daemon.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-sd-daemon.Tpo -c -o librsyslog_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-sd-daemon.Tpo $(DEPDIR)/librsyslog_la-sd-daemon.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sd-daemon.c' object='librsyslog_la-sd-daemon.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sd-daemon.c' object='librsyslog_la-sd-daemon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-sd-daemon.lo `test -f 'sd-daemon.c' || echo '$(srcdir)/'`sd-daemon.c librsyslog_la-action.lo: ../action.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-action.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-action.Tpo -c -o librsyslog_la-action.lo `test -f '../action.c' || echo '$(srcdir)/'`../action.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-action.Tpo $(DEPDIR)/librsyslog_la-action.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../action.c' object='librsyslog_la-action.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../action.c' object='librsyslog_la-action.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-action.lo `test -f '../action.c' || echo '$(srcdir)/'`../action.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-action.lo `test -f '../action.c' || echo '$(srcdir)/'`../action.c librsyslog_la-threads.lo: ../threads.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-threads.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-threads.Tpo -c -o librsyslog_la-threads.lo `test -f '../threads.c' || echo '$(srcdir)/'`../threads.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-threads.Tpo $(DEPDIR)/librsyslog_la-threads.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../threads.c' object='librsyslog_la-threads.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../threads.c' object='librsyslog_la-threads.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-threads.lo `test -f '../threads.c' || echo '$(srcdir)/'`../threads.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-threads.lo `test -f '../threads.c' || echo '$(srcdir)/'`../threads.c librsyslog_la-parse.lo: ../parse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-parse.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-parse.Tpo -c -o librsyslog_la-parse.lo `test -f '../parse.c' || echo '$(srcdir)/'`../parse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-parse.Tpo $(DEPDIR)/librsyslog_la-parse.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../parse.c' object='librsyslog_la-parse.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../parse.c' object='librsyslog_la-parse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-parse.lo `test -f '../parse.c' || echo '$(srcdir)/'`../parse.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-parse.lo `test -f '../parse.c' || echo '$(srcdir)/'`../parse.c librsyslog_la-hashtable.lo: hashtable.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-hashtable.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-hashtable.Tpo -c -o librsyslog_la-hashtable.lo `test -f 'hashtable.c' || echo '$(srcdir)/'`hashtable.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-hashtable.Tpo $(DEPDIR)/librsyslog_la-hashtable.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashtable.c' object='librsyslog_la-hashtable.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hashtable.c' object='librsyslog_la-hashtable.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-hashtable.lo `test -f 'hashtable.c' || echo '$(srcdir)/'`hashtable.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-hashtable.lo `test -f 'hashtable.c' || echo '$(srcdir)/'`hashtable.c librsyslog_la-hashtable_itr.lo: hashtable_itr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-hashtable_itr.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-hashtable_itr.Tpo -c -o librsyslog_la-hashtable_itr.lo `test -f 'hashtable_itr.c' || echo '$(srcdir)/'`hashtable_itr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-hashtable_itr.Tpo $(DEPDIR)/librsyslog_la-hashtable_itr.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashtable_itr.c' object='librsyslog_la-hashtable_itr.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hashtable_itr.c' object='librsyslog_la-hashtable_itr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-hashtable_itr.lo `test -f 'hashtable_itr.c' || echo '$(srcdir)/'`hashtable_itr.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-hashtable_itr.lo `test -f 'hashtable_itr.c' || echo '$(srcdir)/'`hashtable_itr.c librsyslog_la-outchannel.lo: ../outchannel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-outchannel.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-outchannel.Tpo -c -o librsyslog_la-outchannel.lo `test -f '../outchannel.c' || echo '$(srcdir)/'`../outchannel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-outchannel.Tpo $(DEPDIR)/librsyslog_la-outchannel.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../outchannel.c' object='librsyslog_la-outchannel.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../outchannel.c' object='librsyslog_la-outchannel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-outchannel.lo `test -f '../outchannel.c' || echo '$(srcdir)/'`../outchannel.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-outchannel.lo `test -f '../outchannel.c' || echo '$(srcdir)/'`../outchannel.c librsyslog_la-template.lo: ../template.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT librsyslog_la-template.lo -MD -MP -MF $(DEPDIR)/librsyslog_la-template.Tpo -c -o librsyslog_la-template.lo `test -f '../template.c' || echo '$(srcdir)/'`../template.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librsyslog_la-template.Tpo $(DEPDIR)/librsyslog_la-template.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../template.c' object='librsyslog_la-template.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../template.c' object='librsyslog_la-template.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-template.lo `test -f '../template.c' || echo '$(srcdir)/'`../template.c - -lmcry_gcry_la-lmcry_gcry.lo: lmcry_gcry.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmcry_gcry_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmcry_gcry_la-lmcry_gcry.lo -MD -MP -MF $(DEPDIR)/lmcry_gcry_la-lmcry_gcry.Tpo -c -o lmcry_gcry_la-lmcry_gcry.lo `test -f 'lmcry_gcry.c' || echo '$(srcdir)/'`lmcry_gcry.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmcry_gcry_la-lmcry_gcry.Tpo $(DEPDIR)/lmcry_gcry_la-lmcry_gcry.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lmcry_gcry.c' object='lmcry_gcry_la-lmcry_gcry.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmcry_gcry_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmcry_gcry_la-lmcry_gcry.lo `test -f 'lmcry_gcry.c' || echo '$(srcdir)/'`lmcry_gcry.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librsyslog_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o librsyslog_la-template.lo `test -f '../template.c' || echo '$(srcdir)/'`../template.c lmnet_la-net.lo: net.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnet_la-net.lo -MD -MP -MF $(DEPDIR)/lmnet_la-net.Tpo -c -o lmnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnet_la-net.Tpo $(DEPDIR)/lmnet_la-net.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='net.c' object='lmnet_la-net.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='net.c' object='lmnet_la-net.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnet_la-net.lo `test -f 'net.c' || echo '$(srcdir)/'`net.c lmnetstrms_la-netstrms.lo: netstrms.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnetstrms_la-netstrms.lo -MD -MP -MF $(DEPDIR)/lmnetstrms_la-netstrms.Tpo -c -o lmnetstrms_la-netstrms.lo `test -f 'netstrms.c' || echo '$(srcdir)/'`netstrms.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnetstrms_la-netstrms.Tpo $(DEPDIR)/lmnetstrms_la-netstrms.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netstrms.c' object='lmnetstrms_la-netstrms.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='netstrms.c' object='lmnetstrms_la-netstrms.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-netstrms.lo `test -f 'netstrms.c' || echo '$(srcdir)/'`netstrms.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-netstrms.lo `test -f 'netstrms.c' || echo '$(srcdir)/'`netstrms.c lmnetstrms_la-netstrm.lo: netstrm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnetstrms_la-netstrm.lo -MD -MP -MF $(DEPDIR)/lmnetstrms_la-netstrm.Tpo -c -o lmnetstrms_la-netstrm.lo `test -f 'netstrm.c' || echo '$(srcdir)/'`netstrm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnetstrms_la-netstrm.Tpo $(DEPDIR)/lmnetstrms_la-netstrm.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netstrm.c' object='lmnetstrms_la-netstrm.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='netstrm.c' object='lmnetstrms_la-netstrm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-netstrm.lo `test -f 'netstrm.c' || echo '$(srcdir)/'`netstrm.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-netstrm.lo `test -f 'netstrm.c' || echo '$(srcdir)/'`netstrm.c lmnetstrms_la-nssel.lo: nssel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnetstrms_la-nssel.lo -MD -MP -MF $(DEPDIR)/lmnetstrms_la-nssel.Tpo -c -o lmnetstrms_la-nssel.lo `test -f 'nssel.c' || echo '$(srcdir)/'`nssel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnetstrms_la-nssel.Tpo $(DEPDIR)/lmnetstrms_la-nssel.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nssel.c' object='lmnetstrms_la-nssel.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nssel.c' object='lmnetstrms_la-nssel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-nssel.lo `test -f 'nssel.c' || echo '$(srcdir)/'`nssel.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-nssel.lo `test -f 'nssel.c' || echo '$(srcdir)/'`nssel.c lmnetstrms_la-nspoll.lo: nspoll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnetstrms_la-nspoll.lo -MD -MP -MF $(DEPDIR)/lmnetstrms_la-nspoll.Tpo -c -o lmnetstrms_la-nspoll.lo `test -f 'nspoll.c' || echo '$(srcdir)/'`nspoll.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnetstrms_la-nspoll.Tpo $(DEPDIR)/lmnetstrms_la-nspoll.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nspoll.c' object='lmnetstrms_la-nspoll.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nspoll.c' object='lmnetstrms_la-nspoll.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-nspoll.lo `test -f 'nspoll.c' || echo '$(srcdir)/'`nspoll.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnetstrms_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnetstrms_la-nspoll.lo `test -f 'nspoll.c' || echo '$(srcdir)/'`nspoll.c lmnsd_gtls_la-nsd_gtls.lo: nsd_gtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_gtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnsd_gtls_la-nsd_gtls.lo -MD -MP -MF $(DEPDIR)/lmnsd_gtls_la-nsd_gtls.Tpo -c -o lmnsd_gtls_la-nsd_gtls.lo `test -f 'nsd_gtls.c' || echo '$(srcdir)/'`nsd_gtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnsd_gtls_la-nsd_gtls.Tpo $(DEPDIR)/lmnsd_gtls_la-nsd_gtls.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsd_gtls.c' object='lmnsd_gtls_la-nsd_gtls.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nsd_gtls.c' object='lmnsd_gtls_la-nsd_gtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_gtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_gtls_la-nsd_gtls.lo `test -f 'nsd_gtls.c' || echo '$(srcdir)/'`nsd_gtls.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_gtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_gtls_la-nsd_gtls.lo `test -f 'nsd_gtls.c' || echo '$(srcdir)/'`nsd_gtls.c lmnsd_gtls_la-nsdsel_gtls.lo: nsdsel_gtls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_gtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnsd_gtls_la-nsdsel_gtls.lo -MD -MP -MF $(DEPDIR)/lmnsd_gtls_la-nsdsel_gtls.Tpo -c -o lmnsd_gtls_la-nsdsel_gtls.lo `test -f 'nsdsel_gtls.c' || echo '$(srcdir)/'`nsdsel_gtls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnsd_gtls_la-nsdsel_gtls.Tpo $(DEPDIR)/lmnsd_gtls_la-nsdsel_gtls.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsdsel_gtls.c' object='lmnsd_gtls_la-nsdsel_gtls.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nsdsel_gtls.c' object='lmnsd_gtls_la-nsdsel_gtls.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_gtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_gtls_la-nsdsel_gtls.lo `test -f 'nsdsel_gtls.c' || echo '$(srcdir)/'`nsdsel_gtls.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_gtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_gtls_la-nsdsel_gtls.lo `test -f 'nsdsel_gtls.c' || echo '$(srcdir)/'`nsdsel_gtls.c lmnsd_ptcp_la-nsd_ptcp.lo: nsd_ptcp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnsd_ptcp_la-nsd_ptcp.lo -MD -MP -MF $(DEPDIR)/lmnsd_ptcp_la-nsd_ptcp.Tpo -c -o lmnsd_ptcp_la-nsd_ptcp.lo `test -f 'nsd_ptcp.c' || echo '$(srcdir)/'`nsd_ptcp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnsd_ptcp_la-nsd_ptcp.Tpo $(DEPDIR)/lmnsd_ptcp_la-nsd_ptcp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsd_ptcp.c' object='lmnsd_ptcp_la-nsd_ptcp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nsd_ptcp.c' object='lmnsd_ptcp_la-nsd_ptcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_ptcp_la-nsd_ptcp.lo `test -f 'nsd_ptcp.c' || echo '$(srcdir)/'`nsd_ptcp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_ptcp_la-nsd_ptcp.lo `test -f 'nsd_ptcp.c' || echo '$(srcdir)/'`nsd_ptcp.c lmnsd_ptcp_la-nsdsel_ptcp.lo: nsdsel_ptcp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnsd_ptcp_la-nsdsel_ptcp.lo -MD -MP -MF $(DEPDIR)/lmnsd_ptcp_la-nsdsel_ptcp.Tpo -c -o lmnsd_ptcp_la-nsdsel_ptcp.lo `test -f 'nsdsel_ptcp.c' || echo '$(srcdir)/'`nsdsel_ptcp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnsd_ptcp_la-nsdsel_ptcp.Tpo $(DEPDIR)/lmnsd_ptcp_la-nsdsel_ptcp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsdsel_ptcp.c' object='lmnsd_ptcp_la-nsdsel_ptcp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nsdsel_ptcp.c' object='lmnsd_ptcp_la-nsdsel_ptcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_ptcp_la-nsdsel_ptcp.lo `test -f 'nsdsel_ptcp.c' || echo '$(srcdir)/'`nsdsel_ptcp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_ptcp_la-nsdsel_ptcp.lo `test -f 'nsdsel_ptcp.c' || echo '$(srcdir)/'`nsdsel_ptcp.c lmnsd_ptcp_la-nsdpoll_ptcp.lo: nsdpoll_ptcp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmnsd_ptcp_la-nsdpoll_ptcp.lo -MD -MP -MF $(DEPDIR)/lmnsd_ptcp_la-nsdpoll_ptcp.Tpo -c -o lmnsd_ptcp_la-nsdpoll_ptcp.lo `test -f 'nsdpoll_ptcp.c' || echo '$(srcdir)/'`nsdpoll_ptcp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmnsd_ptcp_la-nsdpoll_ptcp.Tpo $(DEPDIR)/lmnsd_ptcp_la-nsdpoll_ptcp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsdpoll_ptcp.c' object='lmnsd_ptcp_la-nsdpoll_ptcp.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nsdpoll_ptcp.c' object='lmnsd_ptcp_la-nsdpoll_ptcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_ptcp_la-nsdpoll_ptcp.lo `test -f 'nsdpoll_ptcp.c' || echo '$(srcdir)/'`nsdpoll_ptcp.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmnsd_ptcp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmnsd_ptcp_la-nsdpoll_ptcp.lo `test -f 'nsdpoll_ptcp.c' || echo '$(srcdir)/'`nsdpoll_ptcp.c lmregexp_la-regexp.lo: regexp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmregexp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmregexp_la-regexp.lo -MD -MP -MF $(DEPDIR)/lmregexp_la-regexp.Tpo -c -o lmregexp_la-regexp.lo `test -f 'regexp.c' || echo '$(srcdir)/'`regexp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmregexp_la-regexp.Tpo $(DEPDIR)/lmregexp_la-regexp.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regexp.c' object='lmregexp_la-regexp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmregexp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmregexp_la-regexp.lo `test -f 'regexp.c' || echo '$(srcdir)/'`regexp.c - -lmsig_gt_la-lmsig_gt.lo: lmsig_gt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmsig_gt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmsig_gt_la-lmsig_gt.lo -MD -MP -MF $(DEPDIR)/lmsig_gt_la-lmsig_gt.Tpo -c -o lmsig_gt_la-lmsig_gt.lo `test -f 'lmsig_gt.c' || echo '$(srcdir)/'`lmsig_gt.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmsig_gt_la-lmsig_gt.Tpo $(DEPDIR)/lmsig_gt_la-lmsig_gt.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lmsig_gt.c' object='lmsig_gt_la-lmsig_gt.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='regexp.c' object='lmregexp_la-regexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmsig_gt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmsig_gt_la-lmsig_gt.lo `test -f 'lmsig_gt.c' || echo '$(srcdir)/'`lmsig_gt.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmregexp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmregexp_la-regexp.lo `test -f 'regexp.c' || echo '$(srcdir)/'`regexp.c lmstrmsrv_la-strmsrv.lo: strmsrv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmstrmsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmstrmsrv_la-strmsrv.lo -MD -MP -MF $(DEPDIR)/lmstrmsrv_la-strmsrv.Tpo -c -o lmstrmsrv_la-strmsrv.lo `test -f 'strmsrv.c' || echo '$(srcdir)/'`strmsrv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmstrmsrv_la-strmsrv.Tpo $(DEPDIR)/lmstrmsrv_la-strmsrv.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strmsrv.c' object='lmstrmsrv_la-strmsrv.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strmsrv.c' object='lmstrmsrv_la-strmsrv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmstrmsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmstrmsrv_la-strmsrv.lo `test -f 'strmsrv.c' || echo '$(srcdir)/'`strmsrv.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmstrmsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmstrmsrv_la-strmsrv.lo `test -f 'strmsrv.c' || echo '$(srcdir)/'`strmsrv.c lmstrmsrv_la-strms_sess.lo: strms_sess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmstrmsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmstrmsrv_la-strms_sess.lo -MD -MP -MF $(DEPDIR)/lmstrmsrv_la-strms_sess.Tpo -c -o lmstrmsrv_la-strms_sess.lo `test -f 'strms_sess.c' || echo '$(srcdir)/'`strms_sess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmstrmsrv_la-strms_sess.Tpo $(DEPDIR)/lmstrmsrv_la-strms_sess.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strms_sess.c' object='lmstrmsrv_la-strms_sess.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strms_sess.c' object='lmstrmsrv_la-strms_sess.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmstrmsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmstrmsrv_la-strms_sess.lo `test -f 'strms_sess.c' || echo '$(srcdir)/'`strms_sess.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmstrmsrv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmstrmsrv_la-strms_sess.lo `test -f 'strms_sess.c' || echo '$(srcdir)/'`strms_sess.c lmzlibw_la-zlibw.lo: zlibw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmzlibw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lmzlibw_la-zlibw.lo -MD -MP -MF $(DEPDIR)/lmzlibw_la-zlibw.Tpo -c -o lmzlibw_la-zlibw.lo `test -f 'zlibw.c' || echo '$(srcdir)/'`zlibw.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lmzlibw_la-zlibw.Tpo $(DEPDIR)/lmzlibw_la-zlibw.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zlibw.c' object='lmzlibw_la-zlibw.lo' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zlibw.c' object='lmzlibw_la-zlibw.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmzlibw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmzlibw_la-zlibw.lo `test -f 'zlibw.c' || echo '$(srcdir)/'`zlibw.c +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lmzlibw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lmzlibw_la-zlibw.lo `test -f 'zlibw.c' || echo '$(srcdir)/'`zlibw.c mostlyclean-libtool: -rm -f *.lo @@ -1351,15 +1327,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: @@ -1462,8 +1433,8 @@ update-systemd: - curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > sd-daemon.c - curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > sd-daemon.h + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c + curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru rsyslog-7.6.0/runtime/modules.c rsyslog-5.10.1/runtime/modules.c --- rsyslog-7.6.0/runtime/modules.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/modules.c 2012-10-17 14:41:20.000000000 +0000 @@ -11,7 +11,7 @@ * * File begun on 2007-07-22 by RGerhards * - * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007, 2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -55,7 +55,6 @@ #endif #include "cfsysline.h" -#include "rsconf.h" #include "modules.h" #include "errmsg.h" #include "parser.h" @@ -73,18 +72,8 @@ /* already dlopen()-ed libs */ static struct dlhandle_s *pHandles = NULL; -static uchar *pModDir; /* directory where loadable modules are found */ - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "load", eCmdHdlrGetWord, 1 } -}; -static struct cnfparamblk pblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; +/* config settings */ +uchar *pModDir = NULL; /* read-only after startup */ /* we provide a set of dummy functions for modules that do not support the @@ -94,30 +83,18 @@ * harm. This simplifies things as in action processing we do not need to check * if the transactional entry points exist. */ -static rsRetVal -dummyBeginTransaction() +static rsRetVal dummyBeginTransaction() { return RS_RET_OK; } -static rsRetVal -dummyEndTransaction() +static rsRetVal dummyEndTransaction() { return RS_RET_OK; } -static rsRetVal -dummyIsCompatibleWithFeature() +static rsRetVal dummyIsCompatibleWithFeature() { return RS_RET_INCOMPATIBLE; } -static rsRetVal -dummynewActInst(uchar *modName, struct nvlst __attribute__((unused)) *dummy1, - void __attribute__((unused)) **dummy2, omodStringRequest_t __attribute__((unused)) **dummy3) -{ - errmsg.LogError(0, RS_RET_CONFOBJ_UNSUPPORTED, "config objects are not " - "supported by module '%s' -- legacy config options " - "MUST be used instead", modName); - return RS_RET_CONFOBJ_UNSUPPORTED; -} #ifdef DEBUG /* we add some home-grown support to track our users (and detect who does not free us). In @@ -244,8 +221,8 @@ static void moduleDestruct(modInfo_t *pThis) { assert(pThis != NULL); - free(pThis->pszName); - free(pThis->cnfName); + if(pThis->pszName != NULL) + free(pThis->pszName); if(pThis->pModHdlr != NULL) { # ifdef VALGRIND # warning "dlclose disabled for valgrind" @@ -313,8 +290,7 @@ /* get the name of a module */ -uchar * -modGetName(modInfo_t *pThis) +static uchar *modGetName(modInfo_t *pThis) { return((pThis->pszName == NULL) ? (uchar*) "" : pThis->pszName); } @@ -335,7 +311,7 @@ /* Add a module to the loaded module linked list */ static inline void -addModToGlblList(modInfo_t *pThis) +addModToList(modInfo_t *pThis) { assert(pThis != NULL); @@ -350,98 +326,6 @@ } -/* ready module for config processing. this includes checking if the module - * is already in the config, so this function may return errors. Returns a - * pointer to the last module inthe current config. That pointer needs to - * be passed to addModToCnfLst() when it is called later in the process. - */ -rsRetVal -readyModForCnf(modInfo_t *pThis, cfgmodules_etry_t **ppNew, cfgmodules_etry_t **ppLast) -{ - cfgmodules_etry_t *pNew; - cfgmodules_etry_t *pLast; - DEFiRet; - assert(pThis != NULL); - - if(loadConf == NULL) { - FINALIZE; /* we are in an early init state */ - } - - /* check for duplicates and, as a side-activity, identify last node */ - pLast = loadConf->modules.root; - if(pLast != NULL) { - while(1) { /* loop broken inside */ - if(pLast->pMod == pThis) { - DBGPRINTF("module '%s' already in this config\n", modGetName(pThis)); - if(strncmp((char*)modGetName(pThis), "builtin:", sizeof("builtin:")-1)) { - errmsg.LogError(0, RS_RET_MODULE_ALREADY_IN_CONF, - "module '%s' already in this config, cannot be added\n", modGetName(pThis)); - ABORT_FINALIZE(RS_RET_MODULE_ALREADY_IN_CONF); - } - FINALIZE; - } - if(pLast->next == NULL) - break; - pLast = pLast->next; - } - } - - /* if we reach this point, pLast is the tail pointer and this module is new - * inside the currently loaded config. So, iff it is an input module, let's - * pass it a pointer which it can populate with a pointer to its module conf. - */ - - CHKmalloc(pNew = MALLOC(sizeof(cfgmodules_etry_t))); - pNew->canActivate = 1; - pNew->next = NULL; - pNew->pMod = pThis; - - if(pThis->beginCnfLoad != NULL) { - CHKiRet(pThis->beginCnfLoad(&pNew->modCnf, loadConf)); - } - - *ppLast = pLast; - *ppNew = pNew; -finalize_it: - RETiRet; -} - - -/* abort the creation of a module entry without adding it to the - * module list. Needed to prevent mem leaks. - */ -static inline void -abortCnfUse(cfgmodules_etry_t *pNew) -{ - free(pNew); -} - - -/* Add a module to the config module list for current loadConf. - * Requires last pointer obtained by readyModForCnf(). - */ -rsRetVal -addModToCnfList(cfgmodules_etry_t *pNew, cfgmodules_etry_t *pLast) -{ - DEFiRet; - assert(pNew != NULL); - - if(loadConf == NULL) { - FINALIZE; /* we are in an early init state */ - } - - if(pLast == NULL) { - loadConf->modules.root = pNew; - } else { - /* there already exist entries */ - pLast->next = pNew; - } - -finalize_it: - RETiRet; -} - - /* Get the next module pointer - this is used to traverse the list. * The function returns the next pointer or NULL, if there is no next one. * The last object must be provided to the function. If NULL is provided, @@ -463,51 +347,19 @@ /* this function is like GetNxt(), but it returns pointers to - * the configmodules entry, which than can be used to obtain the - * actual module pointer. Note that it returns those for - * modules of specific type only. Only modules from the provided - * config are returned. Note that processing speed could be improved, - * but this is really not relevant, as config file loading is not really - * something we are concerned about in regard to runtime. - */ -static cfgmodules_etry_t -*GetNxtCnfType(rsconf_t *cnf, cfgmodules_etry_t *node, eModType_t rqtdType) -{ - if(node == NULL) { /* start at beginning of module list */ - node = cnf->modules.root; - } else { - node = node->next; - } - - if(rqtdType != eMOD_ANY) { /* if any, we already have the right one! */ - while(node != NULL && node->pMod->eType != rqtdType) { - node = node->next; - } - } - - return node; -} - - -/* Find a module with the given conf name and type. Returns NULL if none - * can be found, otherwise module found. + * modules of specific type only. As we currently deal just with output modules, + * it is a dummy, to be filled with real code later. + * rgerhards, 2007-07-24 */ -static modInfo_t * -FindWithCnfName(rsconf_t *cnf, uchar *name, eModType_t rqtdType) +static modInfo_t *GetNxtType(modInfo_t *pThis, eModType_t rqtdType) { - cfgmodules_etry_t *node; + modInfo_t *pMod = pThis; - ; - for( node = cnf->modules.root - ; node != NULL - ; node = node->next) { - if(node->pMod->eType != rqtdType || node->pMod->cnfName == NULL) - continue; - if(!strcasecmp((char*)node->pMod->cnfName, (char*)name)) - break; - } + do { + pMod = GetNxt(pMod); + } while(!(pMod == NULL || pMod->eType == rqtdType)); /* warning: do ... while() */ - return node == NULL ? NULL : node->pMod; + return pMod; } @@ -549,8 +401,7 @@ * everything needed to fully initialize the module. */ static rsRetVal -doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)(), modInfo_t*), - uchar *name, void *pModHdlr, modInfo_t **pNewModule) +doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)(), modInfo_t*), uchar *name, void *pModHdlr) { rsRetVal localRet; modInfo_t *pNew = NULL; @@ -561,8 +412,6 @@ rsRetVal (*modGetType)(eModType_t *pType); rsRetVal (*modGetKeepType)(eModKeepType_t *pKeepType); struct dlhandle_s *pHandle = NULL; - rsRetVal (*getModCnfName)(uchar **cnfName); - uchar *cnfName; DEFiRet; assert(modInit != NULL); @@ -585,7 +434,7 @@ CHKiRet((*modGetType)(&pNew->eType)); CHKiRet((*pNew->modQueryEtryPt)((uchar*)"getKeepType", &modGetKeepType)); CHKiRet((*modGetKeepType)(&pNew->eKeepType)); - dbgprintf("module %s of type %d being loaded (keepType=%d).\n", name, pNew->eType, pNew->eKeepType); + dbgprintf("module of type %d being loaded.\n", pNew->eType); /* OK, we know we can successfully work with the module. So we now fill the * rest of the data elements. First we load the interfaces common to all @@ -598,40 +447,7 @@ pNew->isCompatibleWithFeature = dummyIsCompatibleWithFeature; else if(localRet != RS_RET_OK) ABORT_FINALIZE(localRet); - localRet = (*pNew->modQueryEtryPt)((uchar*)"setModCnf", &pNew->setModCnf); - if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) - pNew->setModCnf = NULL; - else if(localRet != RS_RET_OK) - ABORT_FINALIZE(localRet); - /* optional calls for new config system */ - localRet = (*pNew->modQueryEtryPt)((uchar*)"getModCnfName", &getModCnfName); - if(localRet == RS_RET_OK) { - if(getModCnfName(&cnfName) == RS_RET_OK) - pNew->cnfName = (uchar*) strdup((char*)cnfName); - /**< we do not care if strdup() fails, we can accept that */ - else - pNew->cnfName = NULL; - dbgprintf("module config name is '%s'\n", cnfName); - } - localRet = (*pNew->modQueryEtryPt)((uchar*)"beginCnfLoad", &pNew->beginCnfLoad); - if(localRet == RS_RET_OK) { - dbgprintf("module %s supports rsyslog v6 config interface\n", name); - CHKiRet((*pNew->modQueryEtryPt)((uchar*)"endCnfLoad", &pNew->endCnfLoad)); - CHKiRet((*pNew->modQueryEtryPt)((uchar*)"freeCnf", &pNew->freeCnf)); - CHKiRet((*pNew->modQueryEtryPt)((uchar*)"checkCnf", &pNew->checkCnf)); - CHKiRet((*pNew->modQueryEtryPt)((uchar*)"activateCnf", &pNew->activateCnf)); - localRet = (*pNew->modQueryEtryPt)((uchar*)"activateCnfPrePrivDrop", &pNew->activateCnfPrePrivDrop); - if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) { - pNew->activateCnfPrePrivDrop = NULL; - } else { - CHKiRet(localRet); - } - } else if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) { - pNew->beginCnfLoad = NULL; /* flag as non-present */ - } else { - ABORT_FINALIZE(localRet); - } /* ... and now the module-specific interfaces */ switch(pNew->eType) { case eMOD_IN: @@ -639,12 +455,6 @@ CHKiRet((*pNew->modQueryEtryPt)((uchar*)"willRun", &pNew->mod.im.willRun)); CHKiRet((*pNew->modQueryEtryPt)((uchar*)"afterRun", &pNew->mod.im.afterRun)); pNew->mod.im.bCanRun = 0; - localRet = (*pNew->modQueryEtryPt)((uchar*)"newInpInst", &pNew->mod.im.newInpInst); - if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) { - pNew->mod.om.newActInst = NULL; - } else if(localRet != RS_RET_OK) { - ABORT_FINALIZE(localRet); - } break; case eMOD_OUT: CHKiRet((*pNew->modQueryEtryPt)((uchar*)"freeInstance", &pNew->freeInstance)); @@ -657,30 +467,18 @@ if(localRet != RS_RET_OK && localRet != RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) ABORT_FINALIZE(localRet); - localRet = (*pNew->modQueryEtryPt)((uchar*)"SetShutdownImmdtPtr", &pNew->mod.om.SetShutdownImmdtPtr); - if(localRet != RS_RET_OK && localRet != RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) - ABORT_FINALIZE(localRet); - localRet = (*pNew->modQueryEtryPt)((uchar*)"beginTransaction", &pNew->mod.om.beginTransaction); if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) pNew->mod.om.beginTransaction = dummyBeginTransaction; else if(localRet != RS_RET_OK) ABORT_FINALIZE(localRet); - localRet = (*pNew->modQueryEtryPt)((uchar*)"endTransaction", - &pNew->mod.om.endTransaction); + localRet = (*pNew->modQueryEtryPt)((uchar*)"endTransaction", &pNew->mod.om.endTransaction); if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) { pNew->mod.om.endTransaction = dummyEndTransaction; } else if(localRet != RS_RET_OK) { ABORT_FINALIZE(localRet); } - - localRet = (*pNew->modQueryEtryPt)((uchar*)"newActInst", &pNew->mod.om.newActInst); - if(localRet == RS_RET_MODULE_ENTRY_POINT_NOT_FOUND) { - pNew->mod.om.newActInst = dummynewActInst; - } else if(localRet != RS_RET_OK) { - ABORT_FINALIZE(localRet); - } break; case eMOD_LIB: break; @@ -727,14 +525,11 @@ CHKiRet(strgen.SetModPtr(pStrgen, pNew)); CHKiRet(strgen.ConstructFinalize(pStrgen)); break; - case eMOD_ANY: /* this is mostly to keep the compiler happy! */ - DBGPRINTF("PROGRAM ERROR: eMOD_ANY set as module type\n"); - assert(0); - break; } pNew->pszName = (uchar*) strdup((char*)name); /* we do not care if strdup() fails, we can accept that */ pNew->pModHdlr = pModHdlr; + /* TODO: take this from module */ if(pModHdlr == NULL) { pNew->eLinkType = eMOD_LINK_STATIC; } else { @@ -766,14 +561,12 @@ } /* we initialized the structure, now let's add it to the linked list of modules */ - addModToGlblList(pNew); - *pNewModule = pNew; + addModToList(pNew); finalize_it: if(iRet != RS_RET_OK) { if(pNew != NULL) moduleDestruct(pNew); - *pNewModule = NULL; } RETiRet; @@ -809,35 +602,25 @@ case eMOD_STRGEN: dbgprintf("strgen"); break; - case eMOD_ANY: /* this is mostly to keep the compiler happy! */ - DBGPRINTF("PROGRAM ERROR: eMOD_ANY set as module type\n"); - assert(0); - break; } dbgprintf(" module.\n"); dbgprintf("Entry points:\n"); dbgprintf("\tqueryEtryPt: 0x%lx\n", (unsigned long) pMod->modQueryEtryPt); dbgprintf("\tdbgPrintInstInfo: 0x%lx\n", (unsigned long) pMod->dbgPrintInstInfo); dbgprintf("\tfreeInstance: 0x%lx\n", (unsigned long) pMod->freeInstance); - dbgprintf("\tbeginCnfLoad: 0x%lx\n", (unsigned long) pMod->beginCnfLoad); - dbgprintf("\tSetModCnf: 0x%lx\n", (unsigned long) pMod->setModCnf); - dbgprintf("\tcheckCnf: 0x%lx\n", (unsigned long) pMod->checkCnf); - dbgprintf("\tactivateCnfPrePrivDrop: 0x%lx\n", (unsigned long) pMod->activateCnfPrePrivDrop); - dbgprintf("\tactivateCnf: 0x%lx\n", (unsigned long) pMod->activateCnf); - dbgprintf("\tfreeCnf: 0x%lx\n", (unsigned long) pMod->freeCnf); switch(pMod->eType) { case eMOD_OUT: dbgprintf("Output Module Entry Points:\n"); - dbgprintf("\tdoAction: %p\n", pMod->mod.om.doAction); - dbgprintf("\tparseSelectorAct: %p\n", pMod->mod.om.parseSelectorAct); - dbgprintf("\tnewActInst: %p\n", (pMod->mod.om.newActInst == dummynewActInst) ? - NULL : pMod->mod.om.newActInst); - dbgprintf("\ttryResume: %p\n", pMod->tryResume); - dbgprintf("\tdoHUP: %p\n", pMod->doHUP); - dbgprintf("\tBeginTransaction: %p\n", ((pMod->mod.om.beginTransaction == dummyBeginTransaction) ? - NULL : pMod->mod.om.beginTransaction)); - dbgprintf("\tEndTransaction: %p\n", ((pMod->mod.om.endTransaction == dummyEndTransaction) ? - NULL : pMod->mod.om.endTransaction)); + dbgprintf("\tdoAction: 0x%lx\n", (unsigned long) pMod->mod.om.doAction); + dbgprintf("\tparseSelectorAct: 0x%lx\n", (unsigned long) pMod->mod.om.parseSelectorAct); + dbgprintf("\ttryResume: 0x%lx\n", (unsigned long) pMod->tryResume); + dbgprintf("\tdoHUP: 0x%lx\n", (unsigned long) pMod->doHUP); + dbgprintf("\tBeginTransaction: 0x%lx\n", (unsigned long) + ((pMod->mod.om.beginTransaction == dummyBeginTransaction) ? + 0 : pMod->mod.om.beginTransaction)); + dbgprintf("\tEndTransaction: 0x%lx\n", (unsigned long) + ((pMod->mod.om.endTransaction == dummyEndTransaction) ? + 0 : pMod->mod.om.endTransaction)); break; case eMOD_IN: dbgprintf("Input Module Entry Points\n"); @@ -855,8 +638,6 @@ dbgprintf("Strgen Module Entry Points\n"); dbgprintf("\tstrgen: 0x%lx\n", (unsigned long) pMod->mod.sm.strgen); break; - case eMOD_ANY: /* this is mostly to keep the compiler happy! */ - break; } dbgprintf("\n"); pMod = GetNxt(pMod); /* done, go next */ @@ -962,27 +743,6 @@ RETiRet; } -/* find module with given name in global list */ -static inline rsRetVal -findModule(uchar *pModName, int iModNameLen, modInfo_t **pMod) -{ - modInfo_t *pModInfo; - uchar *pModNameCmp; - DEFiRet; - - pModInfo = GetNxt(NULL); - while(pModInfo != NULL) { - if(!strncmp((char *) pModName, (char *) (pModNameCmp = modGetName(pModInfo)), iModNameLen) && - (!*(pModNameCmp + iModNameLen) || !strcmp((char *) pModNameCmp + iModNameLen, ".so"))) { - dbgprintf("Module '%s' found\n", pModName); - break; - } - pModInfo = GetNxt(pModInfo); - } - *pMod = pModInfo; - RETiRet; -} - /* load a module and initialize it, based on doModLoad() from conf.c * rgerhards, 2008-03-05 @@ -992,23 +752,17 @@ * configuration file processing, which is executed on a single thread. Should we * change that design at any stage (what is unlikely), we need to find a * replacement. - * rgerhards, 2011-04-27: - * Parameter "bConfLoad" tells us if the load was triggered by a config handler, in - * which case we need to tie the loaded module to the current config. If bConfLoad == 0, - * the system loads a module for internal reasons, this is not directly tied to a - * configuration. We could also think if it would be useful to add only certain types - * of modules, but the current implementation at least looks simpler. - * Note: pvals = NULL means legacy config system */ static rsRetVal -Load(uchar *pModName, sbool bConfLoad, struct nvlst *lst) +Load(uchar *pModName) { + DEFiRet; + size_t iPathLen, iModNameLen; + uchar *pModNameCmp; int bHasExtension; void *pModHdlr, *pModInit; modInfo_t *pModInfo; - cfgmodules_etry_t *pNew; - cfgmodules_etry_t *pLast; uchar *pModDirCurr, *pModDirNext; int iLoadCnt; struct dlhandle_s *pHandle = NULL; @@ -1019,11 +773,9 @@ # endif uchar *pPathBuf = pathBuf; size_t lenPathBuf = sizeof(pathBuf); - rsRetVal localRet; - DEFiRet; assert(pModName != NULL); - DBGPRINTF("Requested to load module '%s'\n", pModName); + dbgprintf("Requested to load module '%s'\n", pModName); iModNameLen = strlen((char*)pModName); /* overhead for a full path is potentially 1 byte for a slash, @@ -1039,40 +791,17 @@ } else bHasExtension = RSFALSE; - CHKiRet(findModule(pModName, iModNameLen, &pModInfo)); - if(pModInfo != NULL) { - DBGPRINTF("Module '%s' already loaded\n", pModName); - if(bConfLoad) { - localRet = readyModForCnf(pModInfo, &pNew, &pLast); - if(pModInfo->setModCnf != NULL && localRet == RS_RET_OK) { - if(!strncmp((char*)pModName, "builtin:", sizeof("builtin:")-1)) { - if(pModInfo->bSetModCnfCalled) { - errmsg.LogError(0, RS_RET_DUP_PARAM, - "parameters for built-in module %s already set - ignored\n", - pModName); - ABORT_FINALIZE(RS_RET_DUP_PARAM); - } else { - /* for built-in moules, we need to call setModConf, - * because there is no way to set parameters at load - * time for obvious reasons... - */ - if(lst != NULL) - pModInfo->setModCnf(lst); - pModInfo->bSetModCnfCalled = 1; - } - } else { - /* regular modules need to be added to conf list (for - * builtins, this happend during initial load). - */ - addModToCnfList(pNew, pLast); - } - } + pModInfo = GetNxt(NULL); + while(pModInfo != NULL) { + if(!strncmp((char *) pModName, (char *) (pModNameCmp = modGetName(pModInfo)), iModNameLen) && + (!*(pModNameCmp + iModNameLen) || !strcmp((char *) pModNameCmp + iModNameLen, ".so"))) { + dbgprintf("Module '%s' already loaded\n", pModName); + ABORT_FINALIZE(RS_RET_OK); } - FINALIZE; + pModInfo = GetNxt(pModInfo); } - pModDirCurr = (uchar *)((pModDir == NULL) ? - _PATH_MODDIR : (char *)pModDir); + pModDirCurr = (uchar *)((pModDir == NULL) ? _PATH_MODDIR : (char *)pModDir); pModDirNext = NULL; pModHdlr = NULL; iLoadCnt = 0; @@ -1129,6 +858,7 @@ * TODO: I guess this is highly importable, so we should change the * algo over time... -- rgerhards, 2008-03-05 */ + /* ... so now add the extension */ strncat((char *) pPathBuf, ".so", lenPathBuf - strlen((char*) pPathBuf) - 1); iPathLen += 3; } @@ -1164,36 +894,16 @@ ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_DLOPEN); } if(!(pModInit = dlsym(pModHdlr, "modInit"))) { - errmsg.LogError(0, RS_RET_MODULE_LOAD_ERR_NO_INIT, - "could not load module '%s', dlsym: %s\n", pPathBuf, dlerror()); + errmsg.LogError(0, RS_RET_MODULE_LOAD_ERR_NO_INIT, "could not load module '%s', dlsym: %s\n", pPathBuf, dlerror()); dlclose(pModHdlr); ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_NO_INIT); } - if((iRet = doModInit(pModInit, (uchar*) pModName, pModHdlr, &pModInfo)) != RS_RET_OK) { - errmsg.LogError(0, RS_RET_MODULE_LOAD_ERR_INIT_FAILED, - "could not load module '%s', rsyslog error %d\n", pPathBuf, iRet); + if((iRet = doModInit(pModInit, (uchar*) pModName, pModHdlr)) != RS_RET_OK) { + errmsg.LogError(0, RS_RET_MODULE_LOAD_ERR_INIT_FAILED, "could not load module '%s', rsyslog error %d\n", pPathBuf, iRet); dlclose(pModHdlr); ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_INIT_FAILED); } - if(bConfLoad) { - readyModForCnf(pModInfo, &pNew, &pLast); - if(pModInfo->setModCnf != NULL) { - if(lst != NULL) { - localRet = pModInfo->setModCnf(lst); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, - "module '%s', failed processing config parameters", - pPathBuf); - abortCnfUse(pNew); - ABORT_FINALIZE(localRet); - } - } - pModInfo->bSetModCnfCalled = 1; - } - addModToCnfList(pNew, pLast); - } - finalize_it: if(pPathBuf != pathBuf) /* used malloc()ed memory? */ free(pPathBuf); @@ -1202,39 +912,6 @@ } -/* the v6+ way of loading modules: process a "module(...)" directive. - * rgerhards, 2012-06-20 - */ -rsRetVal -modulesProcessCnf(struct cnfobj *o) -{ - struct cnfparamvals *pvals; - uchar *cnfModName = NULL; - int typeIdx; - DEFiRet; - - pvals = nvlstGetParams(o->nvlst, &pblk, NULL); - if(pvals == NULL) { - ABORT_FINALIZE(RS_RET_ERR); - } - DBGPRINTF("modulesProcessCnf params:\n"); - cnfparamsPrint(&pblk, pvals); - typeIdx = cnfparamGetIdx(&pblk, "load"); - if(pvals[typeIdx].bUsed == 0) { - errmsg.LogError(0, RS_RET_CONF_RQRD_PARAM_MISSING, "module type missing"); - ABORT_FINALIZE(RS_RET_CONF_RQRD_PARAM_MISSING); - } - - cnfModName = (uchar*)es_str2cstr(pvals[typeIdx].val.d.estr, NULL); - iRet = Load(cnfModName, 1, o->nvlst); - -finalize_it: - free(cnfModName); - cnfparamvalsDestruct(pvals, &pblk); - RETiRet; -} - - /* set the default module load directory. A NULL value may be provided, in * which case any previous value is deleted but no new one set. The caller-provided * string is duplicated. If it needs to be freed, that's the caller's duty. @@ -1327,7 +1004,6 @@ /* release objects we no longer need */ objRelease(errmsg, CORE_COMPONENT); objRelease(parser, CORE_COMPONENT); - free(pModDir); # ifdef DEBUG modUsrPrintAll(); /* debug aid - TODO: integrate with debug.c, at least the settings! */ # endif @@ -1349,11 +1025,10 @@ * of course, also affects the "if" above). */ pIf->GetNxt = GetNxt; - pIf->GetNxtCnfType = GetNxtCnfType; + pIf->GetNxtType = GetNxtType; pIf->GetName = modGetName; pIf->GetStateName = modGetStateName; pIf->PrintList = modPrintList; - pIf->FindWithCnfName = FindWithCnfName; pIf->UnloadAndDestructAll = modUnloadAndDestructAll; pIf->doModInit = doModInit; pIf->SetModDir = SetModDir; diff -Nru rsyslog-7.6.0/runtime/modules.h rsyslog-5.10.1/runtime/modules.h --- rsyslog-7.6.0/runtime/modules.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/modules.h 2012-10-17 14:41:20.000000000 +0000 @@ -12,7 +12,7 @@ * * File begun on 2007-07-22 by RGerhards * - * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -36,7 +36,7 @@ #define MODULES_H_INCLUDED 1 #include "objomsr.h" -#include "rainerscript.h" + /* the following define defines the current version of the module interface. * It can be used by any module which want's to simply prevent version conflicts @@ -47,18 +47,15 @@ * version 5 changes the way parsing works for input modules. This is * an important change, parseAndSubmitMessage() goes away. Other * module types are not affected. -- rgerhards, 2008-10-09 - * version 6 introduces scoping support (starting with the output - * modules) -- rgerhards, 2010-07-27 */ -#define CURR_MOD_IF_VERSION 6 +#define CURR_MOD_IF_VERSION 5 typedef enum eModType_ { eMOD_IN = 0, /* input module */ eMOD_OUT = 1, /* output module */ eMOD_LIB = 2, /* library module */ eMOD_PARSER = 3,/* parser module */ - eMOD_STRGEN = 4,/* strgen module */ - eMOD_ANY = 5 /* meta-name for "any type of module" -- to be used in function calls */ + eMOD_STRGEN = 4 /* strgen module */ } eModType_t; @@ -99,9 +96,7 @@ eModLinkType_t eLinkType; eModKeepType_t eKeepType; /* keep the module dynamically linked on unload */ uchar* pszName; /* printable module name, e.g. for dbgprintf */ - uchar* cnfName; /* name to be used in config statements (e.g. 'name="omusrmsg"') */ unsigned uRefCnt; /* reference count for this module; 0 -> may be unloaded */ - sbool bSetModCnfCalled;/* is setModCnf already called? Needed for built-in modules */ /* functions supported by all types of modules */ rsRetVal (*modInit)(int, int*, rsRetVal(**)()); /* initialize the module */ /* be sure to support version handshake! */ @@ -113,21 +108,20 @@ rsRetVal (*modExit)(void); /* called before termination or module unload */ rsRetVal (*modGetID)(void **); /* get its unique ID from module */ rsRetVal (*doHUP)(void *); /* non-restart type HUP handler */ - /* v2 config system specific */ - rsRetVal (*beginCnfLoad)(void*newCnf, rsconf_t *pConf); - rsRetVal (*setModCnf)(struct nvlst *lst); - rsRetVal (*endCnfLoad)(void*Cnf); - rsRetVal (*checkCnf)(void*Cnf); - rsRetVal (*activateCnfPrePrivDrop)(void*Cnf); - rsRetVal (*activateCnf)(void*Cnf); /* make provided config the running conf */ - rsRetVal (*freeCnf)(void*Cnf); - /* end v2 config system specific */ + /* below: parse a configuration line - return if processed + * or not. If not, must be parsed to next module. + */ + rsRetVal (*parseConfigLine)(uchar **pConfLine); + /* below: create an instance of this module. Most importantly the module + * can allocate instance memory in this call. + */ + rsRetVal (*createInstance)(); + /* TODO: pass pointer to msg submit function to IM rger, 2007-12-14 */ union { struct {/* data for input modules */ -/* TODO: remove? */rsRetVal (*willRun)(void); /* check if the current config will be able to run*/ rsRetVal (*runInput)(thrdInfo_t*); /* function to gather input and submit to queue */ + rsRetVal (*willRun)(void); /* function to gather input and submit to queue */ rsRetVal (*afterRun)(thrdInfo_t*); /* function to gather input and submit to queue */ - rsRetVal (*newInpInst)(struct nvlst *lst); int bCanRun; /* cached value of whether willRun() succeeded */ } im; struct {/* data for output modules */ @@ -137,8 +131,6 @@ rsRetVal (*doAction)(uchar**, unsigned, void*); rsRetVal (*endTransaction)(void*); rsRetVal (*parseSelectorAct)(uchar**, void**,omodStringRequest_t**); - rsRetVal (*newActInst)(uchar *modName, struct nvlst *lst, void **, omodStringRequest_t **); - rsRetVal (*SetShutdownImmdtPtr)(void *pData, void *pPtr); } om; struct { /* data for library modules */ char dummy; @@ -152,7 +144,9 @@ } mod; void *pModHdlr; /* handler to the dynamic library holding the module */ # ifdef DEBUG - /* we add some home-grown support to track our users (and detect who does not free us). */ + /* we add some home-grown support to track our users (and detect who does not free us). In + * the long term, this should probably be migrated into debug.c (TODO). -- rgerhards, 2008-03-11 + */ modUsr_t *pModUsrRoot; # endif }; @@ -161,37 +155,23 @@ /* interfaces */ BEGINinterface(module) /* name must also be changed in ENDinterface macro! */ modInfo_t *(*GetNxt)(modInfo_t *pThis); - cfgmodules_etry_t *(*GetNxtCnfType)(rsconf_t *cnf, cfgmodules_etry_t *pThis, eModType_t rqtdType); + modInfo_t *(*GetNxtType)(modInfo_t *pThis, eModType_t rqtdType); uchar *(*GetName)(modInfo_t *pThis); uchar *(*GetStateName)(modInfo_t *pThis); rsRetVal (*Use)(char *srcFile, modInfo_t *pThis); /**< must be called before a module is used (ref counting) */ rsRetVal (*Release)(char *srcFile, modInfo_t **ppThis); /**< release a module (ref counting) */ void (*PrintList)(void); rsRetVal (*UnloadAndDestructAll)(eModLinkType_t modLinkTypesToUnload); - rsRetVal (*doModInit)(rsRetVal (*modInit)(), uchar *name, void *pModHdlr, modInfo_t **pNew); - rsRetVal (*Load)(uchar *name, sbool bConfLoad, struct nvlst *lst); + rsRetVal (*doModInit)(rsRetVal (*modInit)(), uchar *name, void *pModHdlr); + rsRetVal (*Load)(uchar *name); rsRetVal (*SetModDir)(uchar *name); - modInfo_t *(*FindWithCnfName)(rsconf_t *cnf, uchar *name, eModType_t rqtdType); /* added v3, 2011-07-19 */ ENDinterface(module) -#define moduleCURR_IF_VERSION 4 /* increment whenever you change the interface structure! */ -/* Changes: - * v2 - * - added param bCondLoad to Load call - 2011-04-27 - * - removed GetNxtType, added GetNxtCnfType - 2011-04-27 - * v3 (see above) - * v4 - * - added third parameter to Load() - 2012-06-20 - */ +#define moduleCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ /* prototypes */ PROTOTYPEObj(module); -/* in v6, we go back to in-core static link for core objects, at least those - * that are not called from plugins. - * ... and we need to know that none of the module functions are called from plugins! - * rgerhards, 2012-09-24 - */ -rsRetVal modulesProcessCnf(struct cnfobj *o); -uchar *modGetName(modInfo_t *pThis); -rsRetVal addModToCnfList(cfgmodules_etry_t *pNew, cfgmodules_etry_t *pLast); -rsRetVal readyModForCnf(modInfo_t *pThis, cfgmodules_etry_t **ppNew, cfgmodules_etry_t **ppLast); + +/* TODO: remove them below (means move the config init code) -- rgerhards, 2008-02-19 */ +extern uchar *pModDir; /* read-only after startup */ + #endif /* #ifndef MODULES_H_INCLUDED */ diff -Nru rsyslog-7.6.0/runtime/module-template.h rsyslog-5.10.1/runtime/module-template.h --- rsyslog-7.6.0/runtime/module-template.h 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/module-template.h 2012-10-17 14:41:20.000000000 +0000 @@ -4,7 +4,7 @@ * * File begun on 2007-07-25 by RGerhards * - * Copyright 2007-2012 Adiscon GmbH. This is Adiscon-exclusive code without any other + * Copyright 2007 Adiscon GmbH. This is Adiscon-exclusive code without any other * contributions. *** GPLv3 *** * * This file is part of the rsyslog runtime library. @@ -35,7 +35,7 @@ /* macro to define standard output-module static data members */ #define DEF_MOD_STATIC_DATA \ - static __attribute__((unused)) rsRetVal (*omsdRegCFSLineHdlr)(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie); + static __attribute__((unused)) rsRetVal (*omsdRegCFSLineHdlr)(); #define DEF_OMOD_STATIC_DATA \ DEF_MOD_STATIC_DATA \ @@ -110,16 +110,6 @@ return RS_RET_OK;\ } -/* macro to provide the v6 config system module name - */ -#define MODULE_CNFNAME(name) \ -static rsRetVal modGetCnfName(uchar **cnfName) \ - { \ - *cnfName = (uchar*) name; \ - return RS_RET_OK;\ - } - - /* to following macros are used to generate function headers and standard * functionality. It works as follows (described on the sample case of * createInstance()): @@ -246,8 +236,7 @@ instanceData *pData = NULL; #define CODESTARTdbgPrintInstInfo \ - pData = (instanceData*) pModData; \ - (void)pData; /* prevent compiler warning if unused! */ + pData = (instanceData*) pModData; #define ENDdbgPrintInstInfo \ RETiRet;\ @@ -305,73 +294,6 @@ } -/* newActInst() - * Extra comments: - * This creates a new instance of a the action that implements the call. - * This is part of the conf2 (rsyslog v6) config system. It is called by - * the core when an action object has been obtained. The output module - * must then verify parameters and create a new action instance (if - * parameters are acceptable) or return an error code. - * On exit, ppModData must point to instance data. Also, a string - * request object must be created and filled. A macro is defined - * for that. - * For the most usual case, we have defined a macro below. - * If more than one string is requested, the macro can be used together - * with own code that overwrites the entry count. In this case, the - * macro must come before the own code. It is recommended to be - * placed right after CODESTARTnewActInst. - */ -#define BEGINnewActInst \ -static rsRetVal newActInst(uchar __attribute__((unused)) *modName, \ - struct nvlst *lst, void **ppModData, omodStringRequest_t **ppOMSR)\ -{\ - DEFiRet;\ - instanceData *pData = NULL; \ - *ppOMSR = NULL; - -#define CODESTARTnewActInst \ - -#define CODE_STD_STRING_REQUESTnewActInst(NumStrReqEntries) \ - CHKiRet(OMSRconstruct(ppOMSR, NumStrReqEntries)); - -#define CODE_STD_FINALIZERnewActInst \ -finalize_it:\ - if(iRet == RS_RET_OK || iRet == RS_RET_SUSPENDED) {\ - *ppModData = pData;\ - } else {\ - /* cleanup, we failed */\ - if(*ppOMSR != NULL) {\ - OMSRdestruct(*ppOMSR);\ - *ppOMSR = NULL;\ - }\ - if(pData != NULL) {\ - freeInstance(pData);\ - } \ - } - -#define ENDnewActInst \ - RETiRet;\ -} - - -/* newInpInst() - * This is basically the equivalent to newActInst() for creating input - * module (listener) instances. - */ -#define BEGINnewInpInst \ -static rsRetVal newInpInst(struct nvlst *lst)\ -{\ - DEFiRet; - -#define CODESTARTnewInpInst \ - -#define CODE_STD_FINALIZERnewInpInst - -#define ENDnewInpInst \ - RETiRet;\ -} - - /* tryResume() * This entry point is called to check if a module can resume operations. This * happens when a module requested that it be suspended. In suspended state, @@ -394,19 +316,6 @@ } -/* initConfVars() - initialize pre-v6.3-config variables - */ -#define BEGINinitConfVars \ -static rsRetVal initConfVars(void)\ -{\ - DEFiRet; - -#define CODESTARTinitConfVars - -#define ENDinitConfVars \ - RETiRet;\ -} - /* queryEtryPt() */ @@ -504,70 +413,6 @@ *pEtryPoint = afterRun;\ } - -/* the following block is to be added for modules that support the v2 - * config system. The config name is also provided. - */ -#define CODEqueryEtryPt_STD_CONF2_QUERIES \ - else if(!strcmp((char*) name, "beginCnfLoad")) {\ - *pEtryPoint = beginCnfLoad;\ - } else if(!strcmp((char*) name, "endCnfLoad")) {\ - *pEtryPoint = endCnfLoad;\ - } else if(!strcmp((char*) name, "checkCnf")) {\ - *pEtryPoint = checkCnf;\ - } else if(!strcmp((char*) name, "activateCnf")) {\ - *pEtryPoint = activateCnf;\ - } else if(!strcmp((char*) name, "freeCnf")) {\ - *pEtryPoint = freeCnf;\ - } \ - CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES - -/* the following block is to be added for modules that support v2 - * module global parameters [module(...)] - */ -#define CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES \ - else if(!strcmp((char*) name, "setModCnf")) {\ - *pEtryPoint = setModCnf;\ - } \ - -/* the following block is to be added for output modules that support the v2 - * config system. The config name is also provided. - */ -#define CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES \ - else if(!strcmp((char*) name, "newActInst")) {\ - *pEtryPoint = newActInst;\ - } \ - CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES - - -/* the following block is to be added for input modules that support the v2 - * config system. The config name is also provided. - */ -#define CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES \ - else if(!strcmp((char*) name, "newInpInst")) {\ - *pEtryPoint = newInpInst;\ - } \ - CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES - - -/* the following block is to be added for modules that require - * pre priv drop activation support. - */ -#define CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES \ - else if(!strcmp((char*) name, "activateCnfPrePrivDrop")) {\ - *pEtryPoint = activateCnfPrePrivDrop;\ - } - -/* the following block is to be added for modules that support - * their config name. This is required for the rsyslog v6 config - * system, especially for outout modules which do not require - * the new set of begin/end config settings. - */ -#define CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES \ - else if(!strcmp((char*) name, "getModCnfName")) {\ - *pEtryPoint = modGetCnfName;\ - } - /* the following definition is the standard block for queryEtryPt for LIBRARY * modules. This can be used if no specific handling (e.g. to cover version * differences) is needed. @@ -640,10 +485,6 @@ /* now get the obj interface so that we can access other objects */ \ CHKiRet(pObjGetObjInterface(&obj)); -/* do those initializations necessary for legacy config variables */ -#define INITLegCnfVars \ - initConfVars(); - #define ENDmodInit \ finalize_it:\ *pQueryEtryPt = queryEtryPt;\ @@ -681,6 +522,7 @@ #define CODEmodInit_QueryRegCFSLineHdlr \ CHKiRet(pHostQueryEtryPt((uchar*)"regCfSysLineHdlr", &omsdRegCFSLineHdlr)); +#endif /* #ifndef MODULE_TEMPLATE_H_INCLUDED */ /* modExit() * This is the counterpart to modInit(). It destroys a module and makes it ready for @@ -706,152 +548,6 @@ } -/* beginCnfLoad() - * This is a function tells an input module that a new config load begins. - * The core passes in a handle to the new module-specific module conf to - * the module. -- rgerards, 2011-05-03 - */ -#define BEGINbeginCnfLoad \ -static rsRetVal beginCnfLoad(modConfData_t **ptr, __attribute__((unused)) rsconf_t *pConf)\ -{\ - modConfData_t *pModConf; \ - DEFiRet; - -#define CODESTARTbeginCnfLoad \ - if((pModConf = calloc(1, sizeof(modConfData_t))) == NULL) {\ - *ptr = NULL;\ - ENDfunc \ - return RS_RET_OUT_OF_MEMORY;\ - } - -#define ENDbeginCnfLoad \ - *ptr = pModConf;\ - RETiRet;\ -} - - -/* setModCnf() - * This function permits to set module global parameters via the v2 config - * interface. It may be called multiple times, but parameters must not be - * set in a conflicting way. The module must use its current config load - * context when processing the directives. - * Note that lst may be NULL, especially if the module is loaded via the - * legacy config system. The module must check for this. - * NOTE: This entry point must only be implemented if module global - * parameters are actually required. - */ -#define BEGINsetModCnf \ -static rsRetVal setModCnf(struct nvlst *lst)\ -{\ - DEFiRet; - -#define CODESTARTsetModCnf - -#define ENDsetModCnf \ - RETiRet;\ -} - - -/* endCnfLoad() - * This is a function tells an input module that the current config load ended. - * It gets a last chance to make changes to its in-memory config object. After - * this call, the config object must no longer be changed. - * The pModConf pointer passed into the module must no longer be used. - * rgerards, 2011-05-03 - */ -#define BEGINendCnfLoad \ -static rsRetVal endCnfLoad(modConfData_t *ptr)\ -{\ - modConfData_t __attribute__((unused)) *pModConf = (modConfData_t*) ptr; \ - DEFiRet; - -#define CODESTARTendCnfLoad - -#define ENDendCnfLoad \ - RETiRet;\ -} - - -/* checkCnf() - * Check the provided config object for errors, inconsistencies and other things - * that do not work out. - * NOTE: no part of the config must be activated, so some checks that require - * activation can not be done in this entry point. They must be done in the - * activateConf() stage, where the caller must also be prepared for error - * returns. - * rgerhards, 2011-05-03 - */ -#define BEGINcheckCnf \ -static rsRetVal checkCnf(modConfData_t *ptr)\ -{\ - modConfData_t __attribute__((unused)) *pModConf = (modConfData_t*) ptr; \ - DEFiRet; - -#define CODESTARTcheckCnf - -#define ENDcheckCnf \ - RETiRet;\ -} - - -/* activateCnfPrePrivDrop() - * Initial config activation, before dropping privileges. This is an optional - * entry points that should only be implemented by those module that really need - * it. Processing should be limited to the minimum possible. Main activation - * should happen in the normal activateCnf() call. - * rgerhards, 2011-05-06 - */ -#define BEGINactivateCnfPrePrivDrop \ -static rsRetVal activateCnfPrePrivDrop(modConfData_t *ptr)\ -{\ - modConfData_t *pModConf = (modConfData_t*) ptr; \ - DEFiRet; - -#define CODESTARTactivateCnfPrePrivDrop - -#define ENDactivateCnfPrePrivDrop \ - RETiRet;\ -} - - -/* activateCnf() - * This activates the provided config, and may report errors if they are detected - * during activation. - * rgerhards, 2011-05-03 - */ -#define BEGINactivateCnf \ -static rsRetVal activateCnf(modConfData_t *ptr)\ -{\ - modConfData_t __attribute__((unused)) *pModConf = (modConfData_t*) ptr; \ - DEFiRet; - -#define CODESTARTactivateCnf - -#define ENDactivateCnf \ - RETiRet;\ -} - - -/* freeCnf() - * This is a function tells an input module that it must free all data - * associated with the passed-in module config. - * rgerhards, 2011-05-03 - */ -#define BEGINfreeCnf \ -static rsRetVal freeCnf(void *ptr)\ -{\ - modConfData_t *pModConf = (modConfData_t*) ptr; \ - DEFiRet; - -#define CODESTARTfreeCnf - -#define ENDfreeCnf \ - if(pModConf != NULL)\ - free(pModConf); /* we need to free this in any case */\ - RETiRet;\ -} - - /* runInput() * This is the main function for input modules. It is used to gather data from the * input source and submit it to the message queue. Each runInput() instance has its own @@ -938,28 +634,6 @@ } -/* SetShutdownImmdtPtr() - * This function is optional. If defined by an output plugin, it is called - * each time the action is invoked to set the "ShutdownImmediate" pointer, - * which is used during termination to indicate the action should shutdown - * as quickly as possible. - */ -#define CODEqueryEtryPt_SetShutdownImmdtPtr \ - else if(!strcmp((char*) name, "SetShutdownImmdtPtr")) {\ - *pEtryPoint = SetShutdownImmdtPtr;\ - } -#define BEGINSetShutdownImmdtPtr \ -static rsRetVal SetShutdownImmdtPtr(instanceData __attribute__((unused)) *pData, int *pPtr)\ -{\ - DEFiRet; - -#define CODESTARTSetShutdownImmdtPtr - -#define ENDSetShutdownImmdtPtr \ - RETiRet;\ -} - - /* parse() - main entry point of parser modules */ #define BEGINparse \ @@ -1013,7 +687,5 @@ } -#endif /* #ifndef MODULE_TEMPLATE_H_INCLUDED */ - /* vim:set ai: */ diff -Nru rsyslog-7.6.0/runtime/msg.c rsyslog-5.10.1/runtime/msg.c --- rsyslog-7.6.0/runtime/msg.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/msg.c 2012-10-17 14:41:20.000000000 +0000 @@ -7,7 +7,7 @@ * of the "old" message code without any modifications. However, it * helps to have things at the right place one we go to the meat of it. * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -36,25 +36,16 @@ #include #include #include -#if HAVE_SYSINFO_UPTIME -#include -#endif #include -#include -#include -/* For struct json_object_iter, should not be necessary in future versions */ -#include #if HAVE_MALLOC_H # include #endif -#ifdef USE_LIBUUID - #include -#endif #include "rsyslog.h" #include "srUtils.h" #include "stringbuf.h" #include "template.h" #include "msg.h" +#include "var.h" #include "datetime.h" #include "glbl.h" #include "regexp.h" @@ -63,36 +54,15 @@ #include "ruleset.h" #include "prop.h" #include "net.h" -#include "var.h" -#include "rsconf.h" -#include "parserif.h" - -/* TODO: move the global variable root to the config object - had no time to to it - * right now before vacation -- rgerhards, 2013-07-22 - */ -static pthread_rwlock_t glblVars_rwlock; -struct json_object *global_var_root = NULL; /* static data */ DEFobjStaticHelpers +DEFobjCurrIf(var) DEFobjCurrIf(datetime) DEFobjCurrIf(glbl) DEFobjCurrIf(regexp) DEFobjCurrIf(prop) DEFobjCurrIf(net) -DEFobjCurrIf(var) - -static char *two_digits[100] = { - "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", - "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", - "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", - "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", - "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", - "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", - "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", - "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", - "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", - "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"}; static struct { uchar *pszName; @@ -291,24 +261,15 @@ { UCHAR_CONSTANT("190"), 5}, { UCHAR_CONSTANT("191"), 5} }; -static char hexdigit[16] = - {'0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /*syslog facility names (as of RFC5424) */ static char *syslog_fac_names[24] = { "kern", "user", "mail", "daemon", "auth", "syslog", "lpr", "news", "uucp", "cron", "authpriv", "ftp", "ntp", "audit", "alert", "clock", "local0", "local1", "local2", "local3", "local4", "local5", "local6", "local7" }; -/* length of the facility names string (for optimizatiions) */ -static short len_syslog_fac_names[24] = { 4, 4, 4, 6, 4, 6, 3, - 4, 4, 4, 8, 3, 3, 5, - 5, 5, 6, 6, 6, 6, - 6, 6, 6, 6 }; /* table of severity names (in numerical order)*/ static char *syslog_severity_names[8] = { "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug" }; -static short len_syslog_severity_names[8] = { 5, 5, 4, 3, 7, 6, 4, 5 }; /* numerical values as string - this is the most efficient approach to convert severity * and facility values to a numerical string... -- rgerhars, 2009-06-17 @@ -323,103 +284,169 @@ #endif /* some forward declarations */ -static int getAPPNAMELen(msg_t * const pM, sbool bLockMutex); -static rsRetVal jsonPathFindParent(struct json_object *jroot, uchar *name, uchar *leaf, struct json_object **parent, int bCreate); -static uchar * jsonPathGetLeaf(uchar *name, int lenName); -static struct json_object *jsonDeepCopy(struct json_object *src); +static int getAPPNAMELen(msg_t *pM, sbool bLockMutex); -/* the locking and unlocking implementations: */ -static inline void -MsgLock(msg_t *pThis) +/* The following functions will support advanced output module + * multithreading, once this is implemented. Currently, we + * include them as hooks only. The idea is that we need to guard + * some msg objects data fields against concurrent access if + * we run on multiple threads. Please note that in any case this + * is not necessary for calls from INPUT modules, because they + * construct the message object and do this serially. Only when + * the message is in the processing queue, multiple threads may + * access a single object. Consequently, there are no guard functions + * for "set" methods, as these are called during input. Only "get" + * functions that modify important structures have them. + * rgerhards, 2007-07-20 + * We now support locked and non-locked operations, depending on + * the configuration of rsyslog. To support this, we use function + * pointers. Initially, we start in non-locked mode. There, all + * locking operations call into dummy functions. When locking is + * enabled, the function pointers are changed to functions doing + * actual work. We also introduced another MsgPrepareEnqueue() function + * which initializes the locking structures, if needed. This is + * necessary because internal messages during config file startup + * processing are always created in non-locking mode. So we can + * not initialize locking structures during constructions. We now + * postpone this until when the message is fully constructed and + * enqueued. Then we know the status of locking. This has a nice + * side effect, and that is that during the initial creation of + * the Msg object no locking needs to be done, which results in better + * performance. -- rgerhards, 2008-01-05 + */ +static void (*funcLock)(msg_t *pMsg); +static void (*funcUnlock)(msg_t *pMsg); +static void (*funcDeleteMutex)(msg_t *pMsg); +void (*funcMsgPrepareEnqueue)(msg_t *pMsg); +#if 1 /* This is a debug aid */ +#define MsgLock(pMsg) funcLock(pMsg) +#define MsgUnlock(pMsg) funcUnlock(pMsg) +#else +#define MsgLock(pMsg) {dbgprintf("MsgLock line %d\n - ", __LINE__); funcLock(pMsg);; } +#define MsgUnlock(pMsg) {dbgprintf("MsgUnlock line %d - ", __LINE__); funcUnlock(pMsg); } +#endif + +/* the next function is a dummy to be used by the looking functions + * when the class is not yet running in an environment where locking + * is necessary. Please note that the need to lock can (and will) change + * during a single run. Typically, this is depending on the operation mode + * of the message queues (which is operator-configurable). -- rgerhards, 2008-01-05 + */ +static void MsgLockingDummy(msg_t __attribute__((unused)) *pMsg) { - /* DEV debug only! dbgprintf("MsgLock(0x%lx)\n", (unsigned long) pThis); */ - pthread_mutex_lock(&pThis->mut); + /* empty be design */ } -static inline void -MsgUnlock(msg_t *pThis) + + +/* The following function prepares a message for enqueue into the queue. This is + * where a message may be accessed by multiple threads. This implementation here + * is the version for multiple concurrent acces. It initializes the locking + * structures. + * TODO: change to an iRet interface! -- rgerhards, 2008-07-14 + */ +static void MsgPrepareEnqueueLockingCase(msg_t *pThis) { - /* DEV debug only! dbgprintf("MsgUnlock(0x%lx)\n", (unsigned long) pThis); */ - pthread_mutex_unlock(&pThis->mut); + BEGINfunc + assert(pThis != NULL); + pthread_mutex_init(&pThis->mut, NULL); + pThis->bDoLock = 1; + ENDfunc } -/* set RcvFromIP name in msg object WITHOUT calling AddRef. - * rgerhards, 2013-01-22 - */ -static inline void -MsgSetRcvFromIPWithoutAddRef(msg_t *pThis, prop_t *new) +/* ... and now the locking and unlocking implementations: */ +static void MsgLockLockingCase(msg_t *pThis) { - if(pThis->pRcvFromIP != NULL) - prop.Destruct(&pThis->pRcvFromIP); - pThis->pRcvFromIP = new; + /* DEV debug only! dbgprintf("MsgLock(0x%lx)\n", (unsigned long) pThis); */ + assert(pThis != NULL); + if(pThis->bDoLock == 1) /* TODO: this is a testing hack, we should find a way with better performance! -- rgerhards, 2009-01-27 */ + pthread_mutex_lock(&pThis->mut); } +static void MsgUnlockLockingCase(msg_t *pThis) +{ + /* DEV debug only! dbgprintf("MsgUnlock(0x%lx)\n", (unsigned long) pThis); */ + assert(pThis != NULL); + if(pThis->bDoLock == 1) /* TODO: this is a testing hack, we should find a way with better performance! -- rgerhards, 2009-01-27 */ + pthread_mutex_unlock(&pThis->mut); +} -/* set RcvFrom name in msg object WITHOUT calling AddRef. - * rgerhards, 2013-01-22 +/* delete the mutex object on message destruction (locking case) */ -void MsgSetRcvFromWithoutAddRef(msg_t *pThis, prop_t *new) +static void MsgDeleteMutexLockingCase(msg_t *pThis) { assert(pThis != NULL); + pthread_mutex_destroy(&pThis->mut); +} - if(pThis->msgFlags & NEEDS_DNSRESOL) { - if(pThis->rcvFrom.pfrominet != NULL) - free(pThis->rcvFrom.pfrominet); - pThis->msgFlags &= ~NEEDS_DNSRESOL; - } else { - if(pThis->rcvFrom.pRcvFrom != NULL) - prop.Destruct(&pThis->rcvFrom.pRcvFrom); - } - pThis->rcvFrom.pRcvFrom = new; +/* enable multiple concurrent access on the message object + * This works on a class-wide basis and can bot be undone. + * That is, if it is once enabled, it can not be disabled during + * the same run. When this function is called, no other thread + * must manipulate message objects. Then we would have race conditions, + * but guarding against this is counter-productive because it + * would cost additional time. Plus, it would be a programming error. + * rgerhards, 2008-01-05 + */ +rsRetVal MsgEnableThreadSafety(void) +{ + DEFiRet; + funcLock = MsgLockLockingCase; + funcUnlock = MsgUnlockLockingCase; + funcMsgPrepareEnqueue = MsgPrepareEnqueueLockingCase; + funcDeleteMutex = MsgDeleteMutexLockingCase; + RETiRet; } +/* end locking functions */ -/* rgerhards 2012-04-18: set associated ruleset (by ruleset name) - * If ruleset cannot be found, no update is done. - */ -static void -MsgSetRulesetByName(msg_t * const pMsg, cstr_t *rulesetName) + +static inline int getProtocolVersion(msg_t *pM) { - rulesetGetRuleset(runConf, &(pMsg->pRuleset), rsCStrGetSzStrNoNULL(rulesetName)); + return(pM->iProtocolVersion); } + /* do a DNS reverse resolution, if not already done, reflect status * rgerhards, 2009-11-16 */ static inline rsRetVal -resolveDNS(msg_t * const pMsg) { +resolveDNS(msg_t *pMsg) { rsRetVal localRet; prop_t *propFromHost = NULL; - prop_t *ip; - prop_t *localName; + prop_t *propFromHostIP = NULL; + uchar fromHost[NI_MAXHOST]; + uchar fromHostIP[NI_MAXHOST]; + uchar fromHostFQDN[NI_MAXHOST]; DEFiRet; MsgLock(pMsg); CHKiRet(objUse(net, CORE_COMPONENT)); if(pMsg->msgFlags & NEEDS_DNSRESOL) { - localRet = net.cvthname(pMsg->rcvFrom.pfrominet, &localName, NULL, &ip); + localRet = net.cvthname(pMsg->rcvFrom.pfrominet, fromHost, fromHostFQDN, fromHostIP); if(localRet == RS_RET_OK) { - /* we pass down the props, so no need for AddRef */ - MsgSetRcvFromWithoutAddRef(pMsg, localName); - MsgSetRcvFromIPWithoutAddRef(pMsg, ip); + MsgSetRcvFromStr(pMsg, fromHost, ustrlen(fromHost), &propFromHost); + CHKiRet(MsgSetRcvFromIPStr(pMsg, fromHostIP, ustrlen(fromHostIP), &propFromHostIP)); } } finalize_it: + MsgUnlock(pMsg); if(iRet != RS_RET_OK) { /* best we can do: remove property */ MsgSetRcvFromStr(pMsg, UCHAR_CONSTANT(""), 0, &propFromHost); prop.Destruct(&propFromHost); } - MsgUnlock(pMsg); if(propFromHost != NULL) prop.Destruct(&propFromHost); + if(propFromHostIP != NULL) + prop.Destruct(&propFromHostIP); RETiRet; } static inline void -getInputName(msg_t * const pM, uchar **ppsz, int *plen) +getInputName(msg_t *pM, uchar **ppsz, int *plen) { BEGINfunc if(pM == NULL || pM->pInputName == NULL) { @@ -433,7 +460,7 @@ static inline uchar* -getRcvFromIP(msg_t * const pM) +getRcvFromIP(msg_t *pM) { uchar *psz; int len; @@ -452,12 +479,17 @@ } + /* map a property name (string) to a property ID */ -rsRetVal -propNameToID(uchar *pName, propid_t *pPropID) +rsRetVal propNameToID(cstr_t *pCSPropName, propid_t *pPropID) { + uchar *pName; DEFiRet; + assert(pCSPropName != NULL); + assert(pPropID != NULL); + pName = rsCStrGetSzStrNoNULL(pCSPropName); + /* sometimes there are aliases to the original MonitoWare * property names. These come after || in the ifs below. */ if(!strcmp((char*) pName, "msg")) { @@ -471,6 +503,11 @@ *pPropID = PROP_SYSLOGTAG; } else if(!strcmp((char*) pName, "rawmsg")) { *pPropID = PROP_RAWMSG; + /* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 + } else if(!strcmp((char*) pName, "uxtradmsg")) { + pRes = getUxTradMsg(pMsg); + */ } else if(!strcmp((char*) pName, "inputname")) { *pPropID = PROP_INPUTNAME; } else if(!strcmp((char*) pName, "fromhost")) { @@ -505,12 +542,6 @@ *pPropID = PROP_PROCID; } else if(!strcmp((char*) pName, "msgid")) { *pPropID = PROP_MSGID; - } else if(!strcmp((char*) pName, "parsesuccess")) { - *pPropID = PROP_PARSESUCCESS; -#ifdef USE_LIBUUID - } else if(!strcmp((char*) pName, "uuid")) { - *pPropID = PROP_UUID; -#endif /* here start system properties (those, that do not relate to the message itself */ } else if(!strcmp((char*) pName, "$now")) { *pPropID = PROP_SYS_NOW; @@ -530,20 +561,9 @@ *pPropID = PROP_SYS_MINUTE; } else if(!strcmp((char*) pName, "$myhostname")) { *pPropID = PROP_SYS_MYHOSTNAME; - } else if(!strcmp((char*) pName, "$!all-json")) { - *pPropID = PROP_CEE_ALL_JSON; } else if(!strcmp((char*) pName, "$bom")) { *pPropID = PROP_SYS_BOM; - } else if(!strcmp((char*) pName, "$uptime")) { - *pPropID = PROP_SYS_UPTIME; - } else if(!strncmp((char*) pName, "$!", 2) || pName[0] == '!') { - *pPropID = PROP_CEE; - } else if(!strncmp((char*) pName, "$.", 2) || pName[0] == '.') { - *pPropID = PROP_LOCAL_VAR; - } else if(!strncmp((char*) pName, "$/", 2) || pName[0] == '/') { - *pPropID = PROP_GLOBAL_VAR; } else { - DBGPRINTF("PROP_INVALID for name '%s'\n", pName); *pPropID = PROP_INVALID; iRet = RS_RET_VAR_NOT_FOUND; } @@ -566,6 +586,12 @@ return UCHAR_CONSTANT("syslogtag"); case PROP_RAWMSG: return UCHAR_CONSTANT("rawmsg"); + /* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 + case PROP_UXTRADMSG: + pRes = getUxTradMsg(pMsg); + break; + */ case PROP_INPUTNAME: return UCHAR_CONSTANT("inputname"); case PROP_FROMHOST: @@ -600,8 +626,6 @@ return UCHAR_CONSTANT("procid"); case PROP_MSGID: return UCHAR_CONSTANT("msgid"); - case PROP_PARSESUCCESS: - return UCHAR_CONSTANT("parsesuccess"); case PROP_SYS_NOW: return UCHAR_CONSTANT("$NOW"); case PROP_SYS_YEAR: @@ -620,16 +644,8 @@ return UCHAR_CONSTANT("$MINUTE"); case PROP_SYS_MYHOSTNAME: return UCHAR_CONSTANT("$MYHOSTNAME"); - case PROP_CEE: - return UCHAR_CONSTANT("*CEE-based property*"); - case PROP_LOCAL_VAR: - return UCHAR_CONSTANT("*LOCAL_VARIABLE*"); - case PROP_CEE_ALL_JSON: - return UCHAR_CONSTANT("$!all-json"); case PROP_SYS_BOM: return UCHAR_CONSTANT("$BOM"); - case PROP_UUID: - return UCHAR_CONSTANT("uuid"); default: return UCHAR_CONSTANT("*invalid property id*"); } @@ -666,11 +682,11 @@ /* initialize members in ORDER they appear in structure (think "cache line"!) */ pM->flowCtlType = 0; - pM->bParseSuccess = 0; + pM->bDoLock = 0; + pM->bAlreadyFreed = 0; pM->iRefCount = 1; pM->iSeverity = -1; pM->iFacility = -1; - pM->iLenPROGNAME = -1; pM->offAfterPRI = 0; pM->offMSG = -1; pM->iProtocolVersion = 0; @@ -689,7 +705,8 @@ pM->pszTIMESTAMP3339 = NULL; pM->pszTIMESTAMP_MySQL = NULL; pM->pszTIMESTAMP_PgSQL = NULL; - pM->pszStrucData = NULL; + pM->pCSProgName = NULL; + pM->pCSStrucData = NULL; pM->pCSAPPNAME = NULL; pM->pCSPROCID = NULL; pM->pCSMSGID = NULL; @@ -697,9 +714,6 @@ pM->pRcvFromIP = NULL; pM->rcvFrom.pRcvFrom = NULL; pM->pRuleset = NULL; - pM->json = NULL; - pM->localvars = NULL; - pM->dfltTZ[0] = '\0'; memset(&pM->tRcvdAt, 0, sizeof(pM->tRcvdAt)); memset(&pM->tTIMESTAMP, 0, sizeof(pM->tTIMESTAMP)); pM->TAG.pszTAG = NULL; @@ -707,10 +721,6 @@ pM->pszTimestamp3339[0] = '\0'; pM->pszTIMESTAMP_SecFrac[0] = '\0'; pM->pszRcvdAt_SecFrac[0] = '\0'; - pM->pszTIMESTAMP_Unix[0] = '\0'; - pM->pszRcvdAt_Unix[0] = '\0'; - pM->pszUUID = NULL; - pthread_mutex_init(&pM->mut, NULL); /* DEV debugging only! dbgprintf("msgConstruct\t0x%x, ref 1\n", (int)pM);*/ @@ -769,19 +779,6 @@ } -/* Special msg constructor, to be used when an object is deserialized. - * we do only the base init as we know the properties will be set in - * any case by the deserializer. We still do the "inexpensive" inits - * just to be on the safe side. The whole process needs to be - * refactored together with the msg serialization subsystem. - */ -rsRetVal -msgConstructForDeserializer(msg_t **ppThis) -{ - return msgBaseConstruct(ppThis); -} - - /* some free handlers for (slightly) complicated cases... All of them may be called * with an empty element. */ @@ -813,6 +810,15 @@ if(currRefCount == 0) { /* DEV Debugging Only! dbgprintf("msgDestruct\t0x%lx, RefCount now 0, doing DESTROY\n", (unsigned long)pThis); */ + /* The if below is included to try to nail down a well-hidden bug causing + * segfaults. I hope that do to the test code the problem is sooner detected and + * thus we get better data for debugging and resolving it. -- rgerhards, 2011-02-23. + * TODO: remove when no longer needed. + */ + if(pThis->bAlreadyFreed) + abort(); + pThis->bAlreadyFreed = 1; + /* end debug code */ if(pThis->pszRawMsg != pThis->szRawMsg) free(pThis->pszRawMsg); freeTAG(pThis); @@ -833,25 +839,20 @@ free(pThis->pszRcvdAt_PgSQL); free(pThis->pszTIMESTAMP_MySQL); free(pThis->pszTIMESTAMP_PgSQL); - free(pThis->pszStrucData); - if(pThis->iLenPROGNAME >= CONF_PROGNAME_BUFSIZE) - free(pThis->PROGNAME.ptr); + if(pThis->pCSProgName != NULL) + rsCStrDestruct(&pThis->pCSProgName); + if(pThis->pCSStrucData != NULL) + rsCStrDestruct(&pThis->pCSStrucData); if(pThis->pCSAPPNAME != NULL) rsCStrDestruct(&pThis->pCSAPPNAME); if(pThis->pCSPROCID != NULL) rsCStrDestruct(&pThis->pCSPROCID); if(pThis->pCSMSGID != NULL) rsCStrDestruct(&pThis->pCSMSGID); - if(pThis->json != NULL) - json_object_put(pThis->json); - if(pThis->localvars != NULL) - json_object_put(pThis->localvars); - if(pThis->pszUUID != NULL) - free(pThis->pszUUID); # ifndef HAVE_ATOMIC_BUILTINS MsgUnlock(pThis); # endif - pthread_mutex_destroy(&pThis->mut); + funcDeleteMutex(pThis); /* now we need to do our own optimization. Testing has shown that at least the glibc * malloc() subsystem returns memory to the OS far too late in our case. So we need * to help it a bit, by calling malloc_trim(), which will tell the alloc subsystem @@ -960,6 +961,10 @@ pNew->pInputName = pOld->pInputName; prop.AddRef(pNew->pInputName); } + /* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 + pNew->offAfterPRI = pOld->offAfterPRI; + */ if(pOld->iLenTAG > 0) { if(pOld->iLenTAG < CONF_TAG_BUFSIZE) { memcpy(pNew->TAG.szBuf, pOld->TAG.szBuf, pOld->iLenTAG + 1); @@ -987,22 +992,13 @@ tmpCOPYSZ(HOSTNAME); } } - if(pOld->pszStrucData == NULL) { - pNew->pszStrucData = NULL; - } else { - pNew->pszStrucData = (uchar*)strdup((char*)pOld->pszStrucData); - pNew->lenStrucData = pOld->lenStrucData; - } + tmpCOPYCSTR(ProgName); + tmpCOPYCSTR(StrucData); tmpCOPYCSTR(APPNAME); tmpCOPYCSTR(PROCID); tmpCOPYCSTR(MSGID); - if(pOld->json != NULL) - pNew->json = jsonDeepCopy(pOld->json); - if(pOld->localvars != NULL) - pNew->localvars = jsonDeepCopy(pOld->localvars); - /* we do not copy all other cache properties, as we do not even know * if they are needed once again. So we let them re-create if needed. */ @@ -1044,6 +1040,10 @@ objSerializeSCALAR(pStrm, ttGenTime, INT); objSerializeSCALAR(pStrm, tRcvdAt, SYSLOGTIME); objSerializeSCALAR(pStrm, tTIMESTAMP, SYSLOGTIME); + /* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 + objSerializeSCALAR(pStrm, offsAfterPRI, SHORT); + */ CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszTAG"), PROPTYPE_PSZ, (void*) ((pThis->iLenTAG < CONF_TAG_BUFSIZE) ? pThis->TAG.szBuf : pThis->TAG.pszTAG))); @@ -1056,23 +1056,12 @@ CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvFrom"), PROPTYPE_PSZ, (void*) psz)); psz = getRcvFromIP(pThis); CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvFromIP"), PROPTYPE_PSZ, (void*) psz)); - psz = pThis->pszStrucData; - CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRcvStrucData"), PROPTYPE_PSZ, (void*) psz)); - if(pThis->json != NULL) { - psz = (uchar*) json_object_get_string(pThis->json); - CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("json"), PROPTYPE_PSZ, (void*) psz)); - } - if(pThis->localvars != NULL) { - psz = (uchar*) json_object_get_string(pThis->localvars); - CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("localvars"), PROPTYPE_PSZ, (void*) psz)); - } + objSerializePTR(pStrm, pCSStrucData, CSTR); objSerializePTR(pStrm, pCSAPPNAME, CSTR); objSerializePTR(pStrm, pCSPROCID, CSTR); objSerializePTR(pStrm, pCSMSGID, CSTR); - objSerializePTR(pStrm, pszUUID, PSZ); - if(pThis->pRuleset != NULL) { rulesetGetName(pThis->pRuleset); CHKiRet(obj.SerializeProp(pStrm, UCHAR_CONSTANT("pszRuleset"), PROPTYPE_PSZ, @@ -1091,176 +1080,6 @@ } -/* This is a helper for MsgDeserialize that re-inits the var object. This - * whole construct should be replaced, var is really ready to be retired. - * But as an interim help during refactoring let's introduce this function - * here (and thus NOT as method of var object!). -- rgerhads, 2012-11-06 - */ -static inline void -reinitVar(var_t *pVar) -{ - rsCStrDestruct(&pVar->pcsName); /* no longer needed */ - if(pVar->varType == VARTYPE_STR) { - if(pVar->val.pStr != NULL) - rsCStrDestruct(&pVar->val.pStr); - } -} -/* deserialize the message again - * we deserialize the properties in the same order that we serialized them. Except - * for some checks to cover downlevel version, we do not need to do all these - * CPU intense name checkings. - */ -#define isProp(name) !rsCStrSzStrCmp(pVar->pcsName, (uchar*) name, sizeof(name) - 1) -rsRetVal -MsgDeserialize(msg_t * const pMsg, strm_t *pStrm) -{ - prop_t *myProp; - prop_t *propRcvFrom = NULL; - prop_t *propRcvFromIP = NULL; - struct json_tokener *tokener; - var_t *pVar = NULL; - DEFiRet; - - ISOBJ_TYPE_assert(pStrm, strm); - - CHKiRet(var.Construct(&pVar)); - CHKiRet(var.ConstructFinalize(pVar)); - - CHKiRet(objDeserializeProperty(pVar, pStrm)); - if(isProp("iProtocolVersion")) { - setProtocolVersion(pMsg, pVar->val.num); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("iSeverity")) { - pMsg->iSeverity = pVar->val.num; - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("iFacility")) { - pMsg->iFacility = pVar->val.num; - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("msgFlags")) { - pMsg->msgFlags = pVar->val.num; - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("ttGenTime")) { - pMsg->ttGenTime = pVar->val.num; - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("tRcvdAt")) { - memcpy(&pMsg->tRcvdAt, &pVar->val.vSyslogTime, sizeof(struct syslogTime)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("tTIMESTAMP")) { - memcpy(&pMsg->tTIMESTAMP, &pVar->val.vSyslogTime, sizeof(struct syslogTime)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszTAG")) { - MsgSetTAG(pMsg, rsCStrGetSzStrNoNULL(pVar->val.pStr), cstrLen(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszRawMsg")) { - MsgSetRawMsg(pMsg, (char*) rsCStrGetSzStrNoNULL(pVar->val.pStr), cstrLen(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszHOSTNAME")) { - MsgSetHOSTNAME(pMsg, rsCStrGetSzStrNoNULL(pVar->val.pStr), rsCStrLen(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszInputName")) { - /* we need to create a property */ - CHKiRet(prop.Construct(&myProp)); - CHKiRet(prop.SetString(myProp, rsCStrGetSzStrNoNULL(pVar->val.pStr), rsCStrLen(pVar->val.pStr))); - CHKiRet(prop.ConstructFinalize(myProp)); - MsgSetInputName(pMsg, myProp); - prop.Destruct(&myProp); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszRcvFrom")) { - MsgSetRcvFromStr(pMsg, rsCStrGetSzStrNoNULL(pVar->val.pStr), rsCStrLen(pVar->val.pStr), &propRcvFrom); - prop.Destruct(&propRcvFrom); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszRcvFromIP")) { - MsgSetRcvFromIPStr(pMsg, rsCStrGetSzStrNoNULL(pVar->val.pStr), rsCStrLen(pVar->val.pStr), &propRcvFromIP); - prop.Destruct(&propRcvFromIP); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("json")) { - tokener = json_tokener_new(); - pMsg->json = json_tokener_parse_ex(tokener, (char*)rsCStrGetSzStrNoNULL(pVar->val.pStr), - cstrLen(pVar->val.pStr)); - json_tokener_free(tokener); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("localvars")) { - tokener = json_tokener_new(); - pMsg->localvars = json_tokener_parse_ex(tokener, (char*)rsCStrGetSzStrNoNULL(pVar->val.pStr), - cstrLen(pVar->val.pStr)); - json_tokener_free(tokener); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszStrucData")) { - MsgSetStructuredData(pMsg, (char*) rsCStrGetSzStrNoNULL(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pCSAPPNAME")) { - MsgSetAPPNAME(pMsg, (char*) rsCStrGetSzStrNoNULL(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pCSPROCID")) { - MsgSetPROCID(pMsg, (char*) rsCStrGetSzStrNoNULL(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pCSMSGID")) { - MsgSetMSGID(pMsg, (char*) rsCStrGetSzStrNoNULL(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszUUID")) { - pMsg->pszUUID = ustrdup(rsCStrGetSzStrNoNULL(pVar->val.pStr)); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - if(isProp("pszRuleset")) { - MsgSetRulesetByName(pMsg, pVar->val.pStr); - reinitVar(pVar); - CHKiRet(objDeserializeProperty(pVar, pStrm)); - } - /* "offMSG" must always be our last field, so we use this as an - * indicator if the sequence is correct. This is a bit questionable, - * but on the other hand it works decently AND we will probably replace - * the whole persisted format soon in any case. -- rgerhards, 2012-11-06 - */ - if(!isProp("offMSG")) - ABORT_FINALIZE(RS_RET_DS_PROP_SEQ_ERR); - MsgSetMSGoffs(pMsg, pVar->val.num); -finalize_it: - if(pVar != NULL) - var.Destruct(&pVar); - RETiRet; -} -#undef isProp - - /* Increment reference count - see description of the "msg" * structure for details. As a convenience to developers, * this method returns the msg pointer that is passed to it. @@ -1268,7 +1087,7 @@ * * pSecondMsgPointer = MsgAddRef(pOrgMsgPointer); */ -msg_t *MsgAddRef(msg_t * const pM) +msg_t *MsgAddRef(msg_t *pM) { assert(pM != NULL); # ifdef HAVE_ATOMIC_BUILTINS @@ -1294,7 +1113,7 @@ * rgerhards, 2005-11-24 * THIS MUST be called with the message lock locked. */ -static rsRetVal aquirePROCIDFromTAG(msg_t * const pM) +static rsRetVal aquirePROCIDFromTAG(msg_t *pM) { register int i; uchar *pszTag; @@ -1305,7 +1124,7 @@ if(pM->pCSPROCID != NULL) return RS_RET_OK; /* we are already done ;) */ - if(msgGetProtocolVersion(pM) != 0) + if(getProtocolVersion(pM) != 0) return RS_RET_OK; /* we can only emulate if we have legacy format */ pszTag = (uchar*) ((pM->iLenTAG < CONF_TAG_BUFSIZE) ? pM->TAG.szBuf : pM->TAG.pszTAG); @@ -1355,33 +1174,32 @@ * The above definition has been taken from the FreeBSD syslogd sources. * * The program name is not parsed by default, because it is infrequently-used. + * If it is needed, this function should be called first. It checks if it is + * already set and extracts it, if not. + * * IMPORTANT: A locked message object must be provided, else a crash will occur. * rgerhards, 2005-10-19 */ -static inline rsRetVal -aquireProgramName(msg_t * const pM) +static rsRetVal aquireProgramName(msg_t *pM) { - int i; - uchar *pszTag, *pszProgName; + register int i; + uchar *pszTag; DEFiRet; assert(pM != NULL); - pszTag = (uchar*) ((pM->iLenTAG < CONF_TAG_BUFSIZE) ? pM->TAG.szBuf : pM->TAG.pszTAG); - for( i = 0 - ; (i < pM->iLenTAG) && isprint((int) pszTag[i]) - && (pszTag[i] != '\0') && (pszTag[i] != ':') - && (pszTag[i] != '[') && (pszTag[i] != '/') - ; ++i) - ; /* just search end of PROGNAME */ - if(i < CONF_PROGNAME_BUFSIZE) { - pszProgName = pM->PROGNAME.szBuf; - } else { - CHKmalloc(pM->PROGNAME.ptr = malloc(i+1)); - pszProgName = pM->PROGNAME.ptr; + if(pM->pCSProgName == NULL) { + /* ok, we do not yet have it. So let's parse the TAG to obtain it. */ + pszTag = (uchar*) ((pM->iLenTAG < CONF_TAG_BUFSIZE) ? pM->TAG.szBuf : pM->TAG.pszTAG); + CHKiRet(cstrConstruct(&pM->pCSProgName)); + for( i = 0 + ; (i < pM->iLenTAG) && isprint((int) pszTag[i]) + && (pszTag[i] != '\0') && (pszTag[i] != ':') + && (pszTag[i] != '[') && (pszTag[i] != '/') + ; ++i) { + CHKiRet(cstrAppendChar(pM->pCSProgName, pszTag[i])); + } + CHKiRet(cstrFinalize(pM->pCSProgName)); } - memcpy((char*)pszProgName, (char*)pszTag, i); - pszProgName[i] = '\0'; - pM->iLenPROGNAME = i; finalize_it: RETiRet; } @@ -1389,7 +1207,7 @@ /* Access methods - dumb & easy, not a comment for each ;) */ -void setProtocolVersion(msg_t * const pM, int iNewVersion) +void setProtocolVersion(msg_t *pM, int iNewVersion) { assert(pM != NULL); if(iNewVersion != 0 && iNewVersion != 1) { @@ -1400,71 +1218,15 @@ } /* note: string is taken from constant pool, do NOT free */ -char *getProtocolVersionString(msg_t * const pM) +char *getProtocolVersionString(msg_t *pM) { assert(pM != NULL); return(pM->iProtocolVersion ? "1" : "0"); } -#ifdef USE_LIBUUID -/* note: libuuid seems not to be thread-safe, so we need - * to get some safeguards in place. - */ -static void msgSetUUID(msg_t * const pM) -{ - size_t lenRes = sizeof(uuid_t) * 2 + 1; - char hex_char [] = "0123456789ABCDEF"; - unsigned int byte_nbr; - uuid_t uuid; - static pthread_mutex_t mutUUID = PTHREAD_MUTEX_INITIALIZER; - - dbgprintf("[MsgSetUUID] START\n"); - assert(pM != NULL); - - if((pM->pszUUID = (uchar*) MALLOC(lenRes)) == NULL) { - pM->pszUUID = (uchar *)""; - } else { - pthread_mutex_lock(&mutUUID); - uuid_generate(uuid); - pthread_mutex_unlock(&mutUUID); - for (byte_nbr = 0; byte_nbr < sizeof (uuid_t); byte_nbr++) { - pM->pszUUID[byte_nbr * 2 + 0] = hex_char[uuid [byte_nbr] >> 4]; - pM->pszUUID[byte_nbr * 2 + 1] = hex_char[uuid [byte_nbr] & 15]; - } - - dbgprintf("[MsgSetUUID] UUID : %s LEN: %d \n", pM->pszUUID, (int)lenRes); - pM->pszUUID[lenRes] = '\0'; - } - dbgprintf("[MsgSetUUID] END\n"); -} - -void getUUID(msg_t * const pM, uchar **pBuf, int *piLen) -{ - dbgprintf("[getUUID] START\n"); - if(pM == NULL) { - dbgprintf("[getUUID] pM is NULL\n"); - *pBuf= UCHAR_CONSTANT(""); - *piLen = 0; - } else { - if(pM->pszUUID == NULL) { - dbgprintf("[getUUID] pM->pszUUID is NULL\n"); - MsgLock(pM); - /* re-query, things may have changed in the mean time... */ - if(pM->pszUUID == NULL) - msgSetUUID(pM); - MsgUnlock(pM); - } else { /* UUID already there we reuse it */ - dbgprintf("[getUUID] pM->pszUUID already exists\n"); - } - *pBuf = pM->pszUUID; - *piLen = sizeof(uuid_t) * 2; - } - dbgprintf("[getUUID] END\n"); -} -#endif -void -getRawMsg(msg_t * const pM, uchar **pBuf, int *piLen) +static inline void +getRawMsg(msg_t *pM, uchar **pBuf, int *piLen) { if(pM == NULL) { *pBuf= UCHAR_CONSTANT(""); @@ -1481,20 +1243,24 @@ } -/* note: setMSGLen() is only for friends who really know what they - * do. Setting an invalid length can be desasterous! - */ -void setMSGLen(msg_t * const pM, int lenMsg) +/* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 +char *getUxTradMsg(msg_t *pM) { - pM->iLenMSG = lenMsg; + if(pM == NULL) + return ""; + else + return (char*)pM->pszRawMsg + pM->offAfterPRI; } +*/ + -int getMSGLen(msg_t * const pM) +int getMSGLen(msg_t *pM) { return((pM == NULL) ? 0 : pM->iLenMSG); } -uchar *getMSG(msg_t * const pM) +uchar *getMSG(msg_t *pM) { uchar *ret; if(pM == NULL) @@ -1510,7 +1276,7 @@ /* Get PRI value as integer */ -static int getPRIi(msg_t * const pM) +static int getPRIi(msg_t *pM) { return (pM->iFacility << 3) + (pM->iSeverity); } @@ -1519,7 +1285,7 @@ /* Get PRI value in text form */ char * -getPRI(msg_t * const pM) +getPRI(msg_t *pM) { /* PRI is a number in the range 0..191. Thus, we use a simple lookup table to obtain the * string value. It looks a bit clumpsy here in code ;) @@ -1535,7 +1301,7 @@ char * -getTimeReported(msg_t * const pM, enum tplFormatTypes eFmt) +getTimeReported(msg_t *pM, enum tplFormatTypes eFmt) { BEGINfunc if(pM == NULL) @@ -1583,13 +1349,6 @@ } MsgUnlock(pM); return(pM->pszTIMESTAMP3339); - case tplFmtUnixDate: - MsgLock(pM); - if(pM->pszTIMESTAMP_Unix[0] == '\0') { - datetime.formatTimestampUnix(&pM->tTIMESTAMP, pM->pszTIMESTAMP_Unix); - } - MsgUnlock(pM); - return(pM->pszTIMESTAMP_Unix); case tplFmtSecFrac: if(pM->pszTIMESTAMP_SecFrac[0] == '\0') { MsgLock(pM); @@ -1605,7 +1364,7 @@ return "INVALID eFmt OPTION!"; } -static inline char *getTimeGenerated(msg_t * const pM, enum tplFormatTypes eFmt) +static inline char *getTimeGenerated(msg_t *pM, enum tplFormatTypes eFmt) { BEGINfunc if(pM == NULL) @@ -1669,13 +1428,6 @@ } MsgUnlock(pM); return(pM->pszRcvdAt3339); - case tplFmtUnixDate: - MsgLock(pM); - if(pM->pszRcvdAt_Unix[0] == '\0') { - datetime.formatTimestampUnix(&pM->tRcvdAt, pM->pszRcvdAt_Unix); - } - MsgUnlock(pM); - return(pM->pszRcvdAt_Unix); case tplFmtSecFrac: if(pM->pszRcvdAt_SecFrac[0] == '\0') { MsgLock(pM); @@ -1692,7 +1444,7 @@ } -static inline char *getSeverity(msg_t * const pM) +static inline char *getSeverity(msg_t *pM) { char *name = NULL; @@ -1709,7 +1461,7 @@ } -static inline char *getSeverityStr(msg_t * const pM) +static inline char *getSeverityStr(msg_t *pM) { char *name = NULL; @@ -1725,7 +1477,7 @@ return name; } -static inline char *getFacility(msg_t * const pM) +static inline char *getFacility(msg_t *pM) { char *name = NULL; @@ -1741,7 +1493,7 @@ return name; } -static inline char *getFacilityStr(msg_t * const pM) +static inline char *getFacilityStr(msg_t *pM) { char *name = NULL; @@ -1765,7 +1517,7 @@ * rgerhards, 2008-03-14 */ rsRetVal -MsgSetFlowControlType(msg_t * const pMsg, flowControl_t eFlowCtl) +MsgSetFlowControlType(msg_t *pMsg, flowControl_t eFlowCtl) { DEFiRet; assert(pMsg != NULL); @@ -1780,7 +1532,7 @@ * rgerhards, 2009-06-16 */ rsRetVal -MsgSetAfterPRIOffs(msg_t * const pMsg, short offs) +MsgSetAfterPRIOffs(msg_t *pMsg, short offs) { assert(pMsg != NULL); pMsg->offAfterPRI = offs; @@ -1794,7 +1546,7 @@ * which already obtained the lock. So in general, this function here must * only be called when it it safe to do so without it aquiring a lock. */ -rsRetVal MsgSetAPPNAME(msg_t * const pMsg, char* pszAPPNAME) +rsRetVal MsgSetAPPNAME(msg_t *pMsg, char* pszAPPNAME) { DEFiRet; assert(pMsg != NULL); @@ -1812,7 +1564,7 @@ /* rgerhards 2004-11-24: set PROCID in msg object */ -rsRetVal MsgSetPROCID(msg_t * const pMsg, char* pszPROCID) +rsRetVal MsgSetPROCID(msg_t *pMsg, char* pszPROCID) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -1833,7 +1585,7 @@ * This must be called WITHOUT the message lock being held. * rgerhards, 2009-06-26 */ -static inline void preparePROCID(msg_t * const pM, sbool bLockMutex) +static inline void preparePROCID(msg_t *pM, sbool bLockMutex) { if(pM->pCSPROCID == NULL) { if(bLockMutex == LOCK_MUTEX) @@ -1861,7 +1613,7 @@ /* rgerhards, 2005-11-24 */ -char *getPROCID(msg_t * const pM, sbool bLockMutex) +char *getPROCID(msg_t *pM, sbool bLockMutex) { uchar *pszRet; @@ -1881,7 +1633,7 @@ /* rgerhards 2004-11-24: set MSGID in msg object */ -rsRetVal MsgSetMSGID(msg_t * const pMsg, char* pszMSGID) +rsRetVal MsgSetMSGID(msg_t *pMsg, char* pszMSGID) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -1897,18 +1649,9 @@ } -/* Return state of last parser. If it had success, "OK" is returned, else - * "FAIL". All from the constant pool. - */ -static inline char *getParseSuccess(msg_t * const pM) -{ - return (pM->bParseSuccess) ? "OK" : "FAIL"; -} - - /* al, 2011-07-26: LockMsg to avoid race conditions */ -static inline char *getMSGID(msg_t * const pM) +static inline char *getMSGID(msg_t *pM) { if (pM->pCSMSGID == NULL) { return "-"; @@ -1921,27 +1664,29 @@ } } -/* rgerhards 2012-03-15: set parser success (an integer, acutally bool) +/* rgerhards 2009-06-12: set associated ruleset */ -void MsgSetParseSuccess(msg_t * const pMsg, int bSuccess) +void MsgSetRuleset(msg_t *pMsg, ruleset_t *pRuleset) { assert(pMsg != NULL); - pMsg->bParseSuccess = bSuccess; + pMsg->pRuleset = pRuleset; } -/* rgerhards 2009-06-12: set associated ruleset + +/* rgerhards 2012-04-18: set associated ruleset (by ruleset name) + * If ruleset cannot be found, no update is done. */ -void MsgSetRuleset(msg_t * const pMsg, ruleset_t *pRuleset) +static void +MsgSetRulesetByName(msg_t *pMsg, cstr_t *rulesetName) { - assert(pMsg != NULL); - pMsg->pRuleset = pRuleset; + rulesetGetRuleset(&(pMsg->pRuleset), rsCStrGetSzStrNoNULL(rulesetName)); } /* set TAG in msg object * (rewritten 2009-06-18 rgerhards) */ -void MsgSetTAG(msg_t * const pMsg, uchar* pszBuf, size_t lenBuf) +void MsgSetTAG(msg_t *pMsg, uchar* pszBuf, size_t lenBuf) { uchar *pBuf; assert(pMsg != NULL); @@ -1974,7 +1719,7 @@ * if there is a TAG and, if not, if it can emulate it. * rgerhards, 2005-11-24 */ -static inline void tryEmulateTAG(msg_t * const pM, sbool bLockMutex) +static inline void tryEmulateTAG(msg_t *pM, sbool bLockMutex) { size_t lenTAG; uchar bufTAG[CONF_TAG_MAXSIZE]; @@ -1988,7 +1733,7 @@ return; /* done, no need to emulate */ } - if(msgGetProtocolVersion(pM) == 1) { + if(getProtocolVersion(pM) == 1) { if(!strcmp(getPROCID(pM, MUTEX_ALREADY_LOCKED), "-")) { /* no process ID, use APP-NAME only */ MsgSetTAG(pM, (uchar*) getAPPNAME(pM, MUTEX_ALREADY_LOCKED), getAPPNAMELen(pM, MUTEX_ALREADY_LOCKED)); @@ -2006,7 +1751,7 @@ void -getTAG(msg_t * const pM, uchar **ppBuf, int *piLen) +getTAG(msg_t *pM, uchar **ppBuf, int *piLen) { if(pM == NULL) { *ppBuf = UCHAR_CONSTANT(""); @@ -2025,7 +1770,7 @@ } -int getHOSTNAMELen(msg_t * const pM) +int getHOSTNAMELen(msg_t *pM) { if(pM == NULL) return 0; @@ -2041,7 +1786,7 @@ } -char *getHOSTNAME(msg_t * const pM) +char *getHOSTNAME(msg_t *pM) { if(pM == NULL) return ""; @@ -2062,7 +1807,7 @@ } -uchar *getRcvFrom(msg_t * const pM) +uchar *getRcvFrom(msg_t *pM) { uchar *psz; int len; @@ -2084,51 +1829,96 @@ /* rgerhards 2004-11-24: set STRUCTURED DATA in msg object */ -rsRetVal MsgSetStructuredData(msg_t * const pMsg, char* pszStrucData) +rsRetVal MsgSetStructuredData(msg_t *pMsg, char* pszStrucData) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); - free(pMsg->pszStrucData); - CHKmalloc(pMsg->pszStrucData = (uchar*)strdup(pszStrucData)); - pMsg->lenStrucData = strlen(pszStrucData); + if(pMsg->pCSStrucData == NULL) { + /* we need to obtain the object first */ + CHKiRet(rsCStrConstruct(&pMsg->pCSStrucData)); + } + /* if we reach this point, we have the object */ + iRet = rsCStrSetSzStr(pMsg->pCSStrucData, (uchar*) pszStrucData); + finalize_it: RETiRet; } +/* get the length of the "STRUCTURED-DATA" sz string + * rgerhards, 2005-11-24 + */ +#if 0 /* This method is currently not called, be we like to preserve it */ +static int getStructuredDataLen(msg_t *pM) +{ + return (pM->pCSStrucData == NULL) ? 1 : rsCStrLen(pM->pCSStrucData); +} +#endif -/* get the "STRUCTURED-DATA" as sz string, including length */ -void -MsgGetStructuredData(msg_t * const pM, uchar **pBuf, rs_size_t *len) + +/* get the "STRUCTURED-DATA" as sz string + * rgerhards, 2005-11-24 + */ +static inline char *getStructuredData(msg_t *pM) { + uchar *pszRet; + MsgLock(pM); - if(pM->pszStrucData == NULL) { - *pBuf = UCHAR_CONSTANT("-"), - *len = 1; - } else { - *pBuf = pM->pszStrucData, - *len = pM->lenStrucData; - } + if(pM->pCSStrucData == NULL) + pszRet = UCHAR_CONSTANT("-"); + else + pszRet = rsCStrGetSzStrNoNULL(pM->pCSStrucData); MsgUnlock(pM); + return (char*) pszRet; } -/* get the "programname" as sz string - * rgerhards, 2005-10-19 + +/* check if we have a ProgramName, and, if not, try to aquire/emulate it. + * rgerhards, 2009-06-26 */ -uchar *getProgramName(msg_t * const pM, sbool bLockMutex) +static inline void prepareProgramName(msg_t *pM, sbool bLockMutex) { - if(pM->iLenPROGNAME == -1) { - if(bLockMutex == LOCK_MUTEX) { + if(pM->pCSProgName == NULL) { + if(bLockMutex == LOCK_MUTEX) MsgLock(pM); - /* need to re-check, things may have change in between! */ - if(pM->iLenPROGNAME == -1) - aquireProgramName(pM); - MsgUnlock(pM); - } else { + + /* re-query as things might have changed during locking */ + if(pM->pCSProgName == NULL) aquireProgramName(pM); - } + + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); } - return (pM->iLenPROGNAME < CONF_PROGNAME_BUFSIZE) ? pM->PROGNAME.szBuf - : pM->PROGNAME.ptr; +} + + +/* get the length of the "programname" sz string + * rgerhards, 2005-10-19 + */ +int getProgramNameLen(msg_t *pM, sbool bLockMutex) +{ + assert(pM != NULL); + prepareProgramName(pM, bLockMutex); + return (pM->pCSProgName == NULL) ? 0 : rsCStrLen(pM->pCSProgName); +} + + +/* get the "programname" as sz string + * rgerhards, 2005-10-19 + */ +uchar *getProgramName(msg_t *pM, sbool bLockMutex) +{ + uchar *pszRet; + + if(bLockMutex == LOCK_MUTEX) + MsgLock(pM); + prepareProgramName(pM, MUTEX_ALREADY_LOCKED); + if(pM->pCSProgName == NULL) + pszRet = UCHAR_CONSTANT(""); + else + pszRet = rsCStrGetSzStrNoNULL(pM->pCSProgName); + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + return pszRet; } @@ -2137,13 +1927,13 @@ * now would like to send out the same one via syslog-protocol. * MUST be called with the Msg Lock locked! */ -static void tryEmulateAPPNAME(msg_t * const pM) +static void tryEmulateAPPNAME(msg_t *pM) { assert(pM != NULL); if(pM->pCSAPPNAME != NULL) return; /* we are already done */ - if(msgGetProtocolVersion(pM) == 0) { + if(getProtocolVersion(pM) == 0) { /* only then it makes sense to emulate */ MsgSetAPPNAME(pM, (char*)getProgramName(pM, MUTEX_ALREADY_LOCKED)); } @@ -2155,7 +1945,7 @@ * This must be called WITHOUT the message lock being held. * rgerhards, 2009-06-26 */ -static inline void prepareAPPNAME(msg_t * const pM, sbool bLockMutex) +static inline void prepareAPPNAME(msg_t *pM, sbool bLockMutex) { if(pM->pCSAPPNAME == NULL) { if(bLockMutex == LOCK_MUTEX) @@ -2172,7 +1962,7 @@ /* rgerhards, 2005-11-24 */ -char *getAPPNAME(msg_t * const pM, sbool bLockMutex) +char *getAPPNAME(msg_t *pM, sbool bLockMutex) { uchar *pszRet; @@ -2191,7 +1981,7 @@ /* rgerhards, 2005-11-24 */ -static int getAPPNAMELen(msg_t * const pM, sbool bLockMutex) +static int getAPPNAMELen(msg_t *pM, sbool bLockMutex) { assert(pM != NULL); prepareAPPNAME(pM, bLockMutex); @@ -2213,15 +2003,6 @@ pThis->pInputName = inputName; } -/* Set default TZ. Note that at most 7 chars are set, as we would - * otherwise overrun our buffer! - */ -void MsgSetDfltTZ(msg_t *pThis, char *tz) -{ - strncpy(pThis->dfltTZ, tz, 7); - pThis->dfltTZ[7] = '\0'; /* ensure 0-Term in case of overflow! */ -} - /* Set the pfrominet socket store, so that we can obtain the peer at some * later time. Note that we do not check if pRcvFrom is already set, so this @@ -2244,6 +2025,7 @@ RETiRet; } + /* rgerhards 2008-09-10: set RcvFrom name in msg object. This calls AddRef() * on the property, because this must be done in all current cases and there * is no case expected where this may not be necessary. @@ -2251,8 +2033,18 @@ */ void MsgSetRcvFrom(msg_t *pThis, prop_t *new) { + assert(pThis != NULL); + prop.AddRef(new); - MsgSetRcvFromWithoutAddRef(pThis, new); + if(pThis->msgFlags & NEEDS_DNSRESOL) { + if(pThis->rcvFrom.pfrominet != NULL) + free(pThis->rcvFrom.pfrominet); + pThis->msgFlags &= ~NEEDS_DNSRESOL; + } else { + if(pThis->rcvFrom.pRcvFrom != NULL) + prop.Destruct(&pThis->rcvFrom.pRcvFrom); + } + pThis->rcvFrom.pRcvFrom = new; } @@ -2285,7 +2077,9 @@ BEGINfunc prop.AddRef(new); - MsgSetRcvFromIPWithoutAddRef(pThis, new); + if(pThis->pRcvFromIP != NULL) + prop.Destruct(&pThis->pRcvFromIP); + pThis->pRcvFromIP = new; ENDfunc return RS_RET_OK; } @@ -2348,7 +2142,7 @@ * (exactly by one). This can happen if we have a message that does not * contain any MSG part. */ -void MsgSetMSGoffs(msg_t * const pMsg, short offs) +void MsgSetMSGoffs(msg_t *pMsg, short offs) { ISOBJ_TYPE_assert(pMsg, msg); pMsg->offMSG = offs; @@ -2401,6 +2195,7 @@ RETiRet; } + /* set raw message in message object. Size of message is provided. * The function makes sure that the stored rawmsg is properly * terminated by '\0'. @@ -2432,27 +2227,28 @@ * try to remove it altogether). * rgerhards, 2009-06-16 */ -void MsgSetRawMsgWOSize(msg_t * const pMsg, char* pszRawMsg) +void MsgSetRawMsgWOSize(msg_t *pMsg, char* pszRawMsg) { MsgSetRawMsg(pMsg, pszRawMsg, strlen(pszRawMsg)); } /* Decode a priority into textual information like auth.emerg. - * The variable pRes must point to a user-supplied buffer. - * The pointer to the buffer + * The variable pRes must point to a user-supplied buffer and + * pResLen must contain its size. The pointer to the buffer * is also returned, what makes this functiona suitable for * use in printf-like functions. * Note: a buffer size of 20 characters is always sufficient. + * Interface to this function changed 2007-06-15 by RGerhards */ -char *textpri(char *pRes, int pri) +char *textpri(char *pRes, size_t pResLen, int pri) { assert(pRes != NULL); - memcpy(pRes, syslog_fac_names[LOG_FAC(pri)], len_syslog_fac_names[LOG_FAC(pri)]); - pRes[len_syslog_fac_names[LOG_FAC(pri)]] = '.'; - memcpy(pRes+len_syslog_fac_names[LOG_FAC(pri)]+1, - syslog_severity_names[LOG_PRI(pri)], - len_syslog_severity_names[LOG_PRI(pri)]+1 /* for \0! */); + assert(pResLen > 0); + + snprintf(pRes, pResLen, "%s.%s<%d>", syslog_fac_names[LOG_FAC(pri)], + syslog_severity_names[LOG_PRI(pri)], pri); + return pRes; } @@ -2466,54 +2262,40 @@ */ typedef enum ENOWType { NOW_NOW, NOW_YEAR, NOW_MONTH, NOW_DAY, NOW_HOUR, NOW_HHOUR, NOW_QHOUR, NOW_MINUTE } eNOWType; #define tmpBUFSIZE 16 /* size of formatting buffer */ -static uchar *getNOW(eNOWType eNow, struct syslogTime *t) +static uchar *getNOW(eNOWType eNow) { uchar *pBuf; - struct syslogTime tt; + struct syslogTime t; if((pBuf = (uchar*) MALLOC(sizeof(uchar) * tmpBUFSIZE)) == NULL) { return NULL; } - if(t == NULL) { /* can happen if called via script engine */ - datetime.getCurrTime(&tt, NULL); - t = &tt; - } - - if(t->year == 0) { /* not yet set! */ - datetime.getCurrTime(t, NULL); - } - + datetime.getCurrTime(&t, NULL); switch(eNow) { case NOW_NOW: - memcpy(pBuf, two_digits[t->year/100], 2); - memcpy(pBuf+2, two_digits[t->year%100], 2); - pBuf[4] = '-'; - memcpy(pBuf+5, two_digits[(int)t->month], 2); - pBuf[7] = '-'; - memcpy(pBuf+8, two_digits[(int)t->day], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%4.4d-%2.2d-%2.2d", t.year, t.month, t.day); break; case NOW_YEAR: - memcpy(pBuf, two_digits[t->year/100], 2); - memcpy(pBuf+2, two_digits[t->year%100], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%4.4d", t.year); break; case NOW_MONTH: - memcpy(pBuf, two_digits[(int)t->month], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%2.2d", t.month); break; case NOW_DAY: - memcpy(pBuf, two_digits[(int)t->day], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%2.2d", t.day); break; case NOW_HOUR: - memcpy(pBuf, two_digits[(int)t->hour], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%2.2d", t.hour); break; case NOW_HHOUR: - memcpy(pBuf, two_digits[t->minute/30], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%2.2d", t.minute / 30); break; case NOW_QHOUR: - memcpy(pBuf, two_digits[t->minute/15], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%2.2d", t.minute / 15); break; case NOW_MINUTE: - memcpy(pBuf, two_digits[(int)t->minute], 3); + snprintf((char*) pBuf, tmpBUFSIZE, "%2.2d", t.minute); break; } @@ -2522,262 +2304,6 @@ #undef tmpBUFSIZE /* clean up */ -/* Get a JSON-Property as string value (used for various types of JSON-based vars) */ -rsRetVal -getJSONPropVal(msg_t * const pMsg, msgPropDescr_t *pProp, uchar **pRes, rs_size_t *buflen, unsigned short *pbMustBeFreed) -{ - uchar *leaf; - struct json_object *jroot; - struct json_object *parent; - struct json_object *field; - DEFiRet; - - if(*pbMustBeFreed) - free(*pRes); - *pRes = NULL; - - if(pProp->id == PROP_CEE) { - jroot = pMsg->json; - } else if(pProp->id == PROP_LOCAL_VAR) { - jroot = pMsg->localvars; - } else if(pProp->id == PROP_GLOBAL_VAR) { - pthread_rwlock_rdlock(&glblVars_rwlock); - jroot = global_var_root; - } else { - DBGPRINTF("msgGetJSONPropVal; invalid property id %d\n", - pProp->id); - ABORT_FINALIZE(RS_RET_NOT_FOUND); - } - if(jroot == NULL) goto finalize_it; - - if(!strcmp((char*)pProp->name, "!")) { - field = jroot; - } else { - leaf = jsonPathGetLeaf(pProp->name, pProp->nameLen); - CHKiRet(jsonPathFindParent(jroot, pProp->name, leaf, &parent, 1)); - field = json_object_object_get(parent, (char*)leaf); - } - if(field != NULL) { - *pRes = (uchar*) strdup(json_object_get_string(field)); - *buflen = (int) ustrlen(*pRes); - *pbMustBeFreed = 1; - } - -finalize_it: - if(pProp->id == PROP_GLOBAL_VAR) - pthread_rwlock_unlock(&glblVars_rwlock); - if(*pRes == NULL) { - /* could not find any value, so set it to empty */ - *pRes = (unsigned char*)""; - *pbMustBeFreed = 0; - } - RETiRet; -} - - -/* Get a JSON-based-variable as native json object */ -rsRetVal -msgGetJSONPropJSON(msg_t * const pMsg, msgPropDescr_t *pProp, struct json_object **pjson) -{ - struct json_object *jroot; - uchar *leaf; - struct json_object *parent; - DEFiRet; - - if(pProp->id == PROP_CEE) { - jroot = pMsg->json; - } else if(pProp->id == PROP_LOCAL_VAR) { - jroot = pMsg->localvars; - } else if(pProp->id == PROP_GLOBAL_VAR) { - pthread_rwlock_rdlock(&glblVars_rwlock); - jroot = global_var_root; - } else { - DBGPRINTF("msgGetJSONPropJSON; invalid property id %d\n", - pProp->id); - ABORT_FINALIZE(RS_RET_NOT_FOUND); - } - if(jroot == NULL) { - DBGPRINTF("msgGetJSONPropJSON; jroot empty for property %s\n", - pProp->name); - ABORT_FINALIZE(RS_RET_NOT_FOUND); - } - - if(!strcmp((char*)pProp->name, "!")) { - *pjson = jroot; - FINALIZE; - } - leaf = jsonPathGetLeaf(pProp->name, pProp->nameLen); - CHKiRet(jsonPathFindParent(jroot, pProp->name, leaf, &parent, 1)); - *pjson = json_object_object_get(parent, (char*)leaf); - if(*pjson == NULL) { - ABORT_FINALIZE(RS_RET_NOT_FOUND); - } - -finalize_it: - if(pProp->id == PROP_GLOBAL_VAR) - pthread_rwlock_unlock(&glblVars_rwlock); - RETiRet; -} - - -/* Encode a JSON value and add it to provided string. Note that - * the string object may be NULL. In this case, it is created - * if and only if escaping is needed. - */ -static rsRetVal -jsonAddVal(uchar *pSrc, unsigned buflen, es_str_t **dst) -{ - unsigned char c; - es_size_t i; - char numbuf[4]; - int j; - DEFiRet; - - for(i = 0 ; i < buflen ; ++i) { - c = pSrc[i]; - if( (c >= 0x23 && c <= 0x5b) - || (c >= 0x5d /* && c <= 0x10FFFF*/) - || c == 0x20 || c == 0x21) { - /* no need to escape */ - if(*dst != NULL) - es_addChar(dst, c); - } else { - if(*dst == NULL) { - if(i == 0) { - /* we hope we have only few escapes... */ - *dst = es_newStr(buflen+10); - } else { - *dst = es_newStrFromBuf((char*)pSrc, i); - } - if(*dst == NULL) { - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - } - } - /* we must escape, try RFC4627-defined special sequences first */ - switch(c) { - case '\0': - es_addBuf(dst, "\\u0000", 6); - break; - case '\"': - es_addBuf(dst, "\\\"", 2); - break; - case '/': - es_addBuf(dst, "\\/", 2); - break; - case '\\': - es_addBuf(dst, "\\\\", 2); - break; - case '\010': - es_addBuf(dst, "\\b", 2); - break; - case '\014': - es_addBuf(dst, "\\f", 2); - break; - case '\n': - es_addBuf(dst, "\\n", 2); - break; - case '\r': - es_addBuf(dst, "\\r", 2); - break; - case '\t': - es_addBuf(dst, "\\t", 2); - break; - default: - /* TODO : proper Unicode encoding (see header comment) */ - for(j = 0 ; j < 4 ; ++j) { - numbuf[3-j] = hexdigit[c % 16]; - c = c / 16; - } - es_addBuf(dst, "\\u", 2); - es_addBuf(dst, numbuf, 4); - break; - } - } - } -finalize_it: - RETiRet; -} - - -/* encode a property in JSON escaped format. This is a helper - * to MsgGetProp. It needs to update all provided parameters. - * Note: Code is borrowed from libee (my own code, so ASL 2.0 - * is fine with it); this function may later be replaced by - * some "better" and more complete implementation (maybe from - * libee or its helpers). - * For performance reasons, we begin to copy the string only - * when we recognice that we actually need to do some escaping. - * rgerhards, 2012-03-16 - */ -static rsRetVal -jsonEncode(uchar **ppRes, unsigned short *pbMustBeFreed, int *pBufLen) -{ - unsigned buflen; - uchar *pSrc; - es_str_t *dst = NULL; - DEFiRet; - - pSrc = *ppRes; - buflen = (*pBufLen == -1) ? ustrlen(pSrc) : *pBufLen; - CHKiRet(jsonAddVal(pSrc, buflen, &dst)); - - if(dst != NULL) { - /* we updated the string and need to replace the - * previous data. - */ - if(*pbMustBeFreed) - free(*ppRes); - *ppRes = (uchar*)es_str2cstr(dst, NULL); - *pbMustBeFreed = 1; - *pBufLen = -1; - es_deleteStr(dst); - } - -finalize_it: - RETiRet; -} - - -/* Format a property as JSON field, that means - * "name"="value" - * where value is JSON-escaped (here we assume that the name - * only contains characters from the valid character set). - * Note: this function duplicates code from jsonEncode(). - * TODO: these two functions should be combined, at least if - * that makes any sense from a performance PoV - definitely - * something to consider at a later stage. rgerhards, 2012-04-19 - */ -static rsRetVal -jsonField(struct templateEntry *pTpe, uchar **ppRes, unsigned short *pbMustBeFreed, int *pBufLen) -{ - unsigned buflen; - uchar *pSrc; - es_str_t *dst = NULL; - DEFiRet; - - pSrc = *ppRes; - buflen = (*pBufLen == -1) ? ustrlen(pSrc) : *pBufLen; - /* we hope we have only few escapes... */ - dst = es_newStr(buflen+pTpe->lenFieldName+15); - es_addChar(&dst, '"'); - es_addBuf(&dst, (char*)pTpe->fieldName, pTpe->lenFieldName); - es_addBufConstcstr(&dst, "\":\""); - CHKiRet(jsonAddVal(pSrc, buflen, &dst)); - es_addChar(&dst, '"'); - - if(*pbMustBeFreed) - free(*ppRes); - /* we know we do not have \0 chars - so the size does not change */ - *pBufLen = es_strlen(dst); - *ppRes = (uchar*)es_str2cstr(dst, NULL); - *pbMustBeFreed = 1; - es_deleteStr(dst); - -finalize_it: - RETiRet; -} - - /* This function returns a string-representation of the * requested message property. This is a generic function used * to abstract properties so that these can be easier @@ -2804,7 +2330,7 @@ * Parameter "bMustBeFreed" is set by this function. It tells the * caller whether or not the string returned must be freed by the * caller itself. It is is 0, the caller MUST NOT free it. If it is - * 1, the caller MUST free it. Handling this wrongly leads to either + * 1, the caller MUST free 1. Handling this wrongly leads to either * a memory leak of a program abort (do to double-frees or frees on * the constant memory pool). So be careful to do it right. * rgerhards 2004-11-23 @@ -2819,17 +2345,16 @@ #define RET_OUT_OF_MEMORY { *pbMustBeFreed = 0;\ *pPropLen = sizeof("**OUT OF MEMORY**") - 1; \ return(UCHAR_CONSTANT("**OUT OF MEMORY**"));} -uchar *MsgGetProp(msg_t * const pMsg, struct templateEntry *pTpe, - msgPropDescr_t *pProp, rs_size_t *pPropLen, - unsigned short *pbMustBeFreed, struct syslogTime *ttNow) +uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, + propid_t propID, size_t *pPropLen, + unsigned short *pbMustBeFreed) { uchar *pRes; /* result pointer */ - rs_size_t bufLen = -1; /* length of string or -1, if not known */ + int bufLen = -1; /* length of string or -1, if not known */ uchar *pBufStart; uchar *pBuf; int iLen; short iOffs; - enum tplFormatTypes datefmt; BEGINfunc assert(pMsg != NULL); @@ -2843,17 +2368,13 @@ *pbMustBeFreed = 0; - switch(pProp->id) { + switch(propID) { case PROP_MSG: pRes = getMSG(pMsg); bufLen = getMSGLen(pMsg); break; case PROP_TIMESTAMP: - if (pTpe != NULL) - datefmt = pTpe->data.field.eDateFormat; - else - datefmt = tplFmtDefault; - pRes = (uchar*)getTimeReported(pMsg, datefmt); + pRes = (uchar*)getTimeReported(pMsg, pTpe->data.field.eDateFormat); break; case PROP_HOSTNAME: pRes = (uchar*)getHOSTNAME(pMsg); @@ -2865,6 +2386,12 @@ case PROP_RAWMSG: getRawMsg(pMsg, &pRes, &bufLen); break; + /* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 + case PROP_UXTRADMSG: + pRes = getUxTradMsg(pMsg); + break; + */ case PROP_INPUTNAME: getInputName(pMsg, &pRes, &bufLen); break; @@ -2883,7 +2410,7 @@ RET_OUT_OF_MEMORY; } else { *pbMustBeFreed = 1; - pRes = (uchar*)textpri((char*)pBuf, getPRIi(pMsg)); + pRes = (uchar*)textpri((char*)pBuf, 20, getPRIi(pMsg)); } break; case PROP_IUT: @@ -2903,11 +2430,7 @@ pRes = (uchar*)getSeverityStr(pMsg); break; case PROP_TIMEGENERATED: - if (pTpe != NULL) - datefmt = pTpe->data.field.eDateFormat; - else - datefmt = tplFmtDefault; - pRes = (uchar*)getTimeGenerated(pMsg, datefmt); + pRes = (uchar*)getTimeGenerated(pMsg, pTpe->data.field.eDateFormat); break; case PROP_PROGRAMNAME: pRes = getProgramName(pMsg, LOCK_MUTEX); @@ -2916,7 +2439,7 @@ pRes = (uchar*)getProtocolVersionString(pMsg); break; case PROP_STRUCTURED_DATA: - MsgGetStructuredData(pMsg, &pRes, &bufLen); + pRes = (uchar*)getStructuredData(pMsg); break; case PROP_APP_NAME: pRes = (uchar*)getAPPNAME(pMsg, LOCK_MUTEX); @@ -2927,166 +2450,75 @@ case PROP_MSGID: pRes = (uchar*)getMSGID(pMsg); break; -#ifdef USE_LIBUUID - case PROP_UUID: - getUUID(pMsg, &pRes, &bufLen); - break; -#endif - case PROP_PARSESUCCESS: - pRes = (uchar*)getParseSuccess(pMsg); - break; case PROP_SYS_NOW: - if((pRes = getNOW(NOW_NOW, ttNow)) == NULL) { + if((pRes = getNOW(NOW_NOW)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 10; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_YEAR: - if((pRes = getNOW(NOW_YEAR, ttNow)) == NULL) { + if((pRes = getNOW(NOW_YEAR)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 4; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_MONTH: - if((pRes = getNOW(NOW_MONTH, ttNow)) == NULL) { + if((pRes = getNOW(NOW_MONTH)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 2; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_DAY: - if((pRes = getNOW(NOW_DAY, ttNow)) == NULL) { + if((pRes = getNOW(NOW_DAY)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 2; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_HOUR: - if((pRes = getNOW(NOW_HOUR, ttNow)) == NULL) { + if((pRes = getNOW(NOW_HOUR)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 2; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_HHOUR: - if((pRes = getNOW(NOW_HHOUR, ttNow)) == NULL) { + if((pRes = getNOW(NOW_HHOUR)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 2; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_QHOUR: - if((pRes = getNOW(NOW_QHOUR, ttNow)) == NULL) { + if((pRes = getNOW(NOW_QHOUR)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 2; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_MINUTE: - if((pRes = getNOW(NOW_MINUTE, ttNow)) == NULL) { + if((pRes = getNOW(NOW_MINUTE)) == NULL) { RET_OUT_OF_MEMORY; - } else { - *pbMustBeFreed = 1; - bufLen = 2; - } + } else + *pbMustBeFreed = 1; /* all of these functions allocate dyn. memory */ break; case PROP_SYS_MYHOSTNAME: pRes = glbl.GetLocalHostName(); break; - case PROP_CEE_ALL_JSON: - if(pMsg->json == NULL) { - if(*pbMustBeFreed == 1) - free(pRes); - pRes = (uchar*) "{}"; - bufLen = 2; - *pbMustBeFreed = 0; - } else { - pRes = (uchar*)strdup(json_object_get_string(pMsg->json)); - *pbMustBeFreed = 1; - } - break; - case PROP_CEE: - case PROP_LOCAL_VAR: - case PROP_GLOBAL_VAR: - getJSONPropVal(pMsg, pProp, &pRes, &bufLen, pbMustBeFreed); - break; case PROP_SYS_BOM: if(*pbMustBeFreed == 1) free(pRes); pRes = (uchar*) "\xEF\xBB\xBF"; *pbMustBeFreed = 0; break; - case PROP_SYS_UPTIME: -# ifndef HAVE_SYSINFO_UPTIME - /* An alternative on some systems (eg Solaris) is to scan - * /var/adm/utmpx for last boot time. - */ - pRes = (uchar*) "UPTIME NOT available on this system"; - *pbMustBeFreed = 0; - -# elif defined(__FreeBSD__) - - { - struct timespec tp; - - if(*pbMustBeFreed == 1) - free(pRes); - if((pRes = (uchar*) MALLOC(sizeof(uchar) * 32)) == NULL) { - RET_OUT_OF_MEMORY; - } - *pbMustBeFreed = 1; - - if(clock_gettime(CLOCK_UPTIME, &tp) == -1) { - *pPropLen = sizeof("**SYSCALL FAILED**") - 1; - return(UCHAR_CONSTANT("**SYSCALL FAILED**")); - } - - snprintf((char*) pRes, sizeof(uchar) * 32, "%ld", tp.tv_sec); - } - -# else - - { - struct sysinfo s_info; - - if(*pbMustBeFreed == 1) - free(pRes); - if((pRes = (uchar*) MALLOC(sizeof(uchar) * 32)) == NULL) { - RET_OUT_OF_MEMORY; - } - *pbMustBeFreed = 1; - - if(sysinfo(&s_info) < 0) { - *pPropLen = sizeof("**SYSCALL FAILED**") - 1; - return(UCHAR_CONSTANT("**SYSCALL FAILED**")); - } - - snprintf((char*) pRes, sizeof(uchar) * 32, "%ld", s_info.uptime); - } -# endif - break; default: /* there is no point in continuing, we may even otherwise render the * error message unreadable. rgerhards, 2007-07-10 */ - dbgprintf("invalid property id: '%d'\n", pProp->id); + dbgprintf("invalid property id: '%d'\n", propID); *pbMustBeFreed = 0; *pPropLen = sizeof("**INVALID PROPERTY NAME**") - 1; return UCHAR_CONSTANT("**INVALID PROPERTY NAME**"); } /* If we did not receive a template pointer, we are already done... */ - if(pTpe == NULL || !pTpe->bComplexProcessing) { - *pPropLen = (bufLen == -1) ? ustrlen(pRes) : bufLen; + if(pTpe == NULL) { return pRes; } @@ -3292,18 +2724,13 @@ uchar *pSb; iFrom = pTpe->data.field.iFromPos; iTo = pTpe->data.field.iToPos; + /* need to zero-base to and from (they are 1-based!) */ + if(iFrom > 0) + --iFrom; + if(iTo > 0) + --iTo; if(bufLen == -1) bufLen = ustrlen(pRes); - if(pTpe->data.field.options.bFromPosEndRelative) { - iFrom = (bufLen < iFrom) ? 0 : bufLen - iFrom; - iTo = (bufLen < iTo)? 0 : bufLen - iTo; - } else { - /* need to zero-base to and from (they are 1-based!) */ - if(iFrom > 0) - --iFrom; - if(iTo > 0) - --iTo; - } if(iFrom == 0 && iTo >= bufLen) { /* in this case, the requested string is a superset of what we already have, * so there is no need to do any processing. This is a frequent case for size-limited @@ -3312,8 +2739,6 @@ */ ; /*DO NOTHING*/ } else { - if(iTo > bufLen) /* iTo is very large, if no to-position is set in the template! */ - iTo = bufLen; iLen = iTo - iFrom + 1; /* the +1 is for an actual char, NOT \0! */ pBufStart = pBuf = MALLOC((iLen + 1) * sizeof(char)); if(pBuf == NULL) { @@ -3515,6 +2940,7 @@ } } +dbgprintf("prop repl 4, pRes='%s', len %d\n", pRes, bufLen); /* Take care of spurious characters to make the property safe * for a path definition */ @@ -3638,8 +3064,8 @@ } } - /* finally, we need to check if the property should be formatted in CSV or JSON. - * For CSV we use RFC 4180, and always use double quotes. As of this writing, + /* finally, we need to check if the property should be formatted in CSV + * format (we use RFC 4180, and always use double quotes). As of this writing, * this should be the last action carried out on the property, but in the * future there may be reasons to change that. -- rgerhards, 2009-04-02 */ @@ -3673,19 +3099,60 @@ pRes = pBStart; bufLen = -1; *pbMustBeFreed = 1; - } else if(pTpe->data.field.options.bJSON) { - jsonEncode(&pRes, pbMustBeFreed, &bufLen); - } else if(pTpe->data.field.options.bJSONf) { - jsonField(pTpe, &pRes, pbMustBeFreed, &bufLen); } - *pPropLen = (bufLen == -1) ? ustrlen(pRes) : bufLen; + if(bufLen == -1) + bufLen = ustrlen(pRes); + *pPropLen = bufLen; +dbgprintf("end prop repl, pRes='%s', len %d\n", pRes, bufLen); ENDfunc return(pRes); } +/* The returns a message variable suitable for use with RainerScript. Most importantly, this means + * that the value is returned in a var_t object. The var_t is constructed inside this function and + * MUST be freed by the caller. + * rgerhards, 2008-02-25 + */ +rsRetVal +msgGetMsgVar(msg_t *pThis, cstr_t *pstrPropName, var_t **ppVar) +{ + DEFiRet; + var_t *pVar; + size_t propLen; + uchar *pszProp = NULL; + cstr_t *pstrProp; + propid_t propid; + unsigned short bMustBeFreed = 0; + + ISOBJ_TYPE_assert(pThis, msg); + ASSERT(pstrPropName != NULL); + ASSERT(ppVar != NULL); + + /* make sure we have a var_t instance */ + CHKiRet(var.Construct(&pVar)); + CHKiRet(var.ConstructFinalize(pVar)); + + /* always call MsgGetProp() without a template specifier */ + /* TODO: optimize propNameToID() call -- rgerhards, 2009-06-26 */ + propNameToID(pstrPropName, &propid); + pszProp = (uchar*) MsgGetProp(pThis, NULL, propid, &propLen, &bMustBeFreed); + + /* now create a string object out of it and hand that over to the var */ + CHKiRet(rsCStrConstructFromszStr(&pstrProp, pszProp)); + CHKiRet(var.SetString(pVar, pstrProp)); + + /* finally store var */ + *ppVar = pVar; + +finalize_it: + if(bMustBeFreed) + free(pszProp); + + RETiRet; +} /* This function can be used as a generic way to set properties. * We have to handle a lot of legacy, so our return value is not always * 100% correct (called functions do not always provide one, should @@ -3698,8 +3165,6 @@ prop_t *myProp; prop_t *propRcvFrom = NULL; prop_t *propRcvFromIP = NULL; - struct json_tokener *tokener; - struct json_object *json; DEFiRet; ISOBJ_TYPE_assert(pThis, msg); @@ -3717,6 +3182,11 @@ MsgSetMSGoffs(pThis, pProp->val.num); } else if(isProp("pszRawMsg")) { MsgSetRawMsg(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr), cstrLen(pProp->val.pStr)); + /* enable this, if someone actually uses UxTradMsg, delete after some time has + * passed and nobody complained -- rgerhards, 2009-06-16 + } else if(isProp("offAfterPRI")) { + pThis->offAfterPRI = pProp->val.num; + */ } else if(isProp("pszUxTradMsg")) { /*IGNORE*/; /* this *was* a property, but does no longer exist */ } else if(isProp("pszTAG")) { @@ -3736,7 +3206,7 @@ prop.Destruct(&propRcvFrom); } else if(isProp("pszHOSTNAME")) { MsgSetHOSTNAME(pThis, rsCStrGetSzStrNoNULL(pProp->val.pStr), rsCStrLen(pProp->val.pStr)); - } else if(isProp("pszStrucData")) { + } else if(isProp("pCSStrucData")) { MsgSetStructuredData(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); } else if(isProp("pCSAPPNAME")) { MsgSetAPPNAME(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); @@ -3754,12 +3224,6 @@ MsgSetRulesetByName(pThis, pProp->val.pStr); } else if(isProp("pszMSG")) { dbgprintf("no longer supported property pszMSG silently ignored\n"); - } else if(isProp("json")) { - tokener = json_tokener_new(); - json = json_tokener_parse_ex(tokener, (char*)rsCStrGetSzStrNoNULL(pProp->val.pStr), - cstrLen(pProp->val.pStr)); - json_tokener_free(tokener); - msgAddJSON(pThis, (uchar*)"!", json); } else { dbgprintf("unknown supported property '%s' silently ignored\n", rsCStrGetSzStrNoNULL(pProp->pcsName)); @@ -3771,409 +3235,29 @@ #undef isProp -/* get the severity - this is an entry point that - * satisfies the base object class getSeverity semantics. - * rgerhards, 2008-01-14 +/* This is a construction finalizer that must be called after all properties + * have been set. It does some final work on the message object. After this + * is done, the object is considered ready for full processing. + * rgerhards, 2008-07-08 */ -rsRetVal -MsgGetSeverity(msg_t * const pMsg, int *piSeverity) +static rsRetVal msgConstructFinalizer(msg_t *pThis) { - *piSeverity = pMsg->iSeverity; + MsgPrepareEnqueue(pThis); return RS_RET_OK; } -static uchar * -jsonPathGetLeaf(uchar *name, int lenName) -{ - int i; - for(i = lenName ; i >= 0 ; --i) - if(i == 0) { - if(name[0] == '!' || name[0] == '.' || name[0] == '/') - break; - } else { - if(name[i] == '!') - break; - } - if(name[i] == '!' || name[i] == '.' || name[i] == '/') - ++i; - return name + i; -} - - -static rsRetVal -jsonPathFindNext(struct json_object *root, uchar *namestart, uchar **name, uchar *leaf, - struct json_object **found, int bCreate) -{ - uchar namebuf[1024]; - struct json_object *json; - size_t i; - uchar *p = *name; - DEFiRet; - - if(*p == '!' || (*name == namestart && (*p == '.' || *p == '/'))) - ++p; - for(i = 0 ; *p && !(p == namestart && (*p == '.' || *p == '/')) && *p != '!' && p != leaf && i < sizeof(namebuf)-1 ; ++i, ++p) - namebuf[i] = *p; - if(i > 0) { - namebuf[i] = '\0'; - dbgprintf("AAAA: next JSONPath elt: '%s'\n", namebuf); - json = json_object_object_get(root, (char*)namebuf); - } else - json = root; - if(json == NULL) { - if(!bCreate) { - ABORT_FINALIZE(RS_RET_JNAME_INVALID); - } else { - json = json_object_new_object(); - json_object_object_add(root, (char*)namebuf, json); - } - } - - *name = p; - *found = json; -finalize_it: - RETiRet; -} - -static rsRetVal -jsonPathFindParent(struct json_object *jroot, uchar *name, uchar *leaf, struct json_object **parent, int bCreate) -{ - uchar *namestart; - DEFiRet; - namestart = name; - *parent = jroot; - while(name < leaf-1) { - jsonPathFindNext(*parent, namestart, &name, leaf, parent, bCreate); - } - RETiRet; -} - -static rsRetVal -jsonMerge(struct json_object *existing, struct json_object *json) -{ - /* TODO: check & handle duplicate names */ - DEFiRet; - struct json_object_iter it; - - json_object_object_foreachC(json, it) { -DBGPRINTF("AAAA jsonMerge adds '%s'\n", it.key); - json_object_object_add(existing, it.key, - json_object_get(it.val)); - } - /* note: json-c does ref counting. We added all descandants refcounts - * in the loop above. So when we now free(_put) the root object, only - * root gets freed(). - */ - json_object_put(json); - RETiRet; -} - -/* find a JSON structure element (field or container doesn't matter). */ -rsRetVal -jsonFind(struct json_object *jroot, msgPropDescr_t *pProp, struct json_object **jsonres) -{ - uchar *leaf; - struct json_object *parent; - struct json_object *field; - DEFiRet; - - if(jroot == NULL) { - field = NULL; - goto finalize_it; - } - - if(!strcmp((char*)pProp->name, "!")) { - field = jroot; - } else { - leaf = jsonPathGetLeaf(pProp->name, pProp->nameLen); - CHKiRet(jsonPathFindParent(jroot, pProp->name, leaf, &parent, 0)); - field = json_object_object_get(parent, (char*)leaf); - } - *jsonres = field; - -finalize_it: - RETiRet; -} - -rsRetVal -msgAddJSON(msg_t * const pM, uchar *name, struct json_object *json) -{ - /* TODO: error checks! This is a quick&dirty PoC! */ - struct json_object **pjroot; - struct json_object *parent, *leafnode; - uchar *leaf; - DEFiRet; - - MsgLock(pM); - if(name[0] == '!') { - pjroot = &pM->json; - } else if(name[0] == '.') { - pjroot = &pM->localvars; - } else { /* globl var */ - pthread_rwlock_wrlock(&glblVars_rwlock); - pjroot = &global_var_root; - } - - if(name[1] == '\0') { /* full tree? */ - if(*pjroot == NULL) - *pjroot = json; - else - CHKiRet(jsonMerge(*pjroot, json)); - } else { - if(*pjroot == NULL) { - /* now we need a root obj */ - *pjroot = json_object_new_object(); - } - leaf = jsonPathGetLeaf(name, ustrlen(name)); - CHKiRet(jsonPathFindParent(*pjroot, name, leaf, &parent, 1)); - if (json_object_get_type(parent) != json_type_object) { - DBGPRINTF("msgAddJSON: not a container in json path," - "name is '%s'\n", name); - json_object_put(json); - ABORT_FINALIZE(RS_RET_INVLD_SETOP); - } - leafnode = json_object_object_get(parent, (char*)leaf); - if(leafnode == NULL) { - json_object_object_add(parent, (char*)leaf, json); - } else { - if(json_object_get_type(json) == json_type_object) { - CHKiRet(jsonMerge(*pjroot, json)); - } else { -//dbgprintf("AAAA: leafnode already exists, type is %d, update with %d\n", (int)json_object_get_type(leafnode), (int)json_object_get_type(json)); - /* TODO: improve the code below, however, the current - * state is not really bad */ - if(json_object_get_type(leafnode) == json_type_object) { - DBGPRINTF("msgAddJSON: trying to update a container " - "node with a leaf, name is '%s' - " - "forbidden\n", name); - json_object_put(json); - ABORT_FINALIZE(RS_RET_INVLD_SETOP); - } - /* json-c code indicates we can simply replace a - * json type. Unfortunaltely, this is not documented - * as part of the interface spec. We still use it, - * because it speeds up processing. If it does not work - * at some point, use - * json_object_object_del(parent, (char*)leaf); - * before adding. rgerhards, 2012-09-17 - */ - json_object_object_add(parent, (char*)leaf, json); - } - } - } - -finalize_it: - if(name[0] == '/') - pthread_rwlock_unlock(&glblVars_rwlock); - MsgUnlock(pM); - RETiRet; -} - - -rsRetVal -msgDelJSON(msg_t * const pM, uchar *name) -{ - struct json_object **jroot; - struct json_object *parent, *leafnode; - uchar *leaf; - DEFiRet; - -dbgprintf("AAAA: unset variable '%s'\n", name); - MsgLock(pM); - - if(name[0] == '!') { - jroot = &pM->json; - } else if(name[0] == '.') { - jroot = &pM->localvars; - } else { /* globl var */ - pthread_rwlock_wrlock(&glblVars_rwlock); - jroot = &global_var_root; - } - if(jroot == NULL) { - DBGPRINTF("msgDelJSONVar; jroot empty in unset for property %s\n", - name); - FINALIZE; - } - - if(name[1] == '\0') { - /* full tree! Strange, but I think we should permit this. After all, - * we trust rsyslog.conf to be written by the admin. - */ - DBGPRINTF("unsetting JSON root object\n"); - json_object_put(*jroot); - *jroot = NULL; - } else { - if(*jroot == NULL) { - /* now we need a root obj */ - *jroot = json_object_new_object(); - } - leaf = jsonPathGetLeaf(name, ustrlen(name)); - CHKiRet(jsonPathFindParent(*jroot, name, leaf, &parent, 1)); - leafnode = json_object_object_get(parent, (char*)leaf); -DBGPRINTF("AAAA: unset found JSON value path '%s', " "leaf '%s', leafnode %p\n", name, leaf, leafnode); - if(leafnode == NULL) { - DBGPRINTF("unset JSON: could not find '%s'\n", name); - ABORT_FINALIZE(RS_RET_JNAME_NOTFOUND); - } else { - DBGPRINTF("deleting JSON value path '%s', " - "leaf '%s', type %d\n", - name, leaf, json_object_get_type(leafnode)); - json_object_object_del(parent, (char*)leaf); - } - } - -finalize_it: - if(name[0] == '/') - pthread_rwlock_unlock(&glblVars_rwlock); - MsgUnlock(pM); - RETiRet; -} - -static struct json_object * -jsonDeepCopy(struct json_object *src) -{ - struct json_object *dst = NULL, *json; - struct json_object_iter it; - int arrayLen, i; - - if(src == NULL) goto done; - - switch(json_object_get_type(src)) { - case json_type_boolean: - dst = json_object_new_boolean(json_object_get_boolean(src)); - break; - case json_type_double: - dst = json_object_new_double(json_object_get_double(src)); - break; - case json_type_int: -#ifdef HAVE_JSON_OBJECT_NEW_INT64 - dst = json_object_new_int64(json_object_get_int64(src)); -#else /* HAVE_JSON_OBJECT_NEW_INT64 */ - dst = json_object_new_int(json_object_get_int(src)); -#endif /* HAVE_JSON_OBJECT_NEW_INT64 */ - break; - case json_type_string: - dst = json_object_new_string(json_object_get_string(src)); - break; - case json_type_object: - dst = json_object_new_object(); - json_object_object_foreachC(src, it) { - json = jsonDeepCopy(it.val); - json_object_object_add(dst, it.key, json); - } - break; - case json_type_array: - arrayLen = json_object_array_length(src); - dst = json_object_new_array(); - for(i = 0 ; i < arrayLen ; ++i) { - json = json_object_array_get_idx(src, i); - json = jsonDeepCopy(json); - json_object_array_add(dst, json); - } - break; - default:DBGPRINTF("jsonDeepCopy(): error unknown type %d\n", - json_object_get_type(src)); - dst = NULL; - break; - } -done: return dst; -} - - -rsRetVal -msgSetJSONFromVar(msg_t * const pMsg, uchar *varname, struct var *v) -{ - struct json_object *json = NULL; - char *cstr; - DEFiRet; - switch(v->datatype) { - case 'S':/* string */ - cstr = es_str2cstr(v->d.estr, NULL); - json = json_object_new_string(cstr); - free(cstr); - break; - case 'N':/* number (integer) */ -#ifdef HAVE_JSON_OBJECT_NEW_INT64 - json = json_object_new_int64(v->d.n); -#else /* HAVE_JSON_OBJECT_NEW_INT64 */ - json = json_object_new_int((int) v->d.n); -#endif /* HAVE_JSON_OBJECT_NEW_INT64 */ - break; - case 'J':/* native JSON */ - json = jsonDeepCopy(v->d.json); - break; - default:DBGPRINTF("msgSetJSONFromVar: unsupported datatype %c\n", - v->datatype); - ABORT_FINALIZE(RS_RET_ERR); - } - - msgAddJSON(pMsg, varname, json); -finalize_it: - RETiRet; -} - -rsRetVal -MsgAddToStructuredData(msg_t * const pMsg, uchar *toadd, rs_size_t len) -{ - uchar *newptr; - rs_size_t newlen; - DEFiRet; - newlen = (pMsg->pszStrucData[0] == '-') ? len : pMsg->lenStrucData + len; - CHKmalloc(newptr = (uchar*) realloc(pMsg->pszStrucData, newlen+1)); - pMsg->pszStrucData = newptr; - if(pMsg->pszStrucData[0] == '-') { /* empty? */ - memcpy(pMsg->pszStrucData, toadd, len); - } else { - memcpy(pMsg->pszStrucData+pMsg->lenStrucData, toadd, len); - } - pMsg->pszStrucData[newlen] = '\0'; - pMsg->lenStrucData = newlen; -finalize_it: - RETiRet; -} - - -/* Fill a message propert description. Space must already be alloced - * by the caller. This is for efficiency, as we expect this to happen - * as part of a larger structure alloc. - * Note that CEE/LOCAL_VAR properties can come in either as - * "$!xx"/"$.xx" or "!xx"/".xx" - we will unify them here. +/* get the severity - this is an entry point that + * satisfies the base object class getSeverity semantics. + * rgerhards, 2008-01-14 */ -rsRetVal -msgPropDescrFill(msgPropDescr_t *pProp, uchar *name, int nameLen) -{ - propid_t id; - int offs; - DEFiRet; - if(propNameToID(name, &id) != RS_RET_OK) { - parser_errmsg("invalid property '%s'", name); - ABORT_FINALIZE(RS_RET_INVLD_PROP); - } - if(id == PROP_CEE || id == PROP_LOCAL_VAR || id == PROP_GLOBAL_VAR) { - /* in these cases, we need the field name for later processing */ - /* normalize name: remove $ if present */ - offs = (name[0] == '$') ? 1 : 0; - pProp->name = ustrdup(name + offs); - pProp->nameLen = nameLen - offs; - /* we patch the root name, so that support functions do not need to - * check for different root chars. */ - pProp->name[0] = '!'; - } - pProp->id = id; -finalize_it: - RETiRet; -} - -void -msgPropDescrDestruct(msgPropDescr_t *pProp) +static rsRetVal +MsgGetSeverity(obj_t_ptr pThis, int *piSeverity) { - if(pProp != NULL) { - if(pProp->id == PROP_CEE || - pProp->id == PROP_LOCAL_VAR || - pProp->id == PROP_GLOBAL_VAR) - free(pProp->name); - } + ISOBJ_TYPE_assert(pThis, msg); + assert(piSeverity != NULL); + *piSeverity = ((msg_t*) pThis)->iSeverity; + return RS_RET_OK; } @@ -4185,16 +3269,22 @@ * rgerhards, 2008-01-04 */ BEGINObjClassInit(msg, 1, OBJ_IS_CORE_MODULE) - pthread_rwlock_init(&glblVars_rwlock, NULL); - /* request objects we use */ + CHKiRet(objUse(var, CORE_COMPONENT)); CHKiRet(objUse(datetime, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(prop, CORE_COMPONENT)); - CHKiRet(objUse(var, CORE_COMPONENT)); /* set our own handlers */ OBJSetMethodHandler(objMethod_SERIALIZE, MsgSerialize); + OBJSetMethodHandler(objMethod_SETPROPERTY, MsgSetProperty); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, msgConstructFinalizer); + OBJSetMethodHandler(objMethod_GETSEVERITY, MsgGetSeverity); + /* initially, we have no need to lock message objects */ + funcLock = MsgLockingDummy; + funcUnlock = MsgLockingDummy; + funcDeleteMutex = MsgLockingDummy; + funcMsgPrepareEnqueue = MsgLockingDummy; /* some more inits */ # if HAVE_MALLOC_TRIM INIT_ATOMIC_HELPER_MUT(mutTrimCtr); diff -Nru rsyslog-7.6.0/runtime/msg.h rsyslog-5.10.1/runtime/msg.h --- rsyslog-7.6.0/runtime/msg.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/msg.h 2012-10-17 14:41:20.000000000 +0000 @@ -3,7 +3,7 @@ * * File begun on 2007-07-13 by RGerhards (extracted from syslogd.c) * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -29,14 +29,12 @@ #define MSG_H_INCLUDED 1 #include -#include -#include -#include #include "obj.h" #include "syslogd-types.h" #include "template.h" #include "atomic.h" + /* rgerhards 2004-11-08: The following structure represents a * syslog message. * @@ -63,7 +61,8 @@ once data has entered the queue, this property is no longer needed. */ pthread_mutex_t mut; int iRefCount; /* reference counter (0 = unused) */ - sbool bParseSuccess; /* set to reflect state of last executed higher level parser */ + sbool bDoLock; /* use the mutex? */ + sbool bAlreadyFreed; /* aid to help detect a well-hidden bad bug -- TODO: remove when no longer needed */ short iSeverity; /* the severity 0..7 */ short iFacility; /* Facility code 0 .. 23*/ short offAfterPRI; /* offset, at which raw message WITHOUT PRI part starts in pszRawMsg */ @@ -74,7 +73,6 @@ int iLenMSG; /* Length of the MSG part */ int iLenTAG; /* Length of the TAG part */ int iLenHOSTNAME; /* Length of HOSTNAME */ - int iLenPROGNAME; /* Length of PROGNAME (-1 = not yet set) */ uchar *pszRawMsg; /* message as it was received on the wire. This is important in case we * need to preserve cryptographic verifiers. */ uchar *pszHOSTNAME; /* HOSTNAME from syslog message */ @@ -86,8 +84,8 @@ char *pszTIMESTAMP3339; /* TIMESTAMP as RFC3339 formatted string (32 charcters at most) */ char *pszTIMESTAMP_MySQL;/* TIMESTAMP as MySQL formatted string (always 14 charcters) */ char *pszTIMESTAMP_PgSQL;/* TIMESTAMP as PgSQL formatted string (always 21 characters) */ - uchar *pszStrucData; /* STRUCTURED-DATA */ - uint16_t lenStrucData; /* (cached) length of STRUCTURED-DATA */ + cstr_t *pCSProgName; /* the (BSD) program name */ + cstr_t *pCSStrucData; /* STRUCTURED-DATA */ cstr_t *pCSAPPNAME; /* APP-NAME */ cstr_t *pCSPROCID; /* PROCID */ cstr_t *pCSMSGID; /* MSGID */ @@ -108,16 +106,10 @@ it obviously is solved in way or another...). */ struct syslogTime tRcvdAt;/* time the message entered this program */ struct syslogTime tTIMESTAMP;/* (parsed) value of the timestamp */ - struct json_object *json; - struct json_object *localvars; /* some fixed-size buffers to save malloc()/free() for frequently used fields (from the default templates) */ uchar szRawMsg[CONF_RAWMSG_BUFSIZE]; /* most messages are small, and these are stored here (without malloc/free!) */ uchar szHOSTNAME[CONF_HOSTNAME_BUFSIZE]; union { - uchar *ptr; /* pointer to progname value */ - uchar szBuf[CONF_PROGNAME_BUFSIZE]; - } PROGNAME; - union { uchar *pszTAG; /* pointer to tag value */ uchar szBuf[CONF_TAG_BUFSIZE]; } TAG; @@ -125,10 +117,6 @@ char pszTimestamp3339[CONST_LEN_TIMESTAMP_3339 + 1]; char pszTIMESTAMP_SecFrac[7]; /* Note: a pointer is 64 bits/8 char, so this is actually fewer than a pointer! */ char pszRcvdAt_SecFrac[7]; /* same as above. Both are fractional seconds for their respective timestamp */ - char pszTIMESTAMP_Unix[12]; /* almost as small as a pointer! */ - char pszRcvdAt_Unix[12]; - char dfltTZ[8]; /* 7 chars max, less overhead than ptr! */ - uchar *pszUUID; /* The message's UUID */ }; @@ -145,33 +133,24 @@ #define NEEDS_ACLCHK_U 0x080 /* check UDP ACLs after DNS resolution has been done in main queue consumer */ #define NO_PRI_IN_RAW 0x100 /* rawmsg does not include a PRI (Solaris!), but PRI is already set correctly in the msg object */ -/* (syslog) protocol types */ -#define MSG_LEGACY_PROTOCOL 0 -#define MSG_RFC5424_PROTOCOL 1 /* function prototypes */ PROTOTYPEObjClassInit(msg); rsRetVal msgConstruct(msg_t **ppThis); rsRetVal msgConstructWithTime(msg_t **ppThis, struct syslogTime *stTime, time_t ttGenTime); -rsRetVal msgConstructForDeserializer(msg_t **ppThis); -rsRetVal msgConstructFinalizer(msg_t *pThis); rsRetVal msgDestruct(msg_t **ppM); msg_t* MsgDup(msg_t* pOld); msg_t *MsgAddRef(msg_t *pM); void setProtocolVersion(msg_t *pM, int iNewVersion); void MsgSetInputName(msg_t *pMsg, prop_t*); -void MsgSetDfltTZ(msg_t *pThis, char *tz); rsRetVal MsgSetAPPNAME(msg_t *pMsg, char* pszAPPNAME); rsRetVal MsgSetPROCID(msg_t *pMsg, char* pszPROCID); rsRetVal MsgSetMSGID(msg_t *pMsg, char* pszMSGID); -void MsgSetParseSuccess(msg_t *pMsg, int bSuccess); void MsgSetTAG(msg_t *pMsg, uchar* pszBuf, size_t lenBuf); void MsgSetRuleset(msg_t *pMsg, ruleset_t*); rsRetVal MsgSetFlowControlType(msg_t *pMsg, flowControl_t eFlowCtl); rsRetVal MsgSetStructuredData(msg_t *pMsg, char* pszStrucData); -rsRetVal MsgAddToStructuredData(msg_t *pMsg, uchar *toadd, rs_size_t len); -void MsgGetStructuredData(msg_t *pM, uchar **pBuf, rs_size_t *len); rsRetVal msgSetFromSockinfo(msg_t *pThis, struct sockaddr_storage *sa); void MsgSetRcvFrom(msg_t *pMsg, prop_t*); void MsgSetRcvFromStr(msg_t *pMsg, uchar* pszRcvFrom, int, prop_t **); @@ -183,52 +162,42 @@ void MsgSetRawMsgWOSize(msg_t *pMsg, char* pszRawMsg); void MsgSetRawMsg(msg_t *pMsg, char* pszRawMsg, size_t lenMsg); rsRetVal MsgReplaceMSG(msg_t *pThis, uchar* pszMSG, int lenMSG); -uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, msgPropDescr_t *pProp, - rs_size_t *pPropLen, unsigned short *pbMustBeFreed, struct syslogTime *ttNow); +uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, + propid_t propID, size_t *pPropLen, unsigned short *pbMustBeFreed); +char *textpri(char *pRes, size_t pResLen, int pri); +rsRetVal msgGetMsgVar(msg_t *pThis, cstr_t *pstrPropName, var_t **ppVar); +rsRetVal MsgEnableThreadSafety(void); uchar *getRcvFrom(msg_t *pM); void getTAG(msg_t *pM, uchar **ppBuf, int *piLen); char *getTimeReported(msg_t *pM, enum tplFormatTypes eFmt); char *getPRI(msg_t *pMsg); -void getRawMsg(msg_t *pM, uchar **pBuf, int *piLen); -rsRetVal msgAddJSON(msg_t *pM, uchar *name, struct json_object *json); -rsRetVal MsgGetSeverity(msg_t *pThis, int *piSeverity); -rsRetVal MsgDeserialize(msg_t *pMsg, strm_t *pStrm); + /* TODO: remove these five (so far used in action.c) */ uchar *getMSG(msg_t *pM); char *getHOSTNAME(msg_t *pM); char *getPROCID(msg_t *pM, sbool bLockMutex); char *getAPPNAME(msg_t *pM, sbool bLockMutex); -void setMSGLen(msg_t *pM, int lenMsg); int getMSGLen(msg_t *pM); char *getHOSTNAME(msg_t *pM); int getHOSTNAMELen(msg_t *pM); uchar *getProgramName(msg_t *pM, sbool bLockMutex); +int getProgramNameLen(msg_t *pM, sbool bLockMutex); uchar *getRcvFrom(msg_t *pM); -rsRetVal propNameToID(uchar *pName, propid_t *pPropID); +rsRetVal propNameToID(cstr_t *pCSPropName, propid_t *pPropID); uchar *propIDToName(propid_t propID); -rsRetVal msgGetJSONPropJSON(msg_t *pMsg, msgPropDescr_t *pProp, struct json_object **pjson); -rsRetVal getJSONPropVal(msg_t *pMsg, msgPropDescr_t *pProp, uchar **pRes, rs_size_t *buflen, unsigned short *pbMustBeFreed); -rsRetVal msgSetJSONFromVar(msg_t *pMsg, uchar *varname, struct var *var); -rsRetVal msgDelJSON(msg_t *pMsg, uchar *varname); -rsRetVal jsonFind(struct json_object *jroot, msgPropDescr_t *pProp, struct json_object **jsonres); - -rsRetVal msgPropDescrFill(msgPropDescr_t *pProp, uchar *name, int nameLen); -void msgPropDescrDestruct(msgPropDescr_t *pProp); - -static inline int -msgGetProtocolVersion(msg_t *pM) -{ - return(pM->iProtocolVersion); -} - -/* returns non-zero if the message has structured data, 0 otherwise */ -static inline sbool -MsgHasStructuredData(msg_t *pM) -{ - return (pM->pszStrucData == NULL) ? 0 : 1; -} + + +/* The MsgPrepareEnqueue() function is a macro for performance reasons. + * It needs one global variable to work. This is acceptable, as it gains + * us quite some performance and is fully abstracted using this header file. + * The important thing is that no other module is permitted to actually + * access that global variable! -- rgerhards, 2008-01-05 + */ +extern void (*funcMsgPrepareEnqueue)(msg_t *pMsg); +#define MsgPrepareEnqueue(pMsg) funcMsgPrepareEnqueue(pMsg) + /* ------------------------------ some inline functions ------------------------------ */ diff -Nru rsyslog-7.6.0/runtime/net.c rsyslog-5.10.1/runtime/net.c --- rsyslog-7.6.0/runtime/net.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/net.c 2012-10-17 14:41:20.000000000 +0000 @@ -12,7 +12,7 @@ * long term, but it is good to have it out of syslogd.c. Maybe this here is * an interim location ;) * - * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. * * rgerhards, 2008-04-16: I changed this code to LGPL today. I carefully analyzed * that it does not borrow code from the original sysklogd and that I have @@ -54,11 +54,7 @@ #include #include #include -#if HAVE_GETIFADDRS #include -#else -#include "compat/ifaddrs.h" -#endif /* HAVE_GETIFADDRS */ #include #include @@ -69,8 +65,6 @@ #include "obj.h" #include "errmsg.h" #include "net.h" -#include "dnscache.h" -#include "prop.h" #ifdef OS_SOLARIS # define s6_addr32 _S6_un._S6_u32 @@ -84,7 +78,6 @@ DEFobjStaticHelpers DEFobjCurrIf(errmsg) DEFobjCurrIf(glbl) -DEFobjCurrIf(prop) /* support for defining allowed TCP and UDP senders. We use the same * structure to implement this (a linked list), but we define two different @@ -232,7 +225,6 @@ /* enqueue the element */ if(pPeer->pWildcardRoot == NULL) { pPeer->pWildcardRoot = pNew; - pPeer->pWildcardLast = pNew; } else { pPeer->pWildcardLast->pNext = pNew; } @@ -582,7 +574,7 @@ clearAllowedSenders(uchar *pszType) { struct AllowedSenders *pPrev; - struct AllowedSenders *pCurr = NULL; + struct AllowedSenders *pCurr; if(setAllowRoot(&pCurr, pszType) != RS_RET_OK) return; /* if something went wrong, so let's leave */ @@ -990,7 +982,7 @@ static int isAllowedSender2(uchar *pszType, struct sockaddr *pFrom, const char *pszFromHost, int bChkDNS) { struct AllowedSenders *pAllow; - struct AllowedSenders *pAllowRoot = NULL; + struct AllowedSenders *pAllowRoot; int bNeededDNS = 0; /* partial check because we could not resolve DNS? */ int ret; @@ -1075,6 +1067,108 @@ #define SO_BSDCOMPAT 0 #endif +/* get the hostname of the message source. This was originally in cvthname() + * but has been moved out of it because of clarity and fuctional separation. + * It must be provided by the socket we received the message on as well as + * a NI_MAXHOST size large character buffer for the FQDN. + * 2008-05-16 rgerhards: added field for IP address representation. Must also + * be NI_MAXHOST size large. + * + * Please see http://www.hmug.org/man/3/getnameinfo.php (under Caveats) + * for some explanation of the code found below. We do by default not + * discard message where we detected malicouos DNS PTR records. However, + * there is a user-configurabel option that will tell us if + * we should abort. For this, the return value tells the caller if the + * message should be processed (1) or discarded (0). + */ +static rsRetVal +gethname(struct sockaddr_storage *f, uchar *pszHostFQDN, uchar *ip) +{ + DEFiRet; + int error; + sigset_t omask, nmask; + struct addrinfo hints, *res; + + assert(f != NULL); + assert(pszHostFQDN != NULL); + + error = mygetnameinfo((struct sockaddr *)f, SALEN((struct sockaddr *)f), + (char*) ip, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); + + if (error) { + dbgprintf("Malformed from address %s\n", gai_strerror(error)); + strcpy((char*) pszHostFQDN, "???"); + strcpy((char*) ip, "???"); + ABORT_FINALIZE(RS_RET_INVALID_SOURCE); + } + + if(!glbl.GetDisableDNS()) { + sigemptyset(&nmask); + sigaddset(&nmask, SIGHUP); + pthread_sigmask(SIG_BLOCK, &nmask, &omask); + + error = mygetnameinfo((struct sockaddr *)f, SALEN((struct sockaddr *) f), + (char*)pszHostFQDN, NI_MAXHOST, NULL, 0, NI_NAMEREQD); + + if (error == 0) { + memset (&hints, 0, sizeof (struct addrinfo)); + hints.ai_flags = AI_NUMERICHOST; + + /* we now do a lookup once again. This one should fail, + * because we should not have obtained a non-numeric address. If + * we got a numeric one, someone messed with DNS! + */ + if (getaddrinfo ((char*)pszHostFQDN, NULL, &hints, &res) == 0) { + uchar szErrMsg[1024]; + freeaddrinfo (res); + /* OK, we know we have evil. The question now is what to do about + * it. One the one hand, the message might probably be intended + * to harm us. On the other hand, losing the message may also harm us. + * Thus, the behaviour is controlled by the $DropMsgsWithMaliciousDnsPTRRecords + * option. If it tells us we should discard, we do so, else we proceed, + * but log an error message together with it. + * time being, we simply drop the name we obtained and use the IP - that one + * is OK in any way. We do also log the error message. rgerhards, 2007-07-16 + */ + if(glbl.GetDropMalPTRMsgs() == 1) { + snprintf((char*)szErrMsg, sizeof(szErrMsg) / sizeof(uchar), + "Malicious PTR record, message dropped " + "IP = \"%s\" HOST = \"%s\"", + ip, pszHostFQDN); + errmsg.LogError(0, RS_RET_MALICIOUS_ENTITY, "%s", szErrMsg); + pthread_sigmask(SIG_SETMASK, &omask, NULL); + ABORT_FINALIZE(RS_RET_MALICIOUS_ENTITY); + } + + /* Please note: we deal with a malicous entry. Thus, we have crafted + * the snprintf() below so that all text is in front of the entry - maybe + * it contains characters that make the message unreadable + * (OK, I admit this is more or less impossible, but I am paranoid...) + * rgerhards, 2007-07-16 + */ + snprintf((char*)szErrMsg, sizeof(szErrMsg) / sizeof(uchar), + "Malicious PTR record (message accepted, but used IP " + "instead of PTR name: IP = \"%s\" HOST = \"%s\"", + ip, pszHostFQDN); + errmsg.LogError(0, NO_ERRCODE, "%s", szErrMsg); + + error = 1; /* that will trigger using IP address below. */ + } + } + pthread_sigmask(SIG_SETMASK, &omask, NULL); + } + + if(error || glbl.GetDisableDNS()) { + dbgprintf("Host name for your address (%s) unknown\n", ip); + strcpy((char*) pszHostFQDN, (char*)ip); + ABORT_FINALIZE(RS_RET_ADDRESS_UNKNOWN); + } + +finalize_it: + RETiRet; +} + + /* print out which socket we are listening on. This is only * a debug aid. rgerhards, 2007-07-02 @@ -1118,15 +1212,98 @@ } -/* Return a printable representation of a host addresses. If - * a parameter is NULL, it is not set. rgerhards, 2013-01-22 +/* Return a printable representation of a host address. + * Now (2007-07-16) also returns the full host name (if it could be obtained) + * in the second param [thanks to mildew@gmail.com for the patch]. + * The caller must provide buffer space for pszHost and pszHostFQDN. These + * buffers must be of size NI_MAXHOST. This is not checked here, because + * there is no way to check it. We use this way of doing things because it + * frees us from using dynamic memory allocation where it really does not + * pay. + * 2005-05-16 rgerhards: added IP representation. Must also be NI_MAXHOST */ -rsRetVal -cvthname(struct sockaddr_storage *f, prop_t **localName, prop_t **fqdn, prop_t **ip) +rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN, uchar *pszIP) { DEFiRet; + register uchar *p; + int count; + assert(f != NULL); - iRet = dnscacheLookup(f, NULL, fqdn, localName, ip); + assert(pszHost != NULL); + assert(pszHostFQDN != NULL); + + iRet = gethname(f, pszHostFQDN, pszIP); + + if(iRet == RS_RET_INVALID_SOURCE || iRet == RS_RET_ADDRESS_UNKNOWN) { + strcpy((char*) pszHost, (char*) pszHostFQDN); /* we use whatever was provided as replacement */ + ABORT_FINALIZE(RS_RET_OK); /* this is handled, we are happy with it */ + } else if(iRet != RS_RET_OK) { + FINALIZE; /* we return whatever error state we have - can not handle it */ + } + + /* if we reach this point, we obtained a non-numeric hostname and can now process it */ + + /* Convert to lower case */ + for(p = pszHostFQDN ; *p ; p++) + if (isupper((int) *p)) + *p = tolower(*p); + + /* OK, the fqdn is now known. Now it is time to extract only the hostname + * part if we were instructed to do so. + */ + /* TODO: quick and dirty right now: we need to optimize that. We simply + * copy over the buffer and then use the old code. In the long term, that should + * be placed in its own function and probably outside of the net module (at least + * if should no longer reley on syslogd.c's global config-setting variables). + * Note that the old code always removes the local domain. We may want to + * make this in option in the long term. (rgerhards, 2007-09-11) + */ + strcpy((char*)pszHost, (char*)pszHostFQDN); + if( (glbl.GetPreserveFQDN() == 0) + && (p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */ + strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()); + if(strcmp((char*)(p + 1), (char*)glbl.GetLocalDomain()) == 0) { + *p = '\0'; /* simply terminate the string */ + } else { + /* now check if we belong to any of the domain names that were specified + * in the -s command line option. If so, remove and we are done. + * TODO: this must go away! -- rgerhards, 2008-04-16 + * For proper modularization, this must be done different, e.g. via a + * "to be stripped" property of *this* object itself. + */ + if(glbl.GetStripDomains() != NULL) { + count=0; + while(glbl.GetStripDomains()[count]) { + if (strcmp((char*)(p + 1), glbl.GetStripDomains()[count]) == 0) { + *p = '\0'; + FINALIZE; /* we are done */ + } + count++; + } + } + /* if we reach this point, we have not found any domain we should strip. Now + * we try and see if the host itself is listed in the -l command line option + * and so should be stripped also. If so, we do it and return. Please note that + * -l list FQDNs, not just the hostname part. If it did just list the hostname, the + * door would be wide-open for all kinds of mixing up of hosts. Because of this, + * you'll see comparison against the full string (pszHost) below. The termination + * still occurs at *p, which points at the first dot after the hostname. + * TODO: this must also go away - see comment above -- rgerhards, 2008-04-16 + */ + if(glbl.GetLocalHosts() != NULL) { + count=0; + while (glbl.GetLocalHosts()[count]) { + if (!strcmp((char*)pszHost, (char*)glbl.GetLocalHosts()[count])) { + *p = '\0'; + break; /* we are done */ + } + count++; + } + } + } + } + +finalize_it: RETiRet; } @@ -1189,16 +1366,12 @@ * hostname and/or pszPort may be NULL, but not both! * bIsServer indicates if a server socket should be created * 1 - server, 0 - client - * param rcvbuf indicates desired rcvbuf size; 0 means OS default */ -int *create_udp_socket(uchar *hostname, uchar *pszPort, int bIsServer, int rcvbuf) +int *create_udp_socket(uchar *hostname, uchar *pszPort, int bIsServer) { struct addrinfo hints, *res, *r; int error, maxs, *s, *socks, on = 1; int sockflags; - int actrcvbuf; - socklen_t optlen; - char errStr[1024]; assert(!((pszPort == NULL) && (hostname == NULL))); memset(&hints, 0, sizeof(hints)); @@ -1301,35 +1474,6 @@ continue; } - if(rcvbuf != 0) { -# if defined(SO_RCVBUFFORCE) - if(setsockopt(*s, SOL_SOCKET, SO_RCVBUFFORCE, &rcvbuf, sizeof(rcvbuf)) < 0) -# endif - { - /* if we fail, try to do it the regular way. Experiments show that at - * least some platforms do not return an error here, but silently set - * it to the max permitted value. So we do our error check a bit - * differently by querying the size below. - */ - setsockopt(*s, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)); - } - } - - if(Debug || rcvbuf != 0) { - optlen = sizeof(actrcvbuf); - if(getsockopt(*s, SOL_SOCKET, SO_RCVBUF, &actrcvbuf, &optlen) == 0) { - dbgprintf("socket %d, actual rcvbuf size %d\n", *s, actrcvbuf); - if(rcvbuf != 0 && actrcvbuf/2 != rcvbuf) { - errmsg.LogError(errno, NO_ERRCODE, - "cannot set rcvbuf size %d for socket %d, value now is %d", - rcvbuf, *s, actrcvbuf/2); - } - } else { - dbgprintf("could not obtain rcvbuf size for socket %d: %s\n", - *s, rs_strerror_r(errno, errStr, sizeof(errStr))); - } - } - if(bIsServer) { /* rgerhards, 2007-06-22: if we run on a kernel that does not support * the IPV6_V6ONLY socket option, we need to use a work-around. On such @@ -1424,7 +1568,7 @@ */ static rsRetVal HasRestrictions(uchar *pszType, int *bHasRestrictions) { - struct AllowedSenders *pAllowRoot = NULL; + struct AllowedSenders *pAllowRoot; DEFiRet; CHKiRet(setAllowRoot(&pAllowRoot, pszType)); @@ -1534,7 +1678,6 @@ CODESTARTObjClassExit(net) /* release objects we no longer need */ objRelease(glbl, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); ENDObjClassExit(net) @@ -1547,7 +1690,6 @@ /* request objects we use */ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); /* set our own handlers */ ENDObjClassInit(net) diff -Nru rsyslog-7.6.0/runtime/net.h rsyslog-5.10.1/runtime/net.h --- rsyslog-7.6.0/runtime/net.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/net.h 2012-10-15 13:45:04.000000000 +0000 @@ -1,6 +1,6 @@ /* Definitions for network-related stuff. * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -131,13 +131,13 @@ /* interfaces */ BEGINinterface(net) /* name must also be changed in ENDinterface macro! */ - rsRetVal (*cvthname)(struct sockaddr_storage *f, prop_t **localName, prop_t **fqdn, prop_t **ip); + rsRetVal (*cvthname)(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN, uchar *pszIP); /* things to go away after proper modularization */ rsRetVal (*addAllowedSenderLine)(char* pName, uchar** ppRestOfConfLine); void (*PrintAllowedSenders)(int iListToPrint); void (*clearAllowedSenders)(uchar*); void (*debugListenInfo)(int fd, char *type); - int *(*create_udp_socket)(uchar *hostname, uchar *LogPort, int bIsServer, int rcvbuf); + int *(*create_udp_socket)(uchar *hostname, uchar *LogPort, int bIsServer); void (*closeUDPListenSockets)(int *finet); int (*isAllowedSender)(uchar *pszType, struct sockaddr *pFrom, const char *pszFromHost); /* deprecated! */ rsRetVal (*getLocalHostname)(uchar**); @@ -156,9 +156,8 @@ /* data members - these should go away over time... TODO */ int *pACLAddHostnameOnFail; /* add hostname to acl when DNS resolving has failed */ int *pACLDontResolve; /* add hostname to acl instead of resolving it to IP(s) */ - /* v8 cvthname() signature change -- rgerhards, 2013-01-18 */ ENDinterface(net) -#define netCURR_IF_VERSION 8 /* increment whenever you change the interface structure! */ +#define netCURR_IF_VERSION 7 /* increment whenever you change the interface structure! */ /* prototypes */ PROTOTYPEObj(net); diff -Nru rsyslog-7.6.0/runtime/netstrm.c rsyslog-5.10.1/runtime/netstrm.c --- rsyslog-7.6.0/runtime/netstrm.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/netstrm.c 2012-10-17 14:41:20.000000000 +0000 @@ -64,7 +64,6 @@ /* destructor for the netstrm object */ BEGINobjDestruct(netstrm) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(netstrm) -//printf("destruct driver data %p\n", pThis->pDrvrData); if(pThis->pDrvrData != NULL) iRet = pThis->Drvr.Destruct(&pThis->pDrvrData); ENDobjDestruct(netstrm) @@ -170,7 +169,6 @@ { DEFiRet; ISOBJ_TYPE_assert(pThis, netstrm); -//printf("Rcv %p\n", pThis); iRet = pThis->Drvr.Rcv(pThis->pDrvrData, pBuf, pLenBuf); RETiRet; } @@ -250,11 +248,11 @@ /* check connection - slim wrapper for NSD driver function */ -static rsRetVal +static void CheckConnection(netstrm_t *pThis) { ISOBJ_TYPE_assert(pThis, netstrm); - return pThis->Drvr.CheckConnection(pThis->pDrvrData); + pThis->Drvr.CheckConnection(pThis->pDrvrData); } @@ -271,11 +269,11 @@ /* get remote IP - slim wrapper for NSD driver function */ static rsRetVal -GetRemoteIP(netstrm_t *pThis, prop_t **ip) +GetRemoteIP(netstrm_t *pThis, uchar **ppsz) { DEFiRet; ISOBJ_TYPE_assert(pThis, netstrm); - iRet = pThis->Drvr.GetRemoteIP(pThis->pDrvrData, ip); + iRet = pThis->Drvr.GetRemoteIP(pThis->pDrvrData, ppsz); RETiRet; } diff -Nru rsyslog-7.6.0/runtime/netstrm.h rsyslog-5.10.1/runtime/netstrm.h --- rsyslog-7.6.0/runtime/netstrm.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/netstrm.h 2012-10-17 14:41:20.000000000 +0000 @@ -49,11 +49,11 @@ rsRetVal (*Send)(netstrm_t *pThis, uchar *pBuf, ssize_t *pLenBuf); rsRetVal (*Connect)(netstrm_t *pThis, int family, unsigned char *port, unsigned char *host); rsRetVal (*GetRemoteHName)(netstrm_t *pThis, uchar **pszName); - rsRetVal (*GetRemoteIP)(netstrm_t *pThis, prop_t **ip); + rsRetVal (*GetRemoteIP)(netstrm_t *pThis, uchar **pszIP); rsRetVal (*SetDrvrMode)(netstrm_t *pThis, int iMode); rsRetVal (*SetDrvrAuthMode)(netstrm_t *pThis, uchar*); rsRetVal (*SetDrvrPermPeers)(netstrm_t *pThis, permittedPeers_t*); - rsRetVal (*CheckConnection)(netstrm_t *pThis); /* This is a trick mostly for plain tcp syslog */ + void (*CheckConnection)(netstrm_t *pThis); /* This is a trick mostly for plain tcp syslog */ /* the GetSock() below is a hack to make imgssapi work. In the long term, * we should migrate imgssapi to a stream driver, which will relieve us of * this problem. Please note that nobody else should use GetSock(). Using it @@ -72,11 +72,9 @@ /* v4 */ rsRetVal (*EnableKeepAlive)(netstrm_t *pThis); ENDinterface(netstrm) -#define netstrmCURR_IF_VERSION 6 /* increment whenever you change the interface structure! */ +#define netstrmCURR_IF_VERSION 4 /* increment whenever you change the interface structure! */ /* interface version 3 added GetRemAddr() * interface version 4 added EnableKeepAlive() -- rgerhards, 2009-06-02 - * interface version 5 changed return of CheckConnection from void to rsRetVal -- alorbach, 2012-09-06 - * interface version 6 changed signature of GetRemoteIP() -- rgerhards, 2013-01-21 * */ /* prototypes */ diff -Nru rsyslog-7.6.0/runtime/netstrms.c rsyslog-5.10.1/runtime/netstrms.c --- rsyslog-7.6.0/runtime/netstrms.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/netstrms.c 2012-10-17 14:41:20.000000000 +0000 @@ -32,6 +32,7 @@ #include "rsyslog.h" #include "module-template.h" #include "obj.h" +//#include "errmsg.h" #include "nsd.h" #include "netstrm.h" #include "nssel.h" diff -Nru rsyslog-7.6.0/runtime/nsd_gtls.c rsyslog-5.10.1/runtime/nsd_gtls.c --- rsyslog-7.6.0/runtime/nsd_gtls.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/nsd_gtls.c 2012-10-17 14:41:20.000000000 +0000 @@ -2,7 +2,7 @@ * * An implementation of the nsd interface for GnuTLS. * - * Copyright (C) 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright (C) 2007, 2008 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -52,6 +52,7 @@ #include "nsd_gtls.h" /* things to move to some better place/functionality - TODO */ +#define DH_BITS 1024 #define CRLFILE "crl.pem" @@ -85,6 +86,7 @@ /* ------------------------------ GnuTLS specifics ------------------------------ */ static gnutls_certificate_credentials xcred; +static gnutls_dh_params dh_params; #ifdef DEBUG #if 0 /* uncomment, if needed some time again -- DEV Debug only */ @@ -259,9 +261,9 @@ static rsRetVal gtlsGetCertInfo(nsd_gtls_t *pThis, cstr_t **ppStr) { - uchar szBufA[1024]; - uchar *szBuf = szBufA; - size_t szBufLen = sizeof(szBufA), tmp; + char dn[128]; + uchar lnBuf[256]; + size_t size; unsigned int algo, bits; time_t expiration_time, activation_time; const gnutls_datum *cert_list; @@ -271,6 +273,8 @@ int gnuRet; DEFiRet; unsigned iAltName; + size_t szAltNameLen; + char szAltName[1024]; /* this is sufficient for the DNSNAME... */ assert(ppStr != NULL); ISOBJ_TYPE_assert(pThis, nsd_gtls); @@ -279,62 +283,61 @@ return RS_RET_TLS_CERT_ERR; cert_list = gnutls_certificate_get_peers(pThis->sess, &cert_list_size); - CHKiRet(rsCStrConstructFromszStrf(&pStr, "peer provided %d certificate(s). ", cert_list_size)); + + CHKiRet(rsCStrConstruct(&pStr)); + + snprintf((char*)lnBuf, sizeof(lnBuf), "peer provided %d certificate(s). ", cert_list_size); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); if(cert_list_size > 0) { /* we only print information about the first certificate */ CHKgnutls(gnutls_x509_crt_init(&cert)); CHKgnutls(gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER)); + CHKiRet(rsCStrAppendStr(pStr, (uchar*)"Certificate 1 info: ")); + expiration_time = gnutls_x509_crt_get_expiration_time(cert); activation_time = gnutls_x509_crt_get_activation_time(cert); - ctime_r(&activation_time, szBuf); - szBuf[strlen(szBuf) - 1] = '\0'; /* strip linefeed */ - CHKiRet(rsCStrAppendStrf(pStr, (uchar*)"Certificate 1 info: " - "certificate valid from %s ", szBuf)); - ctime_r(&expiration_time, szBuf); - szBuf[strlen(szBuf) - 1] = '\0'; /* strip linefeed */ - CHKiRet(rsCStrAppendStrf(pStr, "to %s; ", szBuf)); + ctime_r(&activation_time, dn); + dn[strlen(dn) - 1] = '\0'; /* strip linefeed */ + snprintf((char*)lnBuf, sizeof(lnBuf), "certificate valid from %s ", dn); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); + + ctime_r(&expiration_time, dn); + dn[strlen(dn) - 1] = '\0'; /* strip linefeed */ + snprintf((char*)lnBuf, sizeof(lnBuf), "to %s; ", dn); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); /* Extract some of the public key algorithm's parameters */ algo = gnutls_x509_crt_get_pk_algorithm(cert, &bits); - CHKiRet(rsCStrAppendStrf(pStr, "Certificate public key: %s; ", - gnutls_pk_algorithm_get_name(algo))); - /* names */ - tmp = szBufLen; - if(gnutls_x509_crt_get_dn(cert, szBuf, &tmp) - == GNUTLS_E_SHORT_MEMORY_BUFFER) { - szBufLen = tmp; - szBuf = malloc(tmp); - gnutls_x509_crt_get_dn(cert, szBuf, &tmp); - } - CHKiRet(rsCStrAppendStrf(pStr, "DN: %s; ", szBuf)); + snprintf((char*)lnBuf, sizeof(lnBuf), "Certificate public key: %s; ", + gnutls_pk_algorithm_get_name(algo)); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); - tmp = szBufLen; - if(gnutls_x509_crt_get_issuer_dn(cert, szBuf, &tmp) - == GNUTLS_E_SHORT_MEMORY_BUFFER) { - szBufLen = tmp; - szBuf = realloc((szBuf == szBufA) ? NULL : szBuf, tmp); - gnutls_x509_crt_get_issuer_dn(cert, szBuf, &tmp); - } - CHKiRet(rsCStrAppendStrf(pStr, "Issuer DN: %s; ", szBuf)); + /* names */ + size = sizeof(dn); + gnutls_x509_crt_get_dn(cert, dn, &size); + snprintf((char*)lnBuf, sizeof(lnBuf), "DN: %s; ", dn); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); + + size = sizeof(dn); + gnutls_x509_crt_get_issuer_dn(cert, dn, &size); + snprintf((char*)lnBuf, sizeof(lnBuf), "Issuer DN: %s; ", dn); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); /* dNSName alt name */ iAltName = 0; while(1) { /* loop broken below */ - tmp = szBufLen; + szAltNameLen = sizeof(szAltName); gnuRet = gnutls_x509_crt_get_subject_alt_name(cert, iAltName, - szBuf, &tmp, NULL); - if(gnuRet == GNUTLS_E_SHORT_MEMORY_BUFFER) { - szBufLen = tmp; - szBuf = realloc((szBuf == szBufA) ? NULL : szBuf, tmp); - continue; - } else if(gnuRet < 0) + szAltName, &szAltNameLen, NULL); + if(gnuRet < 0) break; else if(gnuRet == GNUTLS_SAN_DNSNAME) { /* we found it! */ - CHKiRet(rsCStrAppendStrf(pStr, "SAN:DNSname: %s; ", szBuf)); + snprintf((char*)lnBuf, sizeof(lnBuf), "SAN:DNSname: %s; ", szAltName); + CHKiRet(rsCStrAppendStr(pStr, lnBuf)); /* do NOT break, because there may be multiple dNSName's! */ } ++iAltName; @@ -351,8 +354,6 @@ if(pStr != NULL) rsCStrDestruct(&pStr); } - if(szBuf != szBufA) - free(szBuf); RETiRet; } @@ -547,20 +548,10 @@ keyFile = glbl.GetDfltNetstrmDrvrKeyFile(); dbgprintf("GTLS certificate file: '%s'\n", certFile); dbgprintf("GTLS key file: '%s'\n", keyFile); - if(certFile == NULL) { - errmsg.LogError(0, RS_RET_CERT_MISSING, "error: certificate file is not set, cannot " - "continue"); - ABORT_FINALIZE(RS_RET_CERT_MISSING); - } - if(keyFile == NULL) { - errmsg.LogError(0, RS_RET_CERTKEY_MISSING, "error: key file is not set, cannot " - "continue"); - ABORT_FINALIZE(RS_RET_CERTKEY_MISSING); - } CHKgnutls(gnutls_certificate_set_x509_key_file(xcred, (char*)certFile, (char*)keyFile, GNUTLS_X509_FMT_PEM)); finalize_it: - if(iRet != RS_RET_OK && iRet != RS_RET_CERT_MISSING && iRet != RS_RET_CERTKEY_MISSING) { + if(iRet != RS_RET_OK) { pGnuErr = gtlsStrerror(gnuRet); errno = 0; errmsg.LogError(0, iRet, "error adding our certificate. GnuTLS error %d, message: '%s', " @@ -590,11 +581,6 @@ /* sets the trusted cas file */ cafile = glbl.GetDfltNetstrmDrvrCAF(); - if(cafile == NULL) { - errmsg.LogError(0, RS_RET_CA_CERT_MISSING, "error: ca certificate is not set, cannot " - "continue"); - ABORT_FINALIZE(RS_RET_CA_CERT_MISSING); - } dbgprintf("GTLS CA file: '%s'\n", cafile); gnuRet = gnutls_certificate_set_x509_trust_file(xcred, (char*)cafile, GNUTLS_X509_FMT_PEM); if(gnuRet < 0) { @@ -634,6 +620,7 @@ /* request client certificate if any. */ gnutls_certificate_server_set_request( session, GNUTLS_CERT_REQUEST); + gnutls_dh_set_prime_bits(session, DH_BITS); pThis->sess = session; @@ -642,6 +629,23 @@ } +static rsRetVal +generate_dh_params(void) +{ + int gnuRet; + DEFiRet; + /* Generate Diffie Hellman parameters - for use with DHE + * kx algorithms. These should be discarded and regenerated + * once a day, once a week or once a month. Depending on the + * security requirements. + */ + CHKgnutls(gnutls_dh_params_init( &dh_params)); + CHKgnutls(gnutls_dh_params_generate2( dh_params, DH_BITS)); +finalize_it: + RETiRet; +} + + /* set up all global things that are needed for server operations * rgerhards, 2008-04-30 */ @@ -655,6 +659,8 @@ * considered legacy. -- rgerhards, 2008-05-05 */ /*CHKgnutls(gnutls_certificate_set_x509_crl_file(xcred, CRLFILE, GNUTLS_X509_FMT_PEM));*/ + CHKiRet(generate_dh_params()); + gnutls_certificate_set_dh_params(xcred, dh_params); /* this is void */ bGlblSrvrInitDone = 1; /* we are all set now */ /* now we need to add our certificate */ @@ -1332,16 +1338,13 @@ * This is a dummy here. For details, check function common in ptcp driver. * rgerhards, 2008-06-09 */ -static rsRetVal +static void CheckConnection(nsd_t __attribute__((unused)) *pNsd) { - DEFiRet; nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd; ISOBJ_TYPE_assert(pThis, nsd_gtls); - CHKiRet(nsd_ptcp.CheckConnection(pThis->pTcp)); -finalize_it: - RETiRet; + nsd_ptcp.CheckConnection(pThis->pTcp); } @@ -1373,14 +1376,16 @@ } -/* get the remote host's IP address. Caller must Destruct the object. */ +/* get the remote host's IP address. The returned string must be freed by the + * caller. -- rgerhards, 2008-04-25 + */ static rsRetVal -GetRemoteIP(nsd_t *pNsd, prop_t **ip) +GetRemoteIP(nsd_t *pNsd, uchar **ppszIP) { DEFiRet; nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd; ISOBJ_TYPE_assert(pThis, nsd_gtls); - iRet = nsd_ptcp.GetRemoteIP(pThis->pTcp, ip); + iRet = nsd_ptcp.GetRemoteIP(pThis->pTcp, ppszIP); RETiRet; } @@ -1427,10 +1432,6 @@ /* we got a handshake, now check authorization */ CHKiRet(gtlsChkPeerAuth(pNew)); } else { - uchar *pGnuErr = gtlsStrerror(gnuRet); - errmsg.LogError(0, RS_RET_TLS_HANDSHAKE_ERR, - "gnutls returned error on handshake: %s\n", pGnuErr); - free(pGnuErr); ABORT_FINALIZE(RS_RET_TLS_HANDSHAKE_ERR); } diff -Nru rsyslog-7.6.0/runtime/nsd.h rsyslog-5.10.1/runtime/nsd.h --- rsyslog-7.6.0/runtime/nsd.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/nsd.h 2012-10-17 14:41:20.000000000 +0000 @@ -27,16 +27,6 @@ #include -/** - * The following structure is a set of descriptors that need to be processed. - * This set will be the result of the epoll call and be used - * in the actual request processing stage. -- rgerhards, 2011-01-24 - */ -struct nsd_epworkset_s { - int id; - void *pUsr; -}; - enum nsdsel_waitOp_e { NSDSEL_RD = 1, NSDSEL_WR = 2, @@ -59,11 +49,11 @@ uchar *pLstnPort, uchar *pLstnIP, int iSessMax); rsRetVal (*AcceptConnReq)(nsd_t *pThis, nsd_t **ppThis); rsRetVal (*GetRemoteHName)(nsd_t *pThis, uchar **pszName); - rsRetVal (*GetRemoteIP)(nsd_t *pThis, prop_t **ip); + rsRetVal (*GetRemoteIP)(nsd_t *pThis, uchar **pszIP); rsRetVal (*SetMode)(nsd_t *pThis, int mode); /* sets a driver specific mode - see driver doc for details */ rsRetVal (*SetAuthMode)(nsd_t *pThis, uchar*); /* sets a driver specific mode - see driver doc for details */ rsRetVal (*SetPermPeers)(nsd_t *pThis, permittedPeers_t*); /* sets driver permitted peers for auth needs */ - rsRetVal (*CheckConnection)(nsd_t *pThis); /* This is a trick mostly for plain tcp syslog */ + void (*CheckConnection)(nsd_t *pThis); /* This is a trick mostly for plain tcp syslog */ rsRetVal (*GetSock)(nsd_t *pThis, int *pSock); rsRetVal (*SetSock)(nsd_t *pThis, int sock); /* GetSock() and SetSock() return an error if the driver does not use plain @@ -80,11 +70,9 @@ /* v5 */ rsRetVal (*EnableKeepAlive)(nsd_t *pThis); ENDinterface(nsd) -#define nsdCURR_IF_VERSION 7 /* increment whenever you change the interface structure! */ +#define nsdCURR_IF_VERSION 5 /* increment whenever you change the interface structure! */ /* interface version 4 added GetRemAddr() * interface version 5 added EnableKeepAlive() -- rgerhards, 2009-06-02 - * interface version 6 changed return of CheckConnection from void to rsRetVal -- alorbach, 2012-09-06 - * interface version 7 changed signature ofGetRempoteIP() -- rgerhards, 2013-01-21 */ /* interface for the select call */ @@ -102,7 +90,7 @@ rsRetVal (*Construct)(nsdpoll_t **ppThis); rsRetVal (*Destruct)(nsdpoll_t **ppThis); rsRetVal (*Ctl)(nsdpoll_t *pNsdpoll, nsd_t *pNsd, int id, void *pUsr, int mode, int op); - rsRetVal (*Wait)(nsdpoll_t *pNsdpoll, int timeout, int *numReady, nsd_epworkset_t workset[]); + rsRetVal (*Wait)(nsdpoll_t *pNsdpoll, int timeout, int *idRdy, void **ppUsr); ENDinterface(nsdpoll) #define nsdpollCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ diff -Nru rsyslog-7.6.0/runtime/nsdpoll_ptcp.c rsyslog-5.10.1/runtime/nsdpoll_ptcp.c --- rsyslog-7.6.0/runtime/nsdpoll_ptcp.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/nsdpoll_ptcp.c 2012-10-17 14:41:20.000000000 +0000 @@ -66,21 +66,18 @@ nsdpoll_epollevt_lst_t *pNew; DEFiRet; - CHKmalloc(pNew = (nsdpoll_epollevt_lst_t*) calloc(1, sizeof(nsdpoll_epollevt_lst_t))); + CHKmalloc(pNew = (nsdpoll_epollevt_lst_t*) malloc(sizeof(nsdpoll_epollevt_lst_t))); pNew->id = id; pNew->pUsr = pUsr; pNew->pSock = pSock; pNew->event.events = 0; /* TODO: at some time we should be able to use EPOLLET */ - //pNew->event.events = EPOLLET; if(mode & NSDPOLL_IN) pNew->event.events |= EPOLLIN; if(mode & NSDPOLL_OUT) pNew->event.events |= EPOLLOUT; - pNew->event.data.ptr = pNew; - pthread_mutex_lock(&pThis->mutEvtLst); + pNew->event.data.u64 = (uint64) pNew; pNew->pNext = pThis->pRoot; pThis->pRoot = pNew; - pthread_mutex_unlock(&pThis->mutEvtLst); *pEvtLst = pNew; finalize_it: @@ -97,7 +94,6 @@ nsdpoll_epollevt_lst_t *pPrev = NULL; DEFiRet; - pthread_mutex_lock(&pThis->mutEvtLst); pEvtLst = pThis->pRoot; while(pEvtLst != NULL && !(pEvtLst->id == id && pEvtLst->pUsr == pUsr)) { pPrev = pEvtLst; @@ -115,7 +111,6 @@ pPrev->pNext = pEvtLst->pNext; finalize_it: - pthread_mutex_unlock(&pThis->mutEvtLst); RETiRet; } @@ -152,27 +147,13 @@ DBGPRINTF("epoll_create1() could not create fd\n"); ABORT_FINALIZE(RS_RET_IO_ERROR); } - pthread_mutex_init(&pThis->mutEvtLst, NULL); finalize_it: ENDobjConstruct(nsdpoll_ptcp) /* destructor for the nsdpoll_ptcp object */ BEGINobjDestruct(nsdpoll_ptcp) /* be sure to specify the object type also in END and CODESTART macros! */ - nsdpoll_epollevt_lst_t *node; - nsdpoll_epollevt_lst_t *nextnode; CODESTARTobjDestruct(nsdpoll_ptcp) - /* we check if the epoll list still holds entries. This may happen, but - * is a bit unusual. - */ - if(pThis->pRoot != NULL) { - for(node = pThis->pRoot ; node != NULL ; node = nextnode) { - nextnode = node->pNext; - dbgprintf("nsdpoll_ptcp destruct, need to destruct node %p\n", node); - delEvent(&node); - } - } - pthread_mutex_destroy(&pThis->mutEvtLst); ENDobjDestruct(nsdpoll_ptcp) @@ -221,25 +202,23 @@ /* Wait for io to become ready. After the successful call, idRdy contains the * id set by the caller for that i/o event, ppUsr is a pointer to a location * where the user pointer shall be stored. - * numEntries contains the maximum number of entries on entry and the actual - * number of entries actually read on exit. + * TODO: this is a trivial implementation that only polls one event at a time. We + * may later extend it to poll for multiple events, what would cause less + * overhead. * rgerhards, 2009-11-18 */ static rsRetVal -Wait(nsdpoll_t *pNsdpoll, int timeout, int *numEntries, nsd_epworkset_t workset[]) { +Wait(nsdpoll_t *pNsdpoll, int timeout, int *idRdy, void **ppUsr) { nsdpoll_ptcp_t *pThis = (nsdpoll_ptcp_t*) pNsdpoll; nsdpoll_epollevt_lst_t *pOurEvt; - struct epoll_event event[128]; + struct epoll_event event; int nfds; - int i; DEFiRet; - assert(workset != NULL); + assert(idRdy != NULL); + assert(ppUsr != NULL); - if(*numEntries > 128) - *numEntries = 128; - DBGPRINTF("doing epoll_wait for max %d events\n", *numEntries); - nfds = epoll_wait(pThis->efd, event, *numEntries, timeout); + nfds = epoll_wait(pThis->efd, &event, 1, timeout); if(nfds == -1) { if(errno == EINTR) { ABORT_FINALIZE(RS_RET_EINTR); @@ -251,15 +230,10 @@ ABORT_FINALIZE(RS_RET_TIMEOUT); } - /* we got valid events, so tell the caller... */ -dbgprintf("epoll returned %d entries\n", nfds); - for(i = 0 ; i < nfds ; ++i) { - pOurEvt = (nsdpoll_epollevt_lst_t*) event[i].data.ptr; - workset[i].id = pOurEvt->id; - workset[i].pUsr = pOurEvt->pUsr; -dbgprintf("epoll push ppusr[%d]: %p\n", i, pOurEvt->pUsr); - } - *numEntries = nfds; + /* we got a valid event, so tell the caller... */ + pOurEvt = (nsdpoll_epollevt_lst_t*) event.data.u64; + *idRdy = pOurEvt->id; + *ppUsr = pOurEvt->pUsr; finalize_it: RETiRet; diff -Nru rsyslog-7.6.0/runtime/nsdpoll_ptcp.h rsyslog-5.10.1/runtime/nsdpoll_ptcp.h --- rsyslog-7.6.0/runtime/nsdpoll_ptcp.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/nsdpoll_ptcp.h 2012-10-17 14:41:20.000000000 +0000 @@ -49,7 +49,6 @@ BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ int efd; /* file descriptor used by epoll */ nsdpoll_epollevt_lst_t *pRoot; /* Root of the epoll event list */ - pthread_mutex_t mutEvtLst; }; /* interface is defined in nsd.h, we just implement it! */ diff -Nru rsyslog-7.6.0/runtime/nsd_ptcp.c rsyslog-5.10.1/runtime/nsd_ptcp.c --- rsyslog-7.6.0/runtime/nsd_ptcp.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/nsd_ptcp.c 2012-10-17 14:41:20.000000000 +0000 @@ -2,7 +2,7 @@ * * An implementation of the nsd interface for plain tcp sockets. * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -50,8 +50,6 @@ #include "nsdsel_ptcp.h" #include "nsdpoll_ptcp.h" #include "nsd_ptcp.h" -#include "prop.h" -#include "dnscache.h" MODULE_TYPE_LIB MODULE_TYPE_NOKEEP @@ -63,7 +61,6 @@ DEFobjCurrIf(net) DEFobjCurrIf(netstrms) DEFobjCurrIf(netstrm) -DEFobjCurrIf(prop) /* a few deinit helpers */ @@ -89,9 +86,10 @@ BEGINobjDestruct(nsd_ptcp) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(nsd_ptcp) sockClose(&pThis->sock); - if(pThis->remoteIP != NULL) - prop.Destruct(&pThis->remoteIP); - free(pThis->pRemHostName); + if(pThis->pRemHostIP != NULL) + free(pThis->pRemHostIP); + if(pThis->pRemHostName != NULL) + free(pThis->pRemHostName); ENDobjDestruct(nsd_ptcp) @@ -250,24 +248,67 @@ * rgerhards, 2008-03-31 */ static rsRetVal -FillRemHost(nsd_ptcp_t *pThis, struct sockaddr_storage *pAddr) +FillRemHost(nsd_ptcp_t *pThis, struct sockaddr *pAddr) { - prop_t *fqdn; + int error; + uchar szIP[NI_MAXHOST] = ""; + uchar szHname[NI_MAXHOST] = ""; + struct addrinfo hints, *res; + size_t len; DEFiRet; ISOBJ_TYPE_assert(pThis, nsd_ptcp); assert(pAddr != NULL); - CHKiRet(dnscacheLookup(pAddr, &fqdn, NULL, NULL, &pThis->remoteIP)); + error = getnameinfo(pAddr, SALEN(pAddr), (char*)szIP, sizeof(szIP), NULL, 0, NI_NUMERICHOST); + + if(error) { + dbgprintf("Malformed from address %s\n", gai_strerror(error)); + strcpy((char*)szHname, "???"); + strcpy((char*)szIP, "???"); + ABORT_FINALIZE(RS_RET_INVALID_HNAME); + } + + if(!glbl.GetDisableDNS()) { + error = getnameinfo(pAddr, SALEN(pAddr), (char*)szHname, NI_MAXHOST, NULL, 0, NI_NAMEREQD); + if(error == 0) { + memset (&hints, 0, sizeof (struct addrinfo)); + hints.ai_flags = AI_NUMERICHOST; + hints.ai_socktype = SOCK_STREAM; + /* we now do a lookup once again. This one should fail, + * because we should not have obtained a non-numeric address. If + * we got a numeric one, someone messed with DNS! + */ + if(getaddrinfo((char*)szHname, NULL, &hints, &res) == 0) { + freeaddrinfo (res); + /* OK, we know we have evil, so let's indicate this to our caller */ + snprintf((char*)szHname, NI_MAXHOST, "[MALICIOUS:IP=%s]", szIP); + dbgprintf("Malicious PTR record, IP = \"%s\" HOST = \"%s\"", szIP, szHname); + iRet = RS_RET_MALICIOUS_HNAME; + } + } else { + strcpy((char*)szHname, (char*)szIP); + } + } else { + strcpy((char*)szHname, (char*)szIP); + } /* We now have the names, so now let's allocate memory and store them permanently. * (side note: we may hold on to these values for quite a while, thus we trim their * memory consumption) */ - if((pThis->pRemHostName = MALLOC(prop.GetStringLen(fqdn)+1)) == NULL) + len = strlen((char*)szIP) + 1; /* +1 for \0 byte */ + if((pThis->pRemHostIP = MALLOC(len)) == NULL) + ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + memcpy(pThis->pRemHostIP, szIP, len); + + len = strlen((char*)szHname) + 1; /* +1 for \0 byte */ + if((pThis->pRemHostName = MALLOC(len)) == NULL) { + free(pThis->pRemHostIP); /* prevent leak */ + pThis->pRemHostIP = NULL; ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - memcpy(pThis->pRemHostName, propGetSzStr(fqdn), prop.GetStringLen(fqdn)+1); - prop.Destruct(&fqdn); + } + memcpy(pThis->pRemHostName, szHname, len); finalize_it: RETiRet; @@ -311,7 +352,7 @@ * of this function. -- rgerhards, 2008-12-01 */ memcpy(&pNew->remAddr, &addr, sizeof(struct sockaddr_storage)); - CHKiRet(FillRemHost(pNew, &addr)); + CHKiRet(FillRemHost(pNew, (struct sockaddr*) &addr)); /* set the new socket to non-blocking IO -TODO:do we really need to do this here? Do we always want it? */ if((sockflags = fcntl(iNewSock, F_GETFL)) != -1) { @@ -451,9 +492,7 @@ #endif ) { /* TODO: check if *we* bound the socket - else we *have* an error! */ - char errStr[1024]; - rs_strerror_r(errno, errStr, sizeof(errStr)); - dbgprintf("error %d while binding tcp socket: %s\n", errno, errStr); + dbgprintf("error %d while binding tcp socket", errno); close(sock); sock = -1; continue; @@ -465,7 +504,7 @@ * to a fixed, reasonable, limit that should work. Only if * that fails, too, we give up. */ - dbgprintf("listen with a backlog of %d failed - retrying with default of 32.\n", + dbgprintf("listen with a backlog of %d failed - retrying with default of 32.", iSessMax / 10 + 5); if(listen(sock, 32) < 0) { dbgprintf("tcp listen error %d, suspending\n", errno); @@ -498,7 +537,7 @@ "- this may or may not be an error indication.\n", numSocks, maxs); if(numSocks == 0) { - dbgprintf("No TCP listen sockets could successfully be initialized\n"); + dbgprintf("No TCP listen sockets could successfully be initialized"); ABORT_FINALIZE(RS_RET_COULD_NOT_BIND); } @@ -687,10 +726,9 @@ * http://blog.gerhards.net/2008/06/getting-bit-more-reliability-from-plain.html * rgerhards, 2008-06-09 */ -static rsRetVal +static void CheckConnection(nsd_t *pNsd) { - DEFiRet; int rc; char msgbuf[1]; /* dummy */ nsd_ptcp_t *pThis = (nsd_ptcp_t*) pNsd; @@ -703,23 +741,25 @@ * need to close our side, too. */ sockClose(&pThis->sock); - ABORT_FINALIZE(RS_RET_IO_ERROR); } -finalize_it: - RETiRet; } -/* get the remote host's IP address. Caller must Destruct the object. +/* get the remote host's IP address. The returned string must be freed by the + * caller. + * rgerhards, 2008-04-24 */ static rsRetVal -GetRemoteIP(nsd_t *pNsd, prop_t **ip) +GetRemoteIP(nsd_t *pNsd, uchar **ppszIP) { DEFiRet; nsd_ptcp_t *pThis = (nsd_ptcp_t*) pNsd; ISOBJ_TYPE_assert(pThis, nsd_ptcp); - prop.AddRef(pThis->remoteIP); - *ip = pThis->remoteIP; + assert(ppszIP != NULL); + + CHKmalloc(*ppszIP = (uchar*)strdup(pThis->pRemHostIP == NULL ? "" : (char*) pThis->pRemHostIP)); + +finalize_it: RETiRet; } @@ -765,7 +805,6 @@ /* release objects we no longer need */ objRelease(net, CORE_COMPONENT); objRelease(glbl, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(netstrm, DONT_LOAD_LIB); objRelease(netstrms, LM_NETSTRMS_FILENAME); @@ -780,7 +819,6 @@ /* request objects we use */ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(objUse(net, CORE_COMPONENT)); CHKiRet(objUse(netstrms, LM_NETSTRMS_FILENAME)); CHKiRet(objUse(netstrm, DONT_LOAD_LIB)); diff -Nru rsyslog-7.6.0/runtime/nsd_ptcp.h rsyslog-5.10.1/runtime/nsd_ptcp.h --- rsyslog-7.6.0/runtime/nsd_ptcp.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/nsd_ptcp.h 2012-09-23 10:29:49.000000000 +0000 @@ -30,7 +30,7 @@ /* the nsd_ptcp object */ struct nsd_ptcp_s { BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ - prop_t *remoteIP; /**< IP address of remote peer (currently used in server mode, only) */ + uchar *pRemHostIP; /**< IP address of remote peer (currently used in server mode, only) */ uchar *pRemHostName; /**< host name of remote peer (currently used in server mode, only) */ struct sockaddr_storage remAddr; /**< remote addr as sockaddr - used for legacy ACL code */ int sock; /**< the socket we use for regular, single-socket, operations */ diff -Nru rsyslog-7.6.0/runtime/nspoll.c rsyslog-5.10.1/runtime/nspoll.c --- rsyslog-7.6.0/runtime/nspoll.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/nspoll.c 2012-10-17 14:41:20.000000000 +0000 @@ -66,6 +66,7 @@ uchar szDrvrName[48]; /* 48 shall be large enough */ pBaseDrvrName = pThis->pBaseDrvrName; + if(pBaseDrvrName == NULL) /* if no drvr name is set, use system default */ pBaseDrvrName = glbl.GetDfltNetstrmDrvr(); if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmnsdpoll_%s", pBaseDrvrName) == sizeof(szDrvrName)) ABORT_FINALIZE(RS_RET_DRVRNAME_TOO_LONG); @@ -128,34 +129,11 @@ /* Carries out the actual wait (all done in lower layers) */ static rsRetVal -Wait(nspoll_t *pThis, int timeout, int *numEntries, nsd_epworkset_t workset[]) { +Wait(nspoll_t *pThis, int timeout, int *idRdy, void **ppUsr) { DEFiRet; ISOBJ_TYPE_assert(pThis, nspoll); - assert(workset != NULL); - iRet = pThis->Drvr.Wait(pThis->pDrvrData, timeout, numEntries, workset); - RETiRet; -} - - -/* set the base driver name. If the driver name - * is set to NULL, the previously set name is deleted but - * no name set again (which results in the system default being - * used)-- rgerhards, 2008-05-05 - */ -static rsRetVal -SetDrvrName(nspoll_t *pThis, uchar *pszName) -{ - DEFiRet; - ISOBJ_TYPE_assert(pThis, netstrms); - if(pThis->pBaseDrvrName != NULL) { - free(pThis->pBaseDrvrName); - pThis->pBaseDrvrName = NULL; - } - - if(pszName != NULL) { - CHKmalloc(pThis->pBaseDrvrName = (uchar*) strdup((char*) pszName)); - } -finalize_it: + assert(idRdy != NULL); + iRet = pThis->Drvr.Wait(pThis->pDrvrData, timeout, idRdy, ppUsr); RETiRet; } @@ -186,7 +164,6 @@ */ pIf->Construct = nspollConstruct; pIf->ConstructFinalize = ConstructFinalize; - pIf->SetDrvrName = SetDrvrName; pIf->Destruct = nspollDestruct; pIf->Wait = Wait; pIf->Ctl = Ctl; diff -Nru rsyslog-7.6.0/runtime/nspoll.h rsyslog-5.10.1/runtime/nspoll.h --- rsyslog-7.6.0/runtime/nspoll.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/nspoll.h 2012-10-17 14:41:20.000000000 +0000 @@ -50,14 +50,11 @@ rsRetVal (*Construct)(nspoll_t **ppThis); rsRetVal (*ConstructFinalize)(nspoll_t *pThis); rsRetVal (*Destruct)(nspoll_t **ppThis); - rsRetVal (*Wait)(nspoll_t *pNsdpoll, int timeout, int *numEntries, nsd_epworkset_t workset[]); + rsRetVal (*Wait)(nspoll_t *pNsdpoll, int timeout, int *idRdy, void **ppUsr); rsRetVal (*Ctl)(nspoll_t *pNsdpoll, netstrm_t *pStrm, int id, void *pUsr, int mode, int op); rsRetVal (*IsEPollSupported)(void); /* static method */ - /* v3 - 2013-09-17 by rgerhards */ - rsRetVal (*SetDrvrName)(nspoll_t *pThis, uchar *name); ENDinterface(nspoll) -#define nspollCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */ -/* interface change in v2 is that wait supports multiple return objects */ +#define nspollCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ /* prototypes */ PROTOTYPEObj(nspoll); diff -Nru rsyslog-7.6.0/runtime/nssel.c rsyslog-5.10.1/runtime/nssel.c --- rsyslog-7.6.0/runtime/nssel.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/nssel.c 2012-09-23 10:29:49.000000000 +0000 @@ -127,29 +127,6 @@ } -/* set the base driver name. If the driver name - * is set to NULL, the previously set name is deleted but - * no name set again (which results in the system default being - * used)-- rgerhards, 2008-05-05 - */ -static rsRetVal -SetDrvrName(nssel_t *pThis, uchar *pszName) -{ - DEFiRet; - ISOBJ_TYPE_assert(pThis, netstrms); - if(pThis->pBaseDrvrName != NULL) { - free(pThis->pBaseDrvrName); - pThis->pBaseDrvrName = NULL; - } - - if(pszName != NULL) { - CHKmalloc(pThis->pBaseDrvrName = (uchar*) strdup((char*) pszName)); - } -finalize_it: - RETiRet; -} - - /* Add a stream object to the current select() set. * Note that a single stream may have multiple "sockets" if * it is a listener. If so, all of them are begin added. @@ -218,7 +195,6 @@ pIf->Construct = nsselConstruct; pIf->ConstructFinalize = ConstructFinalize; pIf->Destruct = nsselDestruct; - pIf->SetDrvrName = SetDrvrName; pIf->Add = Add; pIf->Wait = Wait; pIf->IsReady = IsReady; diff -Nru rsyslog-7.6.0/runtime/nssel.h rsyslog-5.10.1/runtime/nssel.h --- rsyslog-7.6.0/runtime/nssel.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/nssel.h 2012-09-23 10:29:49.000000000 +0000 @@ -42,10 +42,8 @@ rsRetVal (*Add)(nssel_t *pThis, netstrm_t *pStrm, nsdsel_waitOp_t waitOp); rsRetVal (*Wait)(nssel_t *pThis, int *pNumReady); rsRetVal (*IsReady)(nssel_t *pThis, netstrm_t *pStrm, nsdsel_waitOp_t waitOp, int *pbIsReady, int *piNumReady); - /* v2 - 2013-09-17 by rgerhards */ - rsRetVal (*SetDrvrName)(nssel_t *pThis, uchar *name); ENDinterface(nssel) -#define nsselCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ +#define nsselCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ /* prototypes */ PROTOTYPEObj(nssel); diff -Nru rsyslog-7.6.0/runtime/obj.c rsyslog-5.10.1/runtime/obj.c --- rsyslog-7.6.0/runtime/obj.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/obj.c 2012-10-17 14:41:20.000000000 +0000 @@ -87,6 +87,7 @@ #include "errmsg.h" #include "cfsysline.h" #include "unicode-helper.h" +#include "apc.h" #include "datetime.h" /* static data */ @@ -604,7 +605,7 @@ /* Deserialize a single property. Pointer must be positioned at begin of line. Whole line * up until the \n is read. */ -rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm) +static rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm) { DEFiRet; number_t i; @@ -665,7 +666,7 @@ if(c != '\n') ABORT_FINALIZE(RS_RET_INVALID_PROPFRAME); finalize_it: - if(Debug && iRet != RS_RET_OK && iRet != RS_RET_NO_PROPLINE) { + if(Debug && iRet != RS_RET_OK) { strm.GetCurrOffset(pStrm, &offs); dbgprintf("error %d deserializing property name, offset %lld, step %d\n", iRet, offs, step); @@ -767,20 +768,21 @@ * of the trailer. Header must already have been processed. * rgerhards, 2008-01-11 */ -static rsRetVal objDeserializeProperties(obj_t *pObj, rsRetVal (*objSetProperty)(), strm_t *pStrm) +static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_t *pStrm) { DEFiRet; var_t *pVar = NULL; ISOBJ_assert(pObj); ISOBJ_TYPE_assert(pStrm, strm); + ASSERT(pObjInfo != NULL); CHKiRet(var.Construct(&pVar)); CHKiRet(var.ConstructFinalize(pVar)); iRet = objDeserializeProperty(pVar, pStrm); while(iRet == RS_RET_OK) { - CHKiRet(objSetProperty(pObj, pVar)); + CHKiRet(pObjInfo->objMethods[objMethod_SETPROPERTY](pObj, pVar)); /* re-init var object - TODO: method of var! */ rsCStrDestruct(&pVar->pcsName); /* no longer needed */ if(pVar->varType == VARTYPE_STR) { @@ -847,7 +849,7 @@ CHKiRet(pObjInfo->objMethods[objMethod_CONSTRUCT](&pObj)); /* we got the object, now we need to fill the properties */ - CHKiRet(objDeserializeProperties(pObj, pObjInfo->objMethods[objMethod_SETPROPERTY], pStrm)); + CHKiRet(objDeserializeProperties(pObj, pObjInfo, pStrm)); /* check if we need to call a fixup function that modifies the object * before it is finalized. -- rgerhards, 2008-01-13 @@ -872,104 +874,6 @@ } -/* De-Serialize an object, with known constructur and destructor. Params like Deserialize(). - * rgerhards, 2012-11-03 - */ -rsRetVal -objDeserializeWithMethods(void *ppObj, uchar *pszTypeExpected, int lenTypeExpected, strm_t *pStrm, rsRetVal (*fFixup)(obj_t*,void*), void *pUsr, rsRetVal (*objConstruct)(), rsRetVal (*objConstructFinalize)(), rsRetVal (*objDeserialize)()) -{ - DEFiRet; - rsRetVal iRetLocal; - obj_t *pObj = NULL; - int oVers = 0; /* keep compiler happy, but it is totally useless but takes up some execution time... */ - cstr_t *pstrID = NULL; - - assert(ppObj != NULL); - assert(pszTypeExpected != NULL); - ISOBJ_TYPE_assert(pStrm, strm); - - /* we de-serialize the header. if all goes well, we are happy. However, if - * we experience a problem, we try to recover. We do this by skipping to - * the next object header. This is defined via the line-start cookies. In - * worst case, we exhaust the queue, but then we receive EOF return state, - * from objDeserializeTryRecover(), what will cause us to ultimately give up. - * rgerhards, 2008-07-08 - */ - do { - iRetLocal = objDeserializeHeader((uchar*) "Obj", &pstrID, &oVers, pStrm); - if(iRetLocal != RS_RET_OK) { - dbgprintf("objDeserialize error %d during header processing - " - "trying to recover\n", iRetLocal); - CHKiRet(objDeserializeTryRecover(pStrm)); - } - } while(iRetLocal != RS_RET_OK); - - if(rsCStrSzStrCmp(pstrID, pszTypeExpected, lenTypeExpected)) - ABORT_FINALIZE(RS_RET_INVALID_OID); - - CHKiRet(objConstruct(&pObj)); - - /* we got the object, now we need to fill the properties */ - CHKiRet(objDeserialize(pObj, pStrm)); - CHKiRet(objDeserializeTrailer(pStrm)); /* do trailer checks */ - - /* check if we need to call a fixup function that modifies the object - * before it is finalized. -- rgerhards, 2008-01-13 - */ - if(fFixup != NULL) - CHKiRet(fFixup(pObj, pUsr)); - - /* we have a valid object, let's finalize our work and return */ - if(objConstructFinalize != NULL) { - CHKiRet(objConstructFinalize(pObj)); - } - - *((obj_t**) ppObj) = pObj; - -finalize_it: - if(iRet != RS_RET_OK && pObj != NULL) - free(pObj); /* TODO: check if we can call destructor 2008-01-13 rger */ - - if(pstrID != NULL) - rsCStrDestruct(&pstrID); - - RETiRet; -} - -/* This is a dummy deserializer, to be used for the delete queue reader - * specifically. This is kind of a hack, but also to be replace (hopefully) soon - * by totally different code. So let's make it as simple as possible... - * rgerhards, 2012-11-06 - */ -rsRetVal -objDeserializeDummy(obj_t __attribute__((unused)) *pObj, strm_t *pStrm) -{ - DEFiRet; - var_t *pVar = NULL; - - CHKiRet(var.Construct(&pVar)); - CHKiRet(var.ConstructFinalize(pVar)); - - iRet = objDeserializeProperty(pVar, pStrm); - while(iRet == RS_RET_OK) { - /* this loop does actually NOGHTING but read the file... */ - /* re-init var object - TODO: method of var! */ - rsCStrDestruct(&pVar->pcsName); /* no longer needed */ - if(pVar->varType == VARTYPE_STR) { - if(pVar->val.pStr != NULL) - rsCStrDestruct(&pVar->val.pStr); - } - iRet = objDeserializeProperty(pVar, pStrm); - } -finalize_it: - if(iRet == RS_RET_NO_PROPLINE) - iRet = RS_RET_OK; /* NO_PROPLINE is OK and a kind of EOF! */ - if(pVar != NULL) - var.Destruct(&pVar); - RETiRet; -} - - /* De-Serialize an object, but treat it as property bag. * rgerhards, 2008-01-11 */ @@ -1006,7 +910,7 @@ CHKiRet(FindObjInfo(pstrID, &pObjInfo)); /* we got the object, now we need to fill the properties */ - CHKiRet(objDeserializeProperties(pObj, pObjInfo->objMethods[objMethod_SETPROPERTY], pStrm)); + CHKiRet(objDeserializeProperties(pObj, pObjInfo, pStrm)); finalize_it: if(pstrID != NULL) @@ -1058,7 +962,7 @@ CHKiRet(FindObjInfo(pstrID, &pObjInfo)); /* we got the object, now we need to fill the properties */ - CHKiRet(objDeserializeProperties(pObj, pObjInfo->objMethods[objMethod_SETPROPERTY], pStrm)); + CHKiRet(objDeserializeProperties(pObj, pObjInfo, pStrm)); finalize_it: if(pstrID != NULL) @@ -1285,7 +1189,7 @@ if(pObjFile == NULL) { FINALIZE; /* no chance, we have lost... */ } else { - CHKiRet(module.Load(pObjFile, 0, NULL)); + CHKiRet(module.Load(pObjFile)); /* NOW, we must find it or we have a problem... */ CHKiRet(FindObjInfo(pStr, &pObjInfo)); } @@ -1464,6 +1368,7 @@ /* init classes we use (limit to as few as possible!) */ CHKiRet(errmsgClassInit(pModInfo)); CHKiRet(datetimeClassInit(pModInfo)); + CHKiRet(apcClassInit(pModInfo)); CHKiRet(cfsyslineInit()); CHKiRet(varClassInit(pModInfo)); CHKiRet(moduleClassInit(pModInfo)); diff -Nru rsyslog-7.6.0/runtime/obj.h rsyslog-5.10.1/runtime/obj.h --- rsyslog-7.6.0/runtime/obj.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/obj.h 2012-10-15 13:45:04.000000000 +0000 @@ -83,7 +83,10 @@ ((obj_t*) (pThis))->pObjInfo = pObjInfoOBJ; \ ((obj_t*) (pThis))->pszName = NULL #endif +#define objDestruct(pThis) (((obj_t*) (pThis))->pObjInfo->objMethods[objMethod_DESTRUCT])(&pThis) #define objSerialize(pThis) (((obj_t*) (pThis))->pObjInfo->objMethods[objMethod_SERIALIZE]) +#define objGetSeverity(pThis, piSever) (((obj_t*) (pThis))->pObjInfo->objMethods[objMethod_GETSEVERITY])(pThis, piSever) +#define objDebugPrint(pThis) (((obj_t*) (pThis))->pObjInfo->objMethods[objMethod_DEBUGPRINT])(pThis) #define OBJSetMethodHandler(methodID, pHdlr) \ CHKiRet(obj.InfoSetMethod(pObjInfoOBJ, methodID, (rsRetVal (*)(void*)) pHdlr)) @@ -118,9 +121,6 @@ rsRetVal objGetObjInterface(obj_if_t *pIf); PROTOTYPEObjClassInit(obj); PROTOTYPEObjClassExit(obj); -rsRetVal objDeserializeWithMethods(void *ppObj, uchar *pszTypeExpected, int lenTypeExpected, strm_t *pStrm, rsRetVal (*fFixup)(obj_t*,void*), void *pUsr, rsRetVal (*objConstruct)(), rsRetVal (*objConstructFinalize)(), rsRetVal (*objDeserialize)()); -rsRetVal objDeserializeProperty(var_t *pProp, strm_t *pStrm); -rsRetVal objDeserializeDummy(obj_t *pObj, strm_t *pStrm); /* the following definition is only for "friends" */ diff -Nru rsyslog-7.6.0/runtime/objomsr.c rsyslog-5.10.1/runtime/objomsr.c --- rsyslog-7.6.0/runtime/objomsr.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/objomsr.c 2012-10-17 14:41:20.000000000 +0000 @@ -42,7 +42,9 @@ /* free the strings */ if(pThis->ppTplName != NULL) { for(i = 0 ; i < pThis->iNumEntries ; ++i) { - free(pThis->ppTplName[i]); + if(pThis->ppTplName[i] != NULL) { + free(pThis->ppTplName[i]); + } } free(pThis->ppTplName); } @@ -58,14 +60,11 @@ */ rsRetVal OMSRconstruct(omodStringRequest_t **ppThis, int iNumEntries) { - omodStringRequest_t *pThis = NULL; + omodStringRequest_t *pThis; DEFiRet; assert(ppThis != NULL); assert(iNumEntries >= 0); - if(iNumEntries > CONF_OMOD_NUMSTRINGS_MAXSIZE) { - ABORT_FINALIZE(RS_RET_MAX_OMSR_REACHED); - } CHKmalloc(pThis = calloc(1, sizeof(omodStringRequest_t))); /* got the structure, so fill it */ @@ -95,6 +94,7 @@ rsRetVal OMSRsetEntry(omodStringRequest_t *pThis, int iEntry, uchar *pTplName, int iTplOpts) { assert(pThis != NULL); + assert(pTplName != NULL); assert(iEntry < pThis->iNumEntries); if(pThis->ppTplName[iEntry] != NULL) @@ -147,8 +147,7 @@ { DEFiRet; assert(pOpts != NULL); - *pOpts = OMSR_RQD_TPL_OPT_SQL | OMSR_TPL_AS_ARRAY | OMSR_TPL_AS_MSG - | OMSR_TPL_AS_JSON; + *pOpts = OMSR_RQD_TPL_OPT_SQL | OMSR_TPL_AS_ARRAY | OMSR_TPL_AS_MSG; RETiRet; } diff -Nru rsyslog-7.6.0/runtime/objomsr.h rsyslog-5.10.1/runtime/objomsr.h --- rsyslog-7.6.0/runtime/objomsr.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/objomsr.h 2012-10-17 14:41:20.000000000 +0000 @@ -25,13 +25,12 @@ /* define flags for required template options */ #define OMSR_NO_RQD_TPL_OPTS 0 #define OMSR_RQD_TPL_OPT_SQL 1 -/* only one of OMSR_TPL_AS_ARRAY, _AS_MSG, or _AS_JSON must be specified, - * if all are given results are unpredictable. +/* only one of OMSR_TPL_AS_ARRAY or _AS_MSG must be specified, if both are given + * results are unpredictable. */ #define OMSR_TPL_AS_ARRAY 2 /* introduced in 4.1.6, 2009-04-03 */ #define OMSR_TPL_AS_MSG 4 /* introduced in 5.3.4, 2009-11-02 */ -#define OMSR_TPL_AS_JSON 8 /* introduced in 6.5.1, 2012-09-02 */ -/* next option is 16, 32, 64, ... */ +/* next option is 8, 16, 32, ... */ struct omodStringRequest_s { /* strings requested by output module for doAction() */ int iNumEntries; /* number of array entries for data elements below */ diff -Nru rsyslog-7.6.0/runtime/obj-types.h rsyslog-5.10.1/runtime/obj-types.h --- rsyslog-7.6.0/runtime/obj-types.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/obj-types.h 2012-09-23 10:29:49.000000000 +0000 @@ -282,12 +282,14 @@ rsRetVal OBJ##Destruct(OBJ##_t __attribute__((unused)) **ppThis) \ { \ DEFiRet; \ + int iCancelStateSave; \ OBJ##_t *pThis; #define CODESTARTobjDestruct(OBJ) \ ASSERT(ppThis != NULL); \ pThis = *ppThis; \ - ISOBJ_TYPE_assert(pThis, OBJ); + ISOBJ_TYPE_assert(pThis, OBJ); \ + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); /* note: there was a long-time bug in the macro below that lead to *ppThis = NULL * only when the object was actually destructed. I discovered this issue during @@ -307,6 +309,7 @@ free(pThis); \ } \ *ppThis = NULL; \ + pthread_setcancelstate(iCancelStateSave, NULL); \ RETiRet; \ } diff -Nru rsyslog-7.6.0/runtime/parser.c rsyslog-5.10.1/runtime/parser.c --- rsyslog-7.6.0/runtime/parser.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/parser.c 2012-10-17 14:41:20.000000000 +0000 @@ -143,14 +143,6 @@ RETiRet; } -void -printParserList(parserList_t *pList) -{ - while(pList != NULL) { - dbgprintf("parser: %s\n", pList->pParser->pName); - pList = pList->pNext; - } -} /* find a parser based on the provided name */ static rsRetVal @@ -188,7 +180,7 @@ CHKiRet(FindParser(&pParser, pName)); CHKiRet(AddParserToList(&pDfltParsLst, pParser)); - DBGPRINTF("Parser '%s' added to default parser set.\n", pName); + dbgprintf("Parser '%s' added to default parser set.\n", pName); finalize_it: RETiRet; @@ -217,7 +209,7 @@ BEGINobjDestruct(parser) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(parser) - DBGPRINTF("destructing parser '%s'\n", pThis->pName); + dbgprintf("destructing parser '%s'\n", pThis->pName); free(pThis->pName); ENDobjDestruct(parser) @@ -362,10 +354,11 @@ */ int bNeedSanitize = 0; for(iSrc = 0 ; iSrc < lenMsg ; iSrc++) { - if(pszMsg[iSrc] < 32) { + if(iscntrl(pszMsg[iSrc])) { if(bSpaceLFOnRcv && pszMsg[iSrc] == '\n') pszMsg[iSrc] = ' '; - else if(pszMsg[iSrc] == '\0' || bEscapeCCOnRcv) { + else + if(pszMsg[iSrc] == '\0' || bEscapeCCOnRcv) { bNeedSanitize = 1; if (!bSpaceLFOnRcv) break; @@ -382,9 +375,7 @@ FINALIZE; } - /* now copy over the message and sanitize it. Note that up to iSrc-1 there was - * obviously no need to sanitize, so we can go over that quickly... - */ + /* now copy over the message and sanitize it */ iMaxLine = glbl.GetMaxLine(); maxDest = lenMsg * 4; /* message can grow at most four-fold */ if(maxDest > iMaxLine) @@ -393,13 +384,9 @@ pDst = szSanBuf; else CHKmalloc(pDst = MALLOC(sizeof(uchar) * (iMaxLine + 1))); - if(iSrc > 0) { - iSrc--; /* go back to where everything is OK */ - memcpy(pDst, pszMsg, iSrc); /* fast copy known good */ - } - iDst = iSrc; + iSrc = iDst = 0; while(iSrc < lenMsg && iDst < maxDest - 3) { /* leave some space if last char must be escaped */ - if((pszMsg[iSrc] < 32) && (pszMsg[iSrc] != '\t' || bEscapeTab)) { + if(iscntrl((int) pszMsg[iSrc]) && (pszMsg[iSrc] != '\t' || bEscapeTab)) { /* note: \0 must always be escaped, the rest of the code currently * can not handle it! -- rgerhards, 2009-08-26 */ @@ -514,7 +501,7 @@ * will cause it to happen. After that, access to the unsanitized message is no * loger possible. */ - pParserList = ruleset.GetParserList(ourConf, pMsg); + pParserList = ruleset.GetParserList(pMsg); if(pParserList == NULL) { pParserList = pDfltParsLst; } @@ -534,7 +521,7 @@ bIsSanitized = RSTRUE; } localRet = pParser->pModule->mod.pm.parse(pMsg); - DBGPRINTF("Parser '%s' returned %d\n", pParser->pName, localRet); + dbgprintf("Parser '%s' returned %d\n", pParser->pName, localRet); if(localRet != RS_RET_COULD_NOT_PARSE) break; pParserList = pParserList->pNext; diff -Nru rsyslog-7.6.0/runtime/parser.h rsyslog-5.10.1/runtime/parser.h --- rsyslog-7.6.0/runtime/parser.h 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/parser.h 2012-10-17 14:41:20.000000000 +0000 @@ -62,7 +62,6 @@ ENDinterface(parser) #define parserCURR_IF_VERSION 1 /* increment whenever you change the interface above! */ -void printParserList(parserList_t *pList); /* prototypes */ PROTOTYPEObj(parser); diff -Nru rsyslog-7.6.0/runtime/prop.c rsyslog-5.10.1/runtime/prop.c --- rsyslog-7.6.0/runtime/prop.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/prop.c 2012-09-23 10:29:49.000000000 +0000 @@ -100,7 +100,7 @@ /* get string */ -rsRetVal GetString(prop_t *pThis, uchar **ppsz, int *plen) +static rsRetVal GetString(prop_t *pThis, uchar **ppsz, int *plen) { BEGINfunc ISOBJ_TYPE_assert(pThis, prop); diff -Nru rsyslog-7.6.0/runtime/prop.h rsyslog-5.10.1/runtime/prop.h --- rsyslog-7.6.0/runtime/prop.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/prop.h 2012-09-23 10:29:49.000000000 +0000 @@ -52,13 +52,6 @@ #define propCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ -/* get classic c-style string */ -static inline uchar * -propGetSzStr(prop_t *pThis) -{ - return(pThis->len < CONF_PROP_BUFSIZE) ? pThis->szVal.sz : pThis->szVal.psz; -} - /* prototypes */ PROTOTYPEObj(prop); diff -Nru rsyslog-7.6.0/runtime/queue.c rsyslog-5.10.1/runtime/queue.c --- rsyslog-7.6.0/runtime/queue.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/queue.c 2012-10-17 14:41:20.000000000 +0000 @@ -12,7 +12,7 @@ * function names - this makes it really hard to read and does not provide much * benefit, at least I (now) think so... * - * Copyright 2008-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008-2011 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -59,7 +59,7 @@ #include "datetime.h" #include "unicode-helper.h" #include "statsobj.h" -#include "parserif.h" +#include "msg.h" /* TODO: remove once we remove MsgAddRef() call */ #ifdef OS_SOLARIS # include @@ -74,7 +74,7 @@ DEFobjCurrIf(statsobj) /* forward-definitions */ -static inline rsRetVal doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, msg_t *pMsg); +static inline rsRetVal doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr); static rsRetVal qqueueChkPersist(qqueue_t *pThis, int nUpdates); static rsRetVal RateLimiter(qqueue_t *pThis); static int qqueueChkStopWrkrDA(qqueue_t *pThis); @@ -83,58 +83,22 @@ static rsRetVal batchProcessed(qqueue_t *pThis, wti_t *pWti); static rsRetVal qqueueMultiEnqObjNonDirect(qqueue_t *pThis, multi_submit_t *pMultiSub); static rsRetVal qqueueMultiEnqObjDirect(qqueue_t *pThis, multi_submit_t *pMultiSub); -static rsRetVal qAddDirect(qqueue_t *pThis, msg_t *pMsg); +static rsRetVal qAddDirect(qqueue_t *pThis, void* pUsr); static rsRetVal qDestructDirect(qqueue_t __attribute__((unused)) *pThis); static rsRetVal qConstructDirect(qqueue_t __attribute__((unused)) *pThis); static rsRetVal qDelDirect(qqueue_t __attribute__((unused)) *pThis); static rsRetVal qDestructDisk(qqueue_t *pThis); -rsRetVal qqueueSetSpoolDir(qqueue_t *pThis, uchar *pszSpoolDir, int lenSpoolDir); /* some constants for queuePersist () */ #define QUEUE_CHECKPOINT 1 #define QUEUE_NO_CHECKPOINT 0 -/* tables for interfacing with the v6 config system */ -static struct cnfparamdescr cnfpdescr[] = { - { "queue.filename", eCmdHdlrGetWord, 0 }, - { "queue.spooldirectory", eCmdHdlrGetWord, 0 }, - { "queue.size", eCmdHdlrSize, 0 }, - { "queue.dequeuebatchsize", eCmdHdlrInt, 0 }, - { "queue.maxdiskspace", eCmdHdlrSize, 0 }, - { "queue.highwatermark", eCmdHdlrInt, 0 }, - { "queue.lowwatermark", eCmdHdlrInt, 0 }, - { "queue.fulldelaymark", eCmdHdlrInt, 0 }, - { "queue.lightdelaymark", eCmdHdlrInt, 0 }, - { "queue.discardmark", eCmdHdlrInt, 0 }, - { "queue.discardseverity", eCmdHdlrFacility, 0 }, - { "queue.checkpointinterval", eCmdHdlrInt, 0 }, - { "queue.syncqueuefiles", eCmdHdlrBinary, 0 }, - { "queue.type", eCmdHdlrQueueType, 0 }, - { "queue.workerthreads", eCmdHdlrInt, 0 }, - { "queue.timeoutshutdown", eCmdHdlrInt, 0 }, - { "queue.timeoutactioncompletion", eCmdHdlrInt, 0 }, - { "queue.timeoutenqueue", eCmdHdlrInt, 0 }, - { "queue.timeoutworkerthreadshutdown", eCmdHdlrInt, 0 }, - { "queue.workerthreadminimummessages", eCmdHdlrInt, 0 }, - { "queue.maxfilesize", eCmdHdlrSize, 0 }, - { "queue.saveonshutdown", eCmdHdlrBinary, 0 }, - { "queue.dequeueslowdown", eCmdHdlrInt, 0 }, - { "queue.dequeuetimebegin", eCmdHdlrInt, 0 }, - { "queue.dequeuetimeend", eCmdHdlrInt, 0 }, - { "queue.cry.provider", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk pblk = - { CNFPARAMBLK_VERSION, - sizeof(cnfpdescr)/sizeof(struct cnfparamdescr), - cnfpdescr - }; - /* debug aid */ -static inline void displayBatchState(batch_t *pBatch) +static void displayBatchState(batch_t *pBatch) { int i; for(i = 0 ; i < pBatch->nElem ; ++i) { - DBGPRINTF("displayBatchState %p[%d]: %d\n", pBatch, i, pBatch->eltState[i]); + dbgprintf("XXXXX: displayBatchState %p[%d]: %d\n", pBatch, i, pBatch->pElem[i].state); } } @@ -227,62 +191,6 @@ /* methods */ -static inline char * -getQueueTypeName(queueType_t t) -{ - char *r; - - switch(t) { - case QUEUETYPE_FIXED_ARRAY: - r = "FixedArray"; - break; - case QUEUETYPE_LINKEDLIST: - r = "LinkedList"; - break; - case QUEUETYPE_DISK: - r = "Disk"; - break; - case QUEUETYPE_DIRECT: - r = "Direct"; - break; - default: - r = "invalid/unknown queue mode"; - break; - } - return r; -} - -void -qqueueDbgPrint(qqueue_t *pThis) -{ - dbgoprint((obj_t*) pThis, "parameter dump:\n"); - dbgoprint((obj_t*) pThis, "queue.filename '%s'\n", - (pThis->pszFilePrefix == NULL) ? "[NONE]" : (char*)pThis->pszFilePrefix); - dbgoprint((obj_t*) pThis, "queue.size: %d\n", pThis->iMaxQueueSize); - dbgoprint((obj_t*) pThis, "queue.dequeuebatchsize: %d\n", pThis->iDeqBatchSize); - dbgoprint((obj_t*) pThis, "queue.maxdiskspace: %lld\n", pThis->sizeOnDiskMax); - dbgoprint((obj_t*) pThis, "queue.highwatermark: %d\n", pThis->iHighWtrMrk); - dbgoprint((obj_t*) pThis, "queue.lowwatermark: %d\n", pThis->iLowWtrMrk); - dbgoprint((obj_t*) pThis, "queue.fulldelaymark: %d\n", pThis->iFullDlyMrk); - dbgoprint((obj_t*) pThis, "queue.lightdelaymark: %d\n", pThis->iLightDlyMrk); - dbgoprint((obj_t*) pThis, "queue.discardmark: %d\n", pThis->iDiscardMrk); - dbgoprint((obj_t*) pThis, "queue.discardseverity: %d\n", pThis->iDiscardSeverity); - dbgoprint((obj_t*) pThis, "queue.checkpointinterval: %d\n", pThis->iPersistUpdCnt); - dbgoprint((obj_t*) pThis, "queue.syncqueuefiles: %d\n", pThis->bSyncQueueFiles); - dbgoprint((obj_t*) pThis, "queue.type: %d [%s]\n", pThis->qType, getQueueTypeName(pThis->qType)); - dbgoprint((obj_t*) pThis, "queue.workerthreads: %d\n", pThis->iNumWorkerThreads); - dbgoprint((obj_t*) pThis, "queue.timeoutshutdown: %d\n", pThis->toQShutdown); - dbgoprint((obj_t*) pThis, "queue.timeoutactioncompletion: %d\n", pThis->toActShutdown); - dbgoprint((obj_t*) pThis, "queue.timeoutenqueue: %d\n", pThis->toEnq); - dbgoprint((obj_t*) pThis, "queue.timeoutworkerthreadshutdown: %d\n", pThis->toWrkShutdown); - dbgoprint((obj_t*) pThis, "queue.workerthreadminimummessages: %d\n", pThis->iMinMsgsPerWrkr); - dbgoprint((obj_t*) pThis, "queue.maxfilesize: %lld\n", pThis->iMaxFileSize); - dbgoprint((obj_t*) pThis, "queue.saveonshutdown: %d\n", pThis->bSaveOnShutdown); - dbgoprint((obj_t*) pThis, "queue.dequeueslowdown: %d\n", pThis->iDeqSlowdown); - dbgoprint((obj_t*) pThis, "queue.dequeuetimebegin: %d\n", pThis->iDeqtWinFromHr); - dbgoprint((obj_t*) pThis, "queuedequeuetimend.: %d\n", pThis->iDeqtWinToHr); -} - /* get the physical queue size. Must only be called * while mutex is locked! @@ -318,16 +226,16 @@ */ static inline void queueDrain(qqueue_t *pThis) { - msg_t *pMsg; + void *pUsr; ASSERT(pThis != NULL); BEGINfunc DBGOPRINT((obj_t*) pThis, "queue (type %d) will lose %d messages, destroying...\n", pThis->qType, pThis->iQueueSize); /* iQueueSize is not decremented by qDel(), so we need to do it ourselves */ while(ATOMIC_DEC_AND_FETCH(&pThis->iQueueSize, &pThis->mutQueueSize) > 0) { - pThis->qDeq(pThis, &pMsg); - if(pMsg != NULL) { - msgDestruct(&pMsg); + pThis->qDeq(pThis, &pUsr); + if(pUsr != NULL) { + objDestruct(pUsr); } pThis->qDel(pThis); } @@ -354,15 +262,16 @@ if(pThis->bIsDA && getLogicalQueueSize(pThis) >= pThis->iHighWtrMrk) { DBGOPRINT((obj_t*) pThis, "(re)activating DA worker\n"); wtpAdviseMaxWorkers(pThis->pWtpDA, 1); /* disk queues have always one worker */ - } - if(getLogicalQueueSize(pThis) == 0) { - iMaxWorkers = 0; - } else if(pThis->qType == QUEUETYPE_DISK || pThis->iMinMsgsPerWrkr == 0) { - iMaxWorkers = 1; } else { - iMaxWorkers = getLogicalQueueSize(pThis) / pThis->iMinMsgsPerWrkr + 1; + if(getLogicalQueueSize(pThis) == 0) { + iMaxWorkers = 0; + } else if(pThis->qType == QUEUETYPE_DISK || pThis->iMinMsgsPerWrkr == 0) { + iMaxWorkers = 1; + } else { + iMaxWorkers = getLogicalQueueSize(pThis) / pThis->iMinMsgsPerWrkr + 1; + } + wtpAdviseMaxWorkers(pThis->pWtpReg, iMaxWorkers); } - wtpAdviseMaxWorkers(pThis->pWtpReg, iMaxWorkers); } RETiRet; @@ -416,12 +325,11 @@ */ pThis->pqDA->pqParent = pThis; - CHKiRet(qqueueSetpAction(pThis->pqDA, pThis->pAction)); + CHKiRet(qqueueSetpUsr(pThis->pqDA, pThis->pUsr)); CHKiRet(qqueueSetsizeOnDiskMax(pThis->pqDA, pThis->sizeOnDiskMax)); CHKiRet(qqueueSetiDeqSlowdown(pThis->pqDA, pThis->iDeqSlowdown)); CHKiRet(qqueueSetMaxFileSize(pThis->pqDA, pThis->iMaxFileSize)); CHKiRet(qqueueSetFilePrefix(pThis->pqDA, pThis->pszFilePrefix, pThis->lenFilePrefix)); - CHKiRet(qqueueSetSpoolDir(pThis->pqDA, pThis->pszSpoolDir, pThis->lenSpoolDir)); CHKiRet(qqueueSetiPersistUpdCnt(pThis->pqDA, pThis->iPersistUpdCnt)); CHKiRet(qqueueSetbSyncQueueFiles(pThis->pqDA, pThis->bSyncQueueFiles)); CHKiRet(qqueueSettoActShutdown(pThis->pqDA, pThis->toActShutdown)); @@ -487,6 +395,7 @@ CHKiRet(wtpSetpfDoWork (pThis->pWtpDA, (rsRetVal (*)(void *pUsr, void *pWti)) ConsumerDA)); CHKiRet(wtpSetpfObjProcessed (pThis->pWtpDA, (rsRetVal (*)(void *pUsr, wti_t *pWti)) batchProcessed)); CHKiRet(wtpSetpmutUsr (pThis->pWtpDA, pThis->mut)); + CHKiRet(wtpSetpcondBusy (pThis->pWtpDA, &pThis->notEmpty)); CHKiRet(wtpSetiNumWorkerThreads (pThis->pWtpDA, 1)); CHKiRet(wtpSettoWrkShutdown (pThis->pWtpDA, pThis->toWrkShutdown)); CHKiRet(wtpSetpUsr (pThis->pWtpDA, pThis)); @@ -551,7 +460,7 @@ } -static rsRetVal qAddFixedArray(qqueue_t *pThis, msg_t* in) +static rsRetVal qAddFixedArray(qqueue_t *pThis, void* in) { DEFiRet; @@ -565,7 +474,7 @@ } -static rsRetVal qDeqFixedArray(qqueue_t *pThis, msg_t **out) +static rsRetVal qDeqFixedArray(qqueue_t *pThis, void **out) { DEFiRet; @@ -626,7 +535,7 @@ RETiRet; } -static rsRetVal qAddLinkedList(qqueue_t *pThis, msg_t* pMsg) +static rsRetVal qAddLinkedList(qqueue_t *pThis, void* pUsr) { qLinkedList_t *pEntry; DEFiRet; @@ -634,7 +543,7 @@ CHKmalloc((pEntry = (qLinkedList_t*) MALLOC(sizeof(qLinkedList_t)))); pEntry->pNext = NULL; - pEntry->pMsg = pMsg; + pEntry->pUsr = pUsr; if(pThis->tVars.linklist.pDelRoot == NULL) { pThis->tVars.linklist.pDelRoot = pThis->tVars.linklist.pDeqRoot = pThis->tVars.linklist.pLast = pEntry; @@ -652,13 +561,14 @@ } -static rsRetVal qDeqLinkedList(qqueue_t *pThis, msg_t **ppMsg) +static rsRetVal qDeqLinkedList(qqueue_t *pThis, obj_t **ppUsr) { qLinkedList_t *pEntry; DEFiRet; pEntry = pThis->tVars.linklist.pDeqRoot; - *ppMsg = pEntry->pMsg; + ISOBJ_TYPE_assert(pEntry->pUsr, msg); + *ppUsr = pEntry->pUsr; pThis->tVars.linklist.pDeqRoot = pEntry->pNext; RETiRet; @@ -734,7 +644,7 @@ DEFiRet; ISOBJ_TYPE_assert(pStrm, strm); ISOBJ_TYPE_assert(pThis, qqueue); - CHKiRet(strm.SetDir(pStrm, pThis->pszSpoolDir, pThis->lenSpoolDir)); + CHKiRet(strm.SetDir(pStrm, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); finalize_it: RETiRet; } @@ -748,12 +658,18 @@ { DEFiRet; strm_t *psQIF = NULL; + uchar pszQIFNam[MAXFNAME]; + size_t lenQIFNam; struct stat stat_buf; ISOBJ_TYPE_assert(pThis, qqueue); + /* Construct file name */ + lenQIFNam = snprintf((char*)pszQIFNam, sizeof(pszQIFNam) / sizeof(uchar), "%s/%s.qi", + (char*) glbl.GetWorkDir(), (char*)pThis->pszFilePrefix); + /* check if the file exists */ - if(stat((char*) pThis->pszQIFNam, &stat_buf) == -1) { + if(stat((char*) pszQIFNam, &stat_buf) == -1) { if(errno == ENOENT) { DBGOPRINT((obj_t*) pThis, "clean startup, no .qi file found\n"); ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); @@ -768,7 +684,7 @@ CHKiRet(strm.Construct(&psQIF)); CHKiRet(strm.SettOperationsMode(psQIF, STREAMMODE_READ)); CHKiRet(strm.SetsType(psQIF, STREAMTYPE_FILE_SINGLE)); - CHKiRet(strm.SetFName(psQIF, pThis->pszQIFNam, pThis->lenQIFNam)); + CHKiRet(strm.SetFName(psQIF, pszQIFNam, lenQIFNam)); CHKiRet(strm.ConstructFinalize(psQIF)); /* first, we try to read the property bag for ourselfs */ @@ -779,19 +695,13 @@ (rsRetVal(*)(obj_t*,void*))qqueueLoadPersStrmInfoFixup, pThis)); CHKiRet(obj.Deserialize(&pThis->tVars.disk.pReadDel, (uchar*) "strm", psQIF, (rsRetVal(*)(obj_t*,void*))qqueueLoadPersStrmInfoFixup, pThis)); - /* create a duplicate for the read "pointer". */ + + /* create a duplicate for the read "pointer". + */ + CHKiRet(strm.Dup(pThis->tVars.disk.pReadDel, &pThis->tVars.disk.pReadDeq)); CHKiRet(strm.SetbDeleteOnClose(pThis->tVars.disk.pReadDeq, 0)); /* deq must NOT delete the files! */ CHKiRet(strm.ConstructFinalize(pThis->tVars.disk.pReadDeq)); - /* if we use a crypto provider, we need to amend the objects with it's info */ - if(pThis->useCryprov) { - CHKiRet(strm.Setcryprov(pThis->tVars.disk.pWrite, &pThis->cryprov)); - CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pWrite, pThis->cryprovData)); - CHKiRet(strm.Setcryprov(pThis->tVars.disk.pReadDeq, &pThis->cryprov)); - CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pReadDeq, pThis->cryprovData)); - CHKiRet(strm.Setcryprov(pThis->tVars.disk.pReadDel, &pThis->cryprov)); - CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pReadDel, pThis->cryprovData)); - } CHKiRet(strm.SeekCurrOffs(pThis->tVars.disk.pWrite)); CHKiRet(strm.SeekCurrOffs(pThis->tVars.disk.pReadDel)); @@ -807,7 +717,7 @@ strm.Destruct(&psQIF); if(iRet != RS_RET_OK) { - DBGOPRINT((obj_t*) pThis, "state %d reading .qi file - can not read persisted info (if any)\n", + DBGOPRINT((obj_t*) pThis, "error %d reading .qi file - can not read persisted info (if any)\n", iRet); } @@ -841,39 +751,27 @@ } else { CHKiRet(strm.Construct(&pThis->tVars.disk.pWrite)); CHKiRet(strm.SetbSync(pThis->tVars.disk.pWrite, pThis->bSyncQueueFiles)); - CHKiRet(strm.SetDir(pThis->tVars.disk.pWrite, pThis->pszSpoolDir, pThis->lenSpoolDir)); + CHKiRet(strm.SetDir(pThis->tVars.disk.pWrite, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); CHKiRet(strm.SetiMaxFiles(pThis->tVars.disk.pWrite, 10000000)); CHKiRet(strm.SettOperationsMode(pThis->tVars.disk.pWrite, STREAMMODE_WRITE)); CHKiRet(strm.SetsType(pThis->tVars.disk.pWrite, STREAMTYPE_FILE_CIRCULAR)); - if(pThis->useCryprov) { - CHKiRet(strm.Setcryprov(pThis->tVars.disk.pWrite, &pThis->cryprov)); - CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pWrite, pThis->cryprovData)); - } CHKiRet(strm.ConstructFinalize(pThis->tVars.disk.pWrite)); CHKiRet(strm.Construct(&pThis->tVars.disk.pReadDeq)); CHKiRet(strm.SetbDeleteOnClose(pThis->tVars.disk.pReadDeq, 0)); - CHKiRet(strm.SetDir(pThis->tVars.disk.pReadDeq, pThis->pszSpoolDir, pThis->lenSpoolDir)); + CHKiRet(strm.SetDir(pThis->tVars.disk.pReadDeq, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); CHKiRet(strm.SetiMaxFiles(pThis->tVars.disk.pReadDeq, 10000000)); CHKiRet(strm.SettOperationsMode(pThis->tVars.disk.pReadDeq, STREAMMODE_READ)); CHKiRet(strm.SetsType(pThis->tVars.disk.pReadDeq, STREAMTYPE_FILE_CIRCULAR)); - if(pThis->useCryprov) { - CHKiRet(strm.Setcryprov(pThis->tVars.disk.pReadDeq, &pThis->cryprov)); - CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pReadDeq, pThis->cryprovData)); - } CHKiRet(strm.ConstructFinalize(pThis->tVars.disk.pReadDeq)); CHKiRet(strm.Construct(&pThis->tVars.disk.pReadDel)); CHKiRet(strm.SetbSync(pThis->tVars.disk.pReadDel, pThis->bSyncQueueFiles)); CHKiRet(strm.SetbDeleteOnClose(pThis->tVars.disk.pReadDel, 1)); - CHKiRet(strm.SetDir(pThis->tVars.disk.pReadDel, pThis->pszSpoolDir, pThis->lenSpoolDir)); + CHKiRet(strm.SetDir(pThis->tVars.disk.pReadDel, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); CHKiRet(strm.SetiMaxFiles(pThis->tVars.disk.pReadDel, 10000000)); CHKiRet(strm.SettOperationsMode(pThis->tVars.disk.pReadDel, STREAMMODE_READ)); CHKiRet(strm.SetsType(pThis->tVars.disk.pReadDel, STREAMTYPE_FILE_CIRCULAR)); - if(pThis->useCryprov) { - CHKiRet(strm.Setcryprov(pThis->tVars.disk.pReadDel, &pThis->cryprov)); - CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pReadDel, pThis->cryprovData)); - } CHKiRet(strm.ConstructFinalize(pThis->tVars.disk.pReadDel)); CHKiRet(strm.SetFName(pThis->tVars.disk.pWrite, pThis->pszFilePrefix, pThis->lenFilePrefix)); @@ -900,8 +798,7 @@ DEFiRet; ASSERT(pThis != NULL); - - free(pThis->pszQIFNam); + if(pThis->tVars.disk.pWrite != NULL) strm.Destruct(&pThis->tVars.disk.pWrite); if(pThis->tVars.disk.pReadDeq != NULL) @@ -912,7 +809,7 @@ RETiRet; } -static rsRetVal qAddDisk(qqueue_t *pThis, msg_t* pMsg) +static rsRetVal qAddDisk(qqueue_t *pThis, void* pUsr) { DEFiRet; number_t nWriteCount; @@ -920,7 +817,7 @@ ASSERT(pThis != NULL); CHKiRet(strm.SetWCntr(pThis->tVars.disk.pWrite, &nWriteCount)); - CHKiRet((objSerialize(pMsg))(pMsg, pThis->tVars.disk.pWrite)); + CHKiRet((objSerialize(pUsr))(pUsr, pThis->tVars.disk.pWrite)); CHKiRet(strm.Flush(pThis->tVars.disk.pWrite)); CHKiRet(strm.SetWCntr(pThis->tVars.disk.pWrite, NULL)); /* no more counting for now... */ @@ -930,7 +827,7 @@ * the in-memory representation. The instance will be re-created upon * dequeue. -- rgerhards, 2008-07-09 */ - msgDestruct(&pMsg); + objDestruct(pUsr); DBGOPRINT((obj_t*) pThis, "write wrote %lld octets to disk, queue disk size now %lld octets, EnqOnly:%d\n", nWriteCount, pThis->tVars.disk.sizeOnDisk, pThis->bEnqOnly); @@ -940,11 +837,43 @@ } -static rsRetVal qDeqDisk(qqueue_t *pThis, msg_t **ppMsg) +static rsRetVal qDeqDisk(qqueue_t *pThis, void **ppUsr) +{ + DEFiRet; + iRet = obj.Deserialize(ppUsr, (uchar*) "msg", pThis->tVars.disk.pReadDeq, NULL, NULL); + RETiRet; +} + + +static rsRetVal qDelDisk(qqueue_t *pThis) { + obj_t *pDummyObj; /* we need to deserialize it... */ DEFiRet; - iRet = objDeserializeWithMethods(ppMsg, (uchar*) "msg", 3, pThis->tVars.disk.pReadDeq, NULL, - NULL, msgConstructForDeserializer, NULL, MsgDeserialize); + + int64 offsIn; + int64 offsOut; + + CHKiRet(strm.GetCurrOffset(pThis->tVars.disk.pReadDel, &offsIn)); + CHKiRet(obj.Deserialize(&pDummyObj, (uchar*) "msg", pThis->tVars.disk.pReadDel, NULL, NULL)); + objDestruct(pDummyObj); + CHKiRet(strm.GetCurrOffset(pThis->tVars.disk.pReadDel, &offsOut)); + + /* This time it is a bit tricky: we free disk space only upon file deletion. So we need + * to keep track of what we have read until we get an out-offset that is lower than the + * in-offset (which indicates file change). Then, we can subtract the whole thing from + * the on-disk size. -- rgerhards, 2008-01-30 + */ + if(offsIn < offsOut) { + pThis->tVars.disk.bytesRead += offsOut - offsIn; + } else { + pThis->tVars.disk.sizeOnDisk -= pThis->tVars.disk.bytesRead; + pThis->tVars.disk.bytesRead = offsOut; + DBGOPRINT((obj_t*) pThis, "a file has been deleted, now %lld octets disk space used\n", pThis->tVars.disk.sizeOnDisk); + /* awake possibly waiting enq process */ + pthread_cond_signal(&pThis->notFull); /* we hold the mutex while we are in here! */ + } + +finalize_it: RETiRet; } @@ -961,12 +890,10 @@ return RS_RET_OK; } -static rsRetVal qAddDirect(qqueue_t *pThis, msg_t* pMsg) +static rsRetVal qAddDirect(qqueue_t *pThis, void* pUsr) { batch_t singleBatch; batch_obj_t batchObj; - batch_state_t batchState = BATCH_STATE_RDY; - sbool active = 1; int i; DEFiRet; @@ -983,17 +910,17 @@ */ memset(&batchObj, 0, sizeof(batch_obj_t)); memset(&singleBatch, 0, sizeof(batch_t)); - batchObj.pMsg = pMsg; + batchObj.state = BATCH_STATE_RDY; + batchObj.pUsrp = (obj_t*) pUsr; + batchObj.bFilterOK = 1; singleBatch.nElem = 1; /* there always is only one in direct mode */ singleBatch.pElem = &batchObj; - singleBatch.eltState = &batchState; - singleBatch.active = &active; - iRet = pThis->pConsumer(pThis->pAction, &singleBatch, &pThis->bShutdownImmediate); + iRet = pThis->pConsumer(pThis->pUsr, &singleBatch, &pThis->bShutdownImmediate); /* delete the batch string params: TODO: create its own "class" for this */ for(i = 0 ; i < CONF_OMOD_NUMSTRINGS_MAXSIZE ; ++i) { free(batchObj.staticActStrings[i]); } - msgDestruct(&pMsg); + objDestruct(pUsr); RETiRet; } @@ -1015,7 +942,7 @@ * We use our knowledge about the batch_t structure below, but without that, we * pay a too-large performance toll... -- rgerhards, 2009-04-22 */ - iRet = pThis->pConsumer(pThis->pAction, pBatch, NULL); + iRet = pThis->pConsumer(pThis->pUsr, pBatch, &pThis->bShutdownImmediate); RETiRet; } @@ -1036,17 +963,17 @@ * things truely different. -- rgerhards, 2008-02-12 */ static rsRetVal -qqueueAdd(qqueue_t *pThis, msg_t *pMsg) +qqueueAdd(qqueue_t *pThis, void *pUsr) { DEFiRet; ASSERT(pThis != NULL); - CHKiRet(pThis->qAdd(pThis, pMsg)); + CHKiRet(pThis->qAdd(pThis, pUsr)); if(pThis->qType != QUEUETYPE_DIRECT) { ATOMIC_INC(&pThis->iQueueSize, &pThis->mutQueueSize); - DBGOPRINT((obj_t*) pThis, "qqueueAdd: entry added, size now log %d, phys %d entries\n", + DBGOPRINT((obj_t*) pThis, "entry added, size now log %d, phys %d entries\n", getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis)); } @@ -1058,7 +985,7 @@ /* generic code to dequeue a queue entry */ static rsRetVal -qqueueDeq(qqueue_t *pThis, msg_t **ppMsg) +qqueueDeq(qqueue_t *pThis, void **ppUsr) { DEFiRet; @@ -1069,7 +996,7 @@ * If we decrement, however, we may lose a message. But that is better than * losing the whole process because it loops... -- rgerhards, 2008-01-03 */ - iRet = pThis->qDeq(pThis, ppMsg); + iRet = pThis->qDeq(pThis, ppUsr); ATOMIC_INC(&pThis->nLogDeq, &pThis->mutLogDeq); // DBGOPRINT((obj_t*) pThis, "entry deleted, size now log %d, phys %d entries\n", @@ -1167,11 +1094,11 @@ rsRetVal iRetLocal; DEFiRet; +RUNLOG_STR("trying to shutdown workers within Action Timeout"); ISOBJ_TYPE_assert(pThis, qqueue); ASSERT(pThis->pqParent == NULL); /* detect invalid calling sequence */ /* instruct workers to finish ASAP, even if still work exists */ - DBGOPRINT((obj_t*) pThis, "trying to shutdown workers within Action Timeout"); DBGOPRINT((obj_t*) pThis, "setting EnqOnly mode\n"); pThis->bEnqOnly = 1; pThis->bShutdownImmediate = 1; @@ -1315,6 +1242,8 @@ RETiRet; } + + /* Constructor for the queue object * This constructs the data structure, but does not yet start the queue. That * is done by queueStart(). The reason is that we want to give the caller a chance @@ -1325,7 +1254,6 @@ { DEFiRet; qqueue_t *pThis; - const uchar *const workDir = glblGetWorkDirRaw(); ASSERT(ppThis != NULL); ASSERT(pConsumer != NULL); @@ -1335,19 +1263,16 @@ /* we have an object, so let's fill the properties */ objConstructSetObjInfo(pThis); + if((pThis->pszSpoolDir = (uchar*) strdup((char*)glbl.GetWorkDir())) == NULL) + ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - if(workDir != NULL) { - if((pThis->pszSpoolDir = ustrdup(workDir)) == NULL) - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - pThis->lenSpoolDir = ustrlen(pThis->pszSpoolDir); - } /* set some water marks so that we have useful defaults if none are set specifically */ - pThis->iFullDlyMrk = -1; - pThis->iLightDlyMrk = -1; + pThis->iFullDlyMrk = iMaxQueueSize - (iMaxQueueSize / 100) * 3; /* default 97% */ + pThis->iLightDlyMrk = iMaxQueueSize - (iMaxQueueSize / 100) * 30; /* default 70% */ + pThis->lenSpoolDir = ustrlen(pThis->pszSpoolDir); pThis->iMaxFileSize = 1024 * 1024; /* default is 1 MiB */ pThis->iQueueSize = 0; pThis->nLogDeq = 0; - pThis->useCryprov = 0; pThis->iMaxQueueSize = iMaxQueueSize; pThis->pConsumer = pConsumer; pThis->iNumWorkerThreads = iWorkerThreads; @@ -1357,6 +1282,42 @@ pThis->pszFilePrefix = NULL; pThis->qType = qType; + /* set type-specific handlers and other very type-specific things (we can not totally hide it...) */ + switch(qType) { + case QUEUETYPE_FIXED_ARRAY: + pThis->qConstruct = qConstructFixedArray; + pThis->qDestruct = qDestructFixedArray; + pThis->qAdd = qAddFixedArray; + pThis->qDeq = qDeqFixedArray; + pThis->qDel = qDelFixedArray; + pThis->MultiEnq = qqueueMultiEnqObjNonDirect; + break; + case QUEUETYPE_LINKEDLIST: + pThis->qConstruct = qConstructLinkedList; + pThis->qDestruct = qDestructLinkedList; + pThis->qAdd = qAddLinkedList; + pThis->qDeq = (rsRetVal (*)(qqueue_t*,void**)) qDeqLinkedList; + pThis->qDel = (rsRetVal (*)(qqueue_t*)) qDelLinkedList; + pThis->MultiEnq = qqueueMultiEnqObjNonDirect; + break; + case QUEUETYPE_DISK: + pThis->qConstruct = qConstructDisk; + pThis->qDestruct = qDestructDisk; + pThis->qAdd = qAddDisk; + pThis->qDeq = qDeqDisk; + pThis->qDel = qDelDisk; + pThis->MultiEnq = qqueueMultiEnqObjNonDirect; + /* special handling */ + pThis->iNumWorkerThreads = 1; /* we need exactly one worker */ + break; + case QUEUETYPE_DIRECT: + pThis->qConstruct = qConstructDirect; + pThis->qDestruct = qDestructDirect; + pThis->qAdd = qAddDirect; + pThis->qDel = qDelDirect; + pThis->MultiEnq = qqueueMultiEnqObjDirect; + break; + } INIT_ATOMIC_HELPER_MUT(pThis->mutQueueSize); INIT_ATOMIC_HELPER_MUT(pThis->mutLogDeq); @@ -1367,70 +1328,6 @@ } -/* set default inside queue object suitable for action queues. - * This shall be called directly after queue construction. This functions has - * been added in support of the new v6 config system. It expect properly pre-initialized - * objects, but we need to differentiate between ruleset main and action queues. - * In order to avoid unnecessary complexity, we provide the necessary defaults - * via specific function calls. - */ -void -qqueueSetDefaultsActionQueue(qqueue_t *pThis) -{ - pThis->qType = QUEUETYPE_DIRECT; /* type of the main message queue above */ - pThis->iMaxQueueSize = 1000; /* size of the main message queue above */ - pThis->iDeqBatchSize = 128; /* default batch size */ - pThis->iHighWtrMrk = -1; /* high water mark for disk-assisted queues */ - pThis->iLowWtrMrk = -1; /* low water mark for disk-assisted queues */ - pThis->iDiscardMrk = -1; /* begin to discard messages */ - pThis->iDiscardSeverity = 8; /* turn off */ - pThis->iNumWorkerThreads = 1; /* number of worker threads for the mm queue above */ - pThis->iMaxFileSize = 1024*1024; - pThis->iPersistUpdCnt = 0; /* persist queue info every n updates */ - pThis->bSyncQueueFiles = 0; - pThis->toQShutdown = 0; /* queue shutdown */ - pThis->toActShutdown = 1000; /* action shutdown (in phase 2) */ - pThis->toEnq = 2000; /* timeout for queue enque */ - pThis->toWrkShutdown = 60000; /* timeout for worker thread shutdown */ - pThis->iMinMsgsPerWrkr = -1; /* minimum messages per worker needed to start a new one */ - pThis->bSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */ - pThis->sizeOnDiskMax = 0; /* unlimited */ - pThis->iDeqSlowdown = 0; - pThis->iDeqtWinFromHr = 0; - pThis->iDeqtWinToHr = 25; /* disable time-windowed dequeuing by default */ -} - - -/* set defaults inside queue object suitable for main/ruleset queues. - * See queueSetDefaultsActionQueue() for more details and background. - */ -void -qqueueSetDefaultsRulesetQueue(qqueue_t *pThis) -{ - pThis->qType = QUEUETYPE_FIXED_ARRAY; /* type of the main message queue above */ - pThis->iMaxQueueSize = 50000; /* size of the main message queue above */ - pThis->iDeqBatchSize = 1024; /* default batch size */ - pThis->iHighWtrMrk = -1; /* high water mark for disk-assisted queues */ - pThis->iLowWtrMrk = -1; /* low water mark for disk-assisted queues */ - pThis->iDiscardMrk = -1; /* begin to discard messages */ - pThis->iDiscardSeverity = 8; /* turn off */ - pThis->iNumWorkerThreads = 1; /* number of worker threads for the mm queue above */ - pThis->iMaxFileSize = 16*1024*1024; - pThis->iPersistUpdCnt = 0; /* persist queue info every n updates */ - pThis->bSyncQueueFiles = 0; - pThis->toQShutdown = 1500; /* queue shutdown */ - pThis->toActShutdown = 1000; /* action shutdown (in phase 2) */ - pThis->toEnq = 2000; /* timeout for queue enque */ - pThis->toWrkShutdown = 60000; /* timeout for worker thread shutdown */ - pThis->iMinMsgsPerWrkr = -1; /* minimum messages per worker needed to start a new one */ - pThis->bSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */ - pThis->sizeOnDiskMax = 0; /* unlimited */ - pThis->iDeqSlowdown = 0; - pThis->iDeqtWinFromHr = 0; - pThis->iDeqtWinToHr = 25; /* disable time-windowed dequeuing by default */ -} - - /* This function checks if the provided message shall be discarded and does so, if needed. * In DA mode, we do not discard any messages as we assume the disk subsystem is fast enough to * provide real-time creation of spool files. @@ -1444,21 +1341,22 @@ * the return state! * rgerhards, 2008-01-24 */ -static int qqueueChkDiscardMsg(qqueue_t *pThis, int iQueueSize, msg_t *pMsg) +static int qqueueChkDiscardMsg(qqueue_t *pThis, int iQueueSize, void *pUsr) { DEFiRet; rsRetVal iRetLocal; int iSeverity; ISOBJ_TYPE_assert(pThis, qqueue); + ISOBJ_assert(pUsr); if(pThis->iDiscardMrk > 0 && iQueueSize >= pThis->iDiscardMrk) { - iRetLocal = MsgGetSeverity(pMsg, &iSeverity); + iRetLocal = objGetSeverity(pUsr, &iSeverity); if(iRetLocal == RS_RET_OK && iSeverity >= pThis->iDiscardSeverity) { DBGOPRINT((obj_t*) pThis, "queue nearly full (%d entries), discarded severity %d message\n", iQueueSize, iSeverity); STATSCOUNTER_INC(pThis->ctrNFDscrd, pThis->mutCtrNFDscrd); - msgDestruct(&pMsg); + objDestruct(pUsr); ABORT_FINALIZE(RS_RET_QUEUE_FULL); } else { DBGOPRINT((obj_t*) pThis, "queue nearly full (%d entries), but could not drop msg " @@ -1477,39 +1375,19 @@ DoDeleteBatchFromQStore(qqueue_t *pThis, int nElem) { int i; - off64_t bytesDel; DEFiRet; ISOBJ_TYPE_assert(pThis, qqueue); /* now send delete request to storage driver */ - if(pThis->qType == QUEUETYPE_DISK) { - strmMultiFileSeek(pThis->tVars.disk.pReadDel, pThis->tVars.disk.deqFileNumOut, - pThis->tVars.disk.deqOffs, &bytesDel); - /* We need to correct the on-disk file size. This time it is a bit tricky: - * we free disk space only upon file deletion. So we need to keep track of what we - * have read until we get an out-offset that is lower than the in-offset (which - * indicates file change). Then, we can subtract the whole thing from the on-disk - * size. -- rgerhards, 2008-01-30 - */ - if(bytesDel != 0) { - pThis->tVars.disk.sizeOnDisk -= bytesDel; - DBGOPRINT((obj_t*) pThis, "doDeleteBatch: a %lld octet file has been deleted, now %lld octets disk " - "space used\n", bytesDel, pThis->tVars.disk.sizeOnDisk); - /* awake possibly waiting enq process */ - pthread_cond_signal(&pThis->notFull); /* we hold the mutex while we are in here! */ - } - } else { /* memory queue */ - for(i = 0 ; i < nElem ; ++i) { - pThis->qDel(pThis); - } + for(i = 0 ; i < nElem ; ++i) { + pThis->qDel(pThis); } /* iQueueSize is not decremented by qDel(), so we need to do it ourselves */ ATOMIC_SUB(&pThis->iQueueSize, nElem, &pThis->mutQueueSize); ATOMIC_SUB(&pThis->nLogDeq, nElem, &pThis->mutLogDeq); - DBGPRINTF("doDeleteBatch: delete batch from store, new sizes: log %d, phys %d\n", - getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis)); +dbgprintf("delete batch from store, new sizes: log %d, phys %d\n", getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis)); ++pThis->deqIDDel; /* one more batch dequeued */ RETiRet; @@ -1545,7 +1423,7 @@ DoDeleteBatchFromQStore(pThis, pBatch->nElem); } else { /* can not delete, insert into to-delete list */ - DBGPRINTF("not at head of to-delete list, enqueue %d\n", (int) pBatch->deqID); + dbgprintf("not at head of to-delete list, enqueue %d\n", (int) pBatch->deqID); CHKiRet(tdlAdd(pThis, pBatch->deqID, pBatch->nElem)); } @@ -1563,7 +1441,7 @@ DeleteProcessedBatch(qqueue_t *pThis, batch_t *pBatch) { int i; - msg_t *pMsg; + void *pUsr; int nEnqueued = 0; rsRetVal localRet; DEFiRet; @@ -1572,19 +1450,21 @@ assert(pBatch != NULL); for(i = 0 ; i < pBatch->nElem ; ++i) { - pMsg = pBatch->pElem[i].pMsg; - if( pBatch->eltState[i] == BATCH_STATE_RDY - || pBatch->eltState[i] == BATCH_STATE_SUB) { - localRet = doEnqSingleObj(pThis, eFLOWCTL_NO_DELAY, MsgAddRef(pMsg)); + pUsr = pBatch->pElem[i].pUsrp; + if( pBatch->pElem[i].state == BATCH_STATE_RDY + || pBatch->pElem[i].state == BATCH_STATE_SUB) { +dbgprintf("XXX: DeleteProcessedBatch re-enqueue %d of %d, state %d\n", i, pBatch->nElem, pBatch->pElem[i].state); + localRet = doEnqSingleObj(pThis, eFLOWCTL_NO_DELAY, + (obj_t*)MsgAddRef((msg_t*) pUsr)); ++nEnqueued; if(localRet != RS_RET_OK) { - DBGPRINTF("DeleteProcessedBatch: error %d re-enqueuing unprocessed data element - discarded\n", localRet); + DBGPRINTF("error %d re-enqueuing unprocessed data element - discarded\n", localRet); } } - msgDestruct(&pMsg); + objDestruct(pUsr); } - DBGPRINTF("DeleteProcessedBatch: we deleted %d objects and enqueued %d objects\n", i-nEnqueued, nEnqueued); + dbgprintf("we deleted %d objects and enqueued %d objects\n", i-nEnqueued, nEnqueued); if(nEnqueued > 0) qqueueChkPersist(pThis, nEnqueued); @@ -1613,7 +1493,7 @@ int nDiscarded; int nDeleted; int iQueueSize; - msg_t *pMsg; + void *pUsr; rsRetVal localRet; DEFiRet; @@ -1621,14 +1501,11 @@ DeleteProcessedBatch(pThis, &pWti->batch); nDequeued = nDiscarded = 0; - if(pThis->qType == QUEUETYPE_DISK) { - pThis->tVars.disk.deqFileNumIn = strmGetCurrFileNum(pThis->tVars.disk.pReadDeq); - } while((iQueueSize = getLogicalQueueSize(pThis)) > 0 && nDequeued < pThis->iDeqBatchSize) { - CHKiRet(qqueueDeq(pThis, &pMsg)); + CHKiRet(qqueueDeq(pThis, &pUsr)); /* check if we should discard this element */ - localRet = qqueueChkDiscardMsg(pThis, pThis->iQueueSize, pMsg); + localRet = qqueueChkDiscardMsg(pThis, pThis->iQueueSize, pUsr); if(localRet == RS_RET_QUEUE_FULL) { ++nDiscarded; continue; @@ -1637,16 +1514,12 @@ } /* all well, use this element */ - pWti->batch.pElem[nDequeued].pMsg = pMsg; - pWti->batch.eltState[nDequeued] = BATCH_STATE_RDY; + pWti->batch.pElem[nDequeued].pUsrp = pUsr; + pWti->batch.pElem[nDequeued].state = BATCH_STATE_RDY; + pWti->batch.pElem[nDequeued].bFilterOK = 1; // TODO: think again if we can handle that with more performance ++nDequeued; } - if(pThis->qType == QUEUETYPE_DISK) { - strm.GetCurrOffset(pThis->tVars.disk.pReadDeq, &pThis->tVars.disk.deqOffs); - pThis->tVars.disk.deqFileNumOut = strmGetCurrFileNum(pThis->tVars.disk.pReadDeq); - } - /* it is sufficient to persist only when the bulk of work is done */ qqueueChkPersist(pThis, nDequeued+nDiscarded+nDeleted); @@ -1654,6 +1527,7 @@ pWti->batch.nElemDeq = nDequeued + nDiscarded; pWti->batch.deqID = getNextDeqID(pThis); *piRemainingQueueSize = iQueueSize; + finalize_it: RETiRet; } @@ -1689,6 +1563,7 @@ pthread_cond_broadcast(&pThis->belowLightDlyWtrMrk); } + // TODO: MULTI: check physical queue size? pthread_cond_signal(&pThis->notFull); /* WE ARE NO LONGER PROTECTED BY THE MUTEX */ @@ -1882,8 +1757,7 @@ /* at this spot, we may be cancelled */ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &iCancelStateSave); - - CHKiRet(pThis->pConsumer(pThis->pAction, &pWti->batch, &pThis->bShutdownImmediate)); + CHKiRet(pThis->pConsumer(pThis->pUsr, &pWti->batch, &pThis->bShutdownImmediate)); /* we now need to check if we should deliberately delay processing a bit * and, if so, do that. -- rgerhards, 2008-01-30 @@ -1941,55 +1815,23 @@ /* iterate over returned results and enqueue them in DA queue */ for(i = 0 ; i < pWti->batch.nElem && !pThis->bShutdownImmediate ; i++) { - iRet = qqueueEnqMsg(pThis->pqDA, eFLOWCTL_NO_DELAY, MsgAddRef(pWti->batch.pElem[i].pMsg)); - if(iRet != RS_RET_OK) { - if(iRet == RS_RET_ERR_QUEUE_EMERGENCY) { - /* Queue emergency error occured */ - DBGOPRINT((obj_t*) pThis, "ConsumerDA:qqueueEnqMsg caught RS_RET_ERR_QUEUE_EMERGENCY, aborting loop.\n"); - FINALIZE; - } else { - DBGOPRINT((obj_t*) pThis, "ConsumerDA:qqueueEnqMsg item (%d) returned with error state: '%d'\n", i, iRet); - } - } - pWti->batch.eltState[i] = BATCH_STATE_COMM; /* commited to other queue! */ + /* TODO: we must add a generic "addRef" mechanism, because the disk queue enqueue destructs + * the message. So far, we simply assume we always have msg_t, what currently is always the case. + * rgerhards, 2009-05-28 + */ + CHKiRet(qqueueEnqObj(pThis->pqDA, eFLOWCTL_NO_DELAY, + (obj_t*)MsgAddRef((msg_t*)(pWti->batch.pElem[i].pUsrp)))); + pWti->batch.pElem[i].state = BATCH_STATE_COMM; /* commited to other queue! */ } /* but now cancellation is no longer permitted */ pthread_setcancelstate(iCancelStateSave, NULL); finalize_it: - /* Check the last return state of qqueueEnqMsg. If an error was returned, we acknowledge it only. - * Unless the error code is RS_RET_ERR_QUEUE_EMERGENCY, we reset the return state to RS_RET_OK. - * Otherwise the Caller functions would run into an infinite Loop trying to enqueue the - * same messages over and over again. - * - * However we do NOT overwrite positive return states like - * RS_RET_TERMINATE_NOW, - * RS_RET_NO_RUN, - * RS_RET_IDLE, - * RS_RET_TERMINATE_WHEN_IDLE - * These return states are important for Queue handling of the upper laying functions. - * RGer: Note that checking for iRet < 0 is a bit bold. In theory, positive iRet - * values are "OK" states, and things that the caller shall deal with. However, - * this has not been done so consistently. Andre convinced me that the current - * code is an elegant solution. However, if problems with queue workers and/or - * shutdown come up, this code here should be looked at suspiciously. In those - * cases it may work out to check all status codes explicitely, just to avoid - * a pitfall due to unexpected states being passed on to the caller. - */ - if( iRet != RS_RET_OK && - iRet != RS_RET_ERR_QUEUE_EMERGENCY && - iRet < 0) { - DBGOPRINT((obj_t*) pThis, "ConsumerDA:qqueueEnqMsg Resetting iRet from %d back to RS_RET_OK\n", iRet); - iRet = RS_RET_OK; - } else { - DBGOPRINT((obj_t*) pThis, "ConsumerDA:qqueueEnqMsg returns with iRet %d\n", iRet); - } - /* now we are done, but potentially need to re-aquire the mutex */ if(bNeedReLock) d_pthread_mutex_lock(pThis->mut); - + DBGOPRINT((obj_t*) pThis, "DAConsumer returns with iRet %d\n", iRet); RETiRet; } @@ -2059,167 +1901,15 @@ { DEFiRet; uchar pszBuf[64]; - uchar pszQIFNam[MAXFNAME]; int wrk; - int goodval; /* a "good value" to use for comparisons (different objects) */ uchar *qName; size_t lenBuf; ASSERT(pThis != NULL); - dbgoprint((obj_t*) pThis, "starting queue\n"); - - if(pThis->pszSpoolDir == NULL) { - /* note: we need to pick the path so late as we do not have - * the workdir during early config load - */ - if((pThis->pszSpoolDir = (uchar*) strdup((char*)glbl.GetWorkDir())) == NULL) - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - pThis->lenSpoolDir = ustrlen(pThis->pszSpoolDir); - } - /* set type-specific handlers and other very type-specific things - * (we can not totally hide it...) - */ - switch(pThis->qType) { - case QUEUETYPE_FIXED_ARRAY: - pThis->qConstruct = qConstructFixedArray; - pThis->qDestruct = qDestructFixedArray; - pThis->qAdd = qAddFixedArray; - pThis->qDeq = qDeqFixedArray; - pThis->qDel = qDelFixedArray; - pThis->MultiEnq = qqueueMultiEnqObjNonDirect; - break; - case QUEUETYPE_LINKEDLIST: - pThis->qConstruct = qConstructLinkedList; - pThis->qDestruct = qDestructLinkedList; - pThis->qAdd = qAddLinkedList; - pThis->qDeq = qDeqLinkedList; - pThis->qDel = qDelLinkedList; - pThis->MultiEnq = qqueueMultiEnqObjNonDirect; - break; - case QUEUETYPE_DISK: - pThis->qConstruct = qConstructDisk; - pThis->qDestruct = qDestructDisk; - pThis->qAdd = qAddDisk; - pThis->qDeq = qDeqDisk; - pThis->qDel = NULL; /* delete for disk handled via special code! */ - pThis->MultiEnq = qqueueMultiEnqObjNonDirect; - /* special handling */ - pThis->iNumWorkerThreads = 1; /* we need exactly one worker */ - /* pre-construct file name for .qi file */ - pThis->lenQIFNam = snprintf((char*)pszQIFNam, sizeof(pszQIFNam) / sizeof(uchar), - "%s/%s.qi", (char*) pThis->pszSpoolDir, (char*)pThis->pszFilePrefix); - pThis->pszQIFNam = ustrdup(pszQIFNam); - DBGOPRINT((obj_t*) pThis, ".qi file name is '%s', len %d\n", pThis->pszQIFNam, - (int) pThis->lenQIFNam); - break; - case QUEUETYPE_DIRECT: - pThis->qConstruct = qConstructDirect; - pThis->qDestruct = qDestructDirect; - pThis->qAdd = qAddDirect; - pThis->qDel = qDelDirect; - pThis->MultiEnq = qqueueMultiEnqObjDirect; - break; - } - - if(pThis->iMaxQueueSize < 100 - && (pThis->qType == QUEUETYPE_LINKEDLIST || pThis->qType == QUEUETYPE_FIXED_ARRAY)) { - errmsg.LogError(0, RS_RET_OK_WARN, "Note: queue.size=\"%d\" is very " - "low and can lead to unpredictable results. See also " - "http://www.rsyslog.com/lower-bound-for-queue-sizes/", - pThis->iMaxQueueSize); - } - /* we need to do a quick check if our water marks are set plausible. If not, - * we correct the most important shortcomings. + * we correct the most important shortcomings. TODO: do that!!!! -- rgerhards, 2008-03-14 */ - goodval = (pThis->iMaxQueueSize / 100) * 60; - if(pThis->iHighWtrMrk != -1 && pThis->iHighWtrMrk < goodval) { - errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING, "queue \"%s\": high water mark " - "is set quite low at %d. You should only set it below " - "60%% (%d) if you have a good reason for this.", - obj.GetName((obj_t*) pThis), pThis->iHighWtrMrk, goodval); - } - - if(pThis->iNumWorkerThreads > 1) { - goodval = (pThis->iMaxQueueSize / 100) * 10; - if(pThis->iMinMsgsPerWrkr != -1 && pThis->iMinMsgsPerWrkr < goodval) { - errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING, "queue \"%s\": " - "queue.workerThreadMinimumMessage " - "is set quite low at %d. You should only set it below " - "10%% (%d) if you have a good reason for this.", - obj.GetName((obj_t*) pThis), pThis->iMinMsgsPerWrkr, goodval); - } - } - - if(pThis->iDiscardMrk > pThis->iMaxQueueSize) { - errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING, "queue \"%s\": " - "queue.discardMark %d is set larger than queue.size", - obj.GetName((obj_t*) pThis), pThis->iDiscardMrk); - } - - goodval = (pThis->iMaxQueueSize / 100) * 80; - if(pThis->iDiscardMrk != -1 && pThis->iDiscardMrk < goodval) { - errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING, "queue \"%s\": queue.discardMark " - "is set quite low at %d. You should only set it below " - "80%% (%d) if you have a good reason for this.", - obj.GetName((obj_t*) pThis), pThis->iDiscardMrk, goodval); - } - - if(pThis->pszFilePrefix != NULL) { /* This means we have a potential DA queue */ - if(pThis->iFullDlyMrk != -1 && pThis->iFullDlyMrk < pThis->iHighWtrMrk) { - errmsg.LogError(0, RS_RET_CONF_WRN_FULLDLY_BELOW_HIGHWTR, - "queue \"%s\": queue.fullDelayMark " - "is set below high water mark. This will result in DA mode " - " NOT being activated for full delayable messages", - obj.GetName((obj_t*) pThis)); - } - } - - /* now come parameter corrections and defaults */ - if(pThis->iHighWtrMrk < 2 || pThis->iHighWtrMrk > pThis->iMaxQueueSize) { - pThis->iHighWtrMrk = (pThis->iMaxQueueSize / 100) * 90; - if(pThis->iHighWtrMrk == 0) { /* guard against very low max queue sizes! */ - pThis->iHighWtrMrk = pThis->iMaxQueueSize; - } - } - if( pThis->iLowWtrMrk < 2 - || pThis->iLowWtrMrk > pThis->iMaxQueueSize - || pThis->iLowWtrMrk > pThis->iHighWtrMrk ) { - pThis->iLowWtrMrk = (pThis->iMaxQueueSize / 100) * 70; - if(pThis->iLowWtrMrk == 0) { - pThis->iLowWtrMrk = 1; - } - } - if( pThis->iMinMsgsPerWrkr < 1 - || pThis->iMinMsgsPerWrkr > pThis->iMaxQueueSize ) - pThis->iMinMsgsPerWrkr = pThis->iMaxQueueSize / pThis->iNumWorkerThreads; - if(pThis->iFullDlyMrk == -1 || pThis->iFullDlyMrk > pThis->iMaxQueueSize) { - pThis->iFullDlyMrk = (pThis->iMaxQueueSize / 100) * 97; - if(pThis->iFullDlyMrk == 0) { - pThis->iFullDlyMrk = - (pThis->iMaxQueueSize == 1) ? 1 : pThis->iMaxQueueSize - 1; - } - } - if(pThis->iLightDlyMrk == -1 || pThis->iLightDlyMrk > pThis->iMaxQueueSize) { - pThis->iLightDlyMrk = (pThis->iMaxQueueSize / 100) * 70; - if(pThis->iLightDlyMrk == 0) { - pThis->iLightDlyMrk = - (pThis->iMaxQueueSize == 1) ? 1 : pThis->iMaxQueueSize - 1; - } - } - - if(pThis->iDiscardMrk < 1 || pThis->iDiscardMrk > pThis->iMaxQueueSize) { - pThis->iDiscardMrk = (pThis->iMaxQueueSize / 100) * 98; - if(pThis->iDiscardMrk == 0) { - /* for very small queues, we disable this by default */ - pThis->iDiscardMrk = pThis->iMaxQueueSize; - } - } - - if(pThis->iMaxQueueSize > 0 && pThis->iDeqBatchSize > pThis->iMaxQueueSize) { - pThis->iDeqBatchSize = pThis->iMaxQueueSize; - } /* finalize some initializations that could not yet be done because it is * influenced by properties which might have been set after queueConstruct () @@ -2235,6 +1925,7 @@ pthread_mutex_init(&pThis->mutThrdMgmt, NULL); pthread_cond_init (&pThis->notFull, NULL); + pthread_cond_init (&pThis->notEmpty, NULL); pthread_cond_init (&pThis->belowFullDlyWtrMrk, NULL); pthread_cond_init (&pThis->belowLightDlyWtrMrk, NULL); @@ -2251,18 +1942,13 @@ pThis->iFullDlyMrk = wrk; } - DBGOPRINT((obj_t*) pThis, "params: type %d, enq-only %d, disk assisted %d, spoolDir '%s', maxFileSz %lld, " - "maxQSize %d, lqsize %d, pqsize %d, child %d, full delay %d, " - "light delay %d, deq batch size %d, high wtrmrk %d, low wtrmrk %d, " - "discardmrk %d, max wrkr %d, min msgs f. wrkr %d\n", - pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->pszSpoolDir, - pThis->iMaxFileSize, pThis->iMaxQueueSize, + DBGOPRINT((obj_t*) pThis, "type %d, enq-only %d, disk assisted %d, maxFileSz %lld, lqsize %d, pqsize %d, child %d, " + "full delay %d, light delay %d, deq batch size %d starting\n", + pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->iMaxFileSize, getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis), pThis->pqParent == NULL ? 0 : 1, pThis->iFullDlyMrk, pThis->iLightDlyMrk, - pThis->iDeqBatchSize, pThis->iHighWtrMrk, pThis->iLowWtrMrk, - pThis->iDiscardMrk, pThis->iNumWorkerThreads, pThis->iMinMsgsPerWrkr); + pThis->iDeqBatchSize); - pThis->bQueueStarted = 1; if(pThis->qType == QUEUETYPE_DIRECT) FINALIZE; /* with direct queues, we are already finished... */ @@ -2277,6 +1963,7 @@ CHKiRet(wtpSetpfDoWork (pThis->pWtpReg, (rsRetVal (*)(void *pUsr, void *pWti)) ConsumerReg)); CHKiRet(wtpSetpfObjProcessed (pThis->pWtpReg, (rsRetVal (*)(void *pUsr, wti_t *pWti)) batchProcessed)); CHKiRet(wtpSetpmutUsr (pThis->pWtpReg, pThis->mut)); + CHKiRet(wtpSetpcondBusy (pThis->pWtpReg, &pThis->notEmpty)); CHKiRet(wtpSetiNumWorkerThreads (pThis->pWtpReg, pThis->iNumWorkerThreads)); CHKiRet(wtpSettoWrkShutdown (pThis->pWtpReg, pThis->toWrkShutdown)); CHKiRet(wtpSetpUsr (pThis->pWtpReg, pThis)); @@ -2292,6 +1979,7 @@ * the case when a disk queue has been loaded. If we did not start it here, it would never start. */ qqueueAdviseMaxWorkers(pThis); + pThis->bQueueStarted = 1; /* support statistics gathering */ qName = obj.GetName((obj_t*)pThis); @@ -2300,26 +1988,26 @@ /* we need to save the queue size, as the stats module initializes it to 0! */ /* iQueueSize is a dual-use counter: no init, no mutex! */ CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("size"), - ctrType_Int, CTR_FLAG_NONE, &pThis->iQueueSize)); + ctrType_Int, &pThis->iQueueSize)); STATSCOUNTER_INIT(pThis->ctrEnqueued, pThis->mutCtrEnqueued); CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("enqueued"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrEnqueued)); + ctrType_IntCtr, &pThis->ctrEnqueued)); STATSCOUNTER_INIT(pThis->ctrFull, pThis->mutCtrFull); CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("full"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrFull)); + ctrType_IntCtr, &pThis->ctrFull)); STATSCOUNTER_INIT(pThis->ctrFDscrd, pThis->mutCtrFDscrd); CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("discarded.full"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrFDscrd)); + ctrType_IntCtr, &pThis->ctrFDscrd)); STATSCOUNTER_INIT(pThis->ctrNFDscrd, pThis->mutCtrNFDscrd); CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("discarded.nf"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &pThis->ctrNFDscrd)); + ctrType_IntCtr, &pThis->ctrNFDscrd)); pThis->ctrMaxqsize = 0; /* no mutex needed, thus no init call */ CHKiRet(statsobj.AddCounter(pThis->statsobj, UCHAR_CONSTANT("maxqsize"), - ctrType_Int, CTR_FLAG_NONE, &pThis->ctrMaxqsize)); + ctrType_Int, &pThis->ctrMaxqsize)); CHKiRet(statsobj.ConstructFinalize(pThis->statsobj)); @@ -2328,7 +2016,7 @@ } -/* persist the queue to disk (write the .qi file). If we have something to persist, we first +/* persist the queue to disk. If we have something to persist, we first * save the information on the queue properties itself and then we call * the queue-type specific drivers. * Variable bIsCheckpoint is set to 1 if the persist is for a checkpoint, @@ -2339,6 +2027,8 @@ { DEFiRet; strm_t *psQIF = NULL; /* Queue Info File */ + uchar pszQIFNam[MAXFNAME]; + size_t lenQIFNam; ASSERT(pThis != NULL); @@ -2356,9 +2046,13 @@ DBGOPRINT((obj_t*) pThis, "persisting queue to disk, %d entries...\n", getPhysicalQueueSize(pThis)); + /* Construct file name */ + lenQIFNam = snprintf((char*)pszQIFNam, sizeof(pszQIFNam) / sizeof(uchar), "%s/%s.qi", + (char*) glbl.GetWorkDir(), (char*)pThis->pszFilePrefix); + if((bIsCheckpoint != QUEUE_CHECKPOINT) && (getPhysicalQueueSize(pThis) == 0)) { if(pThis->bNeedDelQIF) { - unlink((char*)pThis->pszQIFNam); + unlink((char*)pszQIFNam); pThis->bNeedDelQIF = 0; } /* indicate spool file needs to be deleted */ @@ -2371,7 +2065,7 @@ CHKiRet(strm.SettOperationsMode(psQIF, STREAMMODE_WRITE_TRUNC)); CHKiRet(strm.SetbSync(psQIF, pThis->bSyncQueueFiles)); CHKiRet(strm.SetsType(psQIF, STREAMTYPE_FILE_SINGLE)); - CHKiRet(strm.SetFName(psQIF, pThis->pszQIFNam, pThis->lenQIFNam)); + CHKiRet(strm.SetFName(psQIF, pszQIFNam, lenQIFNam)); CHKiRet(strm.ConstructFinalize(psQIF)); /* first, write the property bag for ourselfs @@ -2383,6 +2077,7 @@ CHKiRet(obj.BeginSerializePropBag(psQIF, (obj_t*) pThis)); objSerializeSCALAR(psQIF, iQueueSize, INT); objSerializeSCALAR(psQIF, tVars.disk.sizeOnDisk, INT64); + objSerializeSCALAR(psQIF, tVars.disk.bytesRead, INT64); CHKiRet(obj.EndSerialize(psQIF)); /* now persist the stream info */ @@ -2482,84 +2177,76 @@ /* destructor for the queue object */ BEGINobjDestruct(qqueue) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(qqueue) - if(pThis->bQueueStarted) { - /* shut down all workers - * We do not need to shutdown workers when we are in enqueue-only mode or we are a - * direct queue - because in both cases we have none... ;) - * with a child! -- rgerhards, 2008-01-28 - */ - if(pThis->qType != QUEUETYPE_DIRECT && !pThis->bEnqOnly && pThis->pqParent == NULL - && pThis->pWtpReg != NULL) - ShutdownWorkers(pThis); - - if(pThis->bIsDA && getPhysicalQueueSize(pThis) > 0 && pThis->bSaveOnShutdown) { - CHKiRet(DoSaveOnShutdown(pThis)); - } - - /* finally destruct our (regular) worker thread pool - * Note: currently pWtpReg is never NULL, but if we optimize our logic, this may happen, - * e.g. when they are not created in enqueue-only mode. We already check the condition - * as this may otherwise be very hard to find once we optimize (and have long forgotten - * about this condition here ;) - * rgerhards, 2008-01-25 - */ - if(pThis->qType != QUEUETYPE_DIRECT && pThis->pWtpReg != NULL) { - wtpDestruct(&pThis->pWtpReg); - } - - /* Now check if we actually have a DA queue and, if so, destruct it. - * Note that the wtp must be destructed first, it may be in cancel cleanup handler - * *right now* and actually *need* to access the queue object to persist some final - * data (re-queueing case). So we need to destruct the wtp first, which will make - * sure all workers have terminated. Please note that this also generates a situation - * where it is possible that the DA queue has a parent pointer but the parent has - * no WtpDA associated with it - which is perfectly legal thanks to this code here. - */ - if(pThis->pWtpDA != NULL) { - wtpDestruct(&pThis->pWtpDA); - } - if(pThis->pqDA != NULL) { - qqueueDestruct(&pThis->pqDA); - } + /* shut down all workers + * We do not need to shutdown workers when we are in enqueue-only mode or we are a + * direct queue - because in both cases we have none... ;) + * with a child! -- rgerhards, 2008-01-28 + */ + if(pThis->qType != QUEUETYPE_DIRECT && !pThis->bEnqOnly && pThis->pqParent == NULL + && pThis->pWtpReg != NULL) + ShutdownWorkers(pThis); + + if(pThis->bIsDA && getPhysicalQueueSize(pThis) > 0 && pThis->bSaveOnShutdown) { + CHKiRet(DoSaveOnShutdown(pThis)); + } + + /* finally destruct our (regular) worker thread pool + * Note: currently pWtpReg is never NULL, but if we optimize our logic, this may happen, + * e.g. when they are not created in enqueue-only mode. We already check the condition + * as this may otherwise be very hard to find once we optimize (and have long forgotten + * about this condition here ;) + * rgerhards, 2008-01-25 + */ + if(pThis->qType != QUEUETYPE_DIRECT && pThis->pWtpReg != NULL) { + wtpDestruct(&pThis->pWtpReg); + } + + /* Now check if we actually have a DA queue and, if so, destruct it. + * Note that the wtp must be destructed first, it may be in cancel cleanup handler + * *right now* and actually *need* to access the queue object to persist some final + * data (re-queueing case). So we need to destruct the wtp first, which will make + * sure all workers have terminated. Please note that this also generates a situation + * where it is possible that the DA queue has a parent pointer but the parent has + * no WtpDA associated with it - which is perfectly legal thanks to this code here. + */ + if(pThis->pWtpDA != NULL) { + wtpDestruct(&pThis->pWtpDA); + } + if(pThis->pqDA != NULL) { + qqueueDestruct(&pThis->pqDA); + } - /* persist the queue (we always do that - queuePersits() does cleanup if the queue is empty) - * This handler is most important for disk queues, it will finally persist the necessary - * on-disk structures. In theory, other queueing modes may implement their other (non-DA) - * methods of persisting a queue between runs, but in practice all of this is done via - * disk queues and DA mode. Anyhow, it doesn't hurt to know that we could extend it here - * if need arises (what I doubt...) -- rgerhards, 2008-01-25 - */ - CHKiRet_Hdlr(qqueuePersist(pThis, QUEUE_NO_CHECKPOINT)) { - DBGOPRINT((obj_t*) pThis, "error %d persisting queue - data lost!\n", iRet); - } + /* persist the queue (we always do that - queuePersits() does cleanup if the queue is empty) + * This handler is most important for disk queues, it will finally persist the necessary + * on-disk structures. In theory, other queueing modes may implement their other (non-DA) + * methods of persisting a queue between runs, but in practice all of this is done via + * disk queues and DA mode. Anyhow, it doesn't hurt to know that we could extend it here + * if need arises (what I doubt...) -- rgerhards, 2008-01-25 + */ + CHKiRet_Hdlr(qqueuePersist(pThis, QUEUE_NO_CHECKPOINT)) { + DBGOPRINT((obj_t*) pThis, "error %d persisting queue - data lost!\n", iRet); + } - /* finally, clean up some simple things... */ - if(pThis->pqParent == NULL) { - /* if we are not a child, we allocated our own mutex, which we now need to destroy */ - pthread_mutex_destroy(pThis->mut); - free(pThis->mut); - } - pthread_mutex_destroy(&pThis->mutThrdMgmt); - pthread_cond_destroy(&pThis->notFull); - pthread_cond_destroy(&pThis->belowFullDlyWtrMrk); - pthread_cond_destroy(&pThis->belowLightDlyWtrMrk); + /* finally, clean up some simple things... */ + if(pThis->pqParent == NULL) { + /* if we are not a child, we allocated our own mutex, which we now need to destroy */ + pthread_mutex_destroy(pThis->mut); + free(pThis->mut); + } + pthread_mutex_destroy(&pThis->mutThrdMgmt); + pthread_cond_destroy(&pThis->notFull); + pthread_cond_destroy(&pThis->notEmpty); + pthread_cond_destroy(&pThis->belowFullDlyWtrMrk); + pthread_cond_destroy(&pThis->belowLightDlyWtrMrk); - DESTROY_ATOMIC_HELPER_MUT(pThis->mutQueueSize); - DESTROY_ATOMIC_HELPER_MUT(pThis->mutLogDeq); + DESTROY_ATOMIC_HELPER_MUT(pThis->mutQueueSize); + DESTROY_ATOMIC_HELPER_MUT(pThis->mutLogDeq); - /* type-specific destructor */ - iRet = pThis->qDestruct(pThis); - } + /* type-specific destructor */ + iRet = pThis->qDestruct(pThis); free(pThis->pszFilePrefix); free(pThis->pszSpoolDir); - if(pThis->useCryprov) { - pThis->cryprov.Destruct(&pThis->cryprovData); - obj.ReleaseObj(__FILE__, pThis->cryprovNameFull+2, pThis->cryprovNameFull, - (void*) &pThis->cryprov); - free(pThis->cryprovName); - free(pThis->cryprovNameFull); - } /* some queues do not provide stats and thus have no statsobj! */ if(pThis->statsobj != NULL) @@ -2567,24 +2254,6 @@ ENDobjDestruct(qqueue) -/* set the queue's spool directory. The directory MUST NOT be NULL. - * The passed-in string is duplicated. So if the caller does not need - * it any longer, it must free it. - */ -rsRetVal -qqueueSetSpoolDir(qqueue_t *pThis, uchar *pszSpoolDir, int lenSpoolDir) -{ - DEFiRet; - - free(pThis->pszSpoolDir); - CHKmalloc(pThis->pszSpoolDir = ustrdup(pszSpoolDir)); - pThis->lenSpoolDir = lenSpoolDir; - -finalize_it: - RETiRet; -} - - /* set the queue's file prefix * The passed-in string is duplicated. So if the caller does not need * it any longer, it must free it. @@ -2636,7 +2305,7 @@ * rgerhards, 2009-06-16 */ static inline rsRetVal -doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, msg_t *pMsg) +doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr) { DEFiRet; int err; @@ -2645,7 +2314,7 @@ STATSCOUNTER_INC(pThis->ctrEnqueued, pThis->mutCtrEnqueued); /* first check if we need to discard this message (which will cause CHKiRet() to exit) */ - CHKiRet(qqueueChkDiscardMsg(pThis, pThis->iQueueSize, pMsg)); + CHKiRet(qqueueChkDiscardMsg(pThis, pThis->iQueueSize, pUsr)); /* handle flow control * There are two different flow control mechanisms: basic and advanced flow control. @@ -2680,7 +2349,7 @@ * In any case, this was the old code (if we do the TODO): * pthread_cond_wait(&pThis->belowFullDlyWtrMrk, pThis->mut); */ - DBGOPRINT((obj_t*) pThis, "doEnqSingleObject: FullDelay mark reached for full delayable message " + DBGOPRINT((obj_t*) pThis, "enqueueMsg: FullDelay mark reached for full delayable message " "- blocking, queue size is %d.\n", pThis->iQueueSize); timeoutComp(&t, 1000); err = pthread_cond_timedwait(&pThis->belowLightDlyWtrMrk, pThis->mut, &t); @@ -2697,7 +2366,7 @@ } } else if(flowCtlType == eFLOWCTL_LIGHT_DELAY && !glbl.GetGlobalInputTermState()) { if(pThis->iQueueSize >= pThis->iLightDlyMrk) { - DBGOPRINT((obj_t*) pThis, "doEnqSingleObject: LightDelay mark reached for light " + DBGOPRINT((obj_t*) pThis, "enqueueMsg: LightDelay mark reached for light " "delayable message - blocking a bit.\n"); timeoutComp(&t, 1000); /* 1000 millisconds = 1 second TODO: make configurable */ err = pthread_cond_timedwait(&pThis->belowLightDlyWtrMrk, pThis->mut, &t); @@ -2716,35 +2385,33 @@ * the queue to become ready or drop the new message. -- rgerhards, 2008-03-14 */ while( (pThis->iMaxQueueSize > 0 && pThis->iQueueSize >= pThis->iMaxQueueSize) - || ((pThis->qType == QUEUETYPE_DISK || pThis->bIsDA) && pThis->sizeOnDiskMax != 0 + || (pThis->qType == QUEUETYPE_DISK && pThis->sizeOnDiskMax != 0 && pThis->tVars.disk.sizeOnDisk > pThis->sizeOnDiskMax)) { STATSCOUNTER_INC(pThis->ctrFull, pThis->mutCtrFull); if(pThis->toEnq == 0 || pThis->bEnqOnly) { - DBGOPRINT((obj_t*) pThis, "doEnqSingleObject: queue FULL - configured for immediate discarding QueueSize=%d " - "MaxQueueSize=%d sizeOnDisk=%lld sizeOnDiskMax=%lld\n", pThis->iQueueSize, pThis->iMaxQueueSize, - pThis->tVars.disk.sizeOnDisk, pThis->sizeOnDiskMax); + DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL - configured for immediate discarding.\n"); STATSCOUNTER_INC(pThis->ctrFDscrd, pThis->mutCtrFDscrd); - msgDestruct(&pMsg); + objDestruct(pUsr); ABORT_FINALIZE(RS_RET_QUEUE_FULL); } else { - DBGOPRINT((obj_t*) pThis, "doEnqSingleObject: queue FULL - waiting %dms to drain.\n", pThis->toEnq); + DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL - waiting %dms to drain.\n", pThis->toEnq); if(glbl.GetGlobalInputTermState()) { - DBGOPRINT((obj_t*) pThis, "doEnqSingleObject: queue FULL, discard due to FORCE_TERM.\n"); + DBGOPRINT((obj_t*) pThis, "enqueueMsg: queue FULL, discard due to FORCE_TERM.\n"); ABORT_FINALIZE(RS_RET_FORCE_TERM); } timeoutComp(&t, pThis->toEnq); if(pthread_cond_timedwait(&pThis->notFull, pThis->mut, &t) != 0) { - DBGOPRINT((obj_t*) pThis, "doEnqSingleObject: cond timeout, dropping message!\n"); + DBGOPRINT((obj_t*) pThis, "enqueueMsg: cond timeout, dropping message!\n"); STATSCOUNTER_INC(pThis->ctrFDscrd, pThis->mutCtrFDscrd); - msgDestruct(&pMsg); + objDestruct(pUsr); ABORT_FINALIZE(RS_RET_QUEUE_FULL); } - dbgoprint((obj_t*) pThis, "doEnqSingleObject: wait solved queue full condition, enqueing\n"); + dbgoprint((obj_t*) pThis, "enqueueMsg: wait solved queue full condition, enqueing\n"); } } /* and finally enqueue the message */ - CHKiRet(qqueueAdd(pThis, pMsg)); + CHKiRet(qqueueAdd(pThis, pUsr)); STATSCOUNTER_SETMAX_NOMUT(pThis->ctrMaxqsize, pThis->iQueueSize); finalize_it: @@ -2820,11 +2487,11 @@ * Enqueues the new element and awakes worker thread. */ rsRetVal -qqueueEnqMsgDirect(qqueue_t *pThis, msg_t *pMsg) +qqueueEnqObjDirect(qqueue_t *pThis, void *pUsr) { DEFiRet; ISOBJ_TYPE_assert(pThis, qqueue); - iRet = qAddDirect(pThis, pMsg); + iRet = qAddDirect(pThis, pUsr); RETiRet; } @@ -2833,7 +2500,7 @@ * Enqueues the new element and awakes worker thread. */ rsRetVal -qqueueEnqMsg(qqueue_t *pThis, flowControl_t flowCtlType, msg_t *pMsg) +qqueueEnqObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr) { DEFiRet; int iCancelStateSave; @@ -2845,7 +2512,7 @@ d_pthread_mutex_lock(pThis->mut); } - CHKiRet(doEnqSingleObj(pThis, flowCtlType, pMsg)); + CHKiRet(doEnqSingleObj(pThis, flowCtlType, pUsr)); qqueueChkPersist(pThis, 1); @@ -2863,179 +2530,6 @@ } -/* are any queue params set at all? 1 - yes, 0 - no - * We need to evaluate the param block for this function, which is somewhat - * inefficient. HOWEVER, this is only done during config load, so we really - * don't care... -- rgerhards, 2013-05-10 - */ -int -queueCnfParamsSet(struct nvlst *lst) -{ - int r; - struct cnfparamvals *pvals; - - pvals = nvlstGetParams(lst, &pblk, NULL); - r = cnfparamvalsIsSet(&pblk, pvals); - cnfparamvalsDestruct(pvals, &pblk); - return r; -} - - -static inline rsRetVal -initCryprov(qqueue_t *pThis, struct nvlst *lst) -{ - uchar szDrvrName[1024]; - DEFiRet; - - if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmcry_%s", pThis->cryprovName) - == sizeof(szDrvrName)) { - errmsg.LogError(0, RS_RET_ERR, "queue: crypto provider " - "name is too long: '%s' - encryption disabled", - pThis->cryprovName); - ABORT_FINALIZE(RS_RET_ERR); - } - pThis->cryprovNameFull = ustrdup(szDrvrName); - - pThis->cryprov.ifVersion = cryprovCURR_IF_VERSION; - /* The pDrvrName+2 below is a hack to obtain the object name. It - * safes us to have yet another variable with the name without "lm" in - * front of it. If we change the module load interface, we may re-think - * about this hack, but for the time being it is efficient and clean enough. - */ - if(obj.UseObj(__FILE__, szDrvrName, szDrvrName, (void*) &pThis->cryprov) - != RS_RET_OK) { - errmsg.LogError(0, RS_RET_LOAD_ERROR, "queue: could not load " - "crypto provider '%s' - encryption disabled", - szDrvrName); - ABORT_FINALIZE(RS_RET_CRYPROV_ERR); - } - - if(pThis->cryprov.Construct(&pThis->cryprovData) != RS_RET_OK) { - errmsg.LogError(0, RS_RET_CRYPROV_ERR, "queue: error constructing " - "crypto provider %s dataset - encryption disabled", - szDrvrName); - ABORT_FINALIZE(RS_RET_CRYPROV_ERR); - } - CHKiRet(pThis->cryprov.SetCnfParam(pThis->cryprovData, lst, CRYPROV_PARAMTYPE_DISK)); - - dbgprintf("loaded crypto provider %s, data instance at %p\n", - szDrvrName, pThis->cryprovData); - pThis->useCryprov = 1; -finalize_it: - RETiRet; -} - -/* apply all params from param block to queue. Must be called before - * finalizing. This supports the v6 config system. Defaults were already - * set during queue creation. The pvals object is destructed by this - * function. - */ -rsRetVal -qqueueApplyCnfParam(qqueue_t *pThis, struct nvlst *lst) -{ - int i; - struct cnfparamvals *pvals; - - pvals = nvlstGetParams(lst, &pblk, NULL); - if(Debug) { - dbgprintf("queue param blk:\n"); - cnfparamsPrint(&pblk, pvals); - } - for(i = 0 ; i < pblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblk.descr[i].name, "queue.filename")) { - pThis->pszFilePrefix = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - pThis->lenFilePrefix = es_strlen(pvals[i].val.d.estr); - } else if(!strcmp(pblk.descr[i].name, "queue.cry.provider")) { - pThis->cryprovName = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblk.descr[i].name, "queue.spooldirectory")) { - free(pThis->pszSpoolDir); - pThis->pszSpoolDir = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - pThis->lenSpoolDir = es_strlen(pvals[i].val.d.estr); - if(pThis->pszSpoolDir[pThis->lenSpoolDir-1] == '/') { - pThis->pszSpoolDir[pThis->lenSpoolDir-1] = '\0'; - --pThis->lenSpoolDir; - parser_errmsg("queue.spooldirectory must not end with '/', " - "corrected to '%s'", pThis->pszSpoolDir); - } - } else if(!strcmp(pblk.descr[i].name, "queue.size")) { - pThis->iMaxQueueSize = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.dequeuebatchsize")) { - pThis->iDeqBatchSize = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.maxdiskspace")) { - pThis->sizeOnDiskMax = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.highwatermark")) { - pThis->iHighWtrMrk = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.lowwatermark")) { - pThis->iLowWtrMrk = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.fulldelaymark")) { - pThis->iFullDlyMrk = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.lightdelaymark")) { - pThis->iLightDlyMrk = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.discardmark")) { - pThis->iDiscardMrk = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.discardseverity")) { - pThis->iDiscardSeverity = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.checkpointinterval")) { - pThis->iPersistUpdCnt = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.syncqueuefiles")) { - pThis->bSyncQueueFiles = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.type")) { - pThis->qType = (queueType_t) pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.workerthreads")) { - pThis->iNumWorkerThreads = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.timeoutshutdown")) { - pThis->toQShutdown = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.timeoutactioncompletion")) { - pThis->toActShutdown = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.timeoutenqueue")) { - pThis->toEnq = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.timeoutworkerthreadshutdown")) { - pThis->toWrkShutdown = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.workerthreadminimummessages")) { - pThis->iMinMsgsPerWrkr = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.maxfilesize")) { - pThis->iMaxFileSize = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.saveonshutdown")) { - pThis->bSaveOnShutdown = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.dequeueslowdown")) { - pThis->iDeqSlowdown = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queue.dequeuetimebegin")) { - pThis->iDeqtWinFromHr = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "queuedequeuetimend.")) { - pThis->iDeqtWinToHr = pvals[i].val.d.n; - } else { - DBGPRINTF("queue: program error, non-handled " - "param '%s'\n", pblk.descr[i].name); - } - } - if(pThis->qType == QUEUETYPE_DISK) { - if(pThis->pszFilePrefix == NULL) { - errmsg.LogError(0, RS_RET_QUEUE_DISK_NO_FN, "error on queue '%s', disk mode selected, but " - "no queue file name given; queue type changed to 'linkedList'", - obj.GetName((obj_t*) pThis)); - pThis->qType = QUEUETYPE_LINKEDLIST; - } - } - - if(pThis->pszFilePrefix == NULL && pThis->cryprovName != NULL) { - errmsg.LogError(0, RS_RET_QUEUE_CRY_DISK_ONLY, "error on queue '%s', crypto provider can " - "only be set for disk or disk assisted queue - ignored", - obj.GetName((obj_t*) pThis)); - free(pThis->cryprovName); - pThis->cryprovName = NULL; - } - - if(pThis->cryprovName != NULL) { - initCryprov(pThis, lst); - } - - cnfparamvalsDestruct(pvals, &pblk); - return RS_RET_OK; -} - - /* some simple object access methods */ DEFpropSetMeth(qqueue, bSyncQueueFiles, int) DEFpropSetMeth(qqueue, iPersistUpdCnt, int) @@ -3052,10 +2546,9 @@ DEFpropSetMeth(qqueue, iDiscardSeverity, int) DEFpropSetMeth(qqueue, iLightDlyMrk, int) DEFpropSetMeth(qqueue, bIsDA, int) -DEFpropSetMeth(qqueue, iNumWorkerThreads, int) DEFpropSetMeth(qqueue, iMinMsgsPerWrkr, int) DEFpropSetMeth(qqueue, bSaveOnShutdown, int) -DEFpropSetMeth(qqueue, pAction, action_t*) +DEFpropSetMeth(qqueue, pUsr, void*) DEFpropSetMeth(qqueue, iDeqSlowdown, int) DEFpropSetMeth(qqueue, iDeqBatchSize, int) DEFpropSetMeth(qqueue, sizeOnDiskMax, int64) @@ -3078,6 +2571,8 @@ pThis->iQueueSize = pProp->val.num; } else if(isProp("tVars.disk.sizeOnDisk")) { pThis->tVars.disk.sizeOnDisk = pProp->val.num; + } else if(isProp("tVars.disk.bytesRead")) { + pThis->tVars.disk.bytesRead = pProp->val.num; } else if(isProp("qType")) { if(pThis->qType != pProp->val.num) ABORT_FINALIZE(RS_RET_QTYPE_MISMATCH); diff -Nru rsyslog-7.6.0/runtime/queue.h rsyslog-5.10.1/runtime/queue.h --- rsyslog-7.6.0/runtime/queue.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/queue.h 2012-10-17 14:41:20.000000000 +0000 @@ -30,7 +30,6 @@ #include "batch.h" #include "stream.h" #include "statsobj.h" -#include "cryprov.h" /* support for the toDelete list */ typedef struct toDeleteLst_s toDeleteLst_t; @@ -52,7 +51,7 @@ /* list member definition for linked list types of queues: */ typedef struct qLinkedList_S { struct qLinkedList_S *pNext; - msg_t *pMsg; + void *pUsr; } qLinkedList_t; @@ -72,7 +71,7 @@ int iMinMsgsPerWrkr;/* minimum nbr of msgs per worker thread, if more, a new worker is started until max wrkrs */ wtp_t *pWtpDA; wtp_t *pWtpReg; - action_t *pAction; /* for action queues, ptr to action object; for main queues unused */ + void *pUsr; /* a global, user-supplied pointer. Is passed back to consumer. */ int iUpdsSincePersist;/* nbr of queue updates since the last persist call */ int iPersistUpdCnt; /* persits queue info after this nbr of updates - 0 -> persist only on shutdown */ sbool bSyncQueueFiles;/* if working with files, sync them after each write? */ @@ -112,8 +111,8 @@ /* type-specific handlers (set during construction) */ rsRetVal (*qConstruct)(struct queue_s *pThis); rsRetVal (*qDestruct)(struct queue_s *pThis); - rsRetVal (*qAdd)(struct queue_s *pThis, msg_t *pMsg); - rsRetVal (*qDeq)(struct queue_s *pThis, msg_t **ppMsg); + rsRetVal (*qAdd)(struct queue_s *pThis, void *pUsr); + rsRetVal (*qDeq)(struct queue_s *pThis, void **ppUsr); rsRetVal (*qDel)(struct queue_s *pThis); /* end type-specific handler */ /* public entry points (set during construction, permit to set best algorithm for params selected) */ @@ -122,7 +121,7 @@ /* synchronization variables */ pthread_mutex_t mutThrdMgmt; /* mutex for the queue's thread management */ pthread_mutex_t *mut; /* mutex for enqueing and dequeueing messages */ - pthread_cond_t notFull; + pthread_cond_t notFull, notEmpty; pthread_cond_t belowFullDlyWtrMrk; /* below eFLOWCTL_FULL_DELAY watermark */ pthread_cond_t belowLightDlyWtrMrk; /* below eFLOWCTL_FULL_DELAY watermark */ int bThrdStateChanged; /* at least one thread state has changed if 1 */ @@ -136,8 +135,6 @@ size_t lenSpoolDir; uchar *pszFilePrefix; size_t lenFilePrefix; - uchar *pszQIFNam; /* full .qi file name, based on parts above */ - size_t lenQIFNam; int iNumberFiles; /* how many files make up the queue? */ int64 iMaxFileSize; /* max size for a single queue file */ int64 sizeOnDiskMax; /* maximum size on disk allowed */ @@ -148,8 +145,7 @@ struct queue_s *pqParent;/* pointer to the parent (if this is a child queue) */ int bDAEnqOnly; /* EnqOnly setting for DA queue */ /* now follow queueing mode specific data elements */ - //union { /* different data elements based on queue type (qType) */ - struct { /* different data elements based on queue type (qType) */ + union { /* different data elements based on queue type (qType) */ struct { long deqhead, head, tail; void** pBuf; /* the queued user data structure */ @@ -161,19 +157,12 @@ } linklist; struct { int64 sizeOnDisk; /* current amount of disk space used */ - int64 deqOffs; /* offset after dequeue batch - used for file deleter */ - int deqFileNumIn; /* same for the circular file numbers, mainly for */ - int deqFileNumOut;/* deleting finished files */ + int64 bytesRead; /* number of bytes read from current (undeleted!) file */ strm_t *pWrite; /* current file to be written */ strm_t *pReadDeq; /* current file for dequeueing */ strm_t *pReadDel; /* current file for deleting */ } disk; } tVars; - sbool useCryprov; /* quicker than checkig ptr (1 vs 8 bytes!) */ - uchar *cryprovName; /* crypto provider to use */ - cryprov_if_t cryprov; /* ptr to crypto provider interface */ - void *cryprovData; /* opaque data ptr for provider use */ - uchar *cryprovNameFull;/* full internal crypto provider name */ DEF_ATOMIC_HELPER_MUT(mutQueueSize); DEF_ATOMIC_HELPER_MUT(mutLogDeq); /* for statistics subsystem */ @@ -195,20 +184,14 @@ /* prototypes */ rsRetVal qqueueDestruct(qqueue_t **ppThis); -rsRetVal qqueueEnqMsgDirect(qqueue_t *pThis, msg_t *pMsg); -rsRetVal qqueueEnqMsg(qqueue_t *pThis, flowControl_t flwCtlType, msg_t *pMsg); +rsRetVal qqueueEnqObjDirect(qqueue_t *pThis, void *pUsr); +rsRetVal qqueueEnqObj(qqueue_t *pThis, flowControl_t flwCtlType, void *pUsr); rsRetVal qqueueStart(qqueue_t *pThis); rsRetVal qqueueSetMaxFileSize(qqueue_t *pThis, size_t iMaxFileSize); rsRetVal qqueueSetFilePrefix(qqueue_t *pThis, uchar *pszPrefix, size_t iLenPrefix); rsRetVal qqueueConstruct(qqueue_t **ppThis, queueType_t qType, int iWorkerThreads, int iMaxQueueSize, rsRetVal (*pConsumer)(void*,batch_t*, int*)); rsRetVal qqueueEnqObjDirectBatch(qqueue_t *pThis, batch_t *pBatch); -int queueCnfParamsSet(struct nvlst *lst); -rsRetVal qqueueApplyCnfParam(qqueue_t *pThis, struct nvlst *lst); -void qqueueSetDefaultsRulesetQueue(qqueue_t *pThis); -void qqueueSetDefaultsActionQueue(qqueue_t *pThis); -void qqueueDbgPrint(qqueue_t *pThis); - PROTOTYPEObjClassInit(qqueue); PROTOTYPEpropSetMeth(qqueue, iPersistUpdCnt, int); PROTOTYPEpropSetMeth(qqueue, bSyncQueueFiles, int); @@ -224,9 +207,8 @@ PROTOTYPEpropSetMeth(qqueue, iDiscardMrk, int); PROTOTYPEpropSetMeth(qqueue, iDiscardSeverity, int); PROTOTYPEpropSetMeth(qqueue, iMinMsgsPerWrkr, int); -PROTOTYPEpropSetMeth(qqueue, iNumWorkerThreads, int); PROTOTYPEpropSetMeth(qqueue, bSaveOnShutdown, int); -PROTOTYPEpropSetMeth(qqueue, pAction, action_t*); +PROTOTYPEpropSetMeth(qqueue, pUsr, void*); PROTOTYPEpropSetMeth(qqueue, iDeqSlowdown, int); PROTOTYPEpropSetMeth(qqueue, sizeOnDiskMax, int64); PROTOTYPEpropSetMeth(qqueue, iDeqBatchSize, int); diff -Nru rsyslog-7.6.0/runtime/ratelimit.c rsyslog-5.10.1/runtime/ratelimit.c --- rsyslog-7.6.0/runtime/ratelimit.c 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/runtime/ratelimit.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,389 +0,0 @@ -/* ratelimit.c - * support for rate-limiting sources, including "last message - * repeated n times" processing. - * - * Copyright 2012 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include -#include -#include - -#include "rsyslog.h" -#include "errmsg.h" -#include "ratelimit.h" -#include "datetime.h" -#include "parser.h" -#include "unicode-helper.h" -#include "msg.h" -#include "rsconf.h" -#include "dirty.h" - -/* definitions for objects we access */ -DEFobjStaticHelpers -DEFobjCurrIf(errmsg) -DEFobjCurrIf(glbl) -DEFobjCurrIf(datetime) -DEFobjCurrIf(parser) - -/* static data */ - -/* generate a "repeated n times" message */ -static inline msg_t * -ratelimitGenRepMsg(ratelimit_t *ratelimit) -{ - msg_t *repMsg; - size_t lenRepMsg; - uchar szRepMsg[1024]; - - if(ratelimit->nsupp == 1) { /* we simply use the original message! */ - repMsg = MsgAddRef(ratelimit->pMsg); - } else {/* we need to duplicate, original message may still be in use in other - * parts of the system! */ - if((repMsg = MsgDup(ratelimit->pMsg)) == NULL) { - DBGPRINTF("Message duplication failed, dropping repeat message.\n"); - goto done; - } - lenRepMsg = snprintf((char*)szRepMsg, sizeof(szRepMsg), - " message repeated %d times: [%.800s]", - ratelimit->nsupp, getMSG(ratelimit->pMsg)); - MsgReplaceMSG(repMsg, szRepMsg, lenRepMsg); - } - -done: return repMsg; -} - -static inline rsRetVal -doLastMessageRepeatedNTimes(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRepMsg) -{ - int bNeedUnlockMutex = 0; - DEFiRet; - - if(ratelimit->bThreadSafe) { - pthread_mutex_lock(&ratelimit->mut); - bNeedUnlockMutex = 1; - } - - if( ratelimit->pMsg != NULL && - getMSGLen(pMsg) == getMSGLen(ratelimit->pMsg) && - !ustrcmp(getMSG(pMsg), getMSG(ratelimit->pMsg)) && - !strcmp(getHOSTNAME(pMsg), getHOSTNAME(ratelimit->pMsg)) && - !strcmp(getPROCID(pMsg, LOCK_MUTEX), getPROCID(ratelimit->pMsg, LOCK_MUTEX)) && - !strcmp(getAPPNAME(pMsg, LOCK_MUTEX), getAPPNAME(ratelimit->pMsg, LOCK_MUTEX))) { - ratelimit->nsupp++; - DBGPRINTF("msg repeated %d times\n", ratelimit->nsupp); - /* use current message, so we have the new timestamp - * (means we need to discard previous one) */ - msgDestruct(&ratelimit->pMsg); - ratelimit->pMsg = pMsg; - ABORT_FINALIZE(RS_RET_DISCARDMSG); - } else {/* new message, do "repeat processing" & save it */ - if(ratelimit->pMsg != NULL) { - if(ratelimit->nsupp > 0) { - *ppRepMsg = ratelimitGenRepMsg(ratelimit); - ratelimit->nsupp = 0; - } - msgDestruct(&ratelimit->pMsg); - } - ratelimit->pMsg = MsgAddRef(pMsg); - } - -finalize_it: - if(bNeedUnlockMutex) - pthread_mutex_unlock(&ratelimit->mut); - RETiRet; -} - - -/* helper: tell how many messages we lost due to linux-like ratelimiting */ -static inline void -tellLostCnt(ratelimit_t *ratelimit) -{ - uchar msgbuf[1024]; - if(ratelimit->missed) { - snprintf((char*)msgbuf, sizeof(msgbuf), - "%s: %u messages lost due to rate-limiting", - ratelimit->name, ratelimit->missed); - ratelimit->missed = 0; - logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0); - } -} - -/* Linux-like ratelimiting, modelled after the linux kernel - * returns 1 if message is within rate limit and shall be - * processed, 0 otherwise. - * This implementation is NOT THREAD-SAFE and must not - * be called concurrently. - */ -static inline int -withinRatelimit(ratelimit_t *ratelimit, time_t tt) -{ - int ret; - uchar msgbuf[1024]; - - if(ratelimit->interval == 0) { - ret = 1; - goto finalize_it; - } - - /* we primarily need "NoTimeCache" mode for imjournal, as it - * sets the message generation time to the journal timestamp. - * As such, we do not get a proper indication of the actual - * message rate. To prevent this, we need to query local - * system time ourselvs. - */ - if(ratelimit->bNoTimeCache) - tt = time(NULL); - - assert(ratelimit->burst != 0); - - if(ratelimit->begin == 0) - ratelimit->begin = tt; - - /* resume if we go out of time window */ - if(tt > ratelimit->begin + ratelimit->interval) { - ratelimit->begin = 0; - ratelimit->done = 0; - tellLostCnt(ratelimit); - } - - /* do actual limit check */ - if(ratelimit->burst > ratelimit->done) { - ratelimit->done++; - ret = 1; - } else { - ratelimit->missed++; - if(ratelimit->missed == 1) { - snprintf((char*)msgbuf, sizeof(msgbuf), - "%s: begin to drop messages due to rate-limiting", - ratelimit->name); - logmsgInternal(RS_RET_RATE_LIMITED, LOG_SYSLOG|LOG_INFO, msgbuf, 0); - } - ret = 0; - } - -finalize_it: - return ret; -} - - -/* ratelimit a message, that means: - * - handle "last message repeated n times" logic - * - handle actual (discarding) rate-limiting - * This function returns RS_RET_OK, if the caller shall process - * the message regularly and RS_RET_DISCARD if the caller must - * discard the message. The caller should also discard the message - * if another return status occurs. This places some burden on the - * caller logic, but provides best performance. Demanding this - * cooperative mode can enable a faulty caller to thrash up part - * of the system, but we accept that risk (a faulty caller can - * always do all sorts of evil, so...) - * If *ppRepMsg != NULL on return, the caller must enqueue that - * message before the original message. - */ -rsRetVal -ratelimitMsg(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRepMsg) -{ - DEFiRet; - rsRetVal localRet; - - if((pMsg->msgFlags & NEEDS_PARSING) != 0) { - if((localRet = parser.ParseMsg(pMsg)) != RS_RET_OK) { - DBGPRINTF("Message discarded, parsing error %d\n", localRet); - ABORT_FINALIZE(RS_RET_DISCARDMSG); - } - } - - *ppRepMsg = NULL; - /* Only the messages having severity level at or below the - * treshold (the value is >=) are subject to ratelimiting. */ - if(ratelimit->interval && (pMsg->iSeverity >= ratelimit->severity)) { - if(withinRatelimit(ratelimit, pMsg->ttGenTime) == 0) { - msgDestruct(&pMsg); - ABORT_FINALIZE(RS_RET_DISCARDMSG); - } - } - if(ratelimit->bReduceRepeatMsgs) { - CHKiRet(doLastMessageRepeatedNTimes(ratelimit, pMsg, ppRepMsg)); - } -finalize_it: - if(Debug) { - if(iRet == RS_RET_DISCARDMSG) - dbgprintf("message discarded by ratelimiting\n"); - } - RETiRet; -} - -/* returns 1, if the ratelimiter performs any checks and 0 otherwise */ -int -ratelimitChecked(ratelimit_t *ratelimit) -{ - return ratelimit->interval || ratelimit->bReduceRepeatMsgs; -} - - -/* add a message to a ratelimiter/multisubmit structure. - * ratelimiting is automatically handled according to the ratelimit - * settings. - * if pMultiSub == NULL, a single-message enqueue happens (under reconsideration) - */ -rsRetVal -ratelimitAddMsg(ratelimit_t *ratelimit, multi_submit_t *pMultiSub, msg_t *pMsg) -{ - rsRetVal localRet; - msg_t *repMsg; - DEFiRet; - - if(pMultiSub == NULL) { - localRet = ratelimitMsg(ratelimit, pMsg, &repMsg); - if(repMsg != NULL) - CHKiRet(submitMsg2(repMsg)); - if(localRet == RS_RET_OK) - CHKiRet(submitMsg2(pMsg)); - } else { - localRet = ratelimitMsg(ratelimit, pMsg, &repMsg); - if(repMsg != NULL) { - pMultiSub->ppMsgs[pMultiSub->nElem++] = repMsg; - if(pMultiSub->nElem == pMultiSub->maxElem) - CHKiRet(multiSubmitMsg2(pMultiSub)); - } - if(localRet == RS_RET_OK) { - pMultiSub->ppMsgs[pMultiSub->nElem++] = pMsg; - if(pMultiSub->nElem == pMultiSub->maxElem) - CHKiRet(multiSubmitMsg2(pMultiSub)); - } - } - -finalize_it: - RETiRet; -} - - -/* modname must be a static name (usually expected to be the module - * name and MUST be present. dynname may be NULL and can be used for - * dynamic information, e.g. PID or listener IP, ... - * Both values should be kept brief. - */ -rsRetVal -ratelimitNew(ratelimit_t **ppThis, char *modname, char *dynname) -{ - ratelimit_t *pThis; - char namebuf[256]; - DEFiRet; - - CHKmalloc(pThis = calloc(1, sizeof(ratelimit_t))); - if(modname == NULL) - modname ="*ERROR:MODULE NAME MISSING*"; - - if(dynname == NULL) { - pThis->name = strdup(modname); - } else { - snprintf(namebuf, sizeof(namebuf), "%s[%s]", - modname, dynname); - namebuf[sizeof(namebuf)-1] = '\0'; /* to be on safe side */ - pThis->name = strdup(namebuf); - } - /* pThis->severity == 0 - all messages are ratelimited */ - pThis->bReduceRepeatMsgs = loadConf->globals.bReduceRepeatMsgs; - *ppThis = pThis; -finalize_it: - RETiRet; -} - - -/* enable linux-like ratelimiting */ -void -ratelimitSetLinuxLike(ratelimit_t *ratelimit, unsigned short interval, unsigned short burst) -{ - ratelimit->interval = interval; - ratelimit->burst = burst; - ratelimit->done = 0; - ratelimit->missed = 0; - ratelimit->begin = 0; -} - - -/* enable thread-safe operations mode. This make sure that - * a single ratelimiter can be called from multiple threads. As - * this causes some overhead and is not always required, it needs - * to be explicitely enabled. This operation cannot be undone - * (think: why should one do that???) - */ -void -ratelimitSetThreadSafe(ratelimit_t *ratelimit) -{ - ratelimit->bThreadSafe = 1; - pthread_mutex_init(&ratelimit->mut, NULL); -} -void -ratelimitSetNoTimeCache(ratelimit_t *ratelimit) -{ - ratelimit->bNoTimeCache = 1; - pthread_mutex_init(&ratelimit->mut, NULL); -} - -/* Severity level determines which messages are subject to - * ratelimiting. Default (no value set) is all messages. - */ -void -ratelimitSetSeverity(ratelimit_t *ratelimit, intTiny severity) -{ - ratelimit->severity = severity; -} - -void -ratelimitDestruct(ratelimit_t *ratelimit) -{ - msg_t *pMsg; - if(ratelimit->pMsg != NULL) { - if(ratelimit->nsupp > 0) { - pMsg = ratelimitGenRepMsg(ratelimit); - if(pMsg != NULL) - submitMsg2(pMsg); - } - msgDestruct(&ratelimit->pMsg); - } - tellLostCnt(ratelimit); - if(ratelimit->bThreadSafe) - pthread_mutex_destroy(&ratelimit->mut); - free(ratelimit->name); - free(ratelimit); -} - -void -ratelimitModExit(void) -{ - objRelease(datetime, CORE_COMPONENT); - objRelease(glbl, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); - objRelease(parser, CORE_COMPONENT); -} - -rsRetVal -ratelimitModInit(void) -{ - DEFiRet; - CHKiRet(objGetObjInterface(&obj)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(datetime, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(parser, CORE_COMPONENT)); -finalize_it: - RETiRet; -} diff -Nru rsyslog-7.6.0/runtime/ratelimit.h rsyslog-5.10.1/runtime/ratelimit.h --- rsyslog-7.6.0/runtime/ratelimit.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/ratelimit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* header for ratelimit.c - * - * Copyright 2012 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_RATELIMIT_H -#define INCLUDED_RATELIMIT_H - -struct ratelimit_s { - char *name; /**< rate limiter name, e.g. for user messages */ - /* support for Linux kernel-type ratelimiting */ - unsigned short interval; - unsigned short burst; - intTiny severity; /**< ratelimit only equal or lower severity levels (eq or higher values) */ - unsigned done; - unsigned missed; - time_t begin; - /* support for "last message repeated n times */ - int bReduceRepeatMsgs; /**< shall we do "last message repeated n times" processing? */ - unsigned nsupp; /**< nbr of msgs suppressed */ - msg_t *pMsg; - sbool bThreadSafe; /**< do we need to operate in Thread-Safe mode? */ - sbool bNoTimeCache; /**< if we shall not used cached reception time */ - pthread_mutex_t mut; /**< mutex if thread-safe operation desired */ -}; - -/* prototypes */ -rsRetVal ratelimitNew(ratelimit_t **ppThis, char *modname, char *dynname); -void ratelimitSetThreadSafe(ratelimit_t *ratelimit); -void ratelimitSetLinuxLike(ratelimit_t *ratelimit, unsigned short interval, unsigned short burst); -void ratelimitSetNoTimeCache(ratelimit_t *ratelimit); -void ratelimitSetSeverity(ratelimit_t *ratelimit, intTiny severity); -rsRetVal ratelimitMsg(ratelimit_t *ratelimit, msg_t *pMsg, msg_t **ppRep); -rsRetVal ratelimitAddMsg(ratelimit_t *ratelimit, multi_submit_t *pMultiSub, msg_t *pMsg); -void ratelimitDestruct(ratelimit_t *pThis); -int ratelimitChecked(ratelimit_t *ratelimit); -rsRetVal ratelimitModInit(void); -void ratelimitModExit(void); - -#endif /* #ifndef INCLUDED_RATELIMIT_H */ diff -Nru rsyslog-7.6.0/runtime/rsconf.c rsyslog-5.10.1/runtime/rsconf.c --- rsyslog-7.6.0/runtime/rsconf.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/rsconf.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1309 +0,0 @@ -/* rsconf.c - the rsyslog configuration system. - * - * Module begun 2011-04-19 by Rainer Gerhards - * - * Copyright 2011-2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" -#include "obj.h" -#include "srUtils.h" -#include "ruleset.h" -#include "modules.h" -#include "conf.h" -#include "queue.h" -#include "rsconf.h" -#include "cfsysline.h" -#include "errmsg.h" -#include "action.h" -#include "glbl.h" -#include "unicode-helper.h" -#include "omshell.h" -#include "omusrmsg.h" -#include "omfwd.h" -#include "omfile.h" -#include "ompipe.h" -#include "omdiscard.h" -#include "pmrfc5424.h" -#include "pmrfc3164.h" -#include "smfile.h" -#include "smtradfile.h" -#include "smfwd.h" -#include "smtradfwd.h" -#include "parser.h" -#include "outchannel.h" -#include "threads.h" -#include "datetime.h" -#include "parserif.h" -#include "modules.h" -#include "dirty.h" -#include "template.h" - -extern char* yytext; -/* static data */ -DEFobjStaticHelpers -DEFobjCurrIf(ruleset) -DEFobjCurrIf(module) -DEFobjCurrIf(conf) -DEFobjCurrIf(errmsg) -DEFobjCurrIf(glbl) -DEFobjCurrIf(parser) -DEFobjCurrIf(datetime) - -/* exported static data */ -rsconf_t *runConf = NULL;/* the currently running config */ -rsconf_t *loadConf = NULL;/* the config currently being loaded (no concurrent config load supported!) */ - -/* hardcoded standard templates (used for defaults) */ -static uchar template_DebugFormat[] = "\"Debug line with all properties:\nFROMHOST: '%FROMHOST%', fromhost-ip: '%fromhost-ip%', HOSTNAME: '%HOSTNAME%', PRI: %PRI%,\nsyslogtag '%syslogtag%', programname: '%programname%', APP-NAME: '%APP-NAME%', PROCID: '%PROCID%', MSGID: '%MSGID%',\nTIMESTAMP: '%TIMESTAMP%', STRUCTURED-DATA: '%STRUCTURED-DATA%',\nmsg: '%msg%'\nescaped msg: '%msg:::drop-cc%'\ninputname: %inputname% rawmsg: '%rawmsg%'\n$!:%$!%\n$.:%$.%\n$/:%$/%\n\n\""; -static uchar template_SyslogProtocol23Format[] = "\"<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n\""; -static uchar template_TraditionalFileFormat[] = "=RSYSLOG_TraditionalFileFormat"; -static uchar template_FileFormat[] = "=RSYSLOG_FileFormat"; -static uchar template_ForwardFormat[] = "=RSYSLOG_ForwardFormat"; -static uchar template_TraditionalForwardFormat[] = "=RSYSLOG_TraditionalForwardFormat"; -static uchar template_WallFmt[] = "\"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r\""; -static uchar template_StdUsrMsgFmt[] = "\" %syslogtag%%msg%\n\r\""; -static uchar template_StdDBFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')\",SQL"; -static uchar template_StdPgSQLFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-pgsql%', '%timegenerated:::date-pgsql%', %iut%, '%syslogtag%')\",STDSQL"; -static uchar template_spoofadr[] = "\"%fromhost-ip%\""; -static uchar template_SysklogdFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n\""; -static uchar template_StdJSONFmt[] = "\"{\\\"message\\\":\\\"%msg:::json%\\\",\\\"fromhost\\\":\\\"%HOSTNAME:::json%\\\",\\\"facility\\\":\\\"%syslogfacility-text%\\\",\\\"priority\\\":\\\"%syslogpriority-text%\\\",\\\"timereported\\\":\\\"%timereported:::date-rfc3339%\\\",\\\"timegenerated\\\":\\\"%timegenerated:::date-rfc3339%\\\"}\""; -/* end templates */ - -/* tables for interfacing with the v6 config system (as far as we need to) */ -static struct cnfparamdescr inppdescr[] = { - { "type", eCmdHdlrString, CNFPARAM_REQUIRED } -}; -static struct cnfparamblk inppblk = - { CNFPARAMBLK_VERSION, - sizeof(inppdescr)/sizeof(struct cnfparamdescr), - inppdescr - }; - -/* forward-definitions */ -void cnfDoCfsysline(char *ln); - -/* Standard-Constructor - */ -BEGINobjConstruct(rsconf) /* be sure to specify the object type also in END macro! */ - pThis->globals.bDebugPrintTemplateList = 1; - pThis->globals.bDebugPrintModuleList = 0; - pThis->globals.bDebugPrintCfSysLineHandlerList = 0; - pThis->globals.bLogStatusMsgs = DFLT_bLogStatusMsgs; - pThis->globals.bErrMsgToStderr = 1; - pThis->globals.umask = -1; - pThis->templates.root = NULL; - pThis->templates.last = NULL; - pThis->templates.lastStatic = NULL; - pThis->actions.nbrActions = 0; - lookupInitCnf(&pThis->lu_tabs); - CHKiRet(llInit(&pThis->rulesets.llRulesets, rulesetDestructForLinkedList, - rulesetKeyDestruct, strcasecmp)); - /* queue params */ - pThis->globals.mainQ.iMainMsgQueueSize = 100000; - pThis->globals.mainQ.iMainMsgQHighWtrMark = 80000; - pThis->globals.mainQ.iMainMsgQLowWtrMark = 20000; - pThis->globals.mainQ.iMainMsgQDiscardMark = 98000; - pThis->globals.mainQ.iMainMsgQDiscardSeverity = 8; - pThis->globals.mainQ.iMainMsgQueueNumWorkers = 2; - pThis->globals.mainQ.MainMsgQueType = QUEUETYPE_FIXED_ARRAY; - pThis->globals.mainQ.pszMainMsgQFName = NULL; - pThis->globals.mainQ.iMainMsgQueMaxFileSize = 1024*1024; - pThis->globals.mainQ.iMainMsgQPersistUpdCnt = 0; - pThis->globals.mainQ.bMainMsgQSyncQeueFiles = 0; - pThis->globals.mainQ.iMainMsgQtoQShutdown = 1500; - pThis->globals.mainQ.iMainMsgQtoActShutdown = 1000; - pThis->globals.mainQ.iMainMsgQtoEnq = 2000; - pThis->globals.mainQ.iMainMsgQtoWrkShutdown = 60000; - pThis->globals.mainQ.iMainMsgQWrkMinMsgs = 40000; - pThis->globals.mainQ.iMainMsgQDeqSlowdown = 0; - pThis->globals.mainQ.iMainMsgQueMaxDiskSpace = 0; - pThis->globals.mainQ.iMainMsgQueDeqBatchSize = 256; - pThis->globals.mainQ.bMainMsgQSaveOnShutdown = 1; - pThis->globals.mainQ.iMainMsgQueueDeqtWinFromHr = 0; - pThis->globals.mainQ.iMainMsgQueueDeqtWinToHr = 25; - /* end queue params */ -finalize_it: -ENDobjConstruct(rsconf) - - -/* ConstructionFinalizer - */ -rsRetVal rsconfConstructFinalize(rsconf_t __attribute__((unused)) *pThis) -{ - DEFiRet; - ISOBJ_TYPE_assert(pThis, rsconf); - RETiRet; -} - - -/* call freeCnf() module entry points AND free the module entries themselfes. - */ -static inline void -freeCnf(rsconf_t *pThis) -{ - cfgmodules_etry_t *etry, *del; - etry = pThis->modules.root; - while(etry != NULL) { - if(etry->pMod->beginCnfLoad != NULL) { - dbgprintf("calling freeCnf(%p) for module '%s'\n", - etry->modCnf, (char*) module.GetName(etry->pMod)); - etry->pMod->freeCnf(etry->modCnf); - } - del = etry; - etry = etry->next; - free(del); - } -} - - -/* destructor for the rsconf object */ -BEGINobjDestruct(rsconf) /* be sure to specify the object type also in END and CODESTART macros! */ -CODESTARTobjDestruct(rsconf) - freeCnf(pThis); - tplDeleteAll(pThis); - free(pThis->globals.mainQ.pszMainMsgQFName); - free(pThis->globals.pszConfDAGFile); - llDestroy(&(pThis->rulesets.llRulesets)); -ENDobjDestruct(rsconf) - - -/* DebugPrint support for the rsconf object */ -BEGINobjDebugPrint(rsconf) /* be sure to specify the object type also in END and CODESTART macros! */ - cfgmodules_etry_t *modNode; - - dbgprintf("configuration object %p\n", pThis); - dbgprintf("Global Settings:\n"); - dbgprintf(" bDebugPrintTemplateList.............: %d\n", - pThis->globals.bDebugPrintTemplateList); - dbgprintf(" bDebugPrintModuleList : %d\n", - pThis->globals.bDebugPrintModuleList); - dbgprintf(" bDebugPrintCfSysLineHandlerList.....: %d\n", - pThis->globals.bDebugPrintCfSysLineHandlerList); - dbgprintf(" bLogStatusMsgs : %d\n", - pThis->globals.bLogStatusMsgs); - dbgprintf(" bErrMsgToStderr.....................: %d\n", - pThis->globals.bErrMsgToStderr); - dbgprintf(" drop Msgs with malicious PTR Record : %d\n", - glbl.GetDropMalPTRMsgs()); - ruleset.DebugPrintAll(pThis); - dbgprintf("\n"); - if(pThis->globals.bDebugPrintTemplateList) - tplPrintList(pThis); - if(pThis->globals.bDebugPrintModuleList) - module.PrintList(); - if(pThis->globals.bDebugPrintCfSysLineHandlerList) - dbgPrintCfSysLineHandlers(); - // TODO: The following code needs to be "streamlined", so far just moved over... - dbgprintf("Main queue size %d messages.\n", pThis->globals.mainQ.iMainMsgQueueSize); - dbgprintf("Main queue worker threads: %d, wThread shutdown: %d, Perists every %d updates.\n", - pThis->globals.mainQ.iMainMsgQueueNumWorkers, - pThis->globals.mainQ.iMainMsgQtoWrkShutdown, pThis->globals.mainQ.iMainMsgQPersistUpdCnt); - dbgprintf("Main queue timeouts: shutdown: %d, action completion shutdown: %d, enq: %d\n", - pThis->globals.mainQ.iMainMsgQtoQShutdown, - pThis->globals.mainQ.iMainMsgQtoActShutdown, pThis->globals.mainQ.iMainMsgQtoEnq); - dbgprintf("Main queue watermarks: high: %d, low: %d, discard: %d, discard-severity: %d\n", - pThis->globals.mainQ.iMainMsgQHighWtrMark, pThis->globals.mainQ.iMainMsgQLowWtrMark, - pThis->globals.mainQ.iMainMsgQDiscardMark, pThis->globals.mainQ.iMainMsgQDiscardSeverity); - dbgprintf("Main queue save on shutdown %d, max disk space allowed %lld\n", - pThis->globals.mainQ.bMainMsgQSaveOnShutdown, pThis->globals.mainQ.iMainMsgQueMaxDiskSpace); - /* TODO: add - iActionRetryCount = 0; - iActionRetryInterval = 30000; - static int iMainMsgQtoWrkMinMsgs = 100; - static int iMainMsgQbSaveOnShutdown = 1; - iMainMsgQueMaxDiskSpace = 0; - setQPROP(qqueueSetiMinMsgsPerWrkr, "$MainMsgQueueWorkerThreadMinimumMessages", 100); - setQPROP(qqueueSetbSaveOnShutdown, "$MainMsgQueueSaveOnShutdown", 1); - */ - dbgprintf("Work Directory: '%s'.\n", glbl.GetWorkDir()); - ochPrintList(); - dbgprintf("Modules used in this configuration:\n"); - for(modNode = pThis->modules.root ; modNode != NULL ; modNode = modNode->next) { - dbgprintf(" %s\n", module.GetName(modNode->pMod)); - } -CODESTARTobjDebugPrint(rsconf) -ENDobjDebugPrint(rsconf) - - -/* Process input() objects */ -rsRetVal -inputProcessCnf(struct cnfobj *o) -{ - struct cnfparamvals *pvals; - modInfo_t *pMod; - uchar *cnfModName = NULL; - int typeIdx; - DEFiRet; - - pvals = nvlstGetParams(o->nvlst, &inppblk, NULL); - if(pvals == NULL) { - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - DBGPRINTF("input param blk after inputProcessCnf:\n"); - cnfparamsPrint(&inppblk, pvals); - typeIdx = cnfparamGetIdx(&inppblk, "type"); - cnfModName = (uchar*)es_str2cstr(pvals[typeIdx].val.d.estr, NULL); - if((pMod = module.FindWithCnfName(loadConf, cnfModName, eMOD_IN)) == NULL) { - errmsg.LogError(0, RS_RET_MOD_UNKNOWN, "input module name '%s' is unknown", cnfModName); - ABORT_FINALIZE(RS_RET_MOD_UNKNOWN); - } - if(pMod->mod.im.newInpInst == NULL) { - errmsg.LogError(0, RS_RET_MOD_NO_INPUT_STMT, - "input module '%s' does not support input() statement", cnfModName); - ABORT_FINALIZE(RS_RET_MOD_NO_INPUT_STMT); - } - CHKiRet(pMod->mod.im.newInpInst(o->nvlst)); -finalize_it: - free(cnfModName); - cnfparamvalsDestruct(pvals, &inppblk); - RETiRet; -} - -/*------------------------------ interface to flex/bison parser ------------------------------*/ -extern int yylineno; - -void -parser_warnmsg(char *fmt, ...) -{ - va_list ap; - char errBuf[1024]; - - va_start(ap, fmt); - if(vsnprintf(errBuf, sizeof(errBuf), fmt, ap) == sizeof(errBuf)) - errBuf[sizeof(errBuf)-1] = '\0'; - errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING, - "warning during parsing file %s, on or before line %d: %s", - cnfcurrfn, yylineno, errBuf); - va_end(ap); -} - -void -parser_errmsg(char *fmt, ...) -{ - va_list ap; - char errBuf[1024]; - - va_start(ap, fmt); - if(vsnprintf(errBuf, sizeof(errBuf), fmt, ap) == sizeof(errBuf)) - errBuf[sizeof(errBuf)-1] = '\0'; - errmsg.LogError(0, RS_RET_CONF_PARSE_ERROR, - "error during parsing file %s, on or before line %d: %s", - cnfcurrfn, yylineno, errBuf); - va_end(ap); -} - -int -yyerror(char *s) -{ - parser_errmsg("%s on token '%s'", s, yytext); - return 0; -} -void cnfDoObj(struct cnfobj *o) -{ - int bDestructObj = 1; - int bChkUnuse = 1; - - dbgprintf("cnf:global:obj: "); - cnfobjPrint(o); - switch(o->objType) { - case CNFOBJ_GLOBAL: - glblProcessCnf(o); - break; - case CNFOBJ_MAINQ: - glblProcessMainQCnf(o); - bDestructObj = 0; - break; - case CNFOBJ_MODULE: - modulesProcessCnf(o); - break; - case CNFOBJ_INPUT: - inputProcessCnf(o); - break; - case CNFOBJ_LOOKUP_TABLE: - lookupProcessCnf(o); - break; - case CNFOBJ_TPL: - if(tplProcessCnf(o) != RS_RET_OK) - parser_errmsg("error processing template object"); - break; - case CNFOBJ_RULESET: - rulesetProcessCnf(o); - break; - case CNFOBJ_PROPERTY: - case CNFOBJ_CONSTANT: - /* these types are processed at a later stage */ - bChkUnuse = 0; - break; - default: - dbgprintf("cnfDoObj program error: unexpected object type %u\n", - o->objType); - break; - } - if(bDestructObj) { - if(bChkUnuse) - nvlstChkUnused(o->nvlst); - cnfobjDestruct(o); - } -} - -void cnfDoScript(struct cnfstmt *script) -{ - dbgprintf("cnf:global:script\n"); - ruleset.AddScript(ruleset.GetCurrent(loadConf), script); -} - -void cnfDoCfsysline(char *ln) -{ - DBGPRINTF("cnf:global:cfsysline: %s\n", ln); - /* the legacy system needs the "$" stripped */ - conf.cfsysline((uchar*) ln+1); - free(ln); -} - -void cnfDoBSDTag(char *ln) -{ - DBGPRINTF("cnf:global:BSD tag: %s\n", ln); - errmsg.LogError(0, RS_RET_BSD_BLOCKS_UNSUPPORTED, - "BSD-style blocks are no longer supported in rsyslog, " - "see http://www.rsyslog.com/g/BSD for details and a " - "solution (Block '%s')", ln); - free(ln); -} - -void cnfDoBSDHost(char *ln) -{ - DBGPRINTF("cnf:global:BSD host: %s\n", ln); - errmsg.LogError(0, RS_RET_BSD_BLOCKS_UNSUPPORTED, - "BSD-style blocks are no longer supported in rsyslog, " - "see http://www.rsyslog.com/g/BSD for details and a " - "solution (Block '%s')", ln); - free(ln); -} -/*------------------------------ end interface to flex/bison parser ------------------------------*/ - - - -/* drop to specified group - * if something goes wrong, the function never returns - * Note that such an abort can cause damage to on-disk structures, so we should - * re-design the "interface" in the long term. -- rgerhards, 2008-11-26 - */ -static void doDropPrivGid(int iGid) -{ - int res; - uchar szBuf[1024]; - - res = setgroups(0, NULL); /* remove all supplementary group IDs */ - if(res) { - perror("could not remove supplemental group IDs"); - exit(1); - } - DBGPRINTF("setgroups(0, NULL): %d\n", res); - res = setgid(iGid); - if(res) { - /* if we can not set the userid, this is fatal, so let's unconditionally abort */ - perror("could not set requested group id"); - exit(1); - } - DBGPRINTF("setgid(%d): %d\n", iGid, res); - snprintf((char*)szBuf, sizeof(szBuf)/sizeof(uchar), "rsyslogd's groupid changed to %d", iGid); - logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, szBuf, 0); -} - - -/* drop to specified user - * if something goes wrong, the function never returns - * Note that such an abort can cause damage to on-disk structures, so we should - * re-design the "interface" in the long term. -- rgerhards, 2008-11-19 - */ -static void doDropPrivUid(int iUid) -{ - int res; - uchar szBuf[1024]; - - res = setuid(iUid); - if(res) { - /* if we can not set the userid, this is fatal, so let's unconditionally abort */ - perror("could not set requested userid"); - exit(1); - } - DBGPRINTF("setuid(%d): %d\n", iUid, res); - snprintf((char*)szBuf, sizeof(szBuf)/sizeof(uchar), "rsyslogd's userid changed to %d", iUid); - logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, szBuf, 0); -} - - - -/* drop privileges. This will drop to the configured privileges, if - * set by the user. After this method has been executed, the previous - * privileges can no be re-gained. - */ -static inline rsRetVal -dropPrivileges(rsconf_t *cnf) -{ - DEFiRet; - - /* If instructed to do so, we now drop privileges. Note that this is not 100% secure, - * because outputs are already running at this time. However, we can implement - * dropping of privileges rather quickly and it will work in many cases. While it is not - * the ultimate solution, the current one is still much better than not being able to - * drop privileges at all. Doing it correctly, requires a change in architecture, which - * we should do over time. TODO -- rgerhards, 2008-11-19 - */ - if(cnf->globals.gidDropPriv != 0) { - doDropPrivGid(ourConf->globals.gidDropPriv); - DBGPRINTF("group privileges have been dropped to gid %u\n", (unsigned) - ourConf->globals.gidDropPriv); - } - - if(cnf->globals.uidDropPriv != 0) { - doDropPrivUid(ourConf->globals.uidDropPriv); - DBGPRINTF("user privileges have been dropped to uid %u\n", (unsigned) - ourConf->globals.uidDropPriv); - } - - RETiRet; -} - - -/* tell the rsysog core (including ourselfs) that the config load is done and - * we need to prepare to move over to activate mode. - */ -static inline void -tellCoreConfigLoadDone(void) -{ - DBGPRINTF("telling rsyslog core that config load for %p is done\n", loadConf); - glblDoneLoadCnf(); -} - - -/* Tell input modules that the config parsing stage is over. */ -static rsRetVal -tellModulesConfigLoadDone(void) -{ - cfgmodules_etry_t *node; - - BEGINfunc - DBGPRINTF("telling modules that config load for %p is done\n", loadConf); - node = module.GetNxtCnfType(loadConf, NULL, eMOD_ANY); - while(node != NULL) { - if(node->pMod->beginCnfLoad != NULL) - node->pMod->endCnfLoad(node->modCnf); - node = module.GetNxtCnfType(runConf, node, eMOD_IN); - } - - ENDfunc - return RS_RET_OK; /* intentional: we do not care about module errors */ -} - - -/* Tell input modules to verify config object */ -static rsRetVal -tellModulesCheckConfig(void) -{ - cfgmodules_etry_t *node; - rsRetVal localRet; - - BEGINfunc - DBGPRINTF("telling modules to check config %p\n", loadConf); - node = module.GetNxtCnfType(loadConf, NULL, eMOD_ANY); - while(node != NULL) { - if(node->pMod->beginCnfLoad != NULL) { - localRet = node->pMod->checkCnf(node->modCnf); - DBGPRINTF("module %s tells us config can %sbe activated\n", - node->pMod->pszName, (localRet == RS_RET_OK) ? "" : "NOT "); - if(localRet == RS_RET_OK) { - node->canActivate = 1; - } else { - node->canActivate = 0; - } - } - node = module.GetNxtCnfType(runConf, node, eMOD_IN); - } - - ENDfunc - return RS_RET_OK; /* intentional: we do not care about module errors */ -} - - -/* Tell modules to activate current running config (pre privilege drop) */ -static rsRetVal -tellModulesActivateConfigPrePrivDrop(void) -{ - cfgmodules_etry_t *node; - rsRetVal localRet; - - BEGINfunc - DBGPRINTF("telling modules to activate config (before dropping privs) %p\n", runConf); - node = module.GetNxtCnfType(runConf, NULL, eMOD_ANY); - while(node != NULL) { - if( node->pMod->beginCnfLoad != NULL - && node->pMod->activateCnfPrePrivDrop != NULL - && node->canActivate) { - DBGPRINTF("pre priv drop activating config %p for module %s\n", - runConf, node->pMod->pszName); - localRet = node->pMod->activateCnfPrePrivDrop(node->modCnf); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, "activation of module %s failed", - node->pMod->pszName); - node->canActivate = 0; /* in a sense, could not activate... */ - } - } - node = module.GetNxtCnfType(runConf, node, eMOD_IN); - } - - ENDfunc - return RS_RET_OK; /* intentional: we do not care about module errors */ -} - - -/* Tell modules to activate current running config */ -static rsRetVal -tellModulesActivateConfig(void) -{ - cfgmodules_etry_t *node; - rsRetVal localRet; - - BEGINfunc - DBGPRINTF("telling modules to activate config %p\n", runConf); - node = module.GetNxtCnfType(runConf, NULL, eMOD_ANY); - while(node != NULL) { - if(node->pMod->beginCnfLoad != NULL && node->canActivate) { - DBGPRINTF("activating config %p for module %s\n", - runConf, node->pMod->pszName); - localRet = node->pMod->activateCnf(node->modCnf); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, "activation of module %s failed", - node->pMod->pszName); - node->canActivate = 0; /* in a sense, could not activate... */ - } - } - node = module.GetNxtCnfType(runConf, node, eMOD_IN); - } - - ENDfunc - return RS_RET_OK; /* intentional: we do not care about module errors */ -} - - -/* Actually run the input modules. This happens after privileges are dropped, - * if that is requested. - */ -static rsRetVal -runInputModules(void) -{ - cfgmodules_etry_t *node; - int bNeedsCancel; - - BEGINfunc - node = module.GetNxtCnfType(runConf, NULL, eMOD_IN); - while(node != NULL) { - if(node->canRun) { - bNeedsCancel = (node->pMod->isCompatibleWithFeature(sFEATURENonCancelInputTermination) == RS_RET_OK) ? - 0 : 1; - DBGPRINTF("running module %s with config %p, term mode: %s\n", node->pMod->pszName, node, - bNeedsCancel ? "cancel" : "cooperative/SIGTTIN"); - thrdCreate(node->pMod->mod.im.runInput, node->pMod->mod.im.afterRun, bNeedsCancel, - (node->pMod->cnfName == NULL) ? node->pMod->pszName : node->pMod->cnfName); - } - node = module.GetNxtCnfType(runConf, node, eMOD_IN); - } - - ENDfunc - return RS_RET_OK; /* intentional: we do not care about module errors */ -} - - -/* Make the modules check if they are ready to start. - */ -static rsRetVal -startInputModules(void) -{ - DEFiRet; - cfgmodules_etry_t *node; - - node = module.GetNxtCnfType(runConf, NULL, eMOD_IN); - while(node != NULL) { - if(node->canActivate) { - iRet = node->pMod->mod.im.willRun(); - node->canRun = (iRet == RS_RET_OK); - if(!node->canRun) { - DBGPRINTF("module %s will not run, iRet %d\n", node->pMod->pszName, iRet); - } - } else { - node->canRun = 0; - } - node = module.GetNxtCnfType(runConf, node, eMOD_IN); - } - - ENDfunc - return RS_RET_OK; /* intentional: we do not care about module errors */ -} - - -/* activate the main queue */ -static inline rsRetVal -activateMainQueue() -{ - struct cnfobj *mainqCnfObj; - DEFiRet; - - mainqCnfObj = glbl.GetmainqCnfObj(); - DBGPRINTF("activateMainQueue: mainq cnf obj ptr is %p\n", mainqCnfObj); - /* create message queue */ - CHKiRet_Hdlr(createMainQueue(&pMsgQueue, UCHAR_CONSTANT("main Q"), - (mainqCnfObj == NULL) ? NULL : mainqCnfObj->nvlst)) { - /* no queue is fatal, we need to give up in that case... */ - fprintf(stderr, "fatal error %d: could not create message queue - rsyslogd can not run!\n", iRet); - FINALIZE; - } - - bHaveMainQueue = (ourConf->globals.mainQ.MainMsgQueType == QUEUETYPE_DIRECT) ? 0 : 1; - DBGPRINTF("Main processing queue is initialized and running\n"); -finalize_it: - glblDestructMainqCnfObj(); - RETiRet; -} - - -/* set the processes umask (upon configuration request) */ -static inline rsRetVal -setUmask(int iUmask) -{ - if(iUmask != -1) { - umask(iUmask); - DBGPRINTF("umask set to 0%3.3o.\n", iUmask); - } - - return RS_RET_OK; -} - - -/* Activate an already-loaded configuration. The configuration will become - * the new running conf (if successful). Note that in theory this method may - * be called when there already is a running conf. In practice, the current - * version of rsyslog does not support this. Future versions probably will. - * Begun 2011-04-20, rgerhards - */ -rsRetVal -activate(rsconf_t *cnf) -{ - DEFiRet; - - /* at this point, we "switch" over to the running conf */ - runConf = cnf; -# if 0 /* currently the DAG is not supported -- code missing! */ - /* TODO: re-enable this functionality some time later! */ - /* check if we need to generate a config DAG and, if so, do that */ - if(ourConf->globals.pszConfDAGFile != NULL) - generateConfigDAG(ourConf->globals.pszConfDAGFile); -# endif - setUmask(cnf->globals.umask); - - /* the output part and the queue is now ready to run. So it is a good time - * to initialize the inputs. Please note that the net code above should be - * shuffled to down here once we have everything in input modules. - * rgerhards, 2007-12-14 - * NOTE: as of 2009-06-29, the input modules are initialized, but not yet run. - * Keep in mind. though, that the outputs already run if the queue was - * persisted to disk. -- rgerhards - */ - tellModulesActivateConfigPrePrivDrop(); - - CHKiRet(dropPrivileges(cnf)); - - tellModulesActivateConfig(); - startInputModules(); - CHKiRet(activateActions()); - CHKiRet(activateMainQueue()); - /* finally let the inputs run... */ - runInputModules(); - - dbgprintf("configuration %p activated\n", cnf); - -finalize_it: - RETiRet; -} - - -/* -------------------- some legacy config handlers -------------------- - * TODO: move to conf.c? - */ - -/* legacy config system: set the action resume interval */ -static rsRetVal setActionResumeInterval(void __attribute__((unused)) *pVal, int iNewVal) -{ - return actionSetGlobalResumeInterval(iNewVal); -} - - -/* Switch the default ruleset (that, what servcies bind to if nothing specific - * is specified). - * rgerhards, 2009-06-12 - */ -static rsRetVal -setDefaultRuleset(void __attribute__((unused)) *pVal, uchar *pszName) -{ - DEFiRet; - - CHKiRet(ruleset.SetDefaultRuleset(ourConf, pszName)); - -finalize_it: - free(pszName); /* no longer needed */ - RETiRet; -} - - -/* Switch to either an already existing rule set or start a new one. The - * named rule set becomes the new "current" rule set (what means that new - * actions are added to it). - * rgerhards, 2009-06-12 - */ -static rsRetVal -setCurrRuleset(void __attribute__((unused)) *pVal, uchar *pszName) -{ - ruleset_t *pRuleset; - rsRetVal localRet; - DEFiRet; - - localRet = ruleset.SetCurrRuleset(ourConf, pszName); - - if(localRet == RS_RET_NOT_FOUND) { - DBGPRINTF("begin new current rule set '%s'\n", pszName); - CHKiRet(ruleset.Construct(&pRuleset)); - CHKiRet(ruleset.SetName(pRuleset, pszName)); - CHKiRet(ruleset.ConstructFinalize(ourConf, pRuleset)); - rulesetSetCurrRulesetPtr(pRuleset); - } else { - ABORT_FINALIZE(localRet); - } - -finalize_it: - free(pszName); /* no longer needed */ - RETiRet; -} - - -/* set the main message queue mode - * rgerhards, 2008-01-03 - */ -static rsRetVal setMainMsgQueType(void __attribute__((unused)) *pVal, uchar *pszType) -{ - DEFiRet; - - if (!strcasecmp((char *) pszType, "fixedarray")) { - loadConf->globals.mainQ.MainMsgQueType = QUEUETYPE_FIXED_ARRAY; - DBGPRINTF("main message queue type set to FIXED_ARRAY\n"); - } else if (!strcasecmp((char *) pszType, "linkedlist")) { - loadConf->globals.mainQ.MainMsgQueType = QUEUETYPE_LINKEDLIST; - DBGPRINTF("main message queue type set to LINKEDLIST\n"); - } else if (!strcasecmp((char *) pszType, "disk")) { - loadConf->globals.mainQ.MainMsgQueType = QUEUETYPE_DISK; - DBGPRINTF("main message queue type set to DISK\n"); - } else if (!strcasecmp((char *) pszType, "direct")) { - loadConf->globals.mainQ.MainMsgQueType = QUEUETYPE_DIRECT; - DBGPRINTF("main message queue type set to DIRECT (no queueing at all)\n"); - } else { - errmsg.LogError(0, RS_RET_INVALID_PARAMS, "unknown mainmessagequeuetype parameter: %s", (char *) pszType); - iRet = RS_RET_INVALID_PARAMS; - } - free(pszType); /* no longer needed */ - - RETiRet; -} - - -/* -------------------- end legacy config handlers -------------------- */ - - -/* set the processes max number ob files (upon configuration request) - * 2009-04-14 rgerhards - */ -static rsRetVal setMaxFiles(void __attribute__((unused)) *pVal, int iFiles) -{ -// TODO this must use a local var, then carry out action during activate! - struct rlimit maxFiles; - char errStr[1024]; - DEFiRet; - - maxFiles.rlim_cur = iFiles; - maxFiles.rlim_max = iFiles; - - if(setrlimit(RLIMIT_NOFILE, &maxFiles) < 0) { - /* NOTE: under valgrind, we seem to be unable to extend the size! */ - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR_RLIM_NOFILE, "could not set process file limit to %d: %s [kernel max %ld]", - iFiles, errStr, (long) maxFiles.rlim_max); - ABORT_FINALIZE(RS_RET_ERR_RLIM_NOFILE); - } -#ifdef USE_UNLIMITED_SELECT - glbl.SetFdSetSize(howmany(iFiles, __NFDBITS) * sizeof (fd_mask)); -#endif - DBGPRINTF("Max number of files set to %d [kernel max %ld].\n", iFiles, (long) maxFiles.rlim_max); - -finalize_it: - RETiRet; -} - - -/* legacy config system: reset config variables to default values. */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) -{ - loadConf->globals.bLogStatusMsgs = DFLT_bLogStatusMsgs; - loadConf->globals.bDebugPrintTemplateList = 1; - loadConf->globals.bDebugPrintCfSysLineHandlerList = 1; - loadConf->globals.bDebugPrintModuleList = 1; - loadConf->globals.bAbortOnUncleanConfig = 0; - loadConf->globals.bReduceRepeatMsgs = 0; - free(loadConf->globals.mainQ.pszMainMsgQFName); - loadConf->globals.mainQ.pszMainMsgQFName = NULL; - loadConf->globals.mainQ.iMainMsgQueueSize = 10000; - loadConf->globals.mainQ.iMainMsgQHighWtrMark = 8000; - loadConf->globals.mainQ.iMainMsgQLowWtrMark = 2000; - loadConf->globals.mainQ.iMainMsgQDiscardMark = 9800; - loadConf->globals.mainQ.iMainMsgQDiscardSeverity = 8; - loadConf->globals.mainQ.iMainMsgQueMaxFileSize = 1024 * 1024; - loadConf->globals.mainQ.iMainMsgQueueNumWorkers = 1; - loadConf->globals.mainQ.iMainMsgQPersistUpdCnt = 0; - loadConf->globals.mainQ.bMainMsgQSyncQeueFiles = 0; - loadConf->globals.mainQ.iMainMsgQtoQShutdown = 1500; - loadConf->globals.mainQ.iMainMsgQtoActShutdown = 1000; - loadConf->globals.mainQ.iMainMsgQtoEnq = 2000; - loadConf->globals.mainQ.iMainMsgQtoWrkShutdown = 60000; - loadConf->globals.mainQ.iMainMsgQWrkMinMsgs = 100; - loadConf->globals.mainQ.iMainMsgQDeqSlowdown = 0; - loadConf->globals.mainQ.bMainMsgQSaveOnShutdown = 1; - loadConf->globals.mainQ.MainMsgQueType = QUEUETYPE_FIXED_ARRAY; - loadConf->globals.mainQ.iMainMsgQueMaxDiskSpace = 0; - loadConf->globals.mainQ.iMainMsgQueDeqBatchSize = 32; - - return RS_RET_OK; -} - - -/* legacy config system: set the action resume interval */ -static rsRetVal -setModDir(void __attribute__((unused)) *pVal, uchar* pszNewVal) -{ - DEFiRet; - iRet = module.SetModDir(pszNewVal); - free(pszNewVal); - RETiRet; -} - - -/* "load" a build in module and register it for the current load config */ -static rsRetVal -regBuildInModule(rsRetVal (*modInit)(), uchar *name, void *pModHdlr) -{ - cfgmodules_etry_t *pNew; - cfgmodules_etry_t *pLast; - modInfo_t *pMod; - DEFiRet; - CHKiRet(module.doModInit(modInit, name, pModHdlr, &pMod)); - readyModForCnf(pMod, &pNew, &pLast); - addModToCnfList(pNew, pLast); -finalize_it: - RETiRet; -} - - -/* load build-in modules - * very first version begun on 2007-07-23 by rgerhards - */ -static rsRetVal -loadBuildInModules() -{ - DEFiRet; - - CHKiRet(regBuildInModule(modInitFile, UCHAR_CONSTANT("builtin:omfile"), NULL)); - CHKiRet(regBuildInModule(modInitPipe, UCHAR_CONSTANT("builtin:ompipe"), NULL)); - CHKiRet(regBuildInModule(modInitShell, UCHAR_CONSTANT("builtin-shell"), NULL)); - CHKiRet(regBuildInModule(modInitDiscard, UCHAR_CONSTANT("builtin:omdiscard"), NULL)); -# ifdef SYSLOG_INET - CHKiRet(regBuildInModule(modInitFwd, UCHAR_CONSTANT("builtin:omfwd"), NULL)); -# endif - - /* dirty, but this must be for the time being: the usrmsg module must always be - * loaded as last module. This is because it processes any type of action selector. - * If we load it before other modules, these others will never have a chance of - * working with the config file. We may change that implementation so that a user name - * must start with an alnum, that would definitely help (but would it break backwards - * compatibility?). * rgerhards, 2007-07-23 - * User names now must begin with: - * [a-zA-Z0-9_.] - */ - CHKiRet(regBuildInModule(modInitUsrMsg, (uchar*) "builtin:omusrmsg", NULL)); - - /* load build-in parser modules */ - CHKiRet(regBuildInModule(modInitpmrfc5424, UCHAR_CONSTANT("builtin:pmrfc5424"), NULL)); - CHKiRet(regBuildInModule(modInitpmrfc3164, UCHAR_CONSTANT("builtin:pmrfc3164"), NULL)); - - /* and set default parser modules. Order is *very* important, legacy - * (3164) parser needs to go last! */ - CHKiRet(parser.AddDfltParser(UCHAR_CONSTANT("rsyslog.rfc5424"))); - CHKiRet(parser.AddDfltParser(UCHAR_CONSTANT("rsyslog.rfc3164"))); - - /* load build-in strgen modules */ - CHKiRet(regBuildInModule(modInitsmfile, UCHAR_CONSTANT("builtin:smfile"), NULL)); - CHKiRet(regBuildInModule(modInitsmtradfile, UCHAR_CONSTANT("builtin:smtradfile"), NULL)); - CHKiRet(regBuildInModule(modInitsmfwd, UCHAR_CONSTANT("builtin:smfwd"), NULL)); - CHKiRet(regBuildInModule(modInitsmtradfwd, UCHAR_CONSTANT("builtin:smtradfwd"), NULL)); - -finalize_it: - if(iRet != RS_RET_OK) { - /* we need to do fprintf, as we do not yet have an error reporting system - * in place. - */ - fprintf(stderr, "fatal error: could not activate built-in modules. Error code %d.\n", - iRet); - } - RETiRet; -} - - -/* intialize the legacy config system */ -static inline rsRetVal -initLegacyConf(void) -{ - DEFiRet; - uchar *pTmp; - ruleset_t *pRuleset; - - DBGPRINTF("doing legacy config system init\n"); - /* construct the default ruleset */ - ruleset.Construct(&pRuleset); - ruleset.SetName(pRuleset, UCHAR_CONSTANT("RSYSLOG_DefaultRuleset")); - ruleset.ConstructFinalize(loadConf, pRuleset); - rulesetSetCurrRulesetPtr(pRuleset); - - /* now register config handlers */ - CHKiRet(regCfSysLineHdlr((uchar *)"sleep", 0, eCmdHdlrGoneAway, - NULL, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"logrsyslogstatusmessages", 0, eCmdHdlrBinary, - NULL, &loadConf->globals.bLogStatusMsgs, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"errormessagestostderr", 0, eCmdHdlrBinary, - NULL, &loadConf->globals.bErrMsgToStderr, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"abortonuncleanconfig", 0, eCmdHdlrBinary, - NULL, &loadConf->globals.bAbortOnUncleanConfig, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"repeatedmsgreduction", 0, eCmdHdlrBinary, - NULL, &loadConf->globals.bReduceRepeatMsgs, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"debugprinttemplatelist", 0, eCmdHdlrBinary, - NULL, &(loadConf->globals.bDebugPrintTemplateList), NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"debugprintmodulelist", 0, eCmdHdlrBinary, - NULL, &(loadConf->globals.bDebugPrintModuleList), NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"debugprintcfsyslinehandlerlist", 0, eCmdHdlrBinary, - NULL, &(loadConf->globals.bDebugPrintCfSysLineHandlerList), NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"privdroptouser", 0, eCmdHdlrUID, - NULL, &loadConf->globals.uidDropPriv, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"privdroptouserid", 0, eCmdHdlrInt, - NULL, &loadConf->globals.uidDropPriv, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"privdroptogroup", 0, eCmdHdlrGID, - NULL, &loadConf->globals.gidDropPriv, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"privdroptogroupid", 0, eCmdHdlrGID, - NULL, &loadConf->globals.gidDropPriv, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"generateconfiggraph", 0, eCmdHdlrGetWord, - NULL, &loadConf->globals.pszConfDAGFile, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"umask", 0, eCmdHdlrFileCreateMode, - NULL, &loadConf->globals.umask, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"maxopenfiles", 0, eCmdHdlrInt, - setMaxFiles, NULL, NULL)); - - CHKiRet(regCfSysLineHdlr((uchar *)"actionresumeinterval", 0, eCmdHdlrInt, - setActionResumeInterval, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"modload", 0, eCmdHdlrCustomHandler, - conf.doModLoad, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"defaultruleset", 0, eCmdHdlrGetWord, - setDefaultRuleset, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"ruleset", 0, eCmdHdlrGetWord, - setCurrRuleset, NULL, NULL)); - - /* handler for "larger" config statements (tie into legacy conf system) */ - CHKiRet(regCfSysLineHdlr((uchar *)"template", 0, eCmdHdlrCustomHandler, - conf.doNameLine, (void*)DIR_TEMPLATE, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"outchannel", 0, eCmdHdlrCustomHandler, - conf.doNameLine, (void*)DIR_OUTCHANNEL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"allowedsender", 0, eCmdHdlrCustomHandler, - conf.doNameLine, (void*)DIR_ALLOWEDSENDER, NULL)); - - /* the following are parameters for the main message queue. I have the - * strong feeling that this needs to go to a different space, but that - * feeling may be wrong - we'll see how things evolve. - * rgerhards, 2011-04-21 - */ - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuefilename", 0, eCmdHdlrGetWord, - NULL, &loadConf->globals.mainQ.pszMainMsgQFName, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesize", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQueueSize, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuehighwatermark", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQHighWtrMark, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuelowwatermark", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQLowWtrMark, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuediscardmark", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQDiscardMark, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuediscardseverity", 0, eCmdHdlrSeverity, - NULL, &loadConf->globals.mainQ.iMainMsgQDiscardSeverity, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuecheckpointinterval", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQPersistUpdCnt, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesyncqueuefiles", 0, eCmdHdlrBinary, - NULL, &loadConf->globals.mainQ.bMainMsgQSyncQeueFiles, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetype", 0, eCmdHdlrGetWord, - setMainMsgQueType, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkerthreads", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQueueNumWorkers, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetimeoutshutdown", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQtoQShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetimeoutactioncompletion", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQtoActShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetimeoutenqueue", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQtoEnq, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkertimeoutthreadshutdown", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQtoWrkShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeueslowdown", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQDeqSlowdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkerthreadminimummessages", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQWrkMinMsgs, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuemaxfilesize", 0, eCmdHdlrSize, - NULL, &loadConf->globals.mainQ.iMainMsgQueMaxFileSize, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeuebatchsize", 0, eCmdHdlrSize, - NULL, &loadConf->globals.mainQ.iMainMsgQueDeqBatchSize, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuemaxdiskspace", 0, eCmdHdlrSize, - NULL, &loadConf->globals.mainQ.iMainMsgQueMaxDiskSpace, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesaveonshutdown", 0, eCmdHdlrBinary, - NULL, &loadConf->globals.mainQ.bMainMsgQSaveOnShutdown, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeuetimebegin", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQueueDeqtWinFromHr, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeuetimeend", 0, eCmdHdlrInt, - NULL, &loadConf->globals.mainQ.iMainMsgQueueDeqtWinToHr, NULL)); - /* moddir is a bit hard problem -- because it actually needs to - * modify a setting that is specific to module.c. The important point - * is that this action MUST actually be carried out during config load, - * because we must load modules in order to get their config extensions - * (no way around). - * TODO: think about a clean solution - */ - CHKiRet(regCfSysLineHdlr((uchar *)"moddir", 0, eCmdHdlrGetWord, - setModDir, NULL, NULL)); - - /* finally, the reset handler */ - CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, - resetConfigVariables, NULL, NULL)); - - /* initialize the build-in templates */ - pTmp = template_DebugFormat; - tplAddLine(ourConf, "RSYSLOG_DebugFormat", &pTmp); - pTmp = template_SyslogProtocol23Format; - tplAddLine(ourConf, "RSYSLOG_SyslogProtocol23Format", &pTmp); - pTmp = template_FileFormat; /* new format for files with high-precision stamp */ - tplAddLine(ourConf, "RSYSLOG_FileFormat", &pTmp); - pTmp = template_TraditionalFileFormat; - tplAddLine(ourConf, "RSYSLOG_TraditionalFileFormat", &pTmp); - pTmp = template_WallFmt; - tplAddLine(ourConf, " WallFmt", &pTmp); - pTmp = template_ForwardFormat; - tplAddLine(ourConf, "RSYSLOG_ForwardFormat", &pTmp); - pTmp = template_TraditionalForwardFormat; - tplAddLine(ourConf, "RSYSLOG_TraditionalForwardFormat", &pTmp); - pTmp = template_StdUsrMsgFmt; - tplAddLine(ourConf, " StdUsrMsgFmt", &pTmp); - pTmp = template_StdDBFmt; - tplAddLine(ourConf, " StdDBFmt", &pTmp); - pTmp = template_SysklogdFileFormat; - tplAddLine(ourConf, "RSYSLOG_SysklogdFileFormat", &pTmp); - pTmp = template_StdPgSQLFmt; - tplAddLine(ourConf, " StdPgSQLFmt", &pTmp); - pTmp = template_StdJSONFmt; - tplAddLine(ourConf, " StdJSONFmt", &pTmp); - pTmp = template_spoofadr; - tplLastStaticInit(ourConf, tplAddLine(ourConf, "RSYSLOG_omudpspoofDfltSourceTpl", &pTmp)); - -finalize_it: - RETiRet; -} - - -/* validate the current configuration, generate error messages, do - * optimizations, etc, etc,... - */ -static inline rsRetVal -validateConf(void) -{ - DEFiRet; - - /* some checks */ - if(ourConf->globals.mainQ.iMainMsgQueueNumWorkers < 1) { - errmsg.LogError(0, NO_ERRCODE, "$MainMsgQueueNumWorkers must be at least 1! Set to 1.\n"); - ourConf->globals.mainQ.iMainMsgQueueNumWorkers = 1; - } - - if(ourConf->globals.mainQ.MainMsgQueType == QUEUETYPE_DISK) { - errno = 0; /* for logerror! */ - if(glbl.GetWorkDir() == NULL) { - errmsg.LogError(0, NO_ERRCODE, "No $WorkDirectory specified - can not run main message queue in 'disk' mode. " - "Using 'FixedArray' instead.\n"); - ourConf->globals.mainQ.MainMsgQueType = QUEUETYPE_FIXED_ARRAY; - } - if(ourConf->globals.mainQ.pszMainMsgQFName == NULL) { - errmsg.LogError(0, NO_ERRCODE, "No $MainMsgQueueFileName specified - can not run main message queue in " - "'disk' mode. Using 'FixedArray' instead.\n"); - ourConf->globals.mainQ.MainMsgQueType = QUEUETYPE_FIXED_ARRAY; - } - } - RETiRet; -} - - -/* Load a configuration. This will do all necessary steps to create - * the in-memory representation of the configuration, including support - * for multiple configuration languages. - * Note that to support the legacy language we must provide some global - * object that holds the currently-being-loaded config ptr. - * Begun 2011-04-20, rgerhards - */ -rsRetVal -load(rsconf_t **cnf, uchar *confFile) -{ - int iNbrActions; - int r; - DEFiRet; - - CHKiRet(rsconfConstruct(&loadConf)); -ourConf = loadConf; // TODO: remove, once ourConf is gone! - - CHKiRet(loadBuildInModules()); - CHKiRet(initLegacyConf()); - - /* open the configuration file */ - r = cnfSetLexFile((char*)confFile); - if(r == 0) { - r = yyparse(); - conf.GetNbrActActions(loadConf, &iNbrActions); - } - - if(r == 1) { - errmsg.LogError(0, RS_RET_CONF_PARSE_ERROR, - "CONFIG ERROR: could not interpret master " - "config file '%s'.", confFile); - ABORT_FINALIZE(RS_RET_CONF_PARSE_ERROR); - } else if(iNbrActions == 0) { - errmsg.LogError(0, RS_RET_NO_ACTIONS, "CONFIG ERROR: there are no " - "active actions configured. Inputs will " - "run, but no output whatsoever is created."); - ABORT_FINALIZE(RS_RET_NO_ACTIONS); - } - tellLexEndParsing(); - rulesetOptimizeAll(loadConf); - - tellCoreConfigLoadDone(); - tellModulesConfigLoadDone(); - - tellModulesCheckConfig(); - CHKiRet(validateConf()); - - /* we are done checking the config - now validate if we should actually run or not. - * If not, terminate. -- rgerhards, 2008-07-25 - * TODO: iConfigVerify -- should it be pulled from the config, or leave as is (option)? - */ - if(iConfigVerify) { - if(iRet == RS_RET_OK) - iRet = RS_RET_VALIDATION_RUN; - FINALIZE; - } - - /* all OK, pass loaded conf to caller */ - *cnf = loadConf; -// TODO: enable this once all config code is moved to here! loadConf = NULL; - - dbgprintf("rsyslog finished loading master config %p\n", loadConf); - rsconfDebugPrint(loadConf); - -finalize_it: - RETiRet; -} - - -/* queryInterface function - */ -BEGINobjQueryInterface(rsconf) -CODESTARTobjQueryInterface(rsconf) - if(pIf->ifVersion != rsconfCURR_IF_VERSION) { /* check for current version, increment on each change */ - ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); - } - - /* ok, we have the right interface, so let's fill it - * Please note that we may also do some backwards-compatibility - * work here (if we can support an older interface version - that, - * of course, also affects the "if" above). - */ - pIf->Construct = rsconfConstruct; - pIf->ConstructFinalize = rsconfConstructFinalize; - pIf->Destruct = rsconfDestruct; - pIf->DebugPrint = rsconfDebugPrint; - pIf->Load = load; - pIf->Activate = activate; -finalize_it: -ENDobjQueryInterface(rsconf) - - -/* Initialize the rsconf class. Must be called as the very first method - * before anything else is called inside this class. - */ -BEGINObjClassInit(rsconf, 1, OBJ_IS_CORE_MODULE) /* class, version */ - /* request objects we use */ - CHKiRet(objUse(ruleset, CORE_COMPONENT)); - CHKiRet(objUse(module, CORE_COMPONENT)); - CHKiRet(objUse(conf, CORE_COMPONENT)); - CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(datetime, CORE_COMPONENT)); - CHKiRet(objUse(parser, CORE_COMPONENT)); - - /* now set our own handlers */ - OBJSetMethodHandler(objMethod_DEBUGPRINT, rsconfDebugPrint); - OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, rsconfConstructFinalize); -ENDObjClassInit(rsconf) - - -/* De-initialize the rsconf class. - */ -BEGINObjClassExit(rsconf, OBJ_IS_CORE_MODULE) /* class, version */ - objRelease(ruleset, CORE_COMPONENT); - objRelease(module, CORE_COMPONENT); - objRelease(conf, CORE_COMPONENT); - objRelease(errmsg, CORE_COMPONENT); - objRelease(glbl, CORE_COMPONENT); - objRelease(datetime, CORE_COMPONENT); - objRelease(parser, CORE_COMPONENT); -ENDObjClassExit(rsconf) - -/* vi:set ai: - */ diff -Nru rsyslog-7.6.0/runtime/rsconf.h rsyslog-5.10.1/runtime/rsconf.h --- rsyslog-7.6.0/runtime/rsconf.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/rsconf.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,184 +0,0 @@ -/* The rsconf object. It models a complete rsyslog configuration. - * - * Copyright 2011 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * The rsyslog runtime library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The rsyslog runtime library 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with the rsyslog runtime library. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. - */ -#ifndef INCLUDED_RSCONF_H -#define INCLUDED_RSCONF_H - -#include "linkedlist.h" -#include "queue.h" -#include "lookup.h" - -/* --- configuration objects (the plan is to have ALL upper layers in this file) --- */ - -/* queue config parameters. TODO: move to queue.c? */ -struct queuecnf_s { - int iMainMsgQueueSize; /* size of the main message queue above */ - int iMainMsgQHighWtrMark; /* high water mark for disk-assisted queues */ - int iMainMsgQLowWtrMark; /* low water mark for disk-assisted queues */ - int iMainMsgQDiscardMark; /* begin to discard messages */ - int iMainMsgQDiscardSeverity; /* by default, discard nothing to prevent unintentional loss */ - int iMainMsgQueueNumWorkers; /* number of worker threads for the mm queue above */ - queueType_t MainMsgQueType; /* type of the main message queue above */ - uchar *pszMainMsgQFName; /* prefix for the main message queue file */ - int64 iMainMsgQueMaxFileSize; - int iMainMsgQPersistUpdCnt; /* persist queue info every n updates */ - int bMainMsgQSyncQeueFiles; /* sync queue files on every write? */ - int iMainMsgQtoQShutdown; /* queue shutdown (ms) */ - int iMainMsgQtoActShutdown; /* action shutdown (in phase 2) */ - int iMainMsgQtoEnq; /* timeout for queue enque */ - int iMainMsgQtoWrkShutdown; /* timeout for worker thread shutdown */ - int iMainMsgQWrkMinMsgs; /* minimum messages per worker needed to start a new one */ - int iMainMsgQDeqSlowdown; /* dequeue slowdown (simple rate limiting) */ - int64 iMainMsgQueMaxDiskSpace; /* max disk space allocated 0 ==> unlimited */ - int64 iMainMsgQueDeqBatchSize; /* dequeue batch size */ - int bMainMsgQSaveOnShutdown; /* save queue on shutdown (when DA enabled)? */ - int iMainMsgQueueDeqtWinFromHr; /* hour begin of time frame when queue is to be dequeued */ - int iMainMsgQueueDeqtWinToHr; /* hour begin of time frame when queue is to be dequeued */ -}; - -/* globals are data items that are really global, and can be set only - * once (at least in theory, because the legacy system permits them to - * be re-set as often as the user likes). - */ -struct globals_s { - int bDebugPrintTemplateList; - int bDebugPrintModuleList; - int bDebugPrintCfSysLineHandlerList; - int bLogStatusMsgs; /* log rsyslog start/stop/HUP messages? */ - int bErrMsgToStderr; /* print error messages to stderr - (in addition to everything else)? */ - int bAbortOnUncleanConfig; /* abort run (rather than starting with partial - config) if there was any issue in conf */ - int uidDropPriv; /* user-id to which priveleges should be dropped to */ - int gidDropPriv; /* group-id to which priveleges should be dropped to */ - int umask; /* umask to use */ - uchar *pszConfDAGFile; /* name of config DAG file, non-NULL means generate one */ - - // TODO are the following ones defaults? - int bReduceRepeatMsgs; /* reduce repeated message - 0 - no, 1 - yes */ - - //TODO: other representation for main queue? Or just load it differently? - queuecnf_t mainQ; /* main queue paramters */ -}; - -/* (global) defaults are global in the sense that they are accessible - * to all code, but they can change value and other objects (like - * actions) actually copy the value a global had at the time the action - * was defined. In that sense, a global default is just that, a default, - * wich can (and will) be changed in the course of config file - * processing. Once the config file has been processed, defaults - * can be dropped. The current code does not do this for simplicity. - * That is not a problem, because the defaults do not take up much memory. - * At a later stage, we may think about dropping them. -- rgerhards, 2011-04-19 - */ -struct defaults_s { -}; - - -/* list of modules loaded in this configuration (config specific module list) */ -struct cfgmodules_etry_s { - cfgmodules_etry_t *next; - modInfo_t *pMod; - void *modCnf; /* pointer to the input module conf */ - /* the following data is input module specific */ - sbool canActivate; /* OK to activate this config? */ - sbool canRun; /* OK to run this config? */ -}; - -struct cfgmodules_s { - cfgmodules_etry_t *root; -}; - -/* outchannel-specific data */ -struct outchannels_s { - struct outchannel *ochRoot; /* the root of the outchannel list */ - struct outchannel *ochLast; /* points to the last element of the outchannel list */ -}; - -struct templates_s { - struct template *root; /* the root of the template list */ - struct template *last; /* points to the last element of the template list */ - struct template *lastStatic; /* last static element of the template list */ -}; - - -struct actions_s { - unsigned nbrActions; /* number of actions */ -}; - - -struct rulesets_s { - linkedList_t llRulesets; /* this is NOT a pointer - no typo here ;) */ - - /* support for legacy rsyslog.conf format */ - ruleset_t *pCurr; /* currently "active" ruleset */ - ruleset_t *pDflt; /* current default ruleset, e.g. for binding to actions which have no other */ -}; - - -/* --- end configuration objects --- */ - -/* the rsconf object */ -struct rsconf_s { - BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ - cfgmodules_t modules; - globals_t globals; - defaults_t defaults; - templates_t templates; - lookup_tables_t lu_tabs; - outchannels_t och; - actions_t actions; - rulesets_t rulesets; - /* note: rulesets include the complete output part: - * - rules - * - filter (as part of the action) - * - actions - * Of course, we need to debate if we shall change that some time... - */ -}; - - -/* interfaces */ -BEGINinterface(rsconf) /* name must also be changed in ENDinterface macro! */ - INTERFACEObjDebugPrint(rsconf); - rsRetVal (*Construct)(rsconf_t **ppThis); - rsRetVal (*ConstructFinalize)(rsconf_t __attribute__((unused)) *pThis); - rsRetVal (*Destruct)(rsconf_t **ppThis); - rsRetVal (*Load)(rsconf_t **ppThis, uchar *confFile); - rsRetVal (*Activate)(rsconf_t *ppThis); -ENDinterface(rsconf) -// TODO: switch version to 1 for first "complete" version!!!! 2011-04-20 -#define rsconfCURR_IF_VERSION 0 /* increment whenever you change the interface above! */ - - -/* prototypes */ -PROTOTYPEObj(rsconf); - -/* globally-visible external data */ -extern rsconf_t *runConf;/* the currently running config */ -extern rsconf_t *loadConf;/* the config currently being loaded (no concurrent config load supported!) */ - - -/* some defaults (to be removed?) */ -#define DFLT_bLogStatusMsgs 1 - -#endif /* #ifndef INCLUDED_RSCONF_H */ diff -Nru rsyslog-7.6.0/runtime/rsyslog.c rsyslog-5.10.1/runtime/rsyslog.c --- rsyslog-7.6.0/runtime/rsyslog.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/rsyslog.c 2012-10-17 14:41:20.000000000 +0000 @@ -35,7 +35,7 @@ * * Module begun 2008-04-16 by Rainer Gerhards * - * Copyright 2008-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -62,19 +62,25 @@ #include "rsyslog.h" #include "obj.h" +#include "vm.h" +#include "sysvar.h" #include "stringbuf.h" #include "wti.h" #include "wtp.h" +#include "expr.h" +#include "ctok.h" +#include "vmop.h" +#include "vmstk.h" +#include "vmprg.h" #include "datetime.h" #include "queue.h" #include "conf.h" -#include "rsconf.h" #include "glbl.h" #include "errmsg.h" #include "prop.h" +#include "rule.h" #include "ruleset.h" #include "parser.h" -#include "lookup.h" #include "strgen.h" #include "statsobj.h" #include "atomic.h" @@ -86,11 +92,11 @@ #endif /* forward definitions */ -static void dfltErrLogger(const int, const int, const uchar *errMsg); +static rsRetVal dfltErrLogger(int, uchar *errMsg); /* globally visible static data - see comment in rsyslog.h for details */ uchar *glblModPath; /* module load path */ -void (*glblErrLogger)(const int, const int, const uchar*) = dfltErrLogger; /* the error logger to use by the errmsg module */ +rsRetVal (*glblErrLogger)(int, uchar*) = dfltErrLogger; /* the error logger to use by the errmsg module */ /* static data */ static int iRefCount = 0; /* our refcount - it MUST exist only once inside a process (not thread) @@ -102,21 +108,24 @@ * default so that we can log errors during the intial phase, most importantly * during initialization. -- rgerhards. 2008-04-17 */ -static void -dfltErrLogger(const int severity, const int iErr, const uchar *errMsg) +static rsRetVal dfltErrLogger(int iErr, uchar *errMsg) { - fprintf(stderr, "rsyslog runtime error(%d,%d): %s\n", severity, iErr, errMsg); + DEFiRet; + fprintf(stderr, "rsyslog runtime error(%d): %s\n", iErr, errMsg); + RETiRet; } /* set the error log function * rgerhards, 2008-04-18 */ -void -rsrtSetErrLogger(void (*errLogger)(const int, const int, const uchar*)) +rsRetVal +rsrtSetErrLogger(rsRetVal (*errLogger)(int, uchar*)) { + DEFiRet; assert(errLogger != NULL); glblErrLogger = errLogger; + RETiRet; } @@ -168,6 +177,24 @@ CHKiRet(glblClassInit(NULL)); if(ppErrObj != NULL) *ppErrObj = "msg"; CHKiRet(msgClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "ctok_token"; + CHKiRet(ctok_tokenClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "ctok"; + CHKiRet(ctokClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "vmstk"; + CHKiRet(vmstkClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "sysvar"; + CHKiRet(sysvarClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "vm"; + CHKiRet(vmClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "vmop"; + CHKiRet(vmopClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "vmprg"; + CHKiRet(vmprgClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "expr"; + CHKiRet(exprClassInit(NULL)); + if(ppErrObj != NULL) *ppErrObj = "rule"; + CHKiRet(ruleClassInit(NULL)); if(ppErrObj != NULL) *ppErrObj = "ruleset"; CHKiRet(rulesetClassInit(NULL)); if(ppErrObj != NULL) *ppErrObj = "wti"; @@ -182,10 +209,6 @@ CHKiRet(parserClassInit(NULL)); if(ppErrObj != NULL) *ppErrObj = "strgen"; CHKiRet(strgenClassInit(NULL)); - if(ppErrObj != NULL) *ppErrObj = "rsconf"; - CHKiRet(rsconfClassInit(NULL)); - if(ppErrObj != NULL) *ppErrObj = "lookup"; - CHKiRet(lookupClassInit()); /* dummy "classes" */ if(ppErrObj != NULL) *ppErrObj = "str"; @@ -217,6 +240,7 @@ confClassExit(); glblClassExit(); rulesetClassExit(); + ruleClassExit(); objClassExit(); /* *THIS* *MUST/SHOULD?* always be the first class initilizer being called (except debug)! */ } diff -Nru rsyslog-7.6.0/runtime/rsyslog.h rsyslog-5.10.1/runtime/rsyslog.h --- rsyslog-7.6.0/runtime/rsyslog.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/rsyslog.h 2012-10-17 14:41:20.000000000 +0000 @@ -3,7 +3,7 @@ * * Begun 2005-09-15 RGerhards * - * Copyright (C) 2005-2013 by Rainer Gerhards and Adiscon GmbH + * Copyright (C) 2005-2008 by Rainer Gerhards and Adiscon GmbH * * This file is part of the rsyslog runtime library. * @@ -46,7 +46,6 @@ #define CONF_HOSTNAME_MAXSIZE 512 /* a value that is deemed far too large for any valid HOSTNAME */ #define CONF_RAWMSG_BUFSIZE 101 #define CONF_TAG_BUFSIZE 32 -#define CONF_PROGNAME_BUFSIZE 16 #define CONF_HOSTNAME_BUFSIZE 32 #define CONF_PROP_BUFSIZE 16 /* should be close to sizeof(ptr) or lighly above it */ #define CONF_MIN_SIZE_FOR_COMPRESS 60 /* config param: minimum message size to try compression. The smaller @@ -61,16 +60,15 @@ * rgerhards, 2006-11-30 */ -#define CONF_OMOD_NUMSTRINGS_MAXSIZE 5 /* cache for pointers to output module buffer pointers. All - * rsyslog-provided plugins do NOT need more than five buffers. If - * more are needed (future developments, third-parties), rsyslog +#define CONF_OMOD_NUMSTRINGS_MAXSIZE 2 /* cache for pointers to output module buffer pointers. All + * rsyslog-provided plugins do NOT need more than two buffers. If + * more are needed (future developments, third-parties), rsyslog * must be recompiled with a larger parameter. Hardcoding this * saves us some overhead, both in runtime in code complexity. As - * it is doubtful if ever more than 3 parameters are needed, the + * it is doubtful if ever more than 2 parameters are needed, the * approach taken here is considered appropriate. * rgerhards, 2010-06-24 */ -#define CONF_NUM_MULTISUB 1024 /* default number of messages per multisub structure */ /* ############################################################# * * # End Config Settings # * @@ -91,7 +89,7 @@ /* the rsyslog core provides information about present feature to plugins - * asking it. Below are feature-test macros which must be used to query + * asking it. Below are feature-test macros which must be used to query * features. Note that this must be powers of two, so that multiple queries * can be combined. -- rgerhards, 2009-04-27 */ @@ -102,6 +100,45 @@ #define _PATH_CONSOLE "/dev/console" #endif +/* properties are now encoded as (tiny) integers. I do not use an enum as I would like + * to keep the memory footprint small (and thus cache hits high). + * rgerhards, 2009-06-26 + */ +typedef uintTiny propid_t; +#define PROP_INVALID 0 +#define PROP_MSG 1 +#define PROP_TIMESTAMP 2 +#define PROP_HOSTNAME 3 +#define PROP_SYSLOGTAG 4 +#define PROP_RAWMSG 5 +#define PROP_INPUTNAME 6 +#define PROP_FROMHOST 7 +#define PROP_FROMHOST_IP 8 +#define PROP_PRI 9 +#define PROP_PRI_TEXT 10 +#define PROP_IUT 11 +#define PROP_SYSLOGFACILITY 12 +#define PROP_SYSLOGFACILITY_TEXT 13 +#define PROP_SYSLOGSEVERITY 14 +#define PROP_SYSLOGSEVERITY_TEXT 15 +#define PROP_TIMEGENERATED 16 +#define PROP_PROGRAMNAME 17 +#define PROP_PROTOCOL_VERSION 18 +#define PROP_STRUCTURED_DATA 19 +#define PROP_APP_NAME 20 +#define PROP_PROCID 21 +#define PROP_MSGID 22 +#define PROP_SYS_NOW 150 +#define PROP_SYS_YEAR 151 +#define PROP_SYS_MONTH 152 +#define PROP_SYS_DAY 153 +#define PROP_SYS_HOUR 154 +#define PROP_SYS_HHOUR 155 +#define PROP_SYS_QHOUR 156 +#define PROP_SYS_MINUTE 157 +#define PROP_SYS_MYHOSTNAME 158 +#define PROP_SYS_BOM 159 + /* The error codes below are orginally "borrowed" from * liblogging. As such, we reserve values up to -2999 @@ -109,7 +146,7 @@ */ enum rsRetVal_ /** return value. All methods return this if not specified otherwise */ { - /* the first two define are for errmsg.logError(), so that we can use the rsRetVal + /* the first two define are for errmsg.logError(), so that we can use the rsRetVal * as an rsyslog error code. -- rgerhards, 20080-06-27 */ RS_RET_NO_ERRCODE = -1, /**< RESERVED for NO_ERRCODE errmsg.logError status name */ @@ -280,7 +317,7 @@ RS_RET_ERR_DOOR = -2147, /**< some problems with handling the Solaris door functionality */ RS_RET_NO_SRCNAME_TPL = -2150, /**< sourcename template was not specified where one was needed (omudpspoof spoof addr) */ RS_RET_HOST_NOT_SPECIFIED = -2151, /**< (target) host was not specified where it was needed */ - RS_RET_ERR_LIBNET_INIT = -2152, /**< error initializing libnet, e.g. because not running as root */ + RS_RET_ERR_LIBNET_INIT = -2152, /**< error initializing libnet */ RS_RET_FORCE_TERM = -2153, /**< thread was forced to terminate by bShallShutdown, a state, not an error */ RS_RET_RULES_QUEUE_EXISTS = -2154,/**< we were instructed to create a new ruleset queue, but one already exists */ RS_RET_NO_CURR_RULESET = -2155,/**< no current ruleset exists (but one is required) */ @@ -295,11 +332,6 @@ RS_RET_TIMEOUT = -2164, /**< timeout occured during operation */ RS_RET_RCV_ERR = -2165, /**< error occured during socket rcv operation */ RS_RET_NO_SOCK_CONFIGURED = -2166, /**< no socket (name) was configured where one is required */ - RS_RET_CONF_NOT_GLBL = -2167, /**< $Begin not in global scope */ - RS_RET_CONF_IN_GLBL = -2168, /**< $End when in global scope */ - RS_RET_CONF_INVLD_END = -2169, /**< $End for wrong conf object (probably nesting error) */ - RS_RET_CONF_INVLD_SCOPE = -2170,/**< config statement not valid in current scope (e.g. global stmt in action block) */ - RS_RET_CONF_END_NO_ACT = -2171, /**< end of action block, but no actual action specified */ RS_RET_NO_LSTN_DEFINED = -2172, /**< no listener defined (e.g. inside an input module) */ RS_RET_EPOLL_CR_FAILED = -2173, /**< epoll_create() failed */ RS_RET_EPOLL_CTL_FAILED = -2174, /**< epoll_ctl() failed */ @@ -316,77 +348,9 @@ RS_RET_MISSING_WHITESPACE = -2185, /**< whitespace is missing in some config construct */ RS_RET_OK_WARN = -2186, /**< config part: everything was OK, but a warning message was emitted */ - RS_RET_INVLD_CONF_OBJ= -2200, /**< invalid config object (e.g. $Begin conf statement) */ - RS_RET_ERR_LIBEE_INIT = -2201, /**< cannot obtain libee ctx */ - RS_RET_ERR_LIBLOGNORM_INIT = -2202,/**< cannot obtain liblognorm ctx */ - RS_RET_ERR_LIBLOGNORM_SAMPDB_LOAD = -2203,/**< liblognorm sampledb load failed */ - RS_RET_CMD_GONE_AWAY = -2204,/**< config directive existed, but no longer supported */ - RS_RET_ERR_SCHED_PARAMS = -2205,/**< there is a problem with configured thread scheduling params */ - RS_RET_SOCKNAME_MISSING = -2206,/**< no socket name configured where one is required */ - RS_RET_CONF_PARSE_ERROR = -2207,/**< (fatal) error parsing config file */ RS_RET_CONF_RQRD_PARAM_MISSING = -2208,/**< required parameter in config object is missing */ - RS_RET_MOD_UNKNOWN = -2209,/**< module (config name) is unknown */ - RS_RET_CONFOBJ_UNSUPPORTED = -2210,/**< config objects (v6 conf) are not supported here */ - RS_RET_MISSING_CNFPARAMS = -2211, /**< missing configuration parameters */ - RS_RET_NO_LISTNERS = -2212, /**< module loaded, but no listeners are defined */ - RS_RET_INVLD_PROTOCOL = -2213, /**< invalid protocol specified in config file */ - RS_RET_CNF_INVLD_FRAMING = -2214, /**< invalid framing specified in config file */ - RS_RET_LEGA_ACT_NOT_SUPPORTED = -2215, /**< the module (no longer) supports legacy action syntax */ - RS_RET_MAX_OMSR_REACHED = -2216, /**< max nbr of string requests reached, not supported by core */ - RS_RET_UID_MISSING = -2217, /**< a user id is missing (but e.g. a password provided) */ - RS_RET_DATAFAIL = -2218, /**< data passed to action caused failure */ - /* reserved for pre-v6.5 */ - RS_RET_DUP_PARAM = -2220, /**< config parameter is given more than once */ - RS_RET_MODULE_ALREADY_IN_CONF = -2221, /**< module already in current configuration */ - RS_RET_PARAM_NOT_PERMITTED = -2222, /**< legacy parameter no longer permitted (usally already set by v2) */ - RS_RET_NO_JSON_PASSING = -2223, /**< rsyslog core does not support JSON-passing plugin API */ - RS_RET_MOD_NO_INPUT_STMT = -2224, /**< (input) module does not support input() statement */ - RS_RET_NO_CEE_MSG = -2225, /**< the message being processed is NOT CEE-enhanced */ - - /**** up to 2290 is reserved for v6 use ****/ - RS_RET_RELP_ERR = -2291, /**<< error in RELP processing */ - /**** up to 3000 is reserved for c7 use ****/ - RS_RET_JNAME_NO_ROOT = -2301, /**< root element is missing in JSON path */ - RS_RET_JNAME_INVALID = -2302, /**< JSON path is invalid */ - RS_RET_JSON_PARSE_ERR = -2303, /**< we had a problem parsing JSON (or extra data) */ - RS_RET_BSD_BLOCKS_UNSUPPORTED = -2304, /**< BSD-style config blocks are no longer supported */ - RS_RET_JNAME_NOTFOUND = -2305, /**< JSON name not found (does not exist) */ - RS_RET_INVLD_SETOP = -2305, /**< invalid variable set operation, incompatible type */ - RS_RET_RULESET_EXISTS = -2306,/**< ruleset already exists */ - RS_RET_DEPRECATED = -2307,/**< deprecated functionality is used */ - RS_RET_DS_PROP_SEQ_ERR = -2308,/**< property sequence error deserializing object */ - RS_RET_INVLD_PROP = -2309,/**< property name error (unknown name) */ - RS_RET_NO_RULEBASE = -2310,/**< mmnormalize: rulebase can not be found or otherwise invalid */ - RS_RET_INVLD_MODE = -2311,/**< invalid mode specified in configuration */ - RS_RET_INVLD_ANON_BITS = -2312,/**< mmanon: invalid number of bits to anonymize specified */ - RS_RET_REPLCHAR_IGNORED = -2313,/**< mmanon: replacementChar parameter is ignored */ - RS_RET_SIGPROV_ERR = -2320,/**< error in signature provider */ - RS_RET_CRYPROV_ERR = -2321,/**< error in cryptography encryption provider */ - RS_RET_EI_OPN_ERR = -2322,/**< error opening an .encinfo file */ - RS_RET_EI_NO_EXISTS = -2323,/**< .encinfo file does not exist (status, not necessarily error!)*/ - RS_RET_EI_WR_ERR = -2324,/**< error writing an .encinfo file */ - RS_RET_EI_INVLD_FILE = -2325,/**< header indicates the file is no .encinfo file */ - RS_RET_CRY_INVLD_ALGO = -2326,/**< user specified invalid (unkonwn) crypto algorithm */ - RS_RET_CRY_INVLD_MODE = -2327,/**< user specified invalid (unkonwn) crypto mode */ - RS_RET_QUEUE_DISK_NO_FN = -2328,/**< disk queue configured, but filename not set */ - RS_RET_CA_CERT_MISSING = -2329,/**< a CA cert is missing where one is required (e.g. TLS) */ - RS_RET_CERT_MISSING = -2330,/**< a cert is missing where one is required (e.g. TLS) */ - RS_RET_CERTKEY_MISSING = -2331,/**< a cert (private) key is missing where one is required (e.g. TLS) */ - RS_RET_STRUC_DATA_INVLD = -2349,/**< structured data is malformed */ - - /* up to 2350 reserved for 7.4 */ - RS_RET_QUEUE_CRY_DISK_ONLY = -2351,/**< crypto provider only supported for disk-associated queues */ - RS_RET_NO_DATA = -2352,/**< file has no data; more a state than a real error */ - RS_RET_RELP_AUTH_FAIL = -2353,/**< RELP peer authentication failed */ - RS_RET_ERR_UDPSEND = -2354,/**< sending msg via UDP failed */ - RS_RET_LAST_ERRREPORT = -2355,/**< module does not emit more error messages as limit is reached */ - RS_RET_READ_ERR = -2356,/**< read error occured (file i/o) */ - RS_RET_CONF_PARSE_WARNING = -2357,/**< warning parsing config file */ - RS_RET_CONF_WRN_FULLDLY_BELOW_HIGHWTR = -2358,/**< warning queue full delay mark below high wtr mark */ - /* RainerScript error messages (range 1000.. 1999) */ RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */ - RS_RET_FIELD_NOT_FOUND = 1002, /**< field() function did not find requested field */ /* some generic error/status codes */ RS_RET_OK = 0, /**< operation successful */ @@ -401,12 +365,7 @@ * Be sure to call the to-be-returned variable always "iRet" and * the function finalizer always "finalize_it". */ -#if HAVE_BUILTIN_EXCEPT -# define CHKiRet(code) if(__builtin_expect(((iRet = code) != RS_RET_OK), 0)) goto finalize_it -#else -# define CHKiRet(code) if((iRet = code) != RS_RET_OK) goto finalize_it -#endif - +#define CHKiRet(code) if((iRet = code) != RS_RET_OK) goto finalize_it /* macro below is to be used if we need our own handling, eg for cleanup */ #define CHKiRet_Hdlr(code) if((iRet = code) != RS_RET_OK) /* macro below is to handle failing malloc/calloc/strdup... which we almost always handle in the same way... */ @@ -424,7 +383,7 @@ /** Object ID. These are for internal checking. Each * object is assigned a specific ID. This is contained in - * all Object structs (just like C++ RTTI). We can use + * all Object structs (just like C++ RTTI). We can use * this field to see if we have been passed a correct ID. * Other than that, there is currently no other use for * the object id. @@ -456,7 +415,7 @@ #endif /** - * This macro should be used to free objects. + * This macro should be used to free objects. * It aids in interpreting dumps during debugging. */ #ifdef NDEBUG @@ -506,25 +465,13 @@ * add them. -- rgerhards, 2008-04-17 */ extern uchar *glblModPath; /* module load path */ -extern void (*glblErrLogger)(const int, const int, const uchar*); +extern rsRetVal (*glblErrLogger)(int, uchar*); /* some runtime prototypes */ rsRetVal rsrtInit(char **ppErrObj, obj_if_t *pObjIF); rsRetVal rsrtExit(void); int rsrtIsInit(void); -void rsrtSetErrLogger(void (*errLogger)(const int, const int, const uchar*)); - -/* this define below is (later) intended to be used to implement empty - * structs. TODO: check if compilers supports this and, if not, define - * a dummy variable. This requires review of where in code empty structs - * are already defined. -- rgerhards, 2010-07-26 - */ -#define EMPTY_STRUCT - -/* TODO: remove this -- this is only for transition of the config system */ -extern rsconf_t *ourConf; /* defined by syslogd.c, a hack for functions that do not - yet receive a copy, so that we can incrementially - compile and change... -- rgerhars, 2011-04-19 */ +rsRetVal rsrtSetErrLogger(rsRetVal (*errLogger)(int, uchar*)); #endif /* multi-include protection */ /* vim:set ai: diff -Nru rsyslog-7.6.0/runtime/rule.c rsyslog-5.10.1/runtime/rule.c --- rsyslog-7.6.0/runtime/rule.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/rule.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,472 @@ +/* rule.c - rsyslog's rule object + * + * See file comment in rule.c for the overall structure of rule processing. + * + * Module begun 2009-06-10 by Rainer Gerhards + * + * Copyright 2009-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "action.h" +#include "rule.h" +#include "errmsg.h" +#include "vm.h" +#include "var.h" +#include "srUtils.h" +#include "batch.h" +#include "unicode-helper.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(errmsg) +DEFobjCurrIf(expr) +DEFobjCurrIf(var) +DEFobjCurrIf(vm) + + +/* support for simple textual representation of FIOP names + * rgerhards, 2005-09-27 + */ +static char* +getFIOPName(unsigned iFIOP) +{ + char *pRet; + switch(iFIOP) { + case FIOP_CONTAINS: + pRet = "contains"; + break; + case FIOP_ISEQUAL: + pRet = "isequal"; + break; + case FIOP_STARTSWITH: + pRet = "startswith"; + break; + case FIOP_REGEX: + pRet = "regex"; + break; + default: + pRet = "NOP"; + break; + } + return pRet; +} + + +/* iterate over all actions, this is often needed, for example when HUP processing + * must be done or a shutdown is pending. + */ +static rsRetVal +iterateAllActions(rule_t *pThis, rsRetVal (*pFunc)(void*, void*), void* pParam) +{ + return llExecFunc(&pThis->llActList, pFunc, pParam); +} + + +/* helper to processMsg(), used to call the configured actions. It is + * executed from within llExecFunc() of the action list. + * rgerhards, 2007-08-02 + */ +DEFFUNC_llExecFunc(processBatchDoActions) +{ + DEFiRet; + rsRetVal iRetMod; /* return value of module - we do not always pass that back */ + action_t *pAction = (action_t*) pData; + batch_t *pBatch = (batch_t*) pParam; + + DBGPRINTF("Processing next action\n"); + iRetMod = pAction->submitToActQ(pAction, pBatch); + + RETiRet; +} + + +/* This functions looks at the given message and checks if it matches the + * provided filter condition. + */ +static rsRetVal +shouldProcessThisMessage(rule_t *pRule, msg_t *pMsg, sbool *bProcessMsg) +{ + DEFiRet; + unsigned short pbMustBeFreed; + uchar *pszPropVal; + int bRet = 0; + size_t propLen; + vm_t *pVM = NULL; + var_t *pResult = NULL; + + ISOBJ_TYPE_assert(pRule, rule); + assert(pMsg != NULL); + + /* we first have a look at the global, BSD-style block filters (for tag + * and host). Only if they match, we evaluate the actual filter. + * rgerhards, 2005-10-18 + */ + if(pRule->eHostnameCmpMode == HN_NO_COMP) { + /* EMPTY BY INTENSION - we check this value first, because + * it is the one most often used, so this saves us time! + */ + } else if(pRule->eHostnameCmpMode == HN_COMP_MATCH) { + if(rsCStrSzStrCmp(pRule->pCSHostnameComp, (uchar*) getHOSTNAME(pMsg), getHOSTNAMELen(pMsg))) { + /* not equal, so we are already done... */ + dbgprintf("hostname filter '+%s' does not match '%s'\n", + rsCStrGetSzStrNoNULL(pRule->pCSHostnameComp), getHOSTNAME(pMsg)); + FINALIZE; + } + } else { /* must be -hostname */ + if(!rsCStrSzStrCmp(pRule->pCSHostnameComp, (uchar*) getHOSTNAME(pMsg), getHOSTNAMELen(pMsg))) { + /* not equal, so we are already done... */ + dbgprintf("hostname filter '-%s' does not match '%s'\n", + rsCStrGetSzStrNoNULL(pRule->pCSHostnameComp), getHOSTNAME(pMsg)); + FINALIZE; + } + } + + if(pRule->pCSProgNameComp != NULL) { + int bInv = 0, bEqv = 0, offset = 0; + if(*(rsCStrGetSzStrNoNULL(pRule->pCSProgNameComp)) == '-') { + if(*(rsCStrGetSzStrNoNULL(pRule->pCSProgNameComp) + 1) == '-') + offset = 1; + else { + bInv = 1; + offset = 1; + } + } + if(!rsCStrOffsetSzStrCmp(pRule->pCSProgNameComp, offset, + (uchar*) getProgramName(pMsg, LOCK_MUTEX), getProgramNameLen(pMsg, LOCK_MUTEX))) + bEqv = 1; + + if((!bEqv && !bInv) || (bEqv && bInv)) { + /* not equal or inverted selection, so we are already done... */ + DBGPRINTF("programname filter '%s' does not match '%s'\n", + rsCStrGetSzStrNoNULL(pRule->pCSProgNameComp), getProgramName(pMsg, LOCK_MUTEX)); + FINALIZE; + } + } + + /* done with the BSD-style block filters */ + + if(pRule->f_filter_type == FILTER_PRI) { + /* skip messages that are incorrect priority */ + if ( (pRule->f_filterData.f_pmask[pMsg->iFacility] == TABLE_NOPRI) || \ + ((pRule->f_filterData.f_pmask[pMsg->iFacility] & (1<iSeverity)) == 0) ) + bRet = 0; + else + bRet = 1; + dbgprintf("testing filter, f_pmask %d, result %d\n", pRule->f_filterData.f_pmask[pMsg->iFacility], bRet); + } else if(pRule->f_filter_type == FILTER_EXPR) { + CHKiRet(vm.Construct(&pVM)); + CHKiRet(vm.ConstructFinalize(pVM)); + CHKiRet(vm.SetMsg(pVM, pMsg)); + CHKiRet(vm.ExecProg(pVM, pRule->f_filterData.f_expr->pVmprg)); + CHKiRet(vm.PopBoolFromStack(pVM, &pResult)); + dbgprintf("result of rainerscript filter evaluation: %lld\n", pResult->val.num); + /* VM is destructed on function exit */ + bRet = (pResult->val.num) ? 1 : 0; + } else { + assert(pRule->f_filter_type == FILTER_PROP); /* assert() just in case... */ + if(pRule->f_filterData.prop.propID == PROP_INVALID) { + DBGPRINTF("invalid property ID, filter always returns 0\n"); + bRet = 0; + } else { + pszPropVal = MsgGetProp(pMsg, NULL, pRule->f_filterData.prop.propID, &propLen, &pbMustBeFreed); + + /* Now do the compares (short list currently ;)) */ + switch(pRule->f_filterData.prop.operation ) { + case FIOP_CONTAINS: + if(rsCStrLocateInSzStr(pRule->f_filterData.prop.pCSCompValue, (uchar*) pszPropVal) != -1) + bRet = 1; + break; + case FIOP_ISEQUAL: + if(rsCStrSzStrCmp(pRule->f_filterData.prop.pCSCompValue, + pszPropVal, ustrlen(pszPropVal)) == 0) + bRet = 1; /* process message! */ + break; + case FIOP_STARTSWITH: + if(rsCStrSzStrStartsWithCStr(pRule->f_filterData.prop.pCSCompValue, + pszPropVal, ustrlen(pszPropVal)) == 0) + bRet = 1; /* process message! */ + break; + case FIOP_REGEX: + if(rsCStrSzStrMatchRegex(pRule->f_filterData.prop.pCSCompValue, + (unsigned char*) pszPropVal, 0, &pRule->f_filterData.prop.regex_cache) == RS_RET_OK) + bRet = 1; + break; + case FIOP_EREREGEX: + if(rsCStrSzStrMatchRegex(pRule->f_filterData.prop.pCSCompValue, + (unsigned char*) pszPropVal, 1, &pRule->f_filterData.prop.regex_cache) == RS_RET_OK) + bRet = 1; + break; + default: + /* here, it handles NOP (for performance reasons) */ + assert(pRule->f_filterData.prop.operation == FIOP_NOP); + bRet = 1; /* as good as any other default ;) */ + break; + } + + /* now check if the value must be negated */ + if(pRule->f_filterData.prop.isNegated) + bRet = (bRet == 1) ? 0 : 1; + + if(Debug) { + dbgprintf("Filter: check for property '%s' (value '%s') ", + propIDToName(pRule->f_filterData.prop.propID), pszPropVal); + if(pRule->f_filterData.prop.isNegated) + dbgprintf("NOT "); + dbgprintf("%s '%s': %s\n", + getFIOPName(pRule->f_filterData.prop.operation), + rsCStrGetSzStrNoNULL(pRule->f_filterData.prop.pCSCompValue), + bRet ? "TRUE" : "FALSE"); + } + + /* cleanup */ + if(pbMustBeFreed) + free(pszPropVal); + } + } + +finalize_it: + /* destruct in any case, not just on error, but it makes error handling much easier */ + if(pVM != NULL) + vm.Destruct(&pVM); + + if(pResult != NULL) + var.Destruct(&pResult); + + *bProcessMsg = bRet; + RETiRet; +} + + + +/* Process (consume) a batch of messages. Calls the actions configured. + * rgerhards, 2005-10-13 + */ +static rsRetVal +processBatch(rule_t *pThis, batch_t *pBatch) +{ + int i; + rsRetVal localRet; + DEFiRet; + + ISOBJ_TYPE_assert(pThis, rule); + assert(pBatch != NULL); + + /* first check the filters and reset status variables */ + for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { + localRet = shouldProcessThisMessage(pThis, (msg_t*)(pBatch->pElem[i].pUsrp), + &(pBatch->pElem[i].bFilterOK)); + if(localRet != RS_RET_OK) { + DBGPRINTF("processBatch: iRet %d returned from shouldProcessThisMessage, " + "ignoring message\n", localRet); + pBatch->pElem[i].bFilterOK = 0; + } + if(pBatch->pElem[i].bFilterOK) { + /* re-init only when actually needed (cache write cost!) */ + pBatch->pElem[i].bPrevWasSuspended = 0; + } + } + CHKiRet(llExecFunc(&pThis->llActList, processBatchDoActions, pBatch)); + +finalize_it: + RETiRet; +} + + +/* Standard-Constructor + */ +BEGINobjConstruct(rule) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(rule) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +static rsRetVal +ruleConstructFinalize(rule_t *pThis) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, rule); + + /* note: actionDestruct is from action.c API! */ + CHKiRet(llInit(&pThis->llActList, actionDestruct, NULL, NULL)); + +finalize_it: + RETiRet; +} + + +/* destructor for the rule object */ +BEGINobjDestruct(rule) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(rule) + if(pThis->pCSHostnameComp != NULL) + rsCStrDestruct(&pThis->pCSHostnameComp); + if(pThis->pCSProgNameComp != NULL) + rsCStrDestruct(&pThis->pCSProgNameComp); + + if(pThis->f_filter_type == FILTER_PROP) { + if(pThis->f_filterData.prop.pCSCompValue != NULL) + rsCStrDestruct(&pThis->f_filterData.prop.pCSCompValue); + if(pThis->f_filterData.prop.regex_cache != NULL) + rsCStrRegexDestruct(&pThis->f_filterData.prop.regex_cache); + } else if(pThis->f_filter_type == FILTER_EXPR) { + if(pThis->f_filterData.f_expr != NULL) + expr.Destruct(&pThis->f_filterData.f_expr); + } + + llDestroy(&pThis->llActList); +ENDobjDestruct(rule) + + +/* set the associated ruleset */ +static rsRetVal +setAssRuleset(rule_t *pThis, ruleset_t *pRuleset) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, rule); + ISOBJ_TYPE_assert(pRuleset, ruleset); + pThis->pRuleset = pRuleset; + RETiRet; +} + +/* get the associated ruleset (may be NULL if not set!) */ +static ruleset_t* +getAssRuleset(rule_t *pThis) +{ + ISOBJ_TYPE_assert(pThis, rule); + return pThis->pRuleset; +} + + +/* helper to DebugPrint, to print out all actions via + * the llExecFunc() facility. + */ +DEFFUNC_llExecFunc(dbgPrintInitInfoAction) +{ + DEFiRet; + iRet = actionDbgPrint((action_t*) pData); + dbgprintf("\n"); + RETiRet; +} + + +/* debugprint for the rule object */ +BEGINobjDebugPrint(rule) /* be sure to specify the object type also in END and CODESTART macros! */ + int i; +CODESTARTobjDebugPrint(rule) + dbgoprint((obj_t*) pThis, "rsyslog rule:\n"); + if(pThis->pCSProgNameComp != NULL) + dbgprintf("tag: '%s'\n", rsCStrGetSzStrNoNULL(pThis->pCSProgNameComp)); + if(pThis->eHostnameCmpMode != HN_NO_COMP) + dbgprintf("hostname: %s '%s'\n", + pThis->eHostnameCmpMode == HN_COMP_MATCH ? + "only" : "allbut", + rsCStrGetSzStrNoNULL(pThis->pCSHostnameComp)); + if(pThis->f_filter_type == FILTER_PRI) { + for (i = 0; i <= LOG_NFACILITIES; i++) + if (pThis->f_filterData.f_pmask[i] == TABLE_NOPRI) + dbgprintf(" X "); + else + dbgprintf("%2X ", pThis->f_filterData.f_pmask[i]); + } else if(pThis->f_filter_type == FILTER_EXPR) { + dbgprintf("EXPRESSION-BASED Filter: can currently not be displayed"); + } else { + dbgprintf("PROPERTY-BASED Filter:\n"); + dbgprintf("\tProperty.: '%s'\n", propIDToName(pThis->f_filterData.prop.propID)); + if(pThis->f_filterData.prop.propID != PROP_INVALID) { + dbgprintf("\tOperation: "); + if(pThis->f_filterData.prop.isNegated) + dbgprintf("NOT "); + dbgprintf("'%s'\n", getFIOPName(pThis->f_filterData.prop.operation)); + dbgprintf("\tValue....: '%s'\n", + rsCStrGetSzStrNoNULL(pThis->f_filterData.prop.pCSCompValue)); + } + dbgprintf("\tAction...: "); + } + + dbgprintf("\nActions:\n"); + llExecFunc(&pThis->llActList, dbgPrintInitInfoAction, NULL); /* actions */ + + dbgprintf("\n"); +ENDobjDebugPrint(rule) + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(rule) +CODESTARTobjQueryInterface(rule) + if(pIf->ifVersion != ruleCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = ruleConstruct; + pIf->ConstructFinalize = ruleConstructFinalize; + pIf->Destruct = ruleDestruct; + pIf->DebugPrint = ruleDebugPrint; + + pIf->IterateAllActions = iterateAllActions; + pIf->ProcessBatch = processBatch; + pIf->SetAssRuleset = setAssRuleset; + pIf->GetAssRuleset = getAssRuleset; +finalize_it: +ENDobjQueryInterface(rule) + + +/* Exit the rule class. + * rgerhards, 2009-04-06 + */ +BEGINObjClassExit(rule, OBJ_IS_CORE_MODULE) /* class, version */ + objRelease(errmsg, CORE_COMPONENT); + objRelease(expr, CORE_COMPONENT); + objRelease(var, CORE_COMPONENT); + objRelease(vm, CORE_COMPONENT); +ENDObjClassExit(rule) + + +/* Initialize the rule class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(rule, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(errmsg, CORE_COMPONENT)); + CHKiRet(objUse(expr, CORE_COMPONENT)); + CHKiRet(objUse(var, CORE_COMPONENT)); + CHKiRet(objUse(vm, CORE_COMPONENT)); + + /* set our own handlers */ + OBJSetMethodHandler(objMethod_DEBUGPRINT, ruleDebugPrint); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, ruleConstructFinalize); +ENDObjClassInit(rule) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/rule.h rsyslog-5.10.1/runtime/rule.h --- rsyslog-7.6.0/runtime/rule.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/rule.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,76 @@ +/* The rule object. + * + * This implements rules within rsyslog. + * + * Copyright 2009-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_RULE_H +#define INCLUDED_RULE_H + +#include "linkedlist.h" +#include "regexp.h" +#include "expr.h" + +/* the rule object */ +struct rule_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + /* filter properties */ + enum { + FILTER_PRI = 0, /* traditional PRI based filer */ + FILTER_PROP = 1, /* extended filter, property based */ + FILTER_EXPR = 2 /* extended filter, expression based */ + } f_filter_type; + EHostnameCmpMode eHostnameCmpMode; + cstr_t *pCSHostnameComp; /* hostname to check */ + cstr_t *pCSProgNameComp; /* tag to check or NULL, if not to be checked */ + union { + u_char f_pmask[LOG_NFACILITIES+1]; /* priority mask */ + struct { + fiop_t operation; + regex_t *regex_cache; /* cache for compiled REs, if such are used */ + cstr_t *pCSCompValue; /* value to "compare" against */ + sbool isNegated; + propid_t propID; /* ID of the requested property */ + } prop; + expr_t *f_expr; /* expression object */ + } f_filterData; + + ruleset_t *pRuleset; /* associated ruleset */ + linkedList_t llActList; /* list of configured actions */ +}; + +/* interfaces */ +BEGINinterface(rule) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(rule); + rsRetVal (*Construct)(rule_t **ppThis); + rsRetVal (*ConstructFinalize)(rule_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(rule_t **ppThis); + rsRetVal (*IterateAllActions)(rule_t *pThis, rsRetVal (*pFunc)(void*, void*), void *pParam); + rsRetVal (*ProcessBatch)(rule_t *pThis, batch_t *pBatch); + rsRetVal (*SetAssRuleset)(rule_t *pThis, ruleset_t*); + ruleset_t* (*GetAssRuleset)(rule_t *pThis); +ENDinterface(rule) +#define ruleCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ +/* change for v2: ProcessMsg replaced by ProcessBatch - 2010-06-10 */ + + +/* prototypes */ +PROTOTYPEObj(rule); + +#endif /* #ifndef INCLUDED_RULE_H */ diff -Nru rsyslog-7.6.0/runtime/ruleset.c rsyslog-5.10.1/runtime/ruleset.c --- rsyslog-7.6.0/runtime/ruleset.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/ruleset.c 2012-10-17 14:41:20.000000000 +0000 @@ -1,7 +1,7 @@ /* ruleset.c - rsyslog's ruleset object * - * We have a two-way structure of linked lists: one config-specifc linked list - * (conf->rulesets.llRulesets) hold alls rule sets that we know. Included in each + * We have a two-way structure of linked lists: one global linked list + * (llAllRulesets) hold alls rule sets that we know. Included in each * list is a list of rules (which contain a list of actions, but that's * a different story). * @@ -11,26 +11,30 @@ * * Module begun 2009-06-10 by Rainer Gerhards * - * Copyright 2009-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * The rsyslog runtime library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The rsyslog runtime library 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the rsyslog runtime library. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. */ + #include "config.h" #include +#include #include #include @@ -39,106 +43,78 @@ #include "cfsysline.h" #include "msg.h" #include "ruleset.h" +#include "rule.h" #include "errmsg.h" #include "parser.h" #include "batch.h" #include "unicode-helper.h" -#include "rsconf.h" -#include "action.h" -#include "rainerscript.h" -#include "srUtils.h" -#include "modules.h" #include "dirty.h" /* for main ruleset queue creation */ /* static data */ DEFobjStaticHelpers DEFobjCurrIf(errmsg) +DEFobjCurrIf(rule) DEFobjCurrIf(parser) -/* tables for interfacing with the v6 config system (as far as we need to) */ -static struct cnfparamdescr rspdescr[] = { - { "name", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "parser", eCmdHdlrArray, 0 } -}; -static struct cnfparamblk rspblk = - { CNFPARAMBLK_VERSION, - sizeof(rspdescr)/sizeof(struct cnfparamdescr), - rspdescr - }; +linkedList_t llRulesets; /* this is NOT a pointer - no typo here ;) */ +ruleset_t *pCurrRuleset = NULL; /* currently "active" ruleset */ +ruleset_t *pDfltRuleset = NULL; /* current default ruleset, e.g. for binding to actions which have no other */ /* forward definitions */ static rsRetVal processBatch(batch_t *pBatch); -static rsRetVal scriptExec(struct cnfstmt *root, batch_t *pBatch, sbool *active); - -/* ---------- linked-list key handling functions (ruleset) ---------- */ +/* ---------- linked-list key handling functions ---------- */ /* destructor for linked list keys. */ -rsRetVal -rulesetKeyDestruct(void __attribute__((unused)) *pData) +static rsRetVal keyDestruct(void __attribute__((unused)) *pData) { free(pData); return RS_RET_OK; } -/* ---------- END linked-list key handling functions (ruleset) ---------- */ -/* iterate over all actions in a script (stmt subtree) */ -static void -scriptIterateAllActions(struct cnfstmt *root, rsRetVal (*pFunc)(void*, void*), void* pParam) -{ - struct cnfstmt *stmt; - for(stmt = root ; stmt != NULL ; stmt = stmt->next) { - switch(stmt->nodetype) { - case S_NOP: - case S_STOP: - case S_CALL:/* call does not need to do anything - done in called ruleset! */ - break; - case S_ACT: - DBGPRINTF("iterateAllActions calling into action %p\n", stmt->d.act); - pFunc(stmt->d.act, pParam); - break; - case S_IF: - if(stmt->d.s_if.t_then != NULL) - scriptIterateAllActions(stmt->d.s_if.t_then, - pFunc, pParam); - if(stmt->d.s_if.t_else != NULL) - scriptIterateAllActions(stmt->d.s_if.t_else, - pFunc, pParam); - break; - case S_PRIFILT: - if(stmt->d.s_prifilt.t_then != NULL) - scriptIterateAllActions(stmt->d.s_prifilt.t_then, - pFunc, pParam); - if(stmt->d.s_prifilt.t_else != NULL) - scriptIterateAllActions(stmt->d.s_prifilt.t_else, - pFunc, pParam); - break; - case S_PROPFILT: - scriptIterateAllActions(stmt->d.s_propfilt.t_then, - pFunc, pParam); - break; - default: - dbgprintf("error: unknown stmt type %u during iterateAll\n", - (unsigned) stmt->nodetype); - break; - } - } -} +/* ---------- END linked-list key handling functions ---------- */ + /* driver to iterate over all of this ruleset actions */ typedef struct iterateAllActions_s { rsRetVal (*pFunc)(void*, void*); void *pParam; } iterateAllActions_t; +DEFFUNC_llExecFunc(doIterateRulesetActions) +{ + DEFiRet; + rule_t* pRule = (rule_t*) pData; + iterateAllActions_t *pMyParam = (iterateAllActions_t*) pParam; + iRet = rule.IterateAllActions(pRule, pMyParam->pFunc, pMyParam->pParam); + RETiRet; +} +/* iterate over all actions of THIS rule set. + */ +static rsRetVal +iterateRulesetAllActions(ruleset_t *pThis, rsRetVal (*pFunc)(void*, void*), void* pParam) +{ + iterateAllActions_t params; + DEFiRet; + assert(pFunc != NULL); + + params.pFunc = pFunc; + params.pParam = pParam; + CHKiRet(llExecFunc(&(pThis->llRules), doIterateRulesetActions, ¶ms)); + +finalize_it: + RETiRet; +} + + /* driver to iterate over all actions */ DEFFUNC_llExecFunc(doIterateAllActions) { DEFiRet; ruleset_t* pThis = (ruleset_t*) pData; iterateAllActions_t *pMyParam = (iterateAllActions_t*) pParam; - scriptIterateAllActions(pThis->root, pMyParam->pFunc, pMyParam->pParam); + iRet = iterateRulesetAllActions(pThis, pMyParam->pFunc, pMyParam->pParam); RETiRet; } /* iterate over ALL actions present in the WHOLE system. @@ -146,7 +122,7 @@ * must be done or a shutdown is pending. */ static rsRetVal -iterateAllActions(rsconf_t *conf, rsRetVal (*pFunc)(void*, void*), void* pParam) +iterateAllActions(rsRetVal (*pFunc)(void*, void*), void* pParam) { iterateAllActions_t params; DEFiRet; @@ -154,17 +130,37 @@ params.pFunc = pFunc; params.pParam = pParam; - CHKiRet(llExecFunc(&(conf->rulesets.llRulesets), doIterateAllActions, ¶ms)); + CHKiRet(llExecFunc(&llRulesets, doIterateAllActions, ¶ms)); finalize_it: RETiRet; } + +/* helper to processBatch(), used to call the configured actions. It is + * executed from within llExecFunc() of the action list. + * rgerhards, 2007-08-02 + */ +DEFFUNC_llExecFunc(processBatchDoRules) +{ + rsRetVal iRet; + ISOBJ_TYPE_assert(pData, rule); + dbgprintf("Processing next rule\n"); + iRet = rule.ProcessBatch((rule_t*) pData, (batch_t*) pParam); +dbgprintf("ruleset: get iRet %d from rule.ProcessMsg()\n", iRet); + return iRet; +} + + + /* This function is similar to processBatch(), but works on a batch that * contains rules from multiple rulesets. In this case, we can not push * the whole batch through the ruleset. Instead, we examine it and * partition it into sub-rulesets which we then push through the system. + * Note that when we evaluate which message must be processed, we do NOT need + * to look at bFilterOK, because this value is only set in a later processing + * stage. Doing so caused a bug during development ;) * rgerhards, 2010-06-15 */ static inline rsRetVal @@ -181,7 +177,7 @@ do { bHaveUnprocessed = 0; /* search for first unprocessed element */ - for(iStart = 0 ; iStart < pBatch->nElem && pBatch->eltState[iStart] == BATCH_STATE_DISC ; ++iStart) + for(iStart = 0 ; iStart < pBatch->nElem && pBatch->pElem[iStart].state == BATCH_STATE_DISC ; ++iStart) /* just search, no action */; if(iStart == pBatch->nElem) break; /* everything processed */ @@ -194,11 +190,11 @@ for(i = iStart ; i < pBatch->nElem ; ++i) { if(batchElemGetRuleset(pBatch, i) == currRuleset) { /* for performance reasons, we copy only those members that we actually need */ - snglRuleBatch.pElem[iNew].pMsg = pBatch->pElem[i].pMsg; - snglRuleBatch.eltState[iNew] = pBatch->eltState[i]; + snglRuleBatch.pElem[iNew].pUsrp = pBatch->pElem[i].pUsrp; + snglRuleBatch.pElem[iNew].state = pBatch->pElem[i].state; ++iNew; /* We indicate the element also as done, so it will not be processed again */ - pBatch->eltState[i] = BATCH_STATE_DISC; + pBatch->pElem[i].state = BATCH_STATE_DISC; } else { bHaveUnprocessed = 1; } @@ -214,374 +210,6 @@ RETiRet; } -/* return a new "active" structure for the batch. Free with freeActive(). */ -static inline sbool *newActive(batch_t *pBatch) -{ - return malloc(sizeof(sbool) * batchNumMsgs(pBatch)); - -} -static inline void freeActive(sbool *active) { free(active); } - - -/* for details, see scriptExec() header comment! */ -/* call action for all messages with filter on */ -static rsRetVal -execAct(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - DEFiRet; -dbgprintf("RRRR: execAct [%s]: batch of %d elements, active %p\n", modGetName(stmt->d.act->pMod), batchNumMsgs(pBatch), active); - pBatch->active = active; - stmt->d.act->submitToActQ(stmt->d.act, pBatch); - RETiRet; -} - -static rsRetVal -execSet(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - int i; - struct var result; - DEFiRet; - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { - if( pBatch->eltState[i] != BATCH_STATE_DISC - && (active == NULL || active[i])) { - cnfexprEval(stmt->d.s_set.expr, &result, pBatch->pElem[i].pMsg); - msgSetJSONFromVar(pBatch->pElem[i].pMsg, stmt->d.s_set.varname, - &result); - varDelete(&result); - } - } - RETiRet; -} - -static rsRetVal -execUnset(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - int i; - DEFiRet; - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { - if( pBatch->eltState[i] != BATCH_STATE_DISC - && (active == NULL || active[i])) { - msgDelJSON(pBatch->pElem[i].pMsg, stmt->d.s_unset.varname); - } - } - RETiRet; -} - -/* for details, see scriptExec() header comment! */ -/* "stop" simply discards the filtered items - it's just a (hopefully more intuitive - * shortcut for users. - */ -static rsRetVal -execStop(batch_t *pBatch, sbool *active) -{ - int i; - DEFiRet; - for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) { - if( pBatch->eltState[i] != BATCH_STATE_DISC - && (active == NULL || active[i])) { - pBatch->eltState[i] = BATCH_STATE_DISC; - } - } - RETiRet; -} -static rsRetVal -execCall(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - msg_t *pMsg; - int i; - DEFiRet; - if(stmt->d.s_call.ruleset == NULL) { - scriptExec(stmt->d.s_call.stmt, pBatch, active); - } else { - for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - CHKmalloc(pMsg = MsgDup((msg_t*) pBatch->pElem[i].pMsg)); - DBGPRINTF("CALL: forwarding message %d to async ruleset %p\n", - i, stmt->d.s_call.ruleset->pQueue); - MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY); - MsgSetRuleset(pMsg, stmt->d.s_call.ruleset); - /* Note: we intentionally use submitMsg2() here, as we process messages - * that were already run through the rate-limiter. - */ - submitMsg2(pMsg); - } - } -finalize_it: - RETiRet; -} - -/* for details, see scriptExec() header comment! */ -// save current filter, evaluate new one -// perform then (if any message) -// if ELSE given: -// set new filter, inverted -// perform else (if any messages) -static rsRetVal -execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - sbool *newAct; - int i; - sbool bRet; - sbool allInactive = 1; - DEFiRet; - newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - if(*(pBatch->pbShutdownImmediate)) - FINALIZE; - if(pBatch->eltState[i] == BATCH_STATE_DISC) - continue; /* will be ignored in any case */ - if(active == NULL || active[i]) { - bRet = cnfexprEvalBool(stmt->d.s_if.expr, pBatch->pElem[i].pMsg); - allInactive = 0; - } else - bRet = 0; - newAct[i] = bRet; - DBGPRINTF("batch: item %d: expr eval: %d\n", i, bRet); - } - - if(allInactive) { - DBGPRINTF("execIf: all batch elements are inactive, holding execution\n"); - freeActive(newAct); - FINALIZE; - } - - if(stmt->d.s_if.t_then != NULL) { - scriptExec(stmt->d.s_if.t_then, pBatch, newAct); - } - if(stmt->d.s_if.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - if(*(pBatch->pbShutdownImmediate)) - FINALIZE; - if(pBatch->eltState[i] != BATCH_STATE_DISC - && (active == NULL || active[i])) - newAct[i] = !newAct[i]; - } - scriptExec(stmt->d.s_if.t_else, pBatch, newAct); - } - freeActive(newAct); -finalize_it: - RETiRet; -} - -/* for details, see scriptExec() header comment! */ -static void -execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - sbool *newAct; - msg_t *pMsg; - int bRet; - int i; - newAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - if(*(pBatch->pbShutdownImmediate)) - return; - if(pBatch->eltState[i] == BATCH_STATE_DISC) - continue; /* will be ignored in any case */ - pMsg = pBatch->pElem[i].pMsg; - if(active == NULL || active[i]) { - if( (stmt->d.s_prifilt.pmask[pMsg->iFacility] == TABLE_NOPRI) || - ((stmt->d.s_prifilt.pmask[pMsg->iFacility] - & (1<iSeverity)) == 0) ) - bRet = 0; - else - bRet = 1; - } else - bRet = 0; - newAct[i] = bRet; - DBGPRINTF("batch: item %d PRIFILT %d\n", i, newAct[i]); - } - - if(stmt->d.s_prifilt.t_then != NULL) { - scriptExec(stmt->d.s_prifilt.t_then, pBatch, newAct); - } - if(stmt->d.s_prifilt.t_else != NULL) { - for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - if(*(pBatch->pbShutdownImmediate)) - return; - if(pBatch->eltState[i] != BATCH_STATE_DISC - && (active == NULL || active[i])) - newAct[i] = !newAct[i]; - } - scriptExec(stmt->d.s_prifilt.t_else, pBatch, newAct); - } - freeActive(newAct); -} - - -/* helper to execPROPFILT(), as the evaluation itself is quite lengthy */ -static int -evalPROPFILT(struct cnfstmt *stmt, msg_t *pMsg) -{ - unsigned short pbMustBeFreed; - uchar *pszPropVal; - int bRet = 0; - rs_size_t propLen; - - if(stmt->d.s_propfilt.prop.id == PROP_INVALID) - goto done; - - pszPropVal = MsgGetProp(pMsg, NULL, &stmt->d.s_propfilt.prop, - &propLen, &pbMustBeFreed, NULL); - - /* Now do the compares (short list currently ;)) */ - switch(stmt->d.s_propfilt.operation ) { - case FIOP_CONTAINS: - if(rsCStrLocateInSzStr(stmt->d.s_propfilt.pCSCompValue, (uchar*) pszPropVal) != -1) - bRet = 1; - break; - case FIOP_ISEMPTY: - if(propLen == 0) - bRet = 1; /* process message! */ - break; - case FIOP_ISEQUAL: - if(rsCStrSzStrCmp(stmt->d.s_propfilt.pCSCompValue, - pszPropVal, propLen) == 0) - bRet = 1; /* process message! */ - break; - case FIOP_STARTSWITH: - if(rsCStrSzStrStartsWithCStr(stmt->d.s_propfilt.pCSCompValue, - pszPropVal, propLen) == 0) - bRet = 1; /* process message! */ - break; - case FIOP_REGEX: - if(rsCStrSzStrMatchRegex(stmt->d.s_propfilt.pCSCompValue, - (unsigned char*) pszPropVal, 0, &stmt->d.s_propfilt.regex_cache) == RS_RET_OK) - bRet = 1; - break; - case FIOP_EREREGEX: - if(rsCStrSzStrMatchRegex(stmt->d.s_propfilt.pCSCompValue, - (unsigned char*) pszPropVal, 1, &stmt->d.s_propfilt.regex_cache) == RS_RET_OK) - bRet = 1; - break; - default: - /* here, it handles NOP (for performance reasons) */ - assert(stmt->d.s_propfilt.operation == FIOP_NOP); - bRet = 1; /* as good as any other default ;) */ - break; - } - - /* now check if the value must be negated */ - if(stmt->d.s_propfilt.isNegated) - bRet = (bRet == 1) ? 0 : 1; - - if(Debug) { - if(stmt->d.s_propfilt.prop.id == PROP_CEE) { - DBGPRINTF("Filter: check for CEE property '%s' (value '%s') ", - stmt->d.s_propfilt.prop.name, pszPropVal); - } else if(stmt->d.s_propfilt.prop.id == PROP_LOCAL_VAR) { - DBGPRINTF("Filter: check for local var '%s' (value '%s') ", - stmt->d.s_propfilt.prop.name, pszPropVal); - } else if(stmt->d.s_propfilt.prop.id == PROP_GLOBAL_VAR) { - DBGPRINTF("Filter: check for global var '%s' (value '%s') ", - stmt->d.s_propfilt.prop.name, pszPropVal); - } else { - DBGPRINTF("Filter: check for property '%s' (value '%s') ", - propIDToName(stmt->d.s_propfilt.prop.id), pszPropVal); - } - if(stmt->d.s_propfilt.isNegated) - DBGPRINTF("NOT "); - if(stmt->d.s_propfilt.operation == FIOP_ISEMPTY) { - DBGPRINTF("%s : %s\n", - getFIOPName(stmt->d.s_propfilt.operation), - bRet ? "TRUE" : "FALSE"); - } else { - DBGPRINTF("%s '%s': %s\n", - getFIOPName(stmt->d.s_propfilt.operation), - rsCStrGetSzStrNoNULL(stmt->d.s_propfilt.pCSCompValue), - bRet ? "TRUE" : "FALSE"); - } - } - - /* cleanup */ - if(pbMustBeFreed) - free(pszPropVal); -done: - return bRet; -} - -/* for details, see scriptExec() header comment! */ -static void -execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) -{ - sbool *thenAct; - sbool bRet; - int i; - thenAct = newActive(pBatch); - for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) { - if(*(pBatch->pbShutdownImmediate)) - return; - if(pBatch->eltState[i] == BATCH_STATE_DISC) - continue; /* will be ignored in any case */ - if(active == NULL || active[i]) { - bRet = evalPROPFILT(stmt, pBatch->pElem[i].pMsg); - } else - bRet = 0; - thenAct[i] = bRet; - DBGPRINTF("batch: item %d PROPFILT %d\n", i, thenAct[i]); - } - - scriptExec(stmt->d.s_propfilt.t_then, pBatch, thenAct); - freeActive(thenAct); -} - -/* The rainerscript execution engine. It is debatable if that would be better - * contained in grammer/rainerscript.c, HOWEVER, that file focusses primarily - * on the parsing and object creation part. So as an actual executor, it is - * better suited here. - * param active: if NULL, all messages are active (to be processed), if non-null - * this is an array of the same size as the batch. If 1, the message - * is to be processed, otherwise not. - * NOTE: this function must receive batches which contain a single ruleset ONLY! - * rgerhards, 2012-09-04 - */ -static rsRetVal -scriptExec(struct cnfstmt *root, batch_t *pBatch, sbool *active) -{ - DEFiRet; - struct cnfstmt *stmt; - - for(stmt = root ; stmt != NULL ; stmt = stmt->next) { - if(Debug) { - dbgprintf("scriptExec: batch of %d elements, active %p, active[0]:%d\n", - batchNumMsgs(pBatch), active, (active == NULL ? 1 : active[0])); - cnfstmtPrintOnly(stmt, 2, 0); - } - switch(stmt->nodetype) { - case S_NOP: - break; - case S_STOP: - execStop(pBatch, active); - break; - case S_ACT: - execAct(stmt, pBatch, active); - break; - case S_SET: - execSet(stmt, pBatch, active); - break; - case S_UNSET: - execUnset(stmt, pBatch, active); - break; - case S_CALL: - execCall(stmt, pBatch, active); - break; - case S_IF: - execIf(stmt, pBatch, active); - break; - case S_PRIFILT: - execPRIFILT(stmt, pBatch, active); - break; - case S_PROPFILT: - execPROPFILT(stmt, pBatch, active); - break; - default: - dbgprintf("error: unknown stmt type %u during exec\n", - (unsigned) stmt->nodetype); - break; - } - } - RETiRet; -} - - /* Process (consume) a batch of messages. Calls the actions configured. * If the whole batch uses a singel ruleset, we can process the batch as * a whole. Otherwise, we need to process it slower, on a message-by-message @@ -599,9 +227,9 @@ if(pBatch->bSingleRuleset) { pThis = batchGetRuleset(pBatch); if(pThis == NULL) - pThis = ourConf->rulesets.pDflt; + pThis = pDfltRuleset; ISOBJ_TYPE_assert(pThis, ruleset); - CHKiRet(scriptExec(pThis->root, pBatch, NULL)); + CHKiRet(llExecFunc(&pThis->llRules, processBatchDoRules, pBatch)); } else { CHKiRet(processBatchMultiRuleset(pBatch)); } @@ -617,27 +245,40 @@ * rgerhards, 2009-11-04 */ static parserList_t* -GetParserList(rsconf_t *conf, msg_t *pMsg) +GetParserList(msg_t *pMsg) { - return (pMsg->pRuleset == NULL) ? conf->rulesets.pDflt->pParserLst : pMsg->pRuleset->pParserLst; + return (pMsg->pRuleset == NULL) ? pDfltRuleset->pParserLst : pMsg->pRuleset->pParserLst; } -/* Add a script block to the current ruleset */ -static void -addScript(ruleset_t *pThis, struct cnfstmt *script) +/* Add a new rule to the end of the current rule set. We do a number + * of checks and ignore the rule if it does not pass them. + */ +static rsRetVal +addRule(ruleset_t *pThis, rule_t **ppRule) { - if(pThis->last == NULL) - pThis->root = pThis->last = script; - else { - pThis->last->next = script; - pThis->last = script; + int iActionCnt; + DEFiRet; + + ISOBJ_TYPE_assert(pThis, ruleset); + ISOBJ_TYPE_assert(*ppRule, rule); + + CHKiRet(llGetNumElts(&(*ppRule)->llActList, &iActionCnt)); + if(iActionCnt == 0) { + errmsg.LogError(0, NO_ERRCODE, "warning: selector line without actions will be discarded"); + rule.Destruct(ppRule); + } else { + CHKiRet(llAppend(&pThis->llRules, NULL, *ppRule)); + dbgprintf("selector line successfully processed\n"); } + +finalize_it: + RETiRet; } /* set name for ruleset */ -static rsRetVal rulesetSetName(ruleset_t *pThis, uchar *pszName) +static rsRetVal setName(ruleset_t *pThis, uchar *pszName) { DEFiRet; free(pThis->pszName); @@ -653,9 +294,9 @@ * is really much more natural to return the pointer directly. */ static ruleset_t* -GetCurrent(rsconf_t *conf) +GetCurrent(void) { - return conf->rulesets.pCurr; + return pCurrRuleset; } @@ -675,13 +316,13 @@ /* Find the ruleset with the given name and return a pointer to its object. */ rsRetVal -rulesetGetRuleset(rsconf_t *conf, ruleset_t **ppRuleset, uchar *pszName) +rulesetGetRuleset(ruleset_t **ppRuleset, uchar *pszName) { DEFiRet; assert(ppRuleset != NULL); assert(pszName != NULL); - CHKiRet(llFind(&(conf->rulesets.llRulesets), pszName, (void*) ppRuleset)); + CHKiRet(llFind(&llRulesets, pszName, (void*) ppRuleset)); finalize_it: RETiRet; @@ -691,43 +332,56 @@ /* Set a new default rule set. If the default can not be found, no change happens. */ static rsRetVal -SetDefaultRuleset(rsconf_t *conf, uchar *pszName) +SetDefaultRuleset(uchar *pszName) { ruleset_t *pRuleset; DEFiRet; assert(pszName != NULL); - CHKiRet(rulesetGetRuleset(conf, &pRuleset, pszName)); - conf->rulesets.pDflt = pRuleset; - DBGPRINTF("default rule set changed to %p: '%s'\n", pRuleset, pszName); + CHKiRet(rulesetGetRuleset(&pRuleset, pszName)); + pDfltRuleset = pRuleset; + dbgprintf("default rule set changed to %p: '%s'\n", pRuleset, pszName); finalize_it: RETiRet; } -/* Set a new current rule set. If the ruleset can not be found, no change happens */ +/* Set a new current rule set. If the ruleset can not be found, no change happens. + */ static rsRetVal -SetCurrRuleset(rsconf_t *conf, uchar *pszName) +SetCurrRuleset(uchar *pszName) { ruleset_t *pRuleset; DEFiRet; assert(pszName != NULL); - CHKiRet(rulesetGetRuleset(conf, &pRuleset, pszName)); - conf->rulesets.pCurr = pRuleset; - DBGPRINTF("current rule set changed to %p: '%s'\n", pRuleset, pszName); + CHKiRet(rulesetGetRuleset(&pRuleset, pszName)); + pCurrRuleset = pRuleset; + dbgprintf("current rule set changed to %p: '%s'\n", pRuleset, pszName); finalize_it: RETiRet; } +/* destructor we need to destruct rules inside our linked list contents. + */ +static rsRetVal +doRuleDestruct(void *pData) +{ + rule_t *pRule = (rule_t *) pData; + DEFiRet; + rule.Destruct(&pRule); + RETiRet; +} + + /* Standard-Constructor */ BEGINobjConstruct(ruleset) /* be sure to specify the object type also in END macro! */ - pThis->root = NULL; - pThis->last = NULL; + CHKiRet(llInit(&pThis->llRules, doRuleDestruct, NULL, NULL)); +finalize_it: ENDobjConstruct(ruleset) @@ -735,7 +389,7 @@ * This also adds the rule set to the list of all known rulesets. */ static rsRetVal -rulesetConstructFinalize(rsconf_t *conf, ruleset_t *pThis) +rulesetConstructFinalize(ruleset_t *pThis) { uchar *keyName; DEFiRet; @@ -746,11 +400,14 @@ * two separate copies. */ CHKmalloc(keyName = ustrdup(pThis->pszName)); - CHKiRet(llAppend(&(conf->rulesets.llRulesets), keyName, pThis)); + CHKiRet(llAppend(&llRulesets, keyName, pThis)); + + /* this now also is the new current ruleset */ + pCurrRuleset = pThis; /* and also the default, if so far none has been set */ - if(conf->rulesets.pDflt == NULL) - conf->rulesets.pDflt = pThis; + if(pDfltRuleset == NULL) + pDfltRuleset = pThis; finalize_it: RETiRet; @@ -760,17 +417,28 @@ /* destructor for the ruleset object */ BEGINobjDestruct(ruleset) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(ruleset) - DBGPRINTF("destructing ruleset %p, name %p\n", pThis, pThis->pszName); + dbgprintf("destructing ruleset %p, name %p\n", pThis, pThis->pszName); if(pThis->pQueue != NULL) { qqueueDestruct(&pThis->pQueue); } if(pThis->pParserLst != NULL) { parser.DestructParserList(&pThis->pParserLst); } + llDestroy(&pThis->llRules); free(pThis->pszName); - cnfstmtDestructLst(pThis->root); ENDobjDestruct(ruleset) +/* this is a special destructor for the linkedList class. LinkedList does NOT + * provide a pointer to the pointer, but rather the raw pointer itself. So we + * must map this, otherwise the destructor will abort. + */ +static rsRetVal +rulesetDestructForLinkedList(void *pData) +{ + ruleset_t *pThis = (ruleset_t*) pData; + return rulesetDestruct(&pThis); +} + /* destruct ALL rule sets that reside in the system. This must * be callable before unloading this module as the module may @@ -779,36 +447,28 @@ * everything runs stable again. -- rgerhards, 2009-06-10 */ static rsRetVal -destructAllActions(rsconf_t *conf) +destructAllActions(void) { DEFiRet; - CHKiRet(llDestroy(&(conf->rulesets.llRulesets))); - CHKiRet(llInit(&(conf->rulesets.llRulesets), rulesetDestructForLinkedList, rulesetKeyDestruct, strcasecmp)); - conf->rulesets.pDflt = NULL; + CHKiRet(llDestroy(&llRulesets)); + CHKiRet(llInit(&llRulesets, rulesetDestructForLinkedList, keyDestruct, strcasecmp)); + pDfltRuleset = NULL; finalize_it: RETiRet; } -/* this is a special destructor for the linkedList class. LinkedList does NOT - * provide a pointer to the pointer, but rather the raw pointer itself. So we - * must map this, otherwise the destructor will abort. - */ -rsRetVal -rulesetDestructForLinkedList(void *pData) +/* helper for debugPrint(), initiates rule printing */ +DEFFUNC_llExecFunc(doDebugPrintRule) { - ruleset_t *pThis = (ruleset_t*) pData; - return rulesetDestruct(&pThis); + return rule.DebugPrint((rule_t*) pData); } - /* debugprint for the ruleset object */ BEGINobjDebugPrint(ruleset) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDebugPrint(ruleset) dbgoprint((obj_t*) pThis, "rsyslog ruleset %s:\n", pThis->pszName); - cnfstmtPrint(pThis->root, 0); - dbgoprint((obj_t*) pThis, "ruleset %s assigned parser list:\n", pThis->pszName); - printParserList(pThis->pParserLst); + llExecFunc(&pThis->llRules, doDebugPrintRule, NULL); ENDobjDebugPrint(ruleset) @@ -820,49 +480,15 @@ /* debug print all rulesets */ static rsRetVal -debugPrintAll(rsconf_t *conf) +debugPrintAll(void) { DEFiRet; dbgprintf("All Rulesets:\n"); - llExecFunc(&(conf->rulesets.llRulesets), doDebugPrintAll, NULL); + llExecFunc(&llRulesets, doDebugPrintAll, NULL); dbgprintf("End of Rulesets.\n"); RETiRet; } -static inline void -rulesetOptimize(ruleset_t *pRuleset) -{ - if(Debug) { - dbgprintf("ruleset '%s' before optimization:\n", - pRuleset->pszName); - rulesetDebugPrint((ruleset_t*) pRuleset); - } - cnfstmtOptimize(pRuleset->root); - if(Debug) { - dbgprintf("ruleset '%s' after optimization:\n", - pRuleset->pszName); - rulesetDebugPrint((ruleset_t*) pRuleset); - } -} - -/* helper for rulsetOptimizeAll(), optimizes a single ruleset */ -DEFFUNC_llExecFunc(doRulesetOptimizeAll) -{ - rulesetOptimize((ruleset_t*) pData); - return RS_RET_OK; -} -/* optimize all rulesets - */ -rsRetVal -rulesetOptimizeAll(rsconf_t *conf) -{ - DEFiRet; - dbgprintf("begin ruleset optimization phase\n"); - llExecFunc(&(conf->rulesets.llRulesets), doRulesetOptimizeAll, NULL); - dbgprintf("ruleset optimization phase finished.\n"); - RETiRet; -} - /* Create a ruleset-specific "main" queue for this ruleset. If one is already * defined, an error message is emitted but nothing else is done. @@ -871,19 +497,19 @@ * considered acceptable for the time being. * rgerhards, 2009-10-27 */ -static inline rsRetVal -doRulesetCreateQueue(rsconf_t *conf, int *pNewVal) +static rsRetVal +rulesetCreateQueue(void __attribute__((unused)) *pVal, int *pNewVal) { uchar *rsname; DEFiRet; - if(conf->rulesets.pCurr == NULL) { + if(pCurrRuleset == NULL) { errmsg.LogError(0, RS_RET_NO_CURR_RULESET, "error: currently no specific ruleset specified, thus a " "queue can not be added to it"); ABORT_FINALIZE(RS_RET_NO_CURR_RULESET); } - if(conf->rulesets.pCurr->pQueue != NULL) { + if(pCurrRuleset->pQueue != NULL) { errmsg.LogError(0, RS_RET_RULES_QUEUE_EXISTS, "error: ruleset already has a main queue, can not " "add another one"); ABORT_FINALIZE(RS_RET_RULES_QUEUE_EXISTS); @@ -892,19 +518,14 @@ if(pNewVal == 0) FINALIZE; /* if it is turned off, we do not need to change anything ;) */ - rsname = (conf->rulesets.pCurr->pszName == NULL) ? (uchar*) "[ruleset]" : conf->rulesets.pCurr->pszName; + rsname = (pCurrRuleset->pszName == NULL) ? (uchar*) "[ruleset]" : pCurrRuleset->pszName; DBGPRINTF("adding a ruleset-specific \"main\" queue for ruleset '%s'\n", rsname); - CHKiRet(createMainQueue(&conf->rulesets.pCurr->pQueue, rsname, NULL)); + CHKiRet(createMainQueue(&pCurrRuleset->pQueue, rsname)); finalize_it: RETiRet; } -static rsRetVal -rulesetCreateQueue(void __attribute__((unused)) *pVal, int *pNewVal) -{ - return doRulesetCreateQueue(ourConf, pNewVal); -} /* Add a ruleset specific parser to the ruleset. Note that adding the first * parser automatically disables the default parsers. If they are needed as well, @@ -916,11 +537,13 @@ * rgerhards, 2009-11-04 */ static rsRetVal -doRulesetAddParser(ruleset_t *pRuleset, uchar *pName) +rulesetAddParser(void __attribute__((unused)) *pVal, uchar *pName) { parser_t *pParser; DEFiRet; + assert(pCurrRuleset != NULL); + CHKiRet(objUse(parser, CORE_COMPONENT)); iRet = parser.FindParser(&pParser, pName); if(iRet == RS_RET_PARSER_NOT_FOUND) { @@ -932,9 +555,10 @@ FINALIZE; } - CHKiRet(parser.AddParserToList(&pRuleset->pParserLst, pParser)); + CHKiRet(parser.AddParserToList(&pCurrRuleset->pParserLst, pParser)); - DBGPRINTF("added parser '%s' to ruleset '%s'\n", pName, pRuleset->pszName); + dbgprintf("added parser '%s' to ruleset '%s'\n", pName, pCurrRuleset->pszName); +RUNLOG_VAR("%p", pCurrRuleset->pParserLst); finalize_it: d_free(pName); /* no longer needed */ @@ -942,75 +566,6 @@ RETiRet; } -static rsRetVal -rulesetAddParser(void __attribute__((unused)) *pVal, uchar *pName) -{ - return doRulesetAddParser(ourConf->rulesets.pCurr, pName); -} - - -/* Process ruleset() objects */ -rsRetVal -rulesetProcessCnf(struct cnfobj *o) -{ - struct cnfparamvals *pvals; - rsRetVal localRet; - uchar *rsName = NULL; - uchar *parserName; - int nameIdx, parserIdx; - ruleset_t *pRuleset; - struct cnfarray *ar; - int i; - uchar *rsname; - DEFiRet; - - pvals = nvlstGetParams(o->nvlst, &rspblk, NULL); - if(pvals == NULL) { - ABORT_FINALIZE(RS_RET_CONFIG_ERROR); - } - DBGPRINTF("ruleset param blk after rulesetProcessCnf:\n"); - cnfparamsPrint(&rspblk, pvals); - nameIdx = cnfparamGetIdx(&rspblk, "name"); - rsName = (uchar*)es_str2cstr(pvals[nameIdx].val.d.estr, NULL); - localRet = rulesetGetRuleset(loadConf, &pRuleset, rsName); - if(localRet == RS_RET_OK) { - errmsg.LogError(0, RS_RET_RULESET_EXISTS, - "error: ruleset '%s' specified more than once", - rsName); - cnfstmtDestructLst(o->script); - ABORT_FINALIZE(RS_RET_RULESET_EXISTS); - } else if(localRet != RS_RET_NOT_FOUND) { - ABORT_FINALIZE(localRet); - } - CHKiRet(rulesetConstruct(&pRuleset)); - CHKiRet(rulesetSetName(pRuleset, rsName)); - CHKiRet(rulesetConstructFinalize(loadConf, pRuleset)); - addScript(pRuleset, o->script); - - /* we have only two params, so we do NOT do the usual param loop */ - parserIdx = cnfparamGetIdx(&rspblk, "parser"); - if(parserIdx != -1 && pvals[parserIdx].bUsed) { - ar = pvals[parserIdx].val.d.ar; - for(i = 0 ; i < ar->nmemb ; ++i) { - parserName = (uchar*)es_str2cstr(ar->arr[i], NULL); - doRulesetAddParser(pRuleset, parserName); - free(parserName); - } - } - - /* pick up ruleset queue parameters */ - if(queueCnfParamsSet(o->nvlst)) { - rsname = (pRuleset->pszName == NULL) ? (uchar*) "[ruleset]" : pRuleset->pszName; - DBGPRINTF("adding a ruleset-specific \"main\" queue for ruleset '%s'\n", rsname); - CHKiRet(createMainQueue(&pRuleset->pQueue, rsname, o->nvlst)); - } - -finalize_it: - free(rsName); - cnfparamvalsDestruct(pvals, &rspblk); - RETiRet; -} - /* queryInterface function * rgerhards, 2008-02-21 @@ -1033,9 +588,9 @@ pIf->IterateAllActions = iterateAllActions; pIf->DestructAllActions = destructAllActions; - pIf->AddScript = addScript; + pIf->AddRule = addRule; pIf->ProcessBatch = processBatch; - pIf->SetName = rulesetSetName; + pIf->SetName = setName; pIf->DebugPrintAll = debugPrintAll; pIf->GetCurrent = GetCurrent; pIf->GetRuleset = rulesetGetRuleset; @@ -1051,7 +606,9 @@ * rgerhards, 2009-04-06 */ BEGINObjClassExit(ruleset, OBJ_IS_CORE_MODULE) /* class, version */ + llDestroy(&llRulesets); objRelease(errmsg, CORE_COMPONENT); + objRelease(rule, CORE_COMPONENT); objRelease(parser, CORE_COMPONENT); ENDObjClassExit(ruleset) @@ -1063,11 +620,15 @@ BEGINObjClassInit(ruleset, 1, OBJ_IS_CORE_MODULE) /* class, version */ /* request objects we use */ CHKiRet(objUse(errmsg, CORE_COMPONENT)); + CHKiRet(objUse(rule, CORE_COMPONENT)); /* set our own handlers */ OBJSetMethodHandler(objMethod_DEBUGPRINT, rulesetDebugPrint); OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, rulesetConstructFinalize); + /* prepare global data */ + CHKiRet(llInit(&llRulesets, rulesetDestructForLinkedList, keyDestruct, strcasecmp)); + /* config file handlers */ CHKiRet(regCfSysLineHdlr((uchar *)"rulesetparser", 0, eCmdHdlrGetWord, rulesetAddParser, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"rulesetcreatemainqueue", 0, eCmdHdlrBinary, rulesetCreateQueue, NULL, NULL)); diff -Nru rsyslog-7.6.0/runtime/ruleset.h rsyslog-5.10.1/runtime/ruleset.h --- rsyslog-7.6.0/runtime/ruleset.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/ruleset.h 2012-10-17 14:41:20.000000000 +0000 @@ -2,7 +2,7 @@ * * This implements rulesets within rsyslog. * - * Copyright 2009-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2009-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -25,59 +25,43 @@ #include "queue.h" #include "linkedlist.h" -#include "rsconf.h" /* the ruleset object */ struct ruleset_s { BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + linkedList_t llRules; /* this is NOT a pointer - no typo here ;) */ uchar *pszName; /* name of our ruleset */ qqueue_t *pQueue; /* "main" message queue, if the ruleset has its own (else NULL) */ - struct cnfstmt *root; - struct cnfstmt *last; parserList_t *pParserLst;/* list of parsers to use for this ruleset */ }; /* interfaces */ BEGINinterface(ruleset) /* name must also be changed in ENDinterface macro! */ INTERFACEObjDebugPrint(ruleset); - rsRetVal (*DebugPrintAll)(rsconf_t *conf); + rsRetVal (*DebugPrintAll)(void); rsRetVal (*Construct)(ruleset_t **ppThis); - rsRetVal (*ConstructFinalize)(rsconf_t *conf, ruleset_t __attribute__((unused)) *pThis); + rsRetVal (*ConstructFinalize)(ruleset_t __attribute__((unused)) *pThis); rsRetVal (*Destruct)(ruleset_t **ppThis); - rsRetVal (*DestructAllActions)(rsconf_t *conf); + rsRetVal (*IterateAllActions)(rsRetVal (*pFunc)(void*, void*), void* pParam); + rsRetVal (*DestructAllActions)(void); + rsRetVal (*AddRule)(ruleset_t *pThis, rule_t **ppRule); rsRetVal (*SetName)(ruleset_t *pThis, uchar *pszName); rsRetVal (*ProcessBatch)(batch_t*); - rsRetVal (*GetRuleset)(rsconf_t *conf, ruleset_t **ppThis, uchar*); - rsRetVal (*SetDefaultRuleset)(rsconf_t *conf, uchar*); - rsRetVal (*SetCurrRuleset)(rsconf_t *conf, uchar*); - ruleset_t* (*GetCurrent)(rsconf_t *conf); + rsRetVal (*GetRuleset)(ruleset_t **ppThis, uchar*); + rsRetVal (*SetDefaultRuleset)(uchar*); + rsRetVal (*SetCurrRuleset)(uchar*); + ruleset_t* (*GetCurrent)(void); qqueue_t* (*GetRulesetQueue)(ruleset_t*); /* v3, 2009-11-04 */ - parserList_t* (*GetParserList)(rsconf_t *conf, msg_t *); - /* v5, 2011-04-19 - * added support for the rsconf object -- fundamental change - * v6, 2011-07-15 - * removed conf ptr from SetName, AddRule as the flex/bison based - * system uses globals in any case. - */ - /* v7, 2012-09-04 */ - /* AddRule() removed */ - /*TODO:REMOVE*/rsRetVal (*IterateAllActions)(rsconf_t *conf, rsRetVal (*pFunc)(void*, void*), void* pParam); - void (*AddScript)(ruleset_t *pThis, struct cnfstmt *script); + parserList_t* (*GetParserList)(msg_t *); + /* v4 */ ENDinterface(ruleset) -#define rulesetCURR_IF_VERSION 7 /* increment whenever you change the interface structure! */ +#define rulesetCURR_IF_VERSION 4 /* increment whenever you change the interface structure! */ /* prototypes */ PROTOTYPEObj(ruleset); -/* TODO: remove these -- currently done dirty for config file - * redo -- rgerhards, 2011-04-19 - * rgerhards, 2012-04-19: actually, it may be way cooler not to remove - * them and use plain c-style conventions at least inside core objects. - */ -rsRetVal rulesetDestructForLinkedList(void *pData); -rsRetVal rulesetKeyDestruct(void __attribute__((unused)) *pData); /* Get name associated to ruleset. This function cannot fail (except, * of course, if previously something went really wrong). Returned @@ -90,24 +74,6 @@ return pRuleset->pszName; } -/* returns 1 if the ruleset has a queue associtated, 0 if not */ -static inline int -rulesetHasQueue(ruleset_t *pRuleset) -{ - return pRuleset->pQueue == NULL ? 0 : 1; -} - -/* we will most probably convert this module back to traditional C - * calling sequence, so here we go... - */ -rsRetVal rulesetGetRuleset(rsconf_t *conf, ruleset_t **ppRuleset, uchar *pszName); -rsRetVal rulesetOptimizeAll(rsconf_t *conf); -rsRetVal rulesetProcessCnf(struct cnfobj *o); - -/* Set a current rule set to already-known pointer */ -static inline void -rulesetSetCurrRulesetPtr(ruleset_t *pRuleset) { - loadConf->rulesets.pCurr = pRuleset; -} +rsRetVal rulesetGetRuleset(ruleset_t **ppRuleset, uchar *pszName); #endif /* #ifndef INCLUDED_RULESET_H */ diff -Nru rsyslog-7.6.0/runtime/sd-daemon.c rsyslog-5.10.1/runtime/sd-daemon.c --- rsyslog-7.6.0/runtime/sd-daemon.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/sd-daemon.c 2012-09-18 15:03:58.000000000 +0000 @@ -25,18 +25,14 @@ ***/ #ifndef _GNU_SOURCE -# define _GNU_SOURCE +#define _GNU_SOURCE #endif #include #include #include #include -#ifdef __BIONIC__ -# include -#else -# include -#endif +#include #include #include #include @@ -44,28 +40,10 @@ #include #include #include -#include -#include - -#if defined(__linux__) -# include -#endif #include "sd-daemon.h" -#if (__GNUC__ >= 4) -# ifdef SD_EXPORT_SYMBOLS -/* Export symbols */ -# define _sd_export_ __attribute__ ((visibility("default"))) -# else -/* Don't export the symbols */ -# define _sd_export_ __attribute__ ((visibility("hidden"))) -# endif -#else -# define _sd_export_ -#endif - -_sd_export_ int sd_listen_fds(int unset_environment) { +int sd_listen_fds(int unset_environment) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) return 0; @@ -75,8 +53,7 @@ char *p = NULL; unsigned long l; - e = getenv("LISTEN_PID"); - if (!e) { + if (!(e = getenv("LISTEN_PID"))) { r = 0; goto finish; } @@ -89,7 +66,7 @@ goto finish; } - if (!p || p == e || *p || l <= 0) { + if (!p || *p || l <= 0) { r = -EINVAL; goto finish; } @@ -100,8 +77,7 @@ goto finish; } - e = getenv("LISTEN_FDS"); - if (!e) { + if (!(e = getenv("LISTEN_FDS"))) { r = 0; goto finish; } @@ -114,7 +90,7 @@ goto finish; } - if (!p || p == e || *p) { + if (!p || *p) { r = -EINVAL; goto finish; } @@ -122,8 +98,7 @@ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { int flags; - flags = fcntl(fd, F_GETFD); - if (flags < 0) { + if ((flags = fcntl(fd, F_GETFD)) < 0) { r = -errno; goto finish; } @@ -149,12 +124,13 @@ #endif } -_sd_export_ int sd_is_fifo(int fd, const char *path) { +int sd_is_fifo(int fd, const char *path) { struct stat st_fd; if (fd < 0) return -EINVAL; + memset(&st_fd, 0, sizeof(st_fd)); if (fstat(fd, &st_fd) < 0) return -errno; @@ -164,6 +140,7 @@ if (path) { struct stat st_path; + memset(&st_path, 0, sizeof(st_path)); if (stat(path, &st_path) < 0) { if (errno == ENOENT || errno == ENOTDIR) @@ -180,42 +157,6 @@ return 1; } -_sd_export_ int sd_is_special(int fd, const char *path) { - struct stat st_fd; - - if (fd < 0) - return -EINVAL; - - if (fstat(fd, &st_fd) < 0) - return -errno; - - if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) - return 0; - - if (path) { - struct stat st_path; - - if (stat(path, &st_path) < 0) { - - if (errno == ENOENT || errno == ENOTDIR) - return 0; - - return -errno; - } - - if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) - return - st_path.st_dev == st_fd.st_dev && - st_path.st_ino == st_fd.st_ino; - else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) - return st_path.st_rdev == st_fd.st_rdev; - else - return 0; - } - - return 1; -} - static int sd_is_socket_internal(int fd, int type, int listening) { struct stat st_fd; @@ -267,14 +208,13 @@ struct sockaddr_storage storage; }; -_sd_export_ int sd_is_socket(int fd, int family, int type, int listening) { +int sd_is_socket(int fd, int family, int type, int listening) { int r; if (family < 0) return -EINVAL; - r = sd_is_socket_internal(fd, type, listening); - if (r <= 0) + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) return r; if (family > 0) { @@ -296,7 +236,7 @@ return 1; } -_sd_export_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { +int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { union sockaddr_union sockaddr; socklen_t l; int r; @@ -304,8 +244,7 @@ if (family != 0 && family != AF_INET && family != AF_INET6) return -EINVAL; - r = sd_is_socket_internal(fd, type, listening); - if (r <= 0) + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) return r; memset(&sockaddr, 0, sizeof(sockaddr)); @@ -342,13 +281,12 @@ return 1; } -_sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { +int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { union sockaddr_union sockaddr; socklen_t l; int r; - r = sd_is_socket_internal(fd, type, listening); - if (r <= 0) + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) return r; memset(&sockaddr, 0, sizeof(sockaddr)); @@ -364,66 +302,29 @@ return 0; if (path) { - if (length == 0) + if (length <= 0) length = strlen(path); - if (length == 0) + if (length <= 0) /* Unnamed socket */ - return l == offsetof(struct sockaddr_un, sun_path); + return l == sizeof(sa_family_t); if (path[0]) /* Normal path socket */ return - (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && + (l >= sizeof(sa_family_t) + length + 1) && memcmp(path, sockaddr.un.sun_path, length+1) == 0; else /* Abstract namespace socket */ return - (l == offsetof(struct sockaddr_un, sun_path) + length) && + (l == sizeof(sa_family_t) + length) && memcmp(path, sockaddr.un.sun_path, length) == 0; } return 1; } -_sd_export_ int sd_is_mq(int fd, const char *path) { -#if !defined(__linux__) - return 0; -#else - struct mq_attr attr; - - if (fd < 0) - return -EINVAL; - - if (mq_getattr(fd, &attr) < 0) - return -errno; - - if (path) { - char fpath[PATH_MAX]; - struct stat a, b; - - if (path[0] != '/') - return -EINVAL; - - if (fstat(fd, &a) < 0) - return -errno; - - strncpy(stpcpy(fpath, "/dev/mqueue"), path, sizeof(fpath) - 12); - fpath[sizeof(fpath)-1] = 0; - - if (stat(fpath, &b) < 0) - return -errno; - - if (a.st_dev != b.st_dev || - a.st_ino != b.st_ino) - return 0; - } - - return 1; -#endif -} - -_sd_export_ int sd_notify(int unset_environment, const char *state) { +int sd_notify(int unset_environment, const char *state) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) || !defined(SOCK_CLOEXEC) return 0; #else @@ -438,8 +339,7 @@ goto finish; } - e = getenv("NOTIFY_SOCKET"); - if (!e) + if (!(e = getenv("NOTIFY_SOCKET"))) return 0; /* Must be an abstract socket, or an absolute path */ @@ -448,8 +348,7 @@ goto finish; } - fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0); - if (fd < 0) { + if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { r = -errno; goto finish; } @@ -467,7 +366,7 @@ memset(&msghdr, 0, sizeof(msghdr)); msghdr.msg_name = &sockaddr; - msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); + msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e); if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) msghdr.msg_namelen = sizeof(struct sockaddr_un); @@ -493,7 +392,7 @@ #endif } -_sd_export_ int sd_notifyf(int unset_environment, const char *format, ...) { +int sd_notifyf(int unset_environment, const char *format, ...) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) return 0; #else @@ -515,19 +414,22 @@ #endif } -_sd_export_ int sd_booted(void) { +int sd_booted(void) { #if defined(DISABLE_SYSTEMD) || !defined(__linux__) return 0; #else - struct stat st; - /* We test whether the runtime unit file directory has been - * created. This takes place in mount-setup.c, so is - * guaranteed to happen very early during boot. */ + struct stat a, b; + + /* We simply test whether the systemd cgroup hierarchy is + * mounted */ + + if (lstat("/sys/fs/cgroup", &a) < 0) + return 0; - if (lstat("/run/systemd/system/", &st) < 0) + if (lstat("/sys/fs/cgroup/systemd", &b) < 0) return 0; - return !!S_ISDIR(st.st_mode); + return a.st_dev != b.st_dev; #endif } diff -Nru rsyslog-7.6.0/runtime/sd-daemon.h rsyslog-5.10.1/runtime/sd-daemon.h --- rsyslog-7.6.0/runtime/sd-daemon.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/sd-daemon.h 2012-09-18 15:03:58.000000000 +0000 @@ -58,21 +58,25 @@ You may find an up-to-date version of these source files online: - http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h - http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c + http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h + http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c This should compile on non-Linux systems, too, but with the exception of the sd_is_xxx() calls all functions will become NOPs. - See sd-daemon(3) for more information. + See sd-daemon(7) for more information. */ -#ifndef _sd_printf_attr_ -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) #define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) +# if defined(SD_EXPORT_SYMBOLS) +# define _sd_hidden_ +# else +# define _sd_hidden_ __attribute__ ((visibility("hidden"))) +# endif #else #define _sd_printf_attr_(a,b) -#endif +#define _sd_hidden_ #endif /* @@ -109,7 +113,7 @@ See sd_listen_fds(3) for more information. */ -int sd_listen_fds(int unset_environment); +int sd_listen_fds(int unset_environment) _sd_hidden_; /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -121,19 +125,7 @@ See sd_is_fifo(3) for more information. */ -int sd_is_fifo(int fd, const char *path); - -/* - Helper call for identifying a passed file descriptor. Returns 1 if - the file descriptor is a special character device on the file - system stored under the specified path, 0 otherwise. - If path is NULL a path name check will not be done and the call - only verifies if the file descriptor refers to a special character. - Returns a negative errno style error code on failure. - - See sd_is_special(3) for more information. -*/ -int sd_is_special(int fd, const char *path); +int sd_is_fifo(int fd, const char *path) _sd_hidden_; /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -149,7 +141,7 @@ See sd_is_socket(3) for more information. */ -int sd_is_socket(int fd, int family, int type, int listening); +int sd_is_socket(int fd, int family, int type, int listening) _sd_hidden_; /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -163,7 +155,7 @@ See sd_is_socket_inet(3) for more information. */ -int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); +int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) _sd_hidden_; /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -179,15 +171,7 @@ See sd_is_socket_unix(3) for more information. */ -int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); - -/* - Helper call for identifying a passed file descriptor. Returns 1 if - the file descriptor is a POSIX Message Queue of the specified name, - 0 otherwise. If path is NULL a message queue name check is not - done. Returns a negative errno style error code on failure. -*/ -int sd_is_mq(int fd, const char *path); +int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) _sd_hidden_; /* Informs systemd about changed daemon state. This takes a number of @@ -197,7 +181,7 @@ READY=1 Tells systemd that daemon startup is finished (only relevant for services of Type=notify). The passed argument is a boolean "1" or "0". Since there is - little value in signaling non-readiness the only + little value in signalling non-readiness the only value daemons should send is "READY=1". STATUS=... Passes a single-line status string back to systemd @@ -217,13 +201,8 @@ MAINPID=... The main pid of a daemon, in case systemd did not fork off the process itself. Example: "MAINPID=4711" - WATCHDOG=1 Tells systemd to update the watchdog timestamp. - Services using this feature should do this in - regular intervals. A watchdog framework can use the - timestamps to detect failed services. - Daemons can choose to send additional variables. However, it is - recommended to prefix variable names not listed above with X_. + recommened to prefix variable names not listed above with X_. Returns a negative errno-style error code on failure. Returns > 0 if systemd could be notified, 0 if it couldn't possibly because @@ -238,7 +217,7 @@ See sd_notify(3) for more information. */ -int sd_notify(int unset_environment, const char *state); +int sd_notify(int unset_environment, const char *state) _sd_hidden_; /* Similar to sd_notify() but takes a format string. @@ -260,7 +239,7 @@ See sd_notifyf(3) for more information. */ -int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); +int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3) _sd_hidden_; /* Returns > 0 if the system was booted with systemd. Returns < 0 on @@ -269,11 +248,11 @@ fine. You should NOT protect them with a call to this function. Also note that this function checks whether the system, not the user session is controlled by systemd. However the functions above work - for both user and system services. + for both session and system services. See sd_booted(3) for more information. */ -int sd_booted(void); +int sd_booted(void) _sd_hidden_; #ifdef __cplusplus } diff -Nru rsyslog-7.6.0/runtime/sigprov.h rsyslog-5.10.1/runtime/sigprov.h --- rsyslog-7.6.0/runtime/sigprov.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/sigprov.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* The interface definition for (file) signature providers. - * - * This is just an abstract driver interface, which needs to be - * implemented by concrete classes. - * - * Copyright 2013 Adiscon GmbH. - * - * This file is part of the rsyslog runtime library. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef INCLUDED_SIGPROV_H -#define INCLUDED_SIGPROV_H - -/* interface */ -BEGINinterface(sigprov) /* name must also be changed in ENDinterface macro! */ - rsRetVal (*Construct)(void *ppThis); - rsRetVal (*SetCnfParam)(void *ppThis, struct nvlst *lst); - rsRetVal (*Destruct)(void *ppThis); - rsRetVal (*OnFileOpen)(void *pThis, uchar *fn, void *pFileInstData); - rsRetVal (*OnRecordWrite)(void *pFileInstData, uchar *rec, rs_size_t lenRec); - rsRetVal (*OnFileClose)(void *pFileInstData); -ENDinterface(sigprov) -#define sigprovCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ -#endif /* #ifndef INCLUDED_SIGPROV_H */ diff -Nru rsyslog-7.6.0/runtime/srutils.c rsyslog-5.10.1/runtime/srutils.c --- rsyslog-7.6.0/runtime/srutils.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/srutils.c 2012-10-15 13:45:04.000000000 +0000 @@ -86,17 +86,12 @@ {"mark", LOG_MARK}, /* INTERNAL */ {"news", LOG_NEWS}, {"security", LOG_AUTH}, /* DEPRECATED */ - {"bsd_security", (13<<3) }, /* BSD-specific, unfortunatly with duplicate name... */ {"syslog", LOG_SYSLOG}, {"user", LOG_USER}, {"uucp", LOG_UUCP}, #if defined(LOG_FTP) {"ftp", LOG_FTP}, #endif -#if defined(LOG_AUDIT) - {"audit", LOG_AUDIT}, -#endif - {"console", (14 << 3)}, /* BSD-specific priority */ {"local0", LOG_LOCAL0}, {"local1", LOG_LOCAL1}, {"local2", LOG_LOCAL2}, @@ -529,7 +524,8 @@ } -/* Decode a symbolic name to a numeric value */ +/* Decode a symbolic name to a numeric value + */ int decodeSyslogName(uchar *name, syslogName_t *codetab) { register syslogName_t *c; @@ -539,23 +535,22 @@ ASSERT(name != NULL); ASSERT(codetab != NULL); - DBGPRINTF("symbolic name: %s", name); - if(isdigit((int) *name)) { - DBGPRINTF("\n"); + dbgprintf("symbolic name: %s", name); + if (isdigit((int) *name)) + { + dbgprintf("\n"); return (atoi((char*) name)); } strncpy((char*) buf, (char*) name, 79); - for(p = buf; *p; p++) { + for (p = buf; *p; p++) if (isupper((int) *p)) *p = tolower((int) *p); - } - for(c = codetab; c->c_name; c++) { - if(!strcmp((char*) buf, (char*) c->c_name)) { - DBGPRINTF(" ==> %d\n", c->c_val); + for (c = codetab; c->c_name; c++) + if (!strcmp((char*) buf, (char*) c->c_name)) + { + dbgprintf(" ==> %d\n", c->c_val); return (c->c_val); } - } - DBGPRINTF("\n"); return (-1); } @@ -632,28 +627,6 @@ RETiRet; } -/* Returns 1 if the given string contains a non-escaped glob(3) - * wildcard character and 0 otherwise (or if the string is empty). - */ -int -containsGlobWildcard(char *str) -{ - char *p; - if(!str) { - return 0; - } - /* From Linux Programmer's Guide: - * "A string is a wildcard pattern if it contains one of the characters '?', '*' or '['" - * "One can remove the special meaning of '?', '*' and '[' by preceding them by a backslash" - */ - for(p = str; *p != '\0'; p++) { - if((*p == '?' || *p == '*' || *p == '[') && - (p == str || *(p-1) != '\\')) { - return 1; - } - } - return 0; -} /* vim:set ai: */ diff -Nru rsyslog-7.6.0/runtime/srUtils.h rsyslog-5.10.1/runtime/srUtils.h --- rsyslog-7.6.0/runtime/srUtils.h 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/srUtils.h 2012-10-15 13:45:04.000000000 +0000 @@ -91,7 +91,6 @@ int decodeSyslogName(uchar *name, syslogName_t *codetab); int getSubString(uchar **ppSrc, char *pDst, size_t DstSize, char cSep); rsRetVal getFileSize(uchar *pszName, off_t *pSize); -int containsGlobWildcard(char *str); /* mutex operations */ /* some useful constants */ diff -Nru rsyslog-7.6.0/runtime/statsobj.c rsyslog-5.10.1/runtime/statsobj.c --- rsyslog-7.6.0/runtime/statsobj.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/statsobj.c 2012-10-17 14:41:20.000000000 +0000 @@ -34,6 +34,7 @@ #include "unicode-helper.h" #include "obj.h" #include "statsobj.h" +#include "sysvar.h" #include "srUtils.h" #include "stringbuf.h" @@ -142,7 +143,7 @@ * is called. */ static rsRetVal -addCounter(statsobj_t *pThis, uchar *ctrName, statsCtrType_t ctrType, int8_t flags, void *pCtr) +addCounter(statsobj_t *pThis, uchar *ctrName, statsCtrType_t ctrType, void *pCtr) { ctr_t *ctr; DEFiRet; @@ -151,7 +152,6 @@ ctr->next = NULL; ctr->prev = NULL; CHKmalloc(ctr->name = ustrdup(ctrName)); - ctr->flags = flags; ctr->ctrType = ctrType; switch(ctrType) { case ctrType_IntCtr: @@ -167,79 +167,11 @@ RETiRet; } -static inline void -resetResettableCtr(ctr_t *pCtr, int8_t bResetCtrs) -{ - if(bResetCtrs && (pCtr->flags & CTR_FLAG_RESETTABLE)) { - switch(pCtr->ctrType) { - case ctrType_IntCtr: - *(pCtr->val.pIntCtr) = 0; - break; - case ctrType_Int: - *(pCtr->val.pInt) = 0; - break; - } - } -} - -/* get all the object's countes together as CEE. */ -static rsRetVal -getStatsLineCEE(statsobj_t *pThis, cstr_t **ppcstr, int cee_cookie, int8_t bResetCtrs) -{ - cstr_t *pcstr; - ctr_t *pCtr; - DEFiRet; - - CHKiRet(cstrConstruct(&pcstr)); - - if (cee_cookie == 1) - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("@cee: "), 6); - - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("{"), 1); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("name"), 4); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT(":"), 1); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); - rsCStrAppendStr(pcstr, pThis->name); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT(","), 1); - - /* now add all counters to this line */ - pthread_mutex_lock(&pThis->mutCtr); - for(pCtr = pThis->ctrRoot ; pCtr != NULL ; pCtr = pCtr->next) { - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); - rsCStrAppendStr(pcstr, pCtr->name); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); - cstrAppendChar(pcstr, ':'); - switch(pCtr->ctrType) { - case ctrType_IntCtr: - rsCStrAppendInt(pcstr, *(pCtr->val.pIntCtr)); // TODO: OK????? - break; - case ctrType_Int: - rsCStrAppendInt(pcstr, *(pCtr->val.pInt)); - break; - } - if (pCtr->next != NULL) { - cstrAppendChar(pcstr, ','); - } else { - cstrAppendChar(pcstr, '}'); - } - resetResettableCtr(pCtr, bResetCtrs); - } - pthread_mutex_unlock(&pThis->mutCtr); - - CHKiRet(cstrFinalize(pcstr)); - *ppcstr = pcstr; - -finalize_it: - RETiRet; -} /* get all the object's countes together with object name as one line. */ static rsRetVal -getStatsLine(statsobj_t *pThis, cstr_t **ppcstr, int8_t bResetCtrs) +getStatsLine(statsobj_t *pThis, cstr_t **ppcstr) { cstr_t *pcstr; ctr_t *pCtr; @@ -263,7 +195,6 @@ break; } cstrAppendChar(pcstr, ' '); - resetResettableCtr(pCtr, bResetCtrs); } pthread_mutex_unlock(&pThis->mutCtr); @@ -282,24 +213,14 @@ * line. If the callback reports an error, processing is stopped. */ static rsRetVal -getAllStatsLines(rsRetVal(*cb)(void*, cstr_t*), void *usrptr, statsFmtType_t fmt, int8_t bResetCtrs) +getAllStatsLines(rsRetVal(*cb)(void*, cstr_t*), void *usrptr) { statsobj_t *o; cstr_t *cstr; DEFiRet; for(o = objRoot ; o != NULL ; o = o->next) { - switch(fmt) { - case statsFmt_Legacy: - CHKiRet(getStatsLine(o, &cstr, bResetCtrs)); - break; - case statsFmt_CEE: - CHKiRet(getStatsLineCEE(o, &cstr, 1, bResetCtrs)); - break; - case statsFmt_JSON: - CHKiRet(getStatsLineCEE(o, &cstr, 0, bResetCtrs)); - break; - } + CHKiRet(getStatsLine(o, &cstr)); CHKiRet(cb(usrptr, cstr)); rsCStrDestruct(&cstr); } @@ -365,7 +286,7 @@ pIf->Destruct = statsobjDestruct; pIf->DebugPrint = statsobjDebugPrint; pIf->SetName = setName; - //pIf->GetStatsLine = getStatsLine; + pIf->GetStatsLine = getStatsLine; pIf->GetAllStatsLines = getAllStatsLines; pIf->AddCounter = addCounter; pIf->EnableStats = enableStats; diff -Nru rsyslog-7.6.0/runtime/statsobj.h rsyslog-5.10.1/runtime/statsobj.h --- rsyslog-7.6.0/runtime/statsobj.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/statsobj.h 2012-10-17 14:41:20.000000000 +0000 @@ -43,16 +43,6 @@ ctrType_Int } statsCtrType_t; -/* stats line format types */ -typedef enum statsFmtType_e { - statsFmt_Legacy, - statsFmt_JSON, - statsFmt_CEE -} statsFmtType_t; - -/* counter flags */ -#define CTR_FLAG_NONE 0 -#define CTR_FLAG_RESETTABLE 1 /* helper entity, the counter */ typedef struct ctr_s { @@ -62,7 +52,6 @@ intctr_t *pIntCtr; int *pInt; } val; - int8_t flags; struct ctr_s *next, *prev; } ctr_t; @@ -86,18 +75,12 @@ rsRetVal (*ConstructFinalize)(statsobj_t *pThis); rsRetVal (*Destruct)(statsobj_t **ppThis); rsRetVal (*SetName)(statsobj_t *pThis, uchar *name); - //rsRetVal (*GetStatsLine)(statsobj_t *pThis, cstr_t **ppcstr); - rsRetVal (*GetAllStatsLines)(rsRetVal(*cb)(void*, cstr_t*), void *usrptr, statsFmtType_t fmt, int8_t bResetCtr); - rsRetVal (*AddCounter)(statsobj_t *pThis, uchar *ctrName, statsCtrType_t ctrType, int8_t flags, void *pCtr); + rsRetVal (*GetStatsLine)(statsobj_t *pThis, cstr_t **ppcstr); + rsRetVal (*GetAllStatsLines)(rsRetVal(*cb)(void*, cstr_t*), void *usrptr); + rsRetVal (*AddCounter)(statsobj_t *pThis, uchar *ctrName, statsCtrType_t ctrType, void *pCtr); rsRetVal (*EnableStats)(void); ENDinterface(statsobj) -#define statsobjCURR_IF_VERSION 11 /* increment whenever you change the interface structure! */ -/* Changes - * v2-v9 rserved for future use in "older" version branches - * v10, 2012-04-01: GetAllStatsLines got fmt parameter - * v11, 2013-09-07: - add "flags" to AddCounter API - * - GetAllStatsLines got parameter telling if ctrs shall be reset - */ +#define statsobjCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ /* prototypes */ diff -Nru rsyslog-7.6.0/runtime/stream.c rsyslog-5.10.1/runtime/stream.c --- rsyslog-7.6.0/runtime/stream.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/stream.c 2012-10-17 14:41:20.000000000 +0000 @@ -16,7 +16,7 @@ * it turns out to be problematic. Then, we need to quasi-refcount the number of accesses * to the object. * - * Copyright 2008-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -45,7 +45,6 @@ #include #include #include -#include #include /* required for HP UX */ #include #include @@ -57,7 +56,6 @@ #include "stream.h" #include "unicode-helper.h" #include "module-template.h" -#include "cryprov.h" #if HAVE_SYS_PRCTL_H # include #endif @@ -67,6 +65,7 @@ # define O_LARGEFILE 0 #endif #ifndef HAVE_LSEEK64 + typedef off_t off64_t; # define lseek64(fd, offset, whence) lseek(fd, offset, whence) #endif @@ -75,14 +74,12 @@ DEFobjCurrIf(zlibw) /* forward definitions */ -static rsRetVal strmFlushInternal(strm_t *pThis, int bFlushZip); +static rsRetVal strmFlushInternal(strm_t *pThis); static rsRetVal strmWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf); static rsRetVal strmCloseFile(strm_t *pThis); static void *asyncWriterThread(void *pPtr); -static rsRetVal doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush); -static rsRetVal doZipFinish(strm_t *pThis); +static rsRetVal doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf); static rsRetVal strmPhysWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf); -static rsRetVal strmSeekCurrOffs(strm_t *pThis); /* methods */ @@ -199,7 +196,6 @@ doPhysOpen(strm_t *pThis) { int iFlags = 0; - struct stat statOpen; DEFiRet; ISOBJ_TYPE_assert(pThis, strm); @@ -237,77 +233,15 @@ ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); else ABORT_FINALIZE(RS_RET_IO_ERROR); - } - - if(pThis->tOperationsMode == STREAMMODE_READ) { - if(fstat(pThis->fd, &statOpen) == -1) { - DBGPRINTF("Error: cannot obtain inode# for file %s\n", pThis->pszCurrFName); - ABORT_FINALIZE(RS_RET_IO_ERROR); - } - pThis->inode = statOpen.st_ino; - } - - if(!ustrcmp(pThis->pszCurrFName, UCHAR_CONSTANT(_PATH_CONSOLE)) || isatty(pThis->fd)) { - DBGPRINTF("file %d is a tty-type file\n", pThis->fd); - pThis->bIsTTY = 1; - } else { - pThis->bIsTTY = 0; - } - - if(pThis->cryprov != NULL) { - CHKiRet(pThis->cryprov->OnFileOpen(pThis->cryprovData, - pThis->pszCurrFName, &pThis->cryprovFileData, - (pThis->tOperationsMode == STREAMMODE_READ) ? 'r' : 'w')); - pThis->cryprov->SetDeleteOnClose(pThis->cryprovFileData, pThis->bDeleteOnClose); - } -finalize_it: - RETiRet; -} - - -static rsRetVal -strmSetCurrFName(strm_t *pThis) -{ - DEFiRet; - - if(pThis->sType == STREAMTYPE_FILE_CIRCULAR) { - CHKiRet(genFileName(&pThis->pszCurrFName, pThis->pszDir, pThis->lenDir, - pThis->pszFName, pThis->lenFName, pThis->iCurrFNum, pThis->iFileNumDigits)); } else { - if(pThis->pszDir == NULL) { - if((pThis->pszCurrFName = ustrdup(pThis->pszFName)) == NULL) - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + if(!ustrcmp(pThis->pszCurrFName, UCHAR_CONSTANT(_PATH_CONSOLE)) || isatty(pThis->fd)) { + DBGPRINTF("file %d is a tty-type file\n", pThis->fd); + pThis->bIsTTY = 1; } else { - CHKiRet(genFileName(&pThis->pszCurrFName, pThis->pszDir, pThis->lenDir, - pThis->pszFName, pThis->lenFName, -1, 0)); + pThis->bIsTTY = 0; } } -finalize_it: - RETiRet; -} - -/* This function checks if the actual file has changed and, if so, resets the - * offset. This is support for monitoring files. It should be called after - * deserializing the strm object and before doing any other operation on it - * (most importantly not an open or seek!). - */ -static rsRetVal -CheckFileChange(strm_t *pThis) -{ - struct stat statName; - DEFiRet; - CHKiRet(strmSetCurrFName(pThis)); - if(stat((char*) pThis->pszCurrFName, &statName) == -1) - ABORT_FINALIZE(RS_RET_IO_ERROR); - DBGPRINTF("stream/after deserialize checking for file change on '%s', " - "inode %u/%u, size/currOffs %llu/%llu\n", - pThis->pszCurrFName, (unsigned) pThis->inode, - (unsigned) statName.st_ino, statName.st_size, pThis->iCurrOffs); - if(pThis->inode != statName.st_ino || statName.st_size < pThis->iCurrOffs) { - DBGPRINTF("stream: file %s has changed\n", pThis->pszCurrFName); - pThis->iCurrOffs = 0; - } finalize_it: RETiRet; } @@ -330,8 +264,19 @@ if(pThis->pszFName == NULL) ABORT_FINALIZE(RS_RET_FILE_PREFIX_MISSING); - CHKiRet(strmSetCurrFName(pThis)); - + if(pThis->sType == STREAMTYPE_FILE_CIRCULAR) { + CHKiRet(genFileName(&pThis->pszCurrFName, pThis->pszDir, pThis->lenDir, + pThis->pszFName, pThis->lenFName, pThis->iCurrFNum, pThis->iFileNumDigits)); + } else { + if(pThis->pszDir == NULL) { + if((pThis->pszCurrFName = ustrdup(pThis->pszFName)) == NULL) + ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + } else { + CHKiRet(genFileName(&pThis->pszCurrFName, pThis->pszDir, pThis->lenDir, + pThis->pszFName, pThis->lenFName, -1, 0)); + } + } + CHKiRet(doPhysOpen(pThis)); pThis->iCurrOffs = 0; @@ -389,7 +334,6 @@ */ static rsRetVal strmCloseFile(strm_t *pThis) { - off64_t currOffs; DEFiRet; ASSERT(pThis != NULL); @@ -397,33 +341,18 @@ (pThis->pszFName == NULL) ? "N/A" : (char*)pThis->pszFName); if(pThis->tOperationsMode != STREAMMODE_READ) { - strmFlushInternal(pThis, 0); - if(pThis->iZipLevel) { - doZipFinish(pThis); - } + strmFlushInternal(pThis); if(pThis->bAsyncWrite) { strmWaitAsyncWriterDone(pThis); } } - /* if we have a signature provider, we must make sure that the crypto - * state files are opened and proper close processing happens. */ - if(pThis->cryprov != NULL && pThis->fd == -1) { - strmOpenFile(pThis); - } - /* the file may already be closed (or never have opened), so guard * against this. -- rgerhards, 2010-03-19 */ if(pThis->fd != -1) { - currOffs = lseek64(pThis->fd, 0, SEEK_CUR); close(pThis->fd); pThis->fd = -1; - pThis->inode = 0; - if(pThis->cryprov != NULL) { - pThis->cryprov->OnFileClose(pThis->cryprovFileData, currOffs); - pThis->cryprovFileData = NULL; - } } if(pThis->fdDir != -1) { @@ -432,13 +361,7 @@ pThis->fdDir = -1; } - if(pThis->bDeleteOnClose) { - if(pThis->pszCurrFName == NULL) { - CHKiRet(genFileName(&pThis->pszCurrFName, pThis->pszDir, pThis->lenDir, - pThis->pszFName, pThis->lenFName, pThis->iCurrFNum, - pThis->iFileNumDigits)); - } - DBGPRINTF("strmCloseFile: deleting '%s'\n", pThis->pszCurrFName); + if(pThis->bDeleteOnClose && pThis->pszCurrFName != NULL) { if(unlink((char*) pThis->pszCurrFName) == -1) { char errStr[1024]; int err = errno; @@ -446,13 +369,12 @@ DBGPRINTF("error %d unlinking '%s' - ignored: %s\n", errno, pThis->pszCurrFName, errStr); } - free(pThis->pszCurrFName); + free(pThis->pszCurrFName); /* no longer needed in any case (just for open) */ pThis->pszCurrFName = NULL; } pThis->iCurrOffs = 0; /* we are back at begin of file */ -finalize_it: RETiRet; } @@ -499,15 +421,18 @@ strmHandleEOFMonitor(strm_t *pThis) { DEFiRet; + struct stat statOpen; struct stat statName; ISOBJ_TYPE_assert(pThis, strm); + if(fstat(pThis->fd, &statOpen) == -1) + ABORT_FINALIZE(RS_RET_IO_ERROR); if(stat((char*) pThis->pszCurrFName, &statName) == -1) ABORT_FINALIZE(RS_RET_IO_ERROR); - DBGPRINTF("stream checking for file change on '%s', inode %u/%u\n", - pThis->pszCurrFName, (unsigned) pThis->inode, + DBGPRINTF("stream checking for file change on '%s', inode %u/%u", + pThis->pszCurrFName, (unsigned) statOpen.st_ino, (unsigned) statName.st_ino); - if(pThis->inode == statName.st_ino) { + if(statOpen.st_ino == statName.st_ino) { ABORT_FINALIZE(RS_RET_EOF); } else { /* we had a file change! */ @@ -558,14 +483,11 @@ * rgerhards, 2008-02-13 */ static rsRetVal -strmReadBuf(strm_t *pThis, int *padBytes) +strmReadBuf(strm_t *pThis) { DEFiRet; int bRun; long iLenRead; - size_t actualDataLen; - size_t toRead; - ssize_t bytesLeft; ISOBJ_TYPE_assert(pThis, strm); /* We need to try read at least twice because we may run into EOF and need to switch files. */ @@ -576,35 +498,13 @@ * rgerhards, 2008-02-13 */ CHKiRet(strmOpenFile(pThis)); - if(pThis->cryprov == NULL) { - toRead = pThis->sIOBufSize; - } else { - CHKiRet(pThis->cryprov->GetBytesLeftInBlock(pThis->cryprovFileData, &bytesLeft)); - if(bytesLeft == -1 || bytesLeft > (ssize_t) pThis->sIOBufSize) { - toRead = pThis->sIOBufSize; - } else { - toRead = (size_t) bytesLeft; - } - } - iLenRead = read(pThis->fd, pThis->pIOBuf, toRead); + iLenRead = read(pThis->fd, pThis->pIOBuf, pThis->sIOBufSize); DBGOPRINT((obj_t*) pThis, "file %d read %ld bytes\n", pThis->fd, iLenRead); - /* end crypto */ if(iLenRead == 0) { CHKiRet(strmHandleEOF(pThis)); } else if(iLenRead < 0) ABORT_FINALIZE(RS_RET_IO_ERROR); else { /* good read */ - /* here we place our crypto interface */ - if(pThis->cryprov != NULL) { - actualDataLen = iLenRead; - pThis->cryprov->Decrypt(pThis->cryprovFileData, pThis->pIOBuf, &actualDataLen); - *padBytes = iLenRead - actualDataLen; - iLenRead = actualDataLen; - DBGOPRINT((obj_t*) pThis, "encrypted file %d pad bytes %d, actual " - "data %ld\n", pThis->fd, *padBytes, iLenRead); - } else { - *padBytes = 0; - } pThis->iBufPtrMax = iLenRead; bRun = 0; /* exit loop */ } @@ -626,7 +526,6 @@ */ static rsRetVal strmReadChar(strm_t *pThis, uchar *pC) { - int padBytes = 0; /* in crypto mode, we may have some padding (non-data) bytes */ DEFiRet; ASSERT(pThis != NULL); @@ -642,9 +541,8 @@ /* do we need to obtain a new buffer? */ if(pThis->iBufPtr >= pThis->iBufPtrMax) { - CHKiRet(strmReadBuf(pThis, &padBytes)); + CHKiRet(strmReadBuf(pThis)); } - pThis->iCurrOffs += padBytes; /* if we reach this point, we have data available in the buffer */ @@ -680,61 +578,45 @@ * destruction of the returned CStr object! -- dlang 2010-12-13 */ static rsRetVal -strmReadLine(strm_t *pThis, cstr_t **ppCStr, uint8_t mode, sbool bEscapeLF) +strmReadLine(strm_t *pThis, cstr_t **ppCStr, int mode) { /* mode = 0 single line mode (equivalent to ReadLine) * mode = 1 LFLF mode (paragraph, blank line between entries) * mode = 2 LF mode, a log line starts at the beginning of a line, but following lines that are indented are part of the same log entry * This modal interface is not nearly as flexible as being able to define a regex for when a new record starts, but it's also not nearly as hard (or as slow) to implement */ + DEFiRet; uchar c; uchar finished; - rsRetVal readCharRet; - sbool bPrevWasNL; - DEFiRet; ASSERT(pThis != NULL); ASSERT(ppCStr != NULL); CHKiRet(cstrConstruct(ppCStr)); - CHKiRet(strmReadChar(pThis, &c)); - if(mode == 0) { - /* append previous message to current message if necessary */ - if(pThis->prevLineSegment != NULL) { - CHKiRet(cstrAppendCStr(*ppCStr, pThis->prevLineSegment)); - cstrDestruct(&pThis->prevLineSegment); - } - while(c != '\n') { + /* now read the line */ + CHKiRet(strmReadChar(pThis, &c)); + if (mode == 0){ + while(c != '\n') { CHKiRet(cstrAppendChar(*ppCStr, c)); - readCharRet = strmReadChar(pThis, &c); - if(readCharRet == RS_RET_EOF) {/* end of file reached without \n? */ - CHKiRet(rsCStrConstructFromCStr(&pThis->prevLineSegment, *ppCStr)); - } - CHKiRet(readCharRet); + CHKiRet(strmReadChar(pThis, &c)); } CHKiRet(cstrFinalize(*ppCStr)); - } else if(mode == 1) { + } + if (mode == 1){ finished=0; - bPrevWasNL = 0; while(finished == 0){ if(c != '\n') { CHKiRet(cstrAppendChar(*ppCStr, c)); CHKiRet(strmReadChar(pThis, &c)); - bPrevWasNL = 0; } else { if ((((*ppCStr)->iStrLen) > 0) ){ - if(bPrevWasNL) { - rsCStrTruncate(*ppCStr, (bEscapeLF) ? 4 : 1); /* remove the prior newline */ + if ((*ppCStr)->pBuf[(*ppCStr)->iStrLen -1 ] == '\n'){ + rsCStrTruncate(*ppCStr,1); /* remove the prior newline */ finished=1; } else { - if(bEscapeLF) { - CHKiRet(rsCStrAppendStrWithLen(*ppCStr, (uchar*)"#012", sizeof("#012")-1)); - } else { - CHKiRet(cstrAppendChar(*ppCStr, c)); - } + CHKiRet(cstrAppendChar(*ppCStr, c)); CHKiRet(strmReadChar(pThis, &c)); - bPrevWasNL = 1; } } else { finished=1; /* this is a blank line, a \n with nothing since the last complete record */ @@ -742,10 +624,10 @@ } } CHKiRet(cstrFinalize(*ppCStr)); - } else if(mode == 2) { + } + if (mode == 2){ /* indented follow-up lines */ finished=0; - bPrevWasNL = 0; while(finished == 0){ if ((*ppCStr)->iStrLen == 0){ if(c != '\n') { @@ -756,31 +638,22 @@ finished=1; /* this is a blank line, a \n with nothing since the last complete record */ } } else { - if(bPrevWasNL) { + if ((*ppCStr)->pBuf[(*ppCStr)->iStrLen -1 ] != '\n'){ + /* not the first character after a newline, add it to the buffer */ + CHKiRet(cstrAppendChar(*ppCStr, c)); + CHKiRet(strmReadChar(pThis, &c)); + } else { if ((c == ' ') || (c == '\t')){ CHKiRet(cstrAppendChar(*ppCStr, c)); CHKiRet(strmReadChar(pThis, &c)); - bPrevWasNL = 0; } else { /* clean things up by putting the character we just read back into * the input buffer and removing the LF character that is currently at the * end of the output string */ CHKiRet(strmUnreadChar(pThis, c)); - rsCStrTruncate(*ppCStr, (bEscapeLF) ? 4 : 1); + rsCStrTruncate(*ppCStr,1); finished=1; } - } else { /* not the first character after a newline, add it to the buffer */ - if(c == '\n') { - bPrevWasNL = 1; - if(bEscapeLF) { - CHKiRet(rsCStrAppendStrWithLen(*ppCStr, (uchar*)"#012", sizeof("#012")-1)); - } else { - CHKiRet(cstrAppendChar(*ppCStr, c)); - } - } else { - CHKiRet(cstrAppendChar(*ppCStr, c)); - } - CHKiRet(strmReadChar(pThis, &c)); } } } @@ -802,11 +675,9 @@ pThis->fd = -1; pThis->fdDir = -1; pThis->iUngetC = -1; - pThis->bVeryReliableZip = 0; pThis->sType = STREAMTYPE_FILE_SINGLE; pThis->sIOBufSize = glblGetIOBufSize(); pThis->tOpenMode = 0600; - pThis->prevLineSegment = NULL; ENDobjConstruct(strm) @@ -906,7 +777,6 @@ BEGINobjDestruct(strm) /* be sure to specify the object type also in END and CODESTART macros! */ int i; CODESTARTobjDestruct(strm) - /* we need to stop the ZIP writer */ if(pThis->bAsyncWrite) /* Note: mutex will be unlocked in stopWriter! */ d_pthread_mutex_lock(&pThis->mut); @@ -1049,14 +919,14 @@ /* write memory buffer to a stream object. */ static inline rsRetVal -doWriteInternal(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush) +doWriteInternal(strm_t *pThis, uchar *pBuf, size_t lenBuf) { DEFiRet; ASSERT(pThis != NULL); if(pThis->iZipLevel) { - CHKiRet(doZipWrite(pThis, pBuf, lenBuf, bFlush)); + CHKiRet(doZipWrite(pThis, pBuf, lenBuf)); } else { /* write without zipping */ CHKiRet(strmPhysWrite(pThis, pBuf, lenBuf)); @@ -1101,7 +971,7 @@ * the background thread. -- rgerhards, 2009-07-07 */ static rsRetVal -strmSchedWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlushZip) +strmSchedWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf) { DEFiRet; @@ -1120,7 +990,7 @@ if(pThis->bAsyncWrite) { CHKiRet(doAsyncWriteInternal(pThis, lenBuf)); } else { - CHKiRet(doWriteInternal(pThis, pBuf, lenBuf, bFlushZip)); + CHKiRet(doWriteInternal(pThis, pBuf, lenBuf)); } @@ -1141,20 +1011,17 @@ sbool bTimedOut = 0; strm_t *pThis = (strm_t*) pPtr; int err; - uchar thrdName[256] = "rs:"; ISOBJ_TYPE_assert(pThis, strm); BEGINfunc - ustrncpy(thrdName+3, pThis->pszFName, sizeof(thrdName)-4); - dbgOutputTID((char*)thrdName); # if HAVE_PRCTL && defined PR_SET_NAME - if(prctl(PR_SET_NAME, (char*)thrdName, 0, 0, 0) != 0) { + if(prctl(PR_SET_NAME, "rs:asyn strmwr", 0, 0, 0) != 0) { DBGPRINTF("prctl failed, not setting thread name for '%s'\n", "stream writer"); } # endif - d_pthread_mutex_lock(&pThis->mut); while(1) { /* loop broken inside */ + d_pthread_mutex_lock(&pThis->mut); while(pThis->iCnt == 0) { if(pThis->bStopWriter) { pthread_cond_broadcast(&pThis->isEmpty); @@ -1163,17 +1030,18 @@ } if(bTimedOut && pThis->iBufPtr > 0) { /* if we timed out, we need to flush pending data */ - strmFlushInternal(pThis, 0); + strmFlushInternal(pThis); bTimedOut = 0; - d_pthread_mutex_unlock(&pThis->mut); - continue; + continue; /* now we should have data */ } bTimedOut = 0; timeoutComp(&t, pThis->iFlushInterval * 1000); /* *1000 millisconds */ if(pThis->bDoTimedWait) { if((err = pthread_cond_timedwait(&pThis->notEmpty, &pThis->mut, &t)) != 0) { - bTimedOut = 1; /* simulate in any case */ - if(err != ETIMEDOUT) { + if(err == ETIMEDOUT) { + bTimedOut = 1; + } else { + bTimedOut = 1; char errStr[1024]; rs_strerror_r(err, errStr, sizeof(errStr)); DBGPRINTF("stream async writer timeout with error (%d): %s - ignoring\n", @@ -1188,12 +1056,8 @@ bTimedOut = 0; /* we may have timed out, but there *is* work to do... */ iDeq = pThis->iDeq++ % STREAM_ASYNC_NUMBUFS; - - /* now we can do the actual write in parallel */ - d_pthread_mutex_unlock(&pThis->mut); - doWriteInternal(pThis, pThis->asyncBuf[iDeq].pBuf, pThis->asyncBuf[iDeq].lenBuf, 0); // TODO: flush state + doWriteInternal(pThis, pThis->asyncBuf[iDeq].pBuf, pThis->asyncBuf[iDeq].lenBuf); // TODO: error check????? 2009-07-06 - d_pthread_mutex_lock(&pThis->mut); --pThis->iCnt; if(pThis->iCnt < STREAM_ASYNC_NUMBUFS) { @@ -1201,8 +1065,8 @@ if(pThis->iCnt == 0) pthread_cond_broadcast(&pThis->isEmpty); } + d_pthread_mutex_unlock(&pThis->mut); } - d_pthread_mutex_unlock(&pThis->mut); finalize_it: ENDfunc @@ -1264,16 +1128,9 @@ DEFiRet; ISOBJ_TYPE_assert(pThis, strm); - DBGPRINTF("strmPhysWrite, stream %p, len %u\n", pThis, (unsigned)lenBuf); if(pThis->fd == -1) CHKiRet(strmOpenFile(pThis)); - /* here we place our crypto interface */ - if(pThis->cryprov != NULL) { - pThis->cryprov->Encrypt(pThis->cryprovFileData, pBuf, &lenBuf); - } - /* end crypto */ - iWritten = lenBuf; CHKiRet(doWriteCall(pThis, pBuf, &iWritten)); @@ -1309,97 +1166,63 @@ * rgerhards, 2009-06-04 */ static rsRetVal -doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush) +doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf) { + z_stream zstrm; int zRet; /* zlib return state */ + sbool bzInitDone = RSFALSE; DEFiRet; - unsigned outavail; assert(pThis != NULL); assert(pBuf != NULL); - if(!pThis->bzInitDone) { - /* allocate deflate state */ - pThis->zstrm.zalloc = Z_NULL; - pThis->zstrm.zfree = Z_NULL; - pThis->zstrm.opaque = Z_NULL; - /* see note in file header for the params we use with deflateInit2() */ - zRet = zlibw.DeflateInit2(&pThis->zstrm, pThis->iZipLevel, Z_DEFLATED, 31, 9, Z_DEFAULT_STRATEGY); - if(zRet != Z_OK) { - DBGPRINTF("error %d returned from zlib/deflateInit2()\n", zRet); - ABORT_FINALIZE(RS_RET_ZLIB_ERR); - } - pThis->bzInitDone = RSTRUE; + /* allocate deflate state */ + zstrm.zalloc = Z_NULL; + zstrm.zfree = Z_NULL; + zstrm.opaque = Z_NULL; + zstrm.next_in = (Bytef*) pBuf; /* as of zlib doc, this must be set BEFORE DeflateInit2 */ + /* see note in file header for the params we use with deflateInit2() */ + zRet = zlibw.DeflateInit2(&zstrm, pThis->iZipLevel, Z_DEFLATED, 31, 9, Z_DEFAULT_STRATEGY); + if(zRet != Z_OK) { + DBGPRINTF("error %d returned from zlib/deflateInit2()\n", zRet); + ABORT_FINALIZE(RS_RET_ZLIB_ERR); } + bzInitDone = RSTRUE; /* now doing the compression */ - pThis->zstrm.next_in = (Bytef*) pBuf; - pThis->zstrm.avail_in = lenBuf; + zstrm.next_in = (Bytef*) pBuf; /* as of zlib doc, this must be set BEFORE DeflateInit2 */ + zstrm.avail_in = lenBuf; /* run deflate() on buffer until everything has been compressed */ do { - DBGPRINTF("in deflate() loop, avail_in %d, total_in %ld\n", pThis->zstrm.avail_in, pThis->zstrm.total_in); - pThis->zstrm.avail_out = pThis->sIOBufSize; - pThis->zstrm.next_out = pThis->pZipBuf; - zRet = zlibw.Deflate(&pThis->zstrm, bFlush ? Z_SYNC_FLUSH : Z_NO_FLUSH); /* no bad return value */ - DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet, pThis->zstrm.avail_out); - outavail =pThis->sIOBufSize - pThis->zstrm.avail_out; - if(outavail != 0) { - CHKiRet(strmPhysWrite(pThis, (uchar*)pThis->pZipBuf, outavail)); - } - } while (pThis->zstrm.avail_out == 0); + DBGPRINTF("in deflate() loop, avail_in %d, total_in %ld\n", zstrm.avail_in, zstrm.total_in); + zstrm.avail_out = pThis->sIOBufSize; + zstrm.next_out = pThis->pZipBuf; + zRet = zlibw.Deflate(&zstrm, Z_FINISH); /* no bad return value */ + DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet, zstrm.avail_out); + assert(zRet != Z_STREAM_ERROR); /* state not clobbered */ + if(zstrm.avail_out == pThis->sIOBufSize) + break; /* this is valid, indicates end of compression --> see zlib howto */ + CHKiRet(strmPhysWrite(pThis, (uchar*)pThis->pZipBuf, pThis->sIOBufSize - zstrm.avail_out)); + } while (zstrm.avail_out == 0); + assert(zstrm.avail_in == 0); /* all input will be used */ finalize_it: - if(pThis->bzInitDone && pThis->bVeryReliableZip) { - doZipFinish(pThis); - } - RETiRet; -} - - - -/* finish zlib buffer, to be called before closing the ZIP file (if - * running in stream mode). - */ -static rsRetVal -doZipFinish(strm_t *pThis) -{ - int zRet; /* zlib return state */ - DEFiRet; - unsigned outavail; - assert(pThis != NULL); - - if(!pThis->bzInitDone) - goto done; - - pThis->zstrm.avail_in = 0; - /* run deflate() on buffer until everything has been compressed */ - do { - DBGPRINTF("in deflate() loop, avail_in %d, total_in %ld\n", pThis->zstrm.avail_in, pThis->zstrm.total_in); - pThis->zstrm.avail_out = pThis->sIOBufSize; - pThis->zstrm.next_out = pThis->pZipBuf; - zRet = zlibw.Deflate(&pThis->zstrm, Z_FINISH); /* no bad return value */ - DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet, pThis->zstrm.avail_out); - outavail = pThis->sIOBufSize - pThis->zstrm.avail_out; - if(outavail != 0) { - CHKiRet(strmPhysWrite(pThis, (uchar*)pThis->pZipBuf, outavail)); + if(bzInitDone) { + zRet = zlibw.DeflateEnd(&zstrm); + if(zRet != Z_OK) { + DBGPRINTF("error %d returned from zlib/deflateEnd()\n", zRet); } - } while (pThis->zstrm.avail_out == 0); - -finalize_it: - zRet = zlibw.DeflateEnd(&pThis->zstrm); - if(zRet != Z_OK) { - DBGPRINTF("error %d returned from zlib/deflateEnd()\n", zRet); } - pThis->bzInitDone = 0; -done: RETiRet; + RETiRet; } + /* flush stream output buffer to persistent storage. This can be called at any time * and is automatically called when the output buffer is full. * rgerhards, 2008-01-10 */ static rsRetVal -strmFlushInternal(strm_t *pThis, int bFlushZip) +strmFlushInternal(strm_t *pThis) { DEFiRet; @@ -1409,7 +1232,7 @@ (long) pThis->iBufPtr, (pThis->iBufPtr == 0) ? " (no need to flush)" : ""); if(pThis->tOperationsMode != STREAMMODE_READ && pThis->iBufPtr > 0) { - iRet = strmSchedWrite(pThis, pThis->pIOBuf, pThis->iBufPtr, bFlushZip); + iRet = strmSchedWrite(pThis, pThis->pIOBuf, pThis->iBufPtr); } RETiRet; @@ -1431,7 +1254,7 @@ if(pThis->bAsyncWrite) d_pthread_mutex_lock(&pThis->mut); - CHKiRet(strmFlushInternal(pThis, 1)); + CHKiRet(strmFlushInternal(pThis)); finalize_it: if(pThis->bAsyncWrite) @@ -1454,15 +1277,11 @@ if(pThis->fd == -1) { CHKiRet(strmOpenFile(pThis)); } else { - CHKiRet(strmFlushInternal(pThis, 0)); + CHKiRet(strmFlushInternal(pThis)); } long long i; DBGOPRINT((obj_t*) pThis, "file %d seek, pos %llu\n", pThis->fd, (long long unsigned) offs); - i = lseek64(pThis->fd, offs, SEEK_SET); - if(i != offs) { - DBGPRINTF("strmSeek: error %lld seeking to offset %lld\n", i, offs); - ABORT_FINALIZE(RS_RET_IO_ERROR); - } + i = lseek64(pThis->fd, offs, SEEK_SET); // TODO: check error! pThis->iCurrOffs = offs; /* we are now at *this* offset */ pThis->iBufPtr = 0; /* buffer invalidated */ @@ -1470,83 +1289,17 @@ RETiRet; } -/* multi-file seek, seeks to file number & offset within file. This - * is a support function for the queue, in circular mode. DO NOT USE - * IT FOR OTHER NEEDS - it may not work as expected. It will - * seek to the new position and delete interim files, as it skips them. - * Note: this code can be removed when the queue gets a new disk store - * handler (if and when it does ;)). - * The output parameter bytesDel receives the number of bytes that have - * been deleted (if a file is deleted) or 0 if nothing was deleted. - * rgerhards, 2012-11-07 - */ -rsRetVal -strmMultiFileSeek(strm_t *pThis, int FNum, off64_t offs, off64_t *bytesDel) -{ - struct stat statBuf; - DEFiRet; - - ISOBJ_TYPE_assert(pThis, strm); - - if(FNum == 0 && offs == 0) { /* happens during queue init */ - *bytesDel = 0; - FINALIZE; - } - - if(pThis->iCurrFNum != FNum) { - /* Note: we assume that no more than one file is skipped - an - * assumption that is being used also by the whole rest of the - * code and most notably the queue subsystem. - */ - CHKiRet(genFileName(&pThis->pszCurrFName, pThis->pszDir, pThis->lenDir, - pThis->pszFName, pThis->lenFName, pThis->iCurrFNum, - pThis->iFileNumDigits)); - stat((char*)pThis->pszCurrFName, &statBuf); - *bytesDel = statBuf.st_size; - DBGPRINTF("strmMultiFileSeek: detected new filenum, was %d, new %d, " - "deleting '%s' (%lld bytes)\n", pThis->iCurrFNum, FNum, - pThis->pszCurrFName, (long long) *bytesDel); - unlink((char*)pThis->pszCurrFName); - if(pThis->cryprov != NULL) - pThis->cryprov->DeleteStateFiles(pThis->pszCurrFName); - free(pThis->pszCurrFName); - pThis->pszCurrFName = NULL; - pThis->iCurrFNum = FNum; - } else { - *bytesDel = 0; - } - pThis->iCurrOffs = offs; - -finalize_it: - RETiRet; -} - /* seek to current offset. This is primarily a helper to readjust the OS file * pointer after a strm object has been deserialized. */ static rsRetVal strmSeekCurrOffs(strm_t *pThis) { - off64_t targetOffs; - uchar c; DEFiRet; ISOBJ_TYPE_assert(pThis, strm); - if(pThis->cryprov == NULL || pThis->tOperationsMode != STREAMMODE_READ) { - iRet = strmSeek(pThis, pThis->iCurrOffs); - FINALIZE; - } - - /* As the cryprov may use CBC or similiar things, we need to read skip data */ - targetOffs = pThis->iCurrOffs; - pThis->iCurrOffs = 0; - DBGOPRINT((obj_t*) pThis, "encrypted, doing skip read of %lld bytes\n", - (long long) targetOffs); - while(targetOffs != pThis->iCurrOffs) { - CHKiRet(strmReadChar(pThis, &c)); - } -finalize_it: + iRet = strmSeek(pThis, pThis->iCurrOffs); RETiRet; } @@ -1567,7 +1320,7 @@ /* if the buffer is full, we need to flush before we can write */ if(pThis->iBufPtr == pThis->sIOBufSize) { - CHKiRet(strmFlushInternal(pThis, 0)); + CHKiRet(strmFlushInternal(pThis)); } /* we now always have space for one character, so we simply copy it */ *(pThis->pIOBuf + pThis->iBufPtr) = c; @@ -1627,17 +1380,17 @@ ASSERT(pThis != NULL); ASSERT(pBuf != NULL); - /* DEV DEBUG ONLY DBGPRINTF("strmWrite(%p[%s], '%65.65s', %ld);, disabled %d, sizelim %ld, size %lld\n", pThis, pThis->pszCurrFName, pBuf,(long) lenBuf, pThis->bDisabled, (long) pThis->iSizeLimit, (long long) pThis->iCurrOffs); */ - if(pThis->bDisabled) - ABORT_FINALIZE(RS_RET_STREAM_DISABLED); - +//DBGPRINTF("strmWrite(%p, '%65.65s', %ld);, disabled %d, sizelim %ld, size %lld\n", pThis, pBuf,lenBuf, pThis->bDisabled, pThis->iSizeLimit, pThis->iCurrOffs); if(pThis->bAsyncWrite) d_pthread_mutex_lock(&pThis->mut); + if(pThis->bDisabled) + ABORT_FINALIZE(RS_RET_STREAM_DISABLED); + iOffset = 0; do { if(pThis->iBufPtr == pThis->sIOBufSize) { - CHKiRet(strmFlushInternal(pThis, 0)); /* get a new buffer for rest of data */ + CHKiRet(strmFlushInternal(pThis)); /* get a new buffer for rest of data */ } iWrite = pThis->sIOBufSize - pThis->iBufPtr; /* this fits in current buf */ if(iWrite > lenBuf) @@ -1652,7 +1405,7 @@ * write it. This seems more natural than waiting (hours?) for the next message... */ if(pThis->iBufPtr == pThis->sIOBufSize) { - CHKiRet(strmFlushInternal(pThis, 0)); /* get a new buffer for rest of data */ + CHKiRet(strmFlushInternal(pThis)); /* get a new buffer for rest of data */ } finalize_it: @@ -1673,29 +1426,18 @@ /* property set methods */ /* simple ones first */ -DEFpropSetMeth(strm, iMaxFileSize, int64) +DEFpropSetMeth(strm, bDeleteOnClose, int) +DEFpropSetMeth(strm, iMaxFileSize, int) DEFpropSetMeth(strm, iFileNumDigits, int) DEFpropSetMeth(strm, tOperationsMode, int) DEFpropSetMeth(strm, tOpenMode, mode_t) DEFpropSetMeth(strm, sType, strmType_t) DEFpropSetMeth(strm, iZipLevel, int) -DEFpropSetMeth(strm, bVeryReliableZip, int) DEFpropSetMeth(strm, bSync, int) DEFpropSetMeth(strm, sIOBufSize, size_t) DEFpropSetMeth(strm, iSizeLimit, off_t) DEFpropSetMeth(strm, iFlushInterval, int) DEFpropSetMeth(strm, pszSizeLimitCmd, uchar*) -DEFpropSetMeth(strm, cryprov, cryprov_if_t*) -DEFpropSetMeth(strm, cryprovData, void*) - -static rsRetVal strmSetbDeleteOnClose(strm_t *pThis, int val) -{ - pThis->bDeleteOnClose = val; - if(pThis->cryprov != NULL) { - pThis->cryprov->SetDeleteOnClose(pThis->cryprovFileData, pThis->bDeleteOnClose); - } - return RS_RET_OK; -} static rsRetVal strmSetiMaxFiles(strm_t *pThis, int iNewVal) { @@ -1822,7 +1564,7 @@ ISOBJ_TYPE_assert(pThis, strm); ISOBJ_TYPE_assert(pStrm, strm); - strmFlushInternal(pThis, 0); + strmFlushInternal(pThis); CHKiRet(obj.BeginSerialize(pStrm, (obj_t*) pThis)); objSerializeSCALAR(pStrm, iCurrFNum, INT); @@ -1842,11 +1584,6 @@ l = pThis->iCurrOffs; objSerializeSCALAR_VAR(pStrm, iCurrOffs, INT64, l); - l = pThis->inode; - objSerializeSCALAR_VAR(pStrm, inode, INT64, l); - - objSerializePTR(pStrm, prevLineSegment, PSZ); - CHKiRet(obj.EndSerialize(pStrm)); finalize_it: @@ -1944,8 +1681,6 @@ CHKiRet(strmSettOpenMode(pThis, pProp->val.num)); } else if(isProp("iCurrOffs")) { pThis->iCurrOffs = pProp->val.num; - } else if(isProp("inode")) { - pThis->inode = (ino_t) pProp->val.num; } else if(isProp("iMaxFileSize")) { CHKiRet(strmSetiMaxFileSize(pThis, pProp->val.num)); } else if(isProp("iMaxFiles")) { @@ -1954,8 +1689,6 @@ CHKiRet(strmSetiFileNumDigits(pThis, pProp->val.num)); } else if(isProp("bDeleteOnClose")) { CHKiRet(strmSetbDeleteOnClose(pThis, pProp->val.num)); - } else if(isProp("prevLineSegment")) { - CHKiRet(rsCStrConstructFromCStr(&pThis->prevLineSegment, pProp->val.pStr)); } finalize_it: @@ -2015,7 +1748,6 @@ pIf->GetCurrOffset = strmGetCurrOffset; pIf->Dup = strmDup; pIf->SetWCntr = strmSetWCntr; - pIf->CheckFileChange = CheckFileChange; /* set methods */ pIf->SetbDeleteOnClose = strmSetbDeleteOnClose; pIf->SetiMaxFileSize = strmSetiMaxFileSize; @@ -2025,14 +1757,11 @@ pIf->SettOpenMode = strmSettOpenMode; pIf->SetsType = strmSetsType; pIf->SetiZipLevel = strmSetiZipLevel; - pIf->SetbVeryReliableZip = strmSetbVeryReliableZip; pIf->SetbSync = strmSetbSync; pIf->SetsIOBufSize = strmSetsIOBufSize; pIf->SetiSizeLimit = strmSetiSizeLimit; pIf->SetiFlushInterval = strmSetiFlushInterval; pIf->SetpszSizeLimitCmd = strmSetpszSizeLimitCmd; - pIf->Setcryprov = strmSetcryprov; - pIf->SetcryprovData = strmSetcryprovData; finalize_it: ENDobjQueryInterface(strm) diff -Nru rsyslog-7.6.0/runtime/stream.h rsyslog-5.10.1/runtime/stream.h --- rsyslog-7.6.0/runtime/stream.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/stream.h 2012-10-17 14:41:20.000000000 +0000 @@ -41,7 +41,7 @@ * deflateInit2(zstrmptr, 6, Z_DEFLATED, 31, 9, Z_DEFAULT_STRATEGY); * -------------------------------------------------------------------------- * - * Copyright 2008-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008, 2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -66,12 +66,11 @@ #define STREAM_H_INCLUDED #include -#include #include "obj-types.h" #include "glbl.h" #include "stream.h" #include "zlibw.h" -#include "cryprov.h" +#include "apc.h" /* stream types */ typedef enum { @@ -114,7 +113,6 @@ int lenDir; int fd; /* the file descriptor, -1 if closed */ int fdDir; /* the directory's descriptor, in case bSync is requested (-1 if closed) */ - ino_t inode; /* current inode for files being monitored (undefined else) */ uchar *pszCurrFName; /* name of current file (if open) */ uchar *pIOBuf; /* the iobuffer currently in use to gather data */ size_t iBufPtrMax; /* current max Ptr in Buffer (if partial read!) */ @@ -127,30 +125,25 @@ sbool bAsyncWrite; /* do asynchronous writes (always if a flush interval is given) */ sbool bStopWriter; /* shall writer thread terminate? */ sbool bDoTimedWait; /* instruct writer thread to do a times wait to support flush timeouts */ - sbool bzInitDone; /* did we do an init of zstrm already? */ - sbool bVeryReliableZip; /* shall we write interim headers to create a very reliable ZIP file? */ int iFlushInterval; /* flush in which interval - 0, no flushing */ + apc_id_t apcID; /* id of current Apc request (used for cancelling) */ pthread_mutex_t mut;/* mutex for flush in async mode */ pthread_cond_t notFull; pthread_cond_t notEmpty; pthread_cond_t isEmpty; unsigned short iEnq; /* this MUST be unsigned as we use module arithmetic (else invalid indexing happens!) */ unsigned short iDeq; /* this MUST be unsigned as we use module arithmetic (else invalid indexing happens!) */ - cryprov_if_t *cryprov; /* ptr to crypto provider; NULL = do not encrypt */ - void *cryprovData; /* opaque data ptr for provider use */ - void *cryprovFileData;/* opaque data ptr for file instance */ short iCnt; /* current nbr of elements in buffer */ - z_stream zstrm; /* zip stream to use */ struct { uchar *pBuf; size_t lenBuf; } asyncBuf[STREAM_ASYNC_NUMBUFS]; pthread_t writerThreadID; + int apcRequested; /* is an apc Requested? */ /* support for omfile size-limiting commands, special counters, NOT persisted! */ off_t iSizeLimit; /* file size limit, 0 = no limit */ uchar *pszSizeLimitCmd; /* command to carry out when size limit is reached */ sbool bIsTTY; /* is this a tty file? */ - cstr_t *prevLineSegment; /* for ReadLine, previous, unwritten part of file */ } strm_t; @@ -159,6 +152,7 @@ rsRetVal (*Construct)(strm_t **ppThis); rsRetVal (*ConstructFinalize)(strm_t *pThis); rsRetVal (*Destruct)(strm_t **ppThis); + rsRetVal (*SetMaxFileSize)(strm_t *pThis, int64 iMaxFileSize); rsRetVal (*SetFileName)(strm_t *pThis, uchar *pszName, size_t iLenName); rsRetVal (*ReadChar)(strm_t *pThis, uchar *pC); rsRetVal (*UnreadChar)(strm_t *pThis, uchar c); @@ -176,7 +170,7 @@ rsRetVal (*SetWCntr)(strm_t *pThis, number_t *pWCnt); rsRetVal (*Dup)(strm_t *pThis, strm_t **ppNew); INTERFACEpropSetMeth(strm, bDeleteOnClose, int); - INTERFACEpropSetMeth(strm, iMaxFileSize, int64); + INTERFACEpropSetMeth(strm, iMaxFileSize, int); INTERFACEpropSetMeth(strm, iMaxFiles, int); INTERFACEpropSetMeth(strm, iFileNumDigits, int); INTERFACEpropSetMeth(strm, tOperationsMode, int); @@ -189,25 +183,12 @@ INTERFACEpropSetMeth(strm, iFlushInterval, int); INTERFACEpropSetMeth(strm, pszSizeLimitCmd, uchar*); /* v6 added */ - rsRetVal (*ReadLine)(strm_t *pThis, cstr_t **ppCStr, uint8_t mode, sbool bEscapeLF); - /* v7 added 2012-09-14 */ - INTERFACEpropSetMeth(strm, bVeryReliableZip, int); - /* v8 added 2013-03-21 */ - rsRetVal (*CheckFileChange)(strm_t *pThis); - /* v9 added 2013-04-04 */ - INTERFACEpropSetMeth(strm, cryprov, cryprov_if_t*); - INTERFACEpropSetMeth(strm, cryprovData, void*); + rsRetVal (*ReadLine)(strm_t *pThis, cstr_t **ppCStr, int mode); ENDinterface(strm) -#define strmCURR_IF_VERSION 10 /* increment whenever you change the interface structure! */ -/* V10, 2013-09-10: added new parameter bEscapeLF, changed mode to uint8_t (rgerhards) */ +#define strmCURR_IF_VERSION 6 /* increment whenever you change the interface structure! */ -static inline int -strmGetCurrFileNum(strm_t *pStrm) { - return pStrm->iCurrFNum; -} /* prototypes */ PROTOTYPEObjClassInit(strm); -rsRetVal strmMultiFileSeek(strm_t *pThis, int fileNum, off64_t offs, off64_t *bytesDel); #endif /* #ifndef STREAM_H_INCLUDED */ diff -Nru rsyslog-7.6.0/runtime/stringbuf.c rsyslog-5.10.1/runtime/stringbuf.c --- rsyslog-7.6.0/runtime/stringbuf.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/stringbuf.c 2012-10-17 14:41:20.000000000 +0000 @@ -32,9 +32,7 @@ #include #include #include -#include #include -#include #include "rsyslog.h" #include "stringbuf.h" #include "srUtils.h" @@ -104,84 +102,6 @@ RETiRet; } - -/* a helper function for rsCStr*Strf() - */ -static rsRetVal rsCStrConstructFromszStrv(cstr_t **ppThis, char *fmt, va_list ap) __attribute__((format(gnu_printf,2, 0))); -static rsRetVal rsCStrConstructFromszStrv(cstr_t **ppThis, char *fmt, va_list ap) -{ - DEFiRet; - cstr_t *pThis; - va_list ap2; - int len; - - assert(ppThis != NULL); - - va_copy(ap2, ap); - len = vsnprintf(NULL, 0, (char*)fmt, ap2); - va_end(ap2); - - if(len < 0) - ABORT_FINALIZE(RS_RET_ERR); - - CHKiRet(rsCStrConstruct(&pThis)); - - pThis->iBufSize = pThis->iStrLen = len; - len++; /* account for the \0 written by vsnprintf */ - if((pThis->pBuf = (uchar*) MALLOC(sizeof(uchar) * len)) == NULL) { - RSFREEOBJ(pThis); - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - } - - vsnprintf((char*)pThis->pBuf, len, (char*)fmt, ap); - *ppThis = pThis; -finalize_it: - RETiRet; -} - - -/* construct from a printf-style formated string - */ -rsRetVal rsCStrConstructFromszStrf(cstr_t **ppThis, char *fmt, ...) -{ - DEFiRet; - va_list ap; - - va_start(ap, fmt); - iRet = rsCStrConstructFromszStrv(ppThis, fmt, ap); - va_end(ap); - - RETiRet; -} - - -/* construct from es_str_t string - * rgerhards 2010-12-03 - */ -rsRetVal cstrConstructFromESStr(cstr_t **ppThis, es_str_t *str) -{ - DEFiRet; - cstr_t *pThis; - - assert(ppThis != NULL); - - CHKiRet(rsCStrConstruct(&pThis)); - - pThis->iBufSize = pThis->iStrLen = es_strlen(str); - if((pThis->pBuf = (uchar*) MALLOC(sizeof(uchar) * pThis->iStrLen)) == NULL) { - RSFREEOBJ(pThis); - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - } - - /* we do NOT need to copy the \0! */ - memcpy(pThis->pBuf, es_getBufAddr(str), pThis->iStrLen); - - *ppThis = pThis; - -finalize_it: - RETiRet; -} - /* construct from CStr object. only the counted string is * copied, not the szString. * rgerhards 2005-10-18 @@ -307,27 +227,6 @@ } -/* append a printf-style formated string - */ -rsRetVal rsCStrAppendStrf(cstr_t *pThis, uchar *fmt, ...) -{ - DEFiRet; - va_list ap; - cstr_t *pStr = NULL; - - va_start(ap, fmt); - iRet = rsCStrConstructFromszStrv(&pStr, (char*)fmt, ap); - va_end(ap); - - CHKiRet(iRet); - - iRet = cstrAppendCStr(pThis, pStr); - rsCStrDestruct(&pStr); -finalize_it: - RETiRet; -} - - rsRetVal rsCStrAppendInt(cstr_t *pThis, long i) { DEFiRet; @@ -528,14 +427,12 @@ /* Trim trailing whitespace from a given string */ -rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis) +rsRetVal rsCStrTrimTrailingWhiteSpace(cstr_t *pThis) { register int i; register uchar *pC; rsCHECKVALIDOBJECT(pThis, OIDrsCStr); - if(pThis->iStrLen == 0) - goto done; /* empty string -> nothing to trim ;) */ i = pThis->iStrLen; pC = pThis->pBuf + i - 1; while(i > 0 && isspace((int)*pC)) { @@ -543,12 +440,30 @@ --i; } /* i now is the new string length! */ - if(i != (int) pThis->iStrLen) { - pThis->iStrLen = i; - pThis->pBuf[pThis->iStrLen] = '\0'; /* we always have this space */ + pThis->iStrLen = i; + + return RS_RET_OK; +} + +/* Trim trailing whitespace from a given string + */ +rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis) +{ + register int i; + register uchar *pC; + rsCHECKVALIDOBJECT(pThis, OIDrsCStr); + + i = pThis->iStrLen; + pC = pThis->pBuf + i - 1; + while(i > 0 && isspace((int)*pC)) { + --pC; + --i; } + /* i now is the new string length! */ + pThis->iStrLen = i; + pThis->pBuf[pThis->iStrLen] = '0'; /* we always have this space */ -done: return RS_RET_OK; + return RS_RET_OK; } /* compare two string objects - works like strcmp(), but operates @@ -924,7 +839,13 @@ * length, so we need to actually check if they * are equal. */ - return strncmp((char*)pCS1->pBuf, (char*)psz, iLenSz); + register size_t i; + for(i = 0 ; i < iLenSz ; ++i) { + if(pCS1->pBuf[i] != psz[i]) + return pCS1->pBuf[i] - psz[i]; + } + /* if we arrive here, the strings are equal */ + return 0; } else return pCS1->iStrLen - iLenSz; diff -Nru rsyslog-7.6.0/runtime/stringbuf.h rsyslog-5.10.1/runtime/stringbuf.h --- rsyslog-7.6.0/runtime/stringbuf.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/stringbuf.h 2012-10-17 14:41:20.000000000 +0000 @@ -33,7 +33,6 @@ #define _STRINGBUF_H_INCLUDED__ 1 #include -#include /** * The dynamic string buffer object. @@ -55,10 +54,8 @@ */ rsRetVal cstrConstruct(cstr_t **ppThis); #define rsCStrConstruct(x) cstrConstruct((x)) -rsRetVal cstrConstructFromESStr(cstr_t **ppThis, es_str_t *str); rsRetVal rsCStrConstructFromszStr(cstr_t **ppThis, uchar *sz); rsRetVal rsCStrConstructFromCStr(cstr_t **ppThis, cstr_t *pFrom); -rsRetVal rsCStrConstructFromszStrf(cstr_t **ppThis, char *fmt, ...) __attribute__((format(printf,2, 3))); /** * Destruct the string buffer object. @@ -155,6 +152,7 @@ */ rsRetVal rsCStrTruncate(cstr_t *pThis, size_t nTrunc); +rsRetVal rsCStrTrimTrailingWhiteSpace(cstr_t *pThis); rsRetVal cstrTrimTrailingWhiteSpace(cstr_t *pThis); /** @@ -173,12 +171,6 @@ */ rsRetVal rsCStrAppendStrWithLen(cstr_t *pThis, uchar* psz, size_t iStrLen); -/** - * Append a printf-style formated string to the buffer. - * - * \param fmt pointer to the format string (see man 3 printf for details). Must not be NULL. - */ -rsRetVal rsCStrAppendStrf(cstr_t *pThis, uchar *fmt, ...); /** * Append an integer to the string. No special formatting is diff -Nru rsyslog-7.6.0/runtime/strmsrv.c rsyslog-5.10.1/runtime/strmsrv.c --- rsyslog-7.6.0/runtime/strmsrv.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/strmsrv.c 2012-10-15 13:45:04.000000000 +0000 @@ -70,7 +70,6 @@ #include "netstrm.h" #include "nssel.h" #include "errmsg.h" -#include "prop.h" #include "unicode-helper.h" MODULE_TYPE_LIB @@ -90,7 +89,6 @@ DEFobjCurrIf(netstrms) DEFobjCurrIf(netstrm) DEFobjCurrIf(nssel) -DEFobjCurrIf(prop) /* forward definitions */ static rsRetVal create_strm_socket(strmsrv_t *pThis); @@ -420,7 +418,7 @@ int iSess = -1; struct sockaddr_storage *addr; uchar *fromHostFQDN = NULL; - prop_t *ip = NULL; + uchar *fromHostIP = NULL; ISOBJ_TYPE_assert(pThis, strmsrv); assert(pLstnInfo != NULL); @@ -446,7 +444,7 @@ /* get the host name */ CHKiRet(netstrm.GetRemoteHName(pNewStrm, &fromHostFQDN)); - CHKiRet(netstrm.GetRemoteIP(pNewStrm, &ip)); + CHKiRet(netstrm.GetRemoteIP(pNewStrm, &fromHostIP)); CHKiRet(netstrm.GetRemAddr(pNewStrm, &addr)); /* TODO: check if we need to strip the domain name here -- rgerhards, 2008-04-24 */ @@ -469,8 +467,8 @@ */ CHKiRet(strms_sess.SetHost(pSess, fromHostFQDN)); fromHostFQDN = NULL; /* we handed this string over */ - CHKiRet(strms_sess.SetHostIP(pSess, ip)); - ip = NULL; /* we handed this string over */ + CHKiRet(strms_sess.SetHostIP(pSess, fromHostIP)); + fromHostIP = NULL; /* we handed this string over */ CHKiRet(strms_sess.SetStrm(pSess, pNewStrm)); pNewStrm = NULL; /* prevent it from being freed in error handler, now done in strms_sess! */ CHKiRet(strms_sess.ConstructFinalize(pSess)); @@ -491,8 +489,7 @@ if(pNewStrm != NULL) netstrm.Destruct(&pNewStrm); free(fromHostFQDN); - if(ip != NULL) - prop.Destruct(&ip); + free(fromHostIP); } RETiRet; @@ -911,7 +908,6 @@ objRelease(strms_sess, DONT_LOAD_LIB); objRelease(conf, CORE_COMPONENT); objRelease(glbl, CORE_COMPONENT); - objRelease(prop, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(netstrms, DONT_LOAD_LIB); objRelease(nssel, DONT_LOAD_LIB); @@ -934,7 +930,6 @@ CHKiRet(objUse(strms_sess, DONT_LOAD_LIB)); CHKiRet(objUse(conf, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); /* set our own handlers */ OBJSetMethodHandler(objMethod_DEBUGPRINT, strmsrvDebugPrint); diff -Nru rsyslog-7.6.0/runtime/strmsrv.h rsyslog-5.10.1/runtime/strmsrv.h --- rsyslog-7.6.0/runtime/strmsrv.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/strmsrv.h 2012-09-23 10:29:49.000000000 +0000 @@ -43,7 +43,7 @@ uchar *pszInputName; /**< value to be used as input name */ permittedPeers_t *pPermPeers;/**< driver's permitted peers */ int iLstnMax; /**< max nbr of listeners currently supported */ - netstrm_t **ppLstn; /**< our netstream listeners */ + netstrm_t **ppLstn; /**< our netstream listners */ strmLstnPortList_t **ppLstnPort; /**< pointer to relevant listen port description */ int iSessMax; /**< max number of sessions supported */ strmLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */ diff -Nru rsyslog-7.6.0/runtime/strms_sess.c rsyslog-5.10.1/runtime/strms_sess.c --- rsyslog-7.6.0/runtime/strms_sess.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/strms_sess.c 2012-09-23 10:29:49.000000000 +0000 @@ -38,14 +38,12 @@ #include "errmsg.h" #include "netstrm.h" #include "msg.h" -#include "prop.h" #include "datetime.h" /* static data */ DEFobjStaticHelpers DEFobjCurrIf(glbl) -DEFobjCurrIf(prop) DEFobjCurrIf(errmsg) DEFobjCurrIf(netstrm) DEFobjCurrIf(datetime) @@ -88,8 +86,7 @@ } /* now destruct our own properties */ free(pThis->fromHost); - if(pThis->fromHostIP != NULL) - prop.Destruct(&pThis->fromHostIP); + free(pThis->fromHostIP); ENDobjDestruct(strms_sess) @@ -114,18 +111,17 @@ RETiRet; } -/* set the remote host's IP. Note that the caller *hands over* the property. That is, +/* set the remote host's IP. Note that the caller *hands over* the string. That is, * the caller no longer controls it once SetHostIP() has received it. Most importantly, - * the caller must not destruct it. -- rgerhards, 2008-05-16 + * the caller must not free it. -- rgerhards, 2008-05-16 */ static rsRetVal -SetHostIP(strms_sess_t *pThis, prop_t *ip) +SetHostIP(strms_sess_t *pThis, uchar *pszHostIP) { DEFiRet; ISOBJ_TYPE_assert(pThis, strms_sess); - if(pThis->fromHostIP != NULL) - prop.Destruct(&pThis->fromHostIP); - pThis->fromHostIP = ip; + free(pThis->fromHostIP); + pThis->fromHostIP = pszHostIP; RETiRet; } @@ -192,8 +188,8 @@ netstrm.Destruct(&pThis->pStrm); free(pThis->fromHost); pThis->fromHost = NULL; /* not really needed, but... */ - if(pThis->fromHostIP != NULL) - prop.Destruct(&pThis->fromHostIP); + free(pThis->fromHostIP); + pThis->fromHostIP = NULL; /* not really needed, but... */ RETiRet; } @@ -288,7 +284,6 @@ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(netstrm, LM_NETSTRMS_FILENAME)); CHKiRet(objUse(datetime, CORE_COMPONENT)); - CHKiRet(objUse(prop, CORE_COMPONENT)); CHKiRet(objUse(glbl, CORE_COMPONENT)); iMaxLine = glbl.GetMaxLine(); /* get maximum size we currently support */ diff -Nru rsyslog-7.6.0/runtime/strms_sess.h rsyslog-5.10.1/runtime/strms_sess.h --- rsyslog-7.6.0/runtime/strms_sess.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/strms_sess.h 2012-09-23 10:29:49.000000000 +0000 @@ -33,8 +33,9 @@ strmsrv_t *pSrv; /* pointer back to my server (e.g. for callbacks) */ strmLstnPortList_t *pLstnInfo; /* pointer back to listener info */ netstrm_t *pStrm; +// uchar *pMsg; /* message (fragment) received */ uchar *fromHost; - prop_t *fromHostIP; + uchar *fromHostIP; void *pUsr; /* a user-pointer */ }; @@ -53,17 +54,15 @@ rsRetVal (*SetUsrP)(strms_sess_t*, void*); void* (*GetUsrP)(strms_sess_t*); rsRetVal (*SetHost)(strms_sess_t *pThis, uchar*); - rsRetVal (*SetHostIP)(strms_sess_t *pThis, prop_t*); + rsRetVal (*SetHostIP)(strms_sess_t *pThis, uchar*); rsRetVal (*SetStrm)(strms_sess_t *pThis, netstrm_t*); rsRetVal (*SetOnMsgReceive)(strms_sess_t *pThis, rsRetVal (*OnMsgReceive)(strms_sess_t*, uchar*, int)); ENDinterface(strms_sess) -#define strms_sessCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */ +#define strms_sessCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ /* interface changes * to version v2, rgerhards, 2009-05-22 * - Data structures changed * - SetLstnInfo entry point added - * version 3, rgerhads, 2013-01-21: - * - signature of SetHostIP() changed */ diff -Nru rsyslog-7.6.0/runtime/sync.c rsyslog-5.10.1/runtime/sync.c --- rsyslog-7.6.0/runtime/sync.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/sync.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,55 @@ +/* synrchonization-related stuff. In theory, that should + * help porting to something different from pthreads. + * + * Copyright 2007-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" + +#include + +#include "rsyslog.h" +#include "sync.h" +#include "debug.h" + + +void +SyncObjInit(pthread_mutex_t **mut) +{ + *mut = (pthread_mutex_t *) MALLOC(sizeof (pthread_mutex_t)); + pthread_mutex_init(*mut, NULL); +} + + +/* This function destroys the mutex and also sets the mutex object + * to NULL. While the later is not strictly necessary, it is a good + * aid when debugging problems. As this function is not exepected to + * be called quite frequently, the additional overhead can well be + * accepted. If this changes over time, setting to NULL may be + * reconsidered. - rgerhards, 2007-11-12 + */ +void +SyncObjExit(pthread_mutex_t **mut) +{ + if(*mut != NULL) { + pthread_mutex_destroy(*mut); + free(*mut); + *mut = NULL; + } +} diff -Nru rsyslog-7.6.0/runtime/sync.h rsyslog-5.10.1/runtime/sync.h --- rsyslog-7.6.0/runtime/sync.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/sync.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,48 @@ +/* Definitions syncrhonization-related stuff. In theory, that should + * help porting to something different from pthreads. + * + * Copyright 2007-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INCLUDED_SYNC_H +#define INCLUDED_SYNC_H + +#include + +/* SYNC_OBJ_TOOL definition must be placed in object to be synced! + * SYNC_OBJ_TOOL_INIT must be called upon of object construction and + * SUNC_OBJ_TOOL_EXIT must be called upon object destruction + */ +#define SYNC_OBJ_TOOL pthread_mutex_t *Sync_mut +#define SYNC_OBJ_TOOL_INIT(x) SyncObjInit(&((x)->Sync_mut)) +#define SYNC_OBJ_TOOL_EXIT(x) SyncObjExit(&((x)->Sync_mut)) + +/* If we run in non-debug (release) mode, we use inline code for the mutex + * operations. If we run in debug mode, we use functions, because they + * are better to trace in the stackframe. + */ +#define LockObj(x) d_pthread_mutex_lock((x)->Sync_mut) +#define UnlockObj(x) d_pthread_mutex_unlock((x)->Sync_mut) + +void SyncObjInit(pthread_mutex_t **mut); +void SyncObjExit(pthread_mutex_t **mut); +extern void lockObj(pthread_mutex_t *mut); +extern void unlockObj(pthread_mutex_t *mut); + +#endif /* #ifndef INCLUDED_SYNC_H */ diff -Nru rsyslog-7.6.0/runtime/sysvar.c rsyslog-5.10.1/runtime/sysvar.c --- rsyslog-7.6.0/runtime/sysvar.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/sysvar.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,202 @@ +/* sysvar.c - imlements rsyslog system variables + * + * At least for now, this class only has static functions and no + * instances. + * + * Module begun 2008-02-25 by Rainer Gerhards + * + * Copyright (C) 2008-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "stringbuf.h" +#include "sysvar.h" +#include "datetime.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(var) +DEFobjCurrIf(datetime) +DEFobjCurrIf(glbl) + + +/* Standard-Constructor + */ +BEGINobjConstruct(sysvar) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(sysvar) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +static rsRetVal +sysvarConstructFinalize(sysvar_t __attribute__((unused)) *pThis) +{ + DEFiRet; + RETiRet; +} + + +/* destructor for the sysvar object */ +BEGINobjDestruct(sysvar) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(sysvar) +ENDobjDestruct(sysvar) + + +/* This function returns the current date in different + * variants. It is used to construct the $NOW series of + * system properties. The returned buffer must be freed + * by the caller when no longer needed. If the function + * can not allocate memory, it returns a NULL pointer. + * Added 2007-07-10 rgerhards + * TODO: this was taken from msg.c and we should consolidate it with the code + * there. This is especially important when we increase the number of system + * variables (what we definitely want to do). + */ +typedef enum ENOWType { NOW_NOW, NOW_YEAR, NOW_MONTH, NOW_DAY, NOW_HOUR, NOW_MINUTE } eNOWType; +static rsRetVal +getNOW(eNOWType eNow, cstr_t **ppStr) +{ + DEFiRet; + uchar szBuf[16]; + struct syslogTime t; + + datetime.getCurrTime(&t, NULL); + switch(eNow) { + case NOW_NOW: + snprintf((char*) szBuf, sizeof(szBuf)/sizeof(uchar), "%4.4d-%2.2d-%2.2d", t.year, t.month, t.day); + break; + case NOW_YEAR: + snprintf((char*) szBuf, sizeof(szBuf)/sizeof(uchar), "%4.4d", t.year); + break; + case NOW_MONTH: + snprintf((char*) szBuf, sizeof(szBuf)/sizeof(uchar), "%2.2d", t.month); + break; + case NOW_DAY: + snprintf((char*) szBuf, sizeof(szBuf)/sizeof(uchar), "%2.2d", t.day); + break; + case NOW_HOUR: + snprintf((char*) szBuf, sizeof(szBuf)/sizeof(uchar), "%2.2d", t.hour); + break; + case NOW_MINUTE: + snprintf((char*) szBuf, sizeof(szBuf)/sizeof(uchar), "%2.2d", t.minute); + break; + } + + /* now create a string object out of it and hand that over to the var */ + CHKiRet(rsCStrConstructFromszStr(ppStr, szBuf)); + +finalize_it: + RETiRet; +} + + +/* The function returns a system variable suitable for use with RainerScript. Most importantly, this means + * that the value is returned in a var_t object. The var_t is constructed inside this function and + * MUST be freed by the caller. + * rgerhards, 2008-02-25 + */ +static rsRetVal +GetVar(cstr_t *pstrVarName, var_t **ppVar) +{ + DEFiRet; + var_t *pVar; + cstr_t *pstrProp; + + ASSERT(pstrVarName != NULL); + ASSERT(ppVar != NULL); + + /* make sure we have a var_t instance */ + CHKiRet(var.Construct(&pVar)); + CHKiRet(var.ConstructFinalize(pVar)); + + /* now begin the actual variable evaluation */ + if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"now", sizeof("now") - 1)) { + CHKiRet(getNOW(NOW_NOW, &pstrProp)); + } else if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"year", sizeof("year") - 1)) { + CHKiRet(getNOW(NOW_YEAR, &pstrProp)); + } else if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"month", sizeof("month") - 1)) { + CHKiRet(getNOW(NOW_MONTH, &pstrProp)); + } else if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"day", sizeof("day") - 1)) { + CHKiRet(getNOW(NOW_DAY, &pstrProp)); + } else if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"hour", sizeof("hour") - 1)) { + CHKiRet(getNOW(NOW_HOUR, &pstrProp)); + } else if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"minute", sizeof("minute") - 1)) { + CHKiRet(getNOW(NOW_MINUTE, &pstrProp)); + } else if(!rsCStrSzStrCmp(pstrVarName, (uchar*)"myhostname", sizeof("myhostname") - 1)) { + CHKiRet(rsCStrConstructFromszStr(&pstrProp, glbl.GetLocalHostName())); + } else { + ABORT_FINALIZE(RS_RET_SYSVAR_NOT_FOUND); + } + + /* now hand the string over to the var object */ + CHKiRet(var.SetString(pVar, pstrProp)); + + /* finally store var */ + *ppVar = pVar; + +finalize_it: + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(sysvar) +CODESTARTobjQueryInterface(sysvar) + if(pIf->ifVersion != sysvarCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = sysvarConstruct; + pIf->ConstructFinalize = sysvarConstructFinalize; + pIf->Destruct = sysvarDestruct; + pIf->GetVar = GetVar; +finalize_it: +ENDobjQueryInterface(sysvar) + + +/* Initialize the sysvar class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(sysvar, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(var, CORE_COMPONENT)); + CHKiRet(objUse(datetime, CORE_COMPONENT)); + CHKiRet(objUse(glbl, CORE_COMPONENT)); + + /* set our own handlers */ + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, sysvarConstructFinalize); +ENDObjClassInit(sysvar) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/sysvar.h rsyslog-5.10.1/runtime/sysvar.h --- rsyslog-7.6.0/runtime/sysvar.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/sysvar.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,47 @@ +/* The sysvar object. So far, no instance can be defined (makes logically no + * sense). + * + * Copyright 2008-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * The rsyslog runtime library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The rsyslog runtime library 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the rsyslog runtime library. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. + */ +#ifndef INCLUDED_SYSVAR_H +#define INCLUDED_SYSVAR_H + +/* the sysvar object - not really used... */ +typedef struct sysvar_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ +} sysvar_t; + + +/* interfaces */ +BEGINinterface(sysvar) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(sysvar); + rsRetVal (*Construct)(sysvar_t **ppThis); + rsRetVal (*ConstructFinalize)(sysvar_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(sysvar_t **ppThis); + rsRetVal (*GetVar)(cstr_t *pstrPropName, var_t **ppVar); +ENDinterface(sysvar) +#define sysvarCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(sysvar); + +#endif /* #ifndef INCLUDED_SYSVAR_H */ diff -Nru rsyslog-7.6.0/runtime/typedefs.h rsyslog-5.10.1/runtime/typedefs.h --- rsyslog-7.6.0/runtime/typedefs.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/typedefs.h 2012-10-17 14:41:20.000000000 +0000 @@ -3,7 +3,7 @@ * * Begun 2010-11-25 RGerhards * - * Copyright (C) 2005-2013 by Rainer Gerhards and Adiscon GmbH + * Copyright (C) 2005-2008 by Rainer Gerhards and Adiscon GmbH * * This file is part of the rsyslog runtime library. * @@ -25,10 +25,6 @@ */ #ifndef INCLUDED_TYPEDEFS_H #define INCLUDED_TYPEDEFS_H -#include -#if defined(__FreeBSD__) || !defined(HAVE_LSEEK64) -#include -#endif /* some universal fixed size integer defines ... */ typedef long long int64; @@ -60,7 +56,6 @@ typedef struct nsdsel_gtls_s nsdsel_gtls_t; typedef struct nsdpoll_ptcp_s nsdpoll_ptcp_t; typedef struct wti_s wti_t; -typedef struct msgPropDescr_s msgPropDescr_t; typedef struct msg msg_t; typedef struct queue_s qqueue_t; typedef struct prop_s prop_t; @@ -84,26 +79,6 @@ typedef struct strgen_s strgen_t; typedef struct strgenList_s strgenList_t; typedef struct statsobj_s statsobj_t; -typedef struct nsd_epworkset_s nsd_epworkset_t; -typedef struct templates_s templates_t; -typedef struct queuecnf_s queuecnf_t; -typedef struct rulesets_s rulesets_t; -typedef struct globals_s globals_t; -typedef struct defaults_s defaults_t; -typedef struct actions_s actions_t; -typedef struct rsconf_s rsconf_t; -typedef struct cfgmodules_s cfgmodules_t; -typedef struct cfgmodules_etry_s cfgmodules_etry_t; -typedef struct outchannels_s outchannels_t; -typedef struct modConfData_s modConfData_t; -typedef struct instanceConf_s instanceConf_t; -typedef struct ratelimit_s ratelimit_t; -typedef struct lookup_string_tab_etry_s lookup_string_tab_etry_t; -typedef struct lookup_tables_s lookup_tables_t; -typedef struct lookup_s lookup_t; -typedef struct action_s action_t; -typedef int rs_size_t; /* we do never need more than 2Gig strings, signed permits to - * use -1 as a special flag. */ typedef rsRetVal (*prsf_t)(struct vmstk_s*, int); /* pointer to a RainerScript function */ typedef uint64 qDeqID; /* queue Dequeue order ID. 32 bits is considered dangerously few */ @@ -152,98 +127,9 @@ FIOP_ISEQUAL = 2, /* is (exactly) equal? */ FIOP_STARTSWITH = 3, /* starts with a string? */ FIOP_REGEX = 4, /* matches a (BRE) regular expression? */ - FIOP_EREREGEX = 5, /* matches a ERE regular expression? */ - FIOP_ISEMPTY = 6 /* string empty <=> strlen(s) == 0 ?*/ + FIOP_EREREGEX = 5 /* matches a ERE regular expression? */ } fiop_t; -#ifndef HAVE_LSEEK64 - typedef off_t off64_t; -#endif - - -/* properties are now encoded as (tiny) integers. I do not use an enum as I would like - * to keep the memory footprint small (and thus cache hits high). - * rgerhards, 2009-06-26 - */ -typedef uintTiny propid_t; -#define PROP_INVALID 0 -#define PROP_MSG 1 -#define PROP_TIMESTAMP 2 -#define PROP_HOSTNAME 3 -#define PROP_SYSLOGTAG 4 -#define PROP_RAWMSG 5 -#define PROP_INPUTNAME 6 -#define PROP_FROMHOST 7 -#define PROP_FROMHOST_IP 8 -#define PROP_PRI 9 -#define PROP_PRI_TEXT 10 -#define PROP_IUT 11 -#define PROP_SYSLOGFACILITY 12 -#define PROP_SYSLOGFACILITY_TEXT 13 -#define PROP_SYSLOGSEVERITY 14 -#define PROP_SYSLOGSEVERITY_TEXT 15 -#define PROP_TIMEGENERATED 16 -#define PROP_PROGRAMNAME 17 -#define PROP_PROTOCOL_VERSION 18 -#define PROP_STRUCTURED_DATA 19 -#define PROP_APP_NAME 20 -#define PROP_PROCID 21 -#define PROP_MSGID 22 -#define PROP_PARSESUCCESS 23 -#define PROP_SYS_NOW 150 -#define PROP_SYS_YEAR 151 -#define PROP_SYS_MONTH 152 -#define PROP_SYS_DAY 153 -#define PROP_SYS_HOUR 154 -#define PROP_SYS_HHOUR 155 -#define PROP_SYS_QHOUR 156 -#define PROP_SYS_MINUTE 157 -#define PROP_SYS_MYHOSTNAME 158 -#define PROP_SYS_BOM 159 -#define PROP_SYS_UPTIME 160 -#define PROP_UUID 161 -#define PROP_CEE 200 -#define PROP_CEE_ALL_JSON 201 -#define PROP_LOCAL_VAR 202 -#define PROP_GLOBAL_VAR 203 - -/* types of configuration handlers - */ -typedef enum cslCmdHdlrType { - eCmdHdlrInvalid = 0, /* invalid handler type - indicates a coding error */ - eCmdHdlrCustomHandler, /* custom handler, just call handler function */ - eCmdHdlrUID, - eCmdHdlrGID, - eCmdHdlrBinary, - eCmdHdlrFileCreateMode, - eCmdHdlrInt, - eCmdHdlrNonNegInt, - eCmdHdlrPositiveInt, - eCmdHdlrSize, - eCmdHdlrGetChar, - eCmdHdlrFacility, - eCmdHdlrSeverity, - eCmdHdlrGetWord, - eCmdHdlrString, - eCmdHdlrArray, - eCmdHdlrQueueType, - eCmdHdlrGoneAway /* statment existed, but is no longer supported */ -} ecslCmdHdrlType; - - -/* the next type describes $Begin .. $End block object types - */ -typedef enum cslConfObjType { - eConfObjGlobal = 0, /* global directives */ - eConfObjAction, /* action-specific directives */ - /* now come states that indicate that we wait for a block-end. These are - * states that permit us to do some safety checks and they hopefully ease - * migration to a "real" parser/grammar. - */ - eConfObjActionWaitEnd, - eConfObjAlways /* always valid, very special case (guess $End only!) */ -} ecslConfObjType; - /* multi-submit support. * This is done via a simple data structure, which holds the number of elements @@ -257,13 +143,6 @@ msg_t **ppMsgs; }; -/* the following structure is a helper to describe a message property */ -struct msgPropDescr_s { - propid_t id; - uchar *name; /* name and lenName are only set for dynamic */ - int nameLen; /* properties (JSON) */ -}; - #endif /* multi-include protection */ /* vim:set ai: */ diff -Nru rsyslog-7.6.0/runtime/unicode-helper.h rsyslog-5.10.1/runtime/unicode-helper.h --- rsyslog-7.6.0/runtime/unicode-helper.h 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/runtime/unicode-helper.h 2012-09-23 10:29:49.000000000 +0000 @@ -53,7 +53,7 @@ return strcmp((char*) psz1, (char*) psz2); } -static inline int ustrlen(const uchar *psz) +static inline int ustrlen(uchar *psz) { return strlen((char*) psz); } diff -Nru rsyslog-7.6.0/runtime/var.c rsyslog-5.10.1/runtime/var.c --- rsyslog-7.6.0/runtime/var.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/var.c 2012-10-17 14:41:20.000000000 +0000 @@ -90,6 +90,324 @@ ENDobjDebugPrint(var) +/* This function is similar to DebugPrint, but does not send its output to + * the debug log but instead to a caller-provided string. The idea here is that + * we can use this string to get a textual representation of a variable. + * Among others, this is useful for creating testbenches, our first use case for + * it. Here, it enables simple comparison of the resulting program to a + * reference program by simple string compare. + * Note that the caller must initialize the string object. We always add + * data to it. So, it can be easily combined into a chain of methods + * to generate the final string. + * rgerhards, 2008-07-07 + */ +static rsRetVal +Obj2Str(var_t *pThis, cstr_t *pstrPrg) +{ + DEFiRet; + size_t lenBuf; + uchar szBuf[2048]; + + ISOBJ_TYPE_assert(pThis, var); + assert(pstrPrg != NULL); + switch(pThis->varType) { + case VARTYPE_STR: + lenBuf = snprintf((char*) szBuf, sizeof(szBuf), "%s[cstr]", rsCStrGetSzStr(pThis->val.pStr)); + break; + case VARTYPE_NUMBER: + lenBuf = snprintf((char*) szBuf, sizeof(szBuf), "%lld[nbr]", pThis->val.num); + break; + default: + lenBuf = snprintf((char*) szBuf, sizeof(szBuf), "**UNKNOWN**[%d]", pThis->varType); + break; + } + CHKiRet(rsCStrAppendStrWithLen(pstrPrg, szBuf, lenBuf)); + +finalize_it: + RETiRet; +} + + +/* duplicates a var instance + * rgerhards, 2008-02-25 + */ +static rsRetVal +Duplicate(var_t *pThis, var_t **ppNew) +{ + DEFiRet; + var_t *pNew = NULL; + cstr_t *pstr; + + ISOBJ_TYPE_assert(pThis, var); + assert(ppNew != NULL); + + CHKiRet(varConstruct(&pNew)); + CHKiRet(varConstructFinalize(pNew)); + + /* we have the object, now copy value */ + pNew->varType = pThis->varType; + if(pThis->varType == VARTYPE_NUMBER) { + pNew->val.num = pThis->val.num; + } else if(pThis->varType == VARTYPE_STR) { + CHKiRet(rsCStrConstructFromCStr(&pstr, pThis->val.pStr)); + pNew->val.pStr = pstr; + } + + *ppNew = pNew; + +finalize_it: + if(iRet != RS_RET_OK && pNew != NULL) + varDestruct(&pNew); + + RETiRet; +} + + +/* free the current values (destructs objects if necessary) + */ +static rsRetVal +varUnsetValues(var_t *pThis) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, var); + if(pThis->varType == VARTYPE_STR) + rsCStrDestruct(&pThis->val.pStr); + + pThis->varType = VARTYPE_NONE; + + RETiRet; +} + + +/* set a string value + * The caller hands over the string and must n longer use it after this method + * has been called. + */ +static rsRetVal +varSetString(var_t *pThis, cstr_t *pStr) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, var); + + CHKiRet(varUnsetValues(pThis)); + pThis->varType = VARTYPE_STR; + pThis->val.pStr = pStr; + +finalize_it: + RETiRet; +} + + +/* set an int64 value */ +static rsRetVal +varSetNumber(var_t *pThis, number_t iVal) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, var); + + CHKiRet(varUnsetValues(pThis)); + pThis->varType = VARTYPE_NUMBER; + pThis->val.num = iVal; + +finalize_it: + RETiRet; +} + + +/* Change the provided object to be of type number. + * rgerhards, 2008-02-22 + */ +rsRetVal +ConvToNumber(var_t *pThis) +{ + DEFiRet; + number_t n; + + if(pThis->varType == VARTYPE_NUMBER) { + FINALIZE; + } else if(pThis->varType == VARTYPE_STR) { + iRet = rsCStrConvertToNumber(pThis->val.pStr, &n); + if(iRet == RS_RET_NOT_A_NUMBER) { + n = 0; + iRet = RS_RET_OK; /* we accept this as part of the language definition */ + } else if (iRet != RS_RET_OK) { + FINALIZE; + } + + /* we need to destruct the string first, because string and number are + * inside a union and share the memory area! -- rgerhards, 2008-04-03 + */ + rsCStrDestruct(&pThis->val.pStr); + + pThis->val.num = n; + pThis->varType = VARTYPE_NUMBER; + } + +finalize_it: + RETiRet; +} + + +/* convert the provided var to type string. This is always possible + * (except, of course, for things like out of memory...) + * TODO: finish implementation!!!!!!!!! + * rgerhards, 2008-02-24 + */ +rsRetVal +ConvToString(var_t *pThis) +{ + DEFiRet; + uchar szNumBuf[64]; + + if(pThis->varType == VARTYPE_STR) { + FINALIZE; + } else if(pThis->varType == VARTYPE_NUMBER) { + CHKiRet(srUtilItoA((char*)szNumBuf, sizeof(szNumBuf)/sizeof(uchar), pThis->val.num)); + CHKiRet(rsCStrConstructFromszStr(&pThis->val.pStr, szNumBuf)); + pThis->varType = VARTYPE_STR; + } + +finalize_it: + RETiRet; +} + + +/* convert (if necessary) the value to a boolean. In essence, this means the + * value must be a number, but in case of a string special logic is used as + * some string-values may represent a boolean (e.g. "true"). + * rgerhards, 2008-02-25 + */ +rsRetVal +ConvToBool(var_t *pThis) +{ + DEFiRet; + number_t n; + + if(pThis->varType == VARTYPE_NUMBER) { + FINALIZE; + } else if(pThis->varType == VARTYPE_STR) { + iRet = rsCStrConvertToBool(pThis->val.pStr, &n); + if(iRet == RS_RET_NOT_A_NUMBER) { + n = 0; + iRet = RS_RET_OK; /* we accept this as part of the language definition */ + } else if (iRet != RS_RET_OK) { + FINALIZE; + } + + /* we need to destruct the string first, because string and number are + * inside a union and share the memory area! -- rgerhards, 2008-04-03 + */ + rsCStrDestruct(&pThis->val.pStr); + pThis->val.num = n; + pThis->varType = VARTYPE_NUMBER; + } + +finalize_it: + RETiRet; +} + + +/* This function is used to prepare two var_t objects for a common operation, + * e.g before they are added, compared. The function looks at + * the data types of both operands and finds the best data type suitable for + * the operation (in respect to current types). Then, it converts those + * operands that need conversion. Please note that the passed-in var objects + * *are* modified and returned as new type. So do call this function only if + * you actually need the conversion. + * + * This is how the common data type is selected. Note that op1 and op2 are + * just the two operands, their order is irrelevant (this would just take up + * more table space - so string/number is the same thing as number/string). + * + * Common Types: + * op1 op2 operation data type + * string string string + * string number number if op1 can be converted to number, string else + * date string date if op1 can be converted to date, string else + * number number number + * date number string (maybe we can do better?) + * date date date + * none n/a error + * + * If a boolean value is required, we need to have a number inside the + * operand. If it is not, conversion rules to number apply. Once we + * have a number, things get easy: 0 is false, anything else is true. + * Please note that due to this conversion rules, "0" becomes false + * while "-4712" becomes true. Using a date as boolen is not a good + * idea. Depending on the ultimate conversion rules, it may always + * become true or false. As such, using dates as booleans is + * prohibited and the result defined to be undefined. + * + * rgerhards, 2008-02-22 + */ +static rsRetVal +ConvForOperation(var_t *pThis, var_t *pOther) +{ + DEFiRet; + + if(pThis->varType == VARTYPE_NONE || pOther->varType == VARTYPE_NONE) + ABORT_FINALIZE(RS_RET_INVALID_VAR); + + switch(pThis->varType) { + case VARTYPE_NONE: + ABORT_FINALIZE(RS_RET_INVALID_VAR); + break; + case VARTYPE_STR: + switch(pOther->varType) { + case VARTYPE_NONE: + ABORT_FINALIZE(RS_RET_INVALID_VAR); + break; + case VARTYPE_STR: + FINALIZE; /* two strings, we are all set */ + break; + case VARTYPE_NUMBER: + /* check if we can convert pThis to a number, if so use number format. */ + iRet = ConvToNumber(pThis); + if(iRet == RS_RET_NOT_A_NUMBER) { + CHKiRet(ConvToString(pOther)); + } else { + FINALIZE; /* OK or error */ + } + break; + case VARTYPE_SYSLOGTIME: + ABORT_FINALIZE(RS_RET_NOT_IMPLEMENTED); + break; + } + break; + case VARTYPE_NUMBER: + switch(pOther->varType) { + case VARTYPE_NONE: + ABORT_FINALIZE(RS_RET_INVALID_VAR); + break; + case VARTYPE_STR: + iRet = ConvToNumber(pOther); + if(iRet == RS_RET_NOT_A_NUMBER) { + CHKiRet(ConvToString(pThis)); + } else { + FINALIZE; /* OK or error */ + } + break; + case VARTYPE_NUMBER: + FINALIZE; /* two numbers, so we are all set */ + break; + case VARTYPE_SYSLOGTIME: + ABORT_FINALIZE(RS_RET_NOT_IMPLEMENTED); + break; + } + break; + case VARTYPE_SYSLOGTIME: + ABORT_FINALIZE(RS_RET_NOT_IMPLEMENTED); + break; + } + +finalize_it: + RETiRet; +} + + /* queryInterface function * rgerhards, 2008-02-21 */ @@ -108,6 +426,14 @@ pIf->ConstructFinalize = varConstructFinalize; pIf->Destruct = varDestruct; pIf->DebugPrint = varDebugPrint; + pIf->Obj2Str = Obj2Str; + pIf->SetNumber = varSetNumber; + pIf->SetString = varSetString; + pIf->ConvForOperation = ConvForOperation; + pIf->ConvToNumber = ConvToNumber; + pIf->ConvToBool = ConvToBool; + pIf->ConvToString = ConvToString; + pIf->Duplicate = Duplicate; finalize_it: ENDobjQueryInterface(var) diff -Nru rsyslog-7.6.0/runtime/var.h rsyslog-5.10.1/runtime/var.h --- rsyslog-7.6.0/runtime/var.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/runtime/var.h 2012-10-17 14:41:20.000000000 +0000 @@ -38,7 +38,6 @@ varType_t varType; union { number_t num; - es_str_t *str; cstr_t *pStr; syslogTime_t vSyslogTime; @@ -52,9 +51,16 @@ rsRetVal (*Construct)(var_t **ppThis); rsRetVal (*ConstructFinalize)(var_t __attribute__((unused)) *pThis); rsRetVal (*Destruct)(var_t **ppThis); + rsRetVal (*SetNumber)(var_t *pThis, number_t iVal); + rsRetVal (*SetString)(var_t *pThis, cstr_t *pCStr); + rsRetVal (*ConvForOperation)(var_t *pThis, var_t *pOther); + rsRetVal (*ConvToNumber)(var_t *pThis); + rsRetVal (*ConvToBool)(var_t *pThis); + rsRetVal (*ConvToString)(var_t *pThis); + rsRetVal (*Obj2Str)(var_t *pThis, cstr_t*); + rsRetVal (*Duplicate)(var_t *pThis, var_t **ppNew); ENDinterface(var) -#define varCURR_IF_VERSION 2 /* increment whenever you change the interface above! */ -/* v2 - 2011-07-15/rger: on the way to remove var */ +#define varCURR_IF_VERSION 1 /* increment whenever you change the interface above! */ /* prototypes */ diff -Nru rsyslog-7.6.0/runtime/vm.c rsyslog-5.10.1/runtime/vm.c --- rsyslog-7.6.0/runtime/vm.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vm.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,842 @@ +/* vm.c - the arithmetic stack of a virtual machine. + * + * Module begun 2008-02-22 by Rainer Gerhards + * + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * The rsyslog runtime library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The rsyslog runtime library 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the rsyslog runtime library. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution. + */ + +#include "config.h" +#include +#include +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "vm.h" +#include "sysvar.h" +#include "stringbuf.h" +#include "unicode-helper.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(vmstk) +DEFobjCurrIf(var) +DEFobjCurrIf(sysvar) + +static pthread_mutex_t mutGetenv; /* we need to make this global because otherwise we can not guarantee proper init! */ + +/* ------------------------------ function registry code and structures ------------------------------ */ + +/* we maintain a registry of known functions */ +/* currently, this is a singly-linked list, this shall become a binary + * tree when we add the real call interface. So far, entries are added + * at the root, only. + */ +typedef struct s_rsf_entry { + cstr_t *pName; /* function name */ + prsf_t rsf; /* pointer to function code */ + struct s_rsf_entry *pNext; /* Pointer to next element or NULL */ +} rsf_entry_t; +rsf_entry_t *funcRegRoot = NULL; + + +/* add a function to the function registry. + * The handed-over cstr_t* object must no longer be used by the caller. + * A duplicate function name is an error. + * rgerhards, 2009-04-06 + */ +static rsRetVal +rsfrAddFunction(uchar *szName, prsf_t rsf) +{ + rsf_entry_t *pEntry; + size_t lenName; + DEFiRet; + + assert(szName != NULL); + assert(rsf != NULL); + + /* first check if we have a duplicate name, with the current approach this means + * we need to go through the whole list. + */ + lenName = strlen((char*)szName); + for(pEntry = funcRegRoot ; pEntry != NULL ; pEntry = pEntry->pNext) + if(!rsCStrSzStrCmp(pEntry->pName, szName, lenName)) + ABORT_FINALIZE(RS_RET_DUP_FUNC_NAME); + + /* unique name, so add to head of list */ + CHKmalloc(pEntry = calloc(1, sizeof(rsf_entry_t))); + CHKiRet(rsCStrConstructFromszStr(&pEntry->pName, szName)); + CHKiRet(cstrFinalize(pEntry->pName)); + pEntry->rsf = rsf; + pEntry->pNext = funcRegRoot; + funcRegRoot = pEntry; + +finalize_it: + if(iRet != RS_RET_OK && iRet != RS_RET_DUP_FUNC_NAME) + free(pEntry); + + RETiRet; +} + + +/* find a function inside the function registry + * The caller provides a cstr_t with the function name and receives + * a function pointer back. If no function is found, an RS_RET_UNKNW_FUNC + * error is returned. So if the function returns with RS_RET_OK, the caller + * can savely assume the function pointer is valid. + * rgerhards, 2009-04-06 + */ +static rsRetVal +findRSFunction(cstr_t *pcsName, prsf_t *prsf) +{ + rsf_entry_t *pEntry; + rsf_entry_t *pFound; + DEFiRet; + + assert(prsf != NULL); + + /* find function by list walkthrough. */ + pFound = NULL; + for(pEntry = funcRegRoot ; pEntry != NULL && pFound == NULL ; pEntry = pEntry->pNext) + if(!rsCStrCStrCmp(pEntry->pName, pcsName)) + pFound = pEntry; + + if(pFound == NULL) + ABORT_FINALIZE(RS_RET_UNKNW_FUNC); + + *prsf = pFound->rsf; + +finalize_it: + RETiRet; +} + + +/* find the name of a RainerScript function whom's function pointer + * is known. This function returns the cstr_t object, which MUST NOT + * be modified by the caller. + * rgerhards, 2009-04-06 + */ +static rsRetVal +findRSFunctionName(prsf_t rsf, cstr_t **ppcsName) +{ + rsf_entry_t *pEntry; + rsf_entry_t *pFound; + DEFiRet; + + assert(rsf != NULL); + assert(ppcsName != NULL); + + /* find function by list walkthrough. */ + pFound = NULL; + for(pEntry = funcRegRoot ; pEntry != NULL && pFound == NULL ; pEntry = pEntry->pNext) + if(pEntry->rsf == rsf) + pFound = pEntry; + + if(pFound == NULL) + ABORT_FINALIZE(RS_RET_UNKNW_FUNC); + + *ppcsName = pFound->pName; + +finalize_it: + RETiRet; +} + + +/* free the whole function registry + */ +static void +rsfrRemoveAll(void) +{ + rsf_entry_t *pEntry; + rsf_entry_t *pEntryDel; + + BEGINfunc + pEntry = funcRegRoot; + while(pEntry != NULL) { + pEntryDel = pEntry; + pEntry = pEntry->pNext; + cstrDestruct(&pEntryDel->pName); + free(pEntryDel); + } + funcRegRoot = NULL; + ENDfunc +} + + +/* ------------------------------ end function registry code and structures ------------------------------ */ + + +/* ------------------------------ instruction set implementation ------------------------------ * + * The following functions implement the VM's instruction set. + */ +#define BEGINop(instruction) \ + static rsRetVal op##instruction(vm_t *pThis, __attribute__((unused)) vmop_t *pOp) \ + { \ + DEFiRet; + +#define CODESTARTop(instruction) \ + ISOBJ_TYPE_assert(pThis, vm); + +#define PUSHRESULTop(operand, res) \ + /* we have a result, so let's push it */ \ + var.SetNumber(operand, res); \ + vmstk.Push(pThis->pStk, operand); /* result */ + +#define ENDop(instruction) \ + RETiRet; \ + } + +/* code generator for boolean operations */ +#define BOOLOP(name, OPERATION) \ +BEGINop(name) /* remember to set the instruction also in the ENDop macro! */ \ + var_t *operand1; \ + var_t *operand2; \ +CODESTARTop(name) \ + vmstk.PopBool(pThis->pStk, &operand1); \ + vmstk.PopBool(pThis->pStk, &operand2); \ + if(operand1->val.num OPERATION operand2->val.num) { \ + CHKiRet(var.SetNumber(operand1, 1)); \ + } else { \ + CHKiRet(var.SetNumber(operand1, 0)); \ + } \ + vmstk.Push(pThis->pStk, operand1); /* result */ \ + var.Destruct(&operand2); /* no longer needed */ \ +finalize_it: \ +ENDop(name) +BOOLOP(OR, ||) +BOOLOP(AND, &&) +#undef BOOLOP + + +/* code generator for numerical operations */ +#define NUMOP(name, OPERATION) \ +BEGINop(name) /* remember to set the instruction also in the ENDop macro! */ \ + var_t *operand1; \ + var_t *operand2; \ +CODESTARTop(name) \ + vmstk.PopNumber(pThis->pStk, &operand1); \ + vmstk.PopNumber(pThis->pStk, &operand2); \ + operand1->val.num = operand1->val.num OPERATION operand2->val.num; \ + vmstk.Push(pThis->pStk, operand1); /* result */ \ + var.Destruct(&operand2); /* no longer needed */ \ +ENDop(name) +NUMOP(PLUS, +) +NUMOP(MINUS, -) +NUMOP(TIMES, *) +NUMOP(DIV, /) +NUMOP(MOD, %) +#undef BOOLOP + + +/* code generator for compare operations */ +#define BEGINCMPOP(name) \ +BEGINop(name) \ + var_t *operand1; \ + var_t *operand2; \ + number_t bRes; \ +CODESTARTop(name) \ + CHKiRet(vmstk.Pop2CommOp(pThis->pStk, &operand1, &operand2)); \ + /* data types are equal (so we look only at operand1), but we must \ + * check which type we have to deal with... \ + */ \ + switch(operand1->varType) { +#define ENDCMPOP(name) \ + default: \ + bRes = 0; /* we do not abort just so that we have a value. TODO: reconsider */ \ + break; \ + } \ + \ + /* we have a result, so let's push it */ \ + var.SetNumber(operand1, bRes); \ + vmstk.Push(pThis->pStk, operand1); /* result */ \ + var.Destruct(&operand2); /* no longer needed */ \ +finalize_it: \ +ENDop(name) + +BEGINCMPOP(CMP_EQ) /* remember to change the name also in the END macro! */ + case VARTYPE_NUMBER: + bRes = operand1->val.num == operand2->val.num; + break; + case VARTYPE_STR: + bRes = !rsCStrCStrCmp(operand1->val.pStr, operand2->val.pStr); + break; +ENDCMPOP(CMP_EQ) + +BEGINCMPOP(CMP_NEQ) /* remember to change the name also in the END macro! */ + case VARTYPE_NUMBER: + bRes = operand1->val.num != operand2->val.num; + break; + case VARTYPE_STR: + bRes = rsCStrCStrCmp(operand1->val.pStr, operand2->val.pStr); + break; +ENDCMPOP(CMP_NEQ) + +BEGINCMPOP(CMP_LT) /* remember to change the name also in the END macro! */ + case VARTYPE_NUMBER: + bRes = operand1->val.num < operand2->val.num; + break; + case VARTYPE_STR: + bRes = rsCStrCStrCmp(operand1->val.pStr, operand2->val.pStr) < 0; + break; +ENDCMPOP(CMP_LT) + +BEGINCMPOP(CMP_GT) /* remember to change the name also in the END macro! */ + case VARTYPE_NUMBER: + bRes = operand1->val.num > operand2->val.num; + break; + case VARTYPE_STR: + bRes = rsCStrCStrCmp(operand1->val.pStr, operand2->val.pStr) > 0; + break; +ENDCMPOP(CMP_GT) + +BEGINCMPOP(CMP_LTEQ) /* remember to change the name also in the END macro! */ + case VARTYPE_NUMBER: + bRes = operand1->val.num <= operand2->val.num; + break; + case VARTYPE_STR: + bRes = rsCStrCStrCmp(operand1->val.pStr, operand2->val.pStr) <= 0; + break; +ENDCMPOP(CMP_LTEQ) + +BEGINCMPOP(CMP_GTEQ) /* remember to change the name also in the END macro! */ + case VARTYPE_NUMBER: + bRes = operand1->val.num >= operand2->val.num; + break; + case VARTYPE_STR: + bRes = rsCStrCStrCmp(operand1->val.pStr, operand2->val.pStr) >= 0; + break; +ENDCMPOP(CMP_GTEQ) + +#undef BEGINCMPOP +#undef ENDCMPOP +/* end regular compare operations */ + +/* comare operations that work on strings, only */ +BEGINop(CMP_CONTAINS) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand1; + var_t *operand2; + number_t bRes; +CODESTARTop(CMP_CONTAINS) + /* operand2 is on top of stack, so needs to be popped first */ + vmstk.PopString(pThis->pStk, &operand2); + vmstk.PopString(pThis->pStk, &operand1); + /* TODO: extend cstr class so that it supports location of cstr inside cstr */ + bRes = (rsCStrLocateInSzStr(operand2->val.pStr, rsCStrGetSzStr(operand1->val.pStr)) == -1) ? 0 : 1; + + /* we have a result, so let's push it */ + PUSHRESULTop(operand1, bRes); + var.Destruct(&operand2); /* no longer needed */ +ENDop(CMP_CONTAINS) + + +BEGINop(CMP_CONTAINSI) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand1; + var_t *operand2; + number_t bRes; +CODESTARTop(CMP_CONTAINSI) + /* operand2 is on top of stack, so needs to be popped first */ + vmstk.PopString(pThis->pStk, &operand2); + vmstk.PopString(pThis->pStk, &operand1); +var.DebugPrint(operand1); \ +var.DebugPrint(operand2); \ + /* TODO: extend cstr class so that it supports location of cstr inside cstr */ + bRes = (rsCStrCaseInsensitiveLocateInSzStr(operand2->val.pStr, rsCStrGetSzStr(operand1->val.pStr)) == -1) ? 0 : 1; + + /* we have a result, so let's push it */ + PUSHRESULTop(operand1, bRes); + var.Destruct(&operand2); /* no longer needed */ +ENDop(CMP_CONTAINSI) + + +BEGINop(CMP_STARTSWITH) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand1; + var_t *operand2; + number_t bRes; +CODESTARTop(CMP_STARTSWITH) + /* operand2 is on top of stack, so needs to be popped first */ + vmstk.PopString(pThis->pStk, &operand2); + vmstk.PopString(pThis->pStk, &operand1); + /* TODO: extend cstr class so that it supports location of cstr inside cstr */ + bRes = (rsCStrStartsWithSzStr(operand1->val.pStr, rsCStrGetSzStr(operand2->val.pStr), + rsCStrLen(operand2->val.pStr)) == 0) ? 1 : 0; + + /* we have a result, so let's push it */ + PUSHRESULTop(operand1, bRes); + var.Destruct(&operand2); /* no longer needed */ +ENDop(CMP_STARTSWITH) + + +BEGINop(CMP_STARTSWITHI) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand1; + var_t *operand2; + number_t bRes; +CODESTARTop(CMP_STARTSWITHI) + /* operand2 is on top of stack, so needs to be popped first */ + vmstk.PopString(pThis->pStk, &operand2); + vmstk.PopString(pThis->pStk, &operand1); + /* TODO: extend cstr class so that it supports location of cstr inside cstr */ + bRes = (rsCStrCaseInsensitveStartsWithSzStr(operand1->val.pStr, rsCStrGetSzStr(operand2->val.pStr), + rsCStrLen(operand2->val.pStr)) == 0) ? 1 : 0; + + /* we have a result, so let's push it */ + PUSHRESULTop(operand1, bRes); + var.Destruct(&operand2); /* no longer needed */ +ENDop(CMP_STARTSWITHI) + +/* end comare operations that work on strings, only */ + +BEGINop(STRADD) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand1; + var_t *operand2; +CODESTARTop(STRADD) + vmstk.PopString(pThis->pStk, &operand2); + vmstk.PopString(pThis->pStk, &operand1); + + CHKiRet(rsCStrAppendCStr(operand1->val.pStr, operand2->val.pStr)); + CHKiRet(cstrFinalize(operand1->val.pStr)); + + /* we have a result, so let's push it */ + vmstk.Push(pThis->pStk, operand1); + var.Destruct(&operand2); /* no longer needed */ +finalize_it: +ENDop(STRADD) + +BEGINop(NOT) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand; +CODESTARTop(NOT) + vmstk.PopBool(pThis->pStk, &operand); + PUSHRESULTop(operand, !operand->val.num); +ENDop(NOT) + +BEGINop(UNARY_MINUS) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand; +CODESTARTop(UNARY_MINUS) + vmstk.PopNumber(pThis->pStk, &operand); + PUSHRESULTop(operand, -operand->val.num); +ENDop(UNARY_MINUS) + + +BEGINop(PUSHCONSTANT) /* remember to set the instruction also in the ENDop macro! */ + var_t *pVarDup; /* we need to duplicate the var, as we need to hand it over */ +CODESTARTop(PUSHCONSTANT) + CHKiRet(var.Duplicate(pOp->operand.pVar, &pVarDup)); + vmstk.Push(pThis->pStk, pVarDup); +finalize_it: +ENDop(PUSHCONSTANT) + + +BEGINop(PUSHMSGVAR) /* remember to set the instruction also in the ENDop macro! */ + var_t *pVal; /* the value to push */ + cstr_t *pstrVal; +CODESTARTop(PUSHMSGVAR) + if(pThis->pMsg == NULL) { + /* TODO: flag an error message! As a work-around, we permit + * execution to continue here with an empty string + */ + /* TODO: create a method in var to create a string var? */ + CHKiRet(var.Construct(&pVal)); + CHKiRet(var.ConstructFinalize(pVal)); + CHKiRet(rsCStrConstructFromszStr(&pstrVal, (uchar*)"")); + CHKiRet(var.SetString(pVal, pstrVal)); + } else { + /* we have a message, so pull value from there */ + CHKiRet(msgGetMsgVar(pThis->pMsg, pOp->operand.pVar->val.pStr, &pVal)); + } + + /* if we reach this point, we have a valid pVal and can push it */ + vmstk.Push(pThis->pStk, pVal); +finalize_it: +ENDop(PUSHMSGVAR) + + +BEGINop(PUSHSYSVAR) /* remember to set the instruction also in the ENDop macro! */ + var_t *pVal; /* the value to push */ +CODESTARTop(PUSHSYSVAR) + CHKiRet(sysvar.GetVar(pOp->operand.pVar->val.pStr, &pVal)); + vmstk.Push(pThis->pStk, pVal); +finalize_it: + if(Debug && iRet != RS_RET_OK) { + if(iRet == RS_RET_SYSVAR_NOT_FOUND) { + DBGPRINTF("rainerscript: sysvar '%s' not found\n", + rsCStrGetSzStrNoNULL(pOp->operand.pVar->val.pStr)); + } else { + DBGPRINTF("rainerscript: error %d trying to obtain sysvar '%s'\n", + iRet, rsCStrGetSzStrNoNULL(pOp->operand.pVar->val.pStr)); + } + } +ENDop(PUSHSYSVAR) + +/* The function call operation is only very roughly implemented. While the plumbing + * to reach this instruction is fine, the instruction itself currently supports only + * functions with a single argument AND with a name that we know. + * TODO: later, we can add here the real logic, that involves looking up function + * names, loading them dynamically ... and all that... + * implementation begun 2009-03-10 by rgerhards + */ +BEGINop(FUNC_CALL) /* remember to set the instruction also in the ENDop macro! */ + var_t *numOperands; +CODESTARTop(FUNC_CALL) + vmstk.PopNumber(pThis->pStk, &numOperands); + CHKiRet((*pOp->operand.rsf)(pThis->pStk, numOperands->val.num)); + var.Destruct(&numOperands); /* no longer needed */ +finalize_it: +ENDop(FUNC_CALL) + + +/* ------------------------------ end instruction set implementation ------------------------------ */ + + +/* ------------------------------ begin built-in function implementation ------------------------------ */ +/* note: this shall probably be moved to a separate module, but for the time being we do it directly + * in here. This is on our way to get from a dirty to a clean solution via baby steps that are + * a bit less dirty each time... + * + * The advantage of doing it here is that we do not yet need to think about how to handle the + * exit case, where we must not unload function modules which functions are still referenced. + * + * CALLING INTERFACE: + * The function must pop its parameters off the stack and pop its result onto + * the stack when it is finished. The number of parameters the function was + * called with is provided to it. If the argument count is less then what the function + * expected, it may handle the situation with defaults (or return an error). If the + * argument count is greater than expected, returnung an error is highly + * recommended (use RS_RET_INVLD_NBR_ARGUMENTS for these cases). + * + * All function names are prefixed with "rsf_" (RainerScript Function) to have + * a separate "name space". + * + * rgerhards, 2009-04-06 + */ + + +/* The strlen function, also probably a prototype of how all functions should be + * implemented. + * rgerhards, 2009-04-06 + */ +static rsRetVal +rsf_strlen(vmstk_t *pStk, int numOperands) +{ + DEFiRet; + var_t *operand1; + int iStrlen; + + if(numOperands != 1) + ABORT_FINALIZE(RS_RET_INVLD_NBR_ARGUMENTS); + + /* pop args and do operaton (trivial case here...) */ + vmstk.PopString(pStk, &operand1); + iStrlen = strlen((char*) rsCStrGetSzStr(operand1->val.pStr)); + + /* Store result and cleanup */ + var.SetNumber(operand1, iStrlen); + vmstk.Push(pStk, operand1); +finalize_it: + RETiRet; +} + + +/* The getenv function. Note that we guard the OS call by a mutex, as that + * function is not guaranteed to be thread-safe. This implementation here is far from + * being optimal, at least we should cache the result. This is left TODO for + * a later revision. + * rgerhards, 2009-11-03 + */ +static rsRetVal +rsf_getenv(vmstk_t *pStk, int numOperands) +{ + DEFiRet; + var_t *operand1; + char *envResult; + cstr_t *pCstr; + + if(numOperands != 1) + ABORT_FINALIZE(RS_RET_INVLD_NBR_ARGUMENTS); + + /* pop args and do operaton (trivial case here...) */ + vmstk.PopString(pStk, &operand1); + d_pthread_mutex_lock(&mutGetenv); + envResult = getenv((char*) rsCStrGetSzStr(operand1->val.pStr)); + DBGPRINTF("rsf_getenv(): envvar '%s', return '%s'\n", rsCStrGetSzStr(operand1->val.pStr), + envResult == NULL ? "(NULL)" : envResult); + iRet = rsCStrConstructFromszStr(&pCstr, (envResult == NULL) ? UCHAR_CONSTANT("") : (uchar*)envResult); + d_pthread_mutex_unlock(&mutGetenv); + if(iRet != RS_RET_OK) + FINALIZE; /* need to do this after mutex is unlocked! */ + + /* Store result and cleanup */ + var.SetString(operand1, pCstr); + vmstk.Push(pStk, operand1); +finalize_it: + RETiRet; +} + + +/* The "tolower" function, which converts its sole argument to lower case. + * Quite honestly, currently this is primarily a test driver for me... + * rgerhards, 2009-04-06 + */ +static rsRetVal +rsf_tolower(vmstk_t *pStk, int numOperands) +{ + DEFiRet; + var_t *operand1; + uchar *pSrc; + cstr_t *pcstr; + int iStrlen; + + if(numOperands != 1) + ABORT_FINALIZE(RS_RET_INVLD_NBR_ARGUMENTS); + + /* pop args and do operaton */ + CHKiRet(cstrConstruct(&pcstr)); + vmstk.PopString(pStk, &operand1); + pSrc = cstrGetSzStr(operand1->val.pStr); + iStrlen = strlen((char*)pSrc); // TODO: use count from string! + while(iStrlen--) { + CHKiRet(cstrAppendChar(pcstr, tolower(*pSrc++))); + } + + /* Store result and cleanup */ + CHKiRet(cstrFinalize(pcstr)); + var.SetString(operand1, pcstr); + vmstk.Push(pStk, operand1); +finalize_it: + RETiRet; +} + + +/* Standard-Constructor + */ +BEGINobjConstruct(vm) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(vm) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +static rsRetVal +vmConstructFinalize(vm_t __attribute__((unused)) *pThis) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vm); + + CHKiRet(vmstk.Construct(&pThis->pStk)); + CHKiRet(vmstk.ConstructFinalize(pThis->pStk)); + +finalize_it: + RETiRet; +} + + +/* destructor for the vm object */ +BEGINobjDestruct(vm) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(vm) + if(pThis->pStk != NULL) + vmstk.Destruct(&pThis->pStk); + if(pThis->pMsg != NULL) + msgDestruct(&pThis->pMsg); +ENDobjDestruct(vm) + + +/* debugprint for the vm object */ +BEGINobjDebugPrint(vm) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDebugPrint(vm) + dbgoprint((obj_t*) pThis, "rsyslog virtual machine, currently no state info available\n"); +ENDobjDebugPrint(vm) + + +/* execute a program + */ +static rsRetVal +execProg(vm_t *pThis, vmprg_t *pProg) +{ + DEFiRet; + vmop_t *pCurrOp; /* virtual instruction pointer */ + + ISOBJ_TYPE_assert(pThis, vm); + ISOBJ_TYPE_assert(pProg, vmprg); + +#define doOP(OP) case opcode_##OP: DBGPRINTF("rainerscript: opcode %s\n", #OP); \ + CHKiRet(op##OP(pThis, pCurrOp)); break + pCurrOp = pProg->vmopRoot; /* TODO: do this via a method! */ + while(pCurrOp != NULL && pCurrOp->opcode != opcode_END_PROG) { + DBGPRINTF("rainerscript: executing step, opcode %d...\n", pCurrOp->opcode); + switch(pCurrOp->opcode) { + doOP(OR); + doOP(AND); + doOP(CMP_EQ); + doOP(CMP_NEQ); + doOP(CMP_LT); + doOP(CMP_GT); + doOP(CMP_LTEQ); + doOP(CMP_GTEQ); + doOP(CMP_CONTAINS); + doOP(CMP_CONTAINSI); + doOP(CMP_STARTSWITH); + doOP(CMP_STARTSWITHI); + doOP(NOT); + doOP(PUSHCONSTANT); + doOP(PUSHMSGVAR); + doOP(PUSHSYSVAR); + doOP(STRADD); + doOP(PLUS); + doOP(MINUS); + doOP(TIMES); + doOP(DIV); + doOP(MOD); + doOP(UNARY_MINUS); + doOP(FUNC_CALL); + default: + dbgoprint((obj_t*) pThis, "invalid instruction %d in vmprg\n", pCurrOp->opcode); + ABORT_FINALIZE(RS_RET_INVALID_VMOP); + break; + } + /* so far, we have plain sequential execution, so on to next... */ + pCurrOp = pCurrOp->pNext; + } +#undef doOP + + /* if we reach this point, our program has intintionally terminated + * (no error state). + */ + +finalize_it: + DBGPRINTF("rainerscript: script execution terminated with state %d\n", iRet); + RETiRet; +} + + +/* Set the current message object for the VM. It *is* valid to set a + * NULL message object, what simply means there is none. Message + * objects are properly reference counted. + */ +static rsRetVal +SetMsg(vm_t *pThis, msg_t *pMsg) +{ + DEFiRet; + if(pThis->pMsg != NULL) { + msgDestruct(&pThis->pMsg); + } + + if(pMsg != NULL) { + pThis->pMsg = MsgAddRef(pMsg); + } + + RETiRet; +} + + +/* Pop a var from the stack and return it to caller. The variable type is not + * changed, it is taken from the stack as is. This functionality is + * partly needed. We may (or may not ;)) be able to remove it once we have + * full RainerScript support. -- rgerhards, 2008-02-25 + */ +static rsRetVal +PopVarFromStack(vm_t *pThis, var_t **ppVar) +{ + DEFiRet; + CHKiRet(vmstk.Pop(pThis->pStk, ppVar)); +finalize_it: + RETiRet; +} + + +/* Pop a boolean from the stack and return it to caller. This functionality is + * partly needed. We may (or may not ;)) be able to remove it once we have + * full RainerScript support. -- rgerhards, 2008-02-25 + */ +static rsRetVal +PopBoolFromStack(vm_t *pThis, var_t **ppVar) +{ + DEFiRet; + CHKiRet(vmstk.PopBool(pThis->pStk, ppVar)); +finalize_it: + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(vm) +CODESTARTobjQueryInterface(vm) + if(pIf->ifVersion != vmCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = vmConstruct; + pIf->ConstructFinalize = vmConstructFinalize; + pIf->Destruct = vmDestruct; + pIf->DebugPrint = vmDebugPrint; + pIf->ExecProg = execProg; + pIf->PopBoolFromStack = PopBoolFromStack; + pIf->PopVarFromStack = PopVarFromStack; + pIf->SetMsg = SetMsg; + pIf->FindRSFunction = findRSFunction; + pIf->FindRSFunctionName = findRSFunctionName; +finalize_it: +ENDobjQueryInterface(vm) + + +/* Exit the vm class. + * rgerhards, 2009-04-06 + */ +BEGINObjClassExit(vm, OBJ_IS_CORE_MODULE) /* class, version */ + rsfrRemoveAll(); + objRelease(sysvar, CORE_COMPONENT); + objRelease(var, CORE_COMPONENT); + objRelease(vmstk, CORE_COMPONENT); + + pthread_mutex_destroy(&mutGetenv); +ENDObjClassExit(vm) + + +/* Initialize the vm class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(vm, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(vmstk, CORE_COMPONENT)); + CHKiRet(objUse(var, CORE_COMPONENT)); + CHKiRet(objUse(sysvar, CORE_COMPONENT)); + + /* set our own handlers */ + OBJSetMethodHandler(objMethod_DEBUGPRINT, vmDebugPrint); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, vmConstructFinalize); + + /* register built-in functions // TODO: move to its own module */ + CHKiRet(rsfrAddFunction((uchar*)"strlen", rsf_strlen)); + CHKiRet(rsfrAddFunction((uchar*)"tolower", rsf_tolower)); + CHKiRet(rsfrAddFunction((uchar*)"getenv", rsf_getenv)); + + pthread_mutex_init(&mutGetenv, NULL); + +ENDObjClassInit(vm) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/vm.h rsyslog-5.10.1/runtime/vm.h --- rsyslog-7.6.0/runtime/vm.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vm.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,66 @@ +/* The vm object. + * + * This implements the rsyslog virtual machine. The initial implementation is + * done to support complex user-defined expressions, but it may evolve into a + * much more useful thing over time. + * + * The virtual machine uses rsyslog variables as its memory storage system. + * All computation is done on a stack (vmstk). The vm supports a given + * instruction set and executes programs of type vmprg, which consist of + * single operations defined in vmop (which hold the instruction and the + * data). + * + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_VM_H +#define INCLUDED_VM_H + +#include "msg.h" +#include "vmstk.h" +#include "vmprg.h" + +/* the vm object */ +typedef struct vm_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + vmstk_t *pStk; /* The stack */ + msg_t *pMsg; /* the current message (or NULL, if we have none) */ +} vm_t; + + +/* interfaces */ +BEGINinterface(vm) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(vm); + rsRetVal (*Construct)(vm_t **ppThis); + rsRetVal (*ConstructFinalize)(vm_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(vm_t **ppThis); + rsRetVal (*ExecProg)(vm_t *pThis, vmprg_t *pProg); + rsRetVal (*PopBoolFromStack)(vm_t *pThis, var_t **ppVar); /* there are a few cases where we need this... */ + rsRetVal (*PopVarFromStack)(vm_t *pThis, var_t **ppVar); /* there are a few cases where we need this... */ + rsRetVal (*SetMsg)(vm_t *pThis, msg_t *pMsg); /* there are a few cases where we need this... */ + /* v2 (4.1.7) */ + rsRetVal (*FindRSFunction)(cstr_t *pcsName, prsf_t *prsf); /* 2009-06-04 */ + rsRetVal (*FindRSFunctionName)(prsf_t rsf, cstr_t **ppcsName); /* 2009-06-04 */ +ENDinterface(vm) +#define vmCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(vm); + +#endif /* #ifndef INCLUDED_VM_H */ diff -Nru rsyslog-7.6.0/runtime/vmop.c rsyslog-5.10.1/runtime/vmop.c --- rsyslog-7.6.0/runtime/vmop.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vmop.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,305 @@ +/* vmop.c - abstracts an operation (instructed) supported by the + * rsyslog virtual machine + * + * Module begun 2008-02-20 by Rainer Gerhards + * + * Copyright 2007-2012 Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "vmop.h" +#include "vm.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(var) +DEFobjCurrIf(vm) + + +/* forward definitions */ +static rsRetVal vmopOpcode2Str(vmop_t *pThis, uchar **ppName); + +/* Standard-Constructor + */ +BEGINobjConstruct(vmop) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(vmop) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +rsRetVal vmopConstructFinalize(vmop_t __attribute__((unused)) *pThis) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmop); + RETiRet; +} + + +/* destructor for the vmop object */ +BEGINobjDestruct(vmop) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(vmop) + if(pThis->opcode != opcode_FUNC_CALL) { + if(pThis->operand.pVar != NULL) + var.Destruct(&pThis->operand.pVar); + } +ENDobjDestruct(vmop) + + +/* DebugPrint support for the vmop object */ +BEGINobjDebugPrint(vmop) /* be sure to specify the object type also in END and CODESTART macros! */ + uchar *pOpcodeName; + cstr_t *pStrVar; +CODESTARTobjDebugPrint(vmop) + vmopOpcode2Str(pThis, &pOpcodeName); + if(pThis->opcode == opcode_FUNC_CALL) { + CHKiRet(vm.FindRSFunctionName(pThis->operand.rsf, &pStrVar)); + assert(pStrVar != NULL); + } else { + CHKiRet(rsCStrConstruct(&pStrVar)); + if(pThis->operand.pVar != NULL) { + CHKiRet(var.Obj2Str(pThis->operand.pVar, pStrVar)); + } + } + CHKiRet(cstrFinalize(pStrVar)); + dbgoprint((obj_t*) pThis, "%.12s\t%s\n", pOpcodeName, rsCStrGetSzStrNoNULL(pStrVar)); + if(pThis->opcode != opcode_FUNC_CALL) + rsCStrDestruct(&pStrVar); +finalize_it: +ENDobjDebugPrint(vmop) + + +/* This function is similar to DebugPrint, but does not send its output to + * the debug log but instead to a caller-provided string. The idea here is that + * we can use this string to get a textual representation of an operation. + * Among others, this is useful for creating testbenches, our first use case for + * it. Here, it enables simple comparison of the resulting program to a + * reference program by simple string compare. + * Note that the caller must initialize the string object. We always add + * data to it. So, it can be easily combined into a chain of methods + * to generate the final string. + * rgerhards, 2008-07-04 + */ +static rsRetVal +Obj2Str(vmop_t *pThis, cstr_t *pstrPrg) +{ + uchar *pOpcodeName; + cstr_t *pcsFuncName; + uchar szBuf[2048]; + size_t lenBuf; + DEFiRet; + + ISOBJ_TYPE_assert(pThis, vmop); + assert(pstrPrg != NULL); + vmopOpcode2Str(pThis, &pOpcodeName); + lenBuf = snprintf((char*) szBuf, sizeof(szBuf), "%s\t", pOpcodeName); + CHKiRet(rsCStrAppendStrWithLen(pstrPrg, szBuf, lenBuf)); + if(pThis->opcode == opcode_FUNC_CALL) { + CHKiRet(vm.FindRSFunctionName(pThis->operand.rsf, &pcsFuncName)); + CHKiRet(rsCStrAppendCStr(pstrPrg, pcsFuncName)); + } else { + if(pThis->operand.pVar != NULL) + CHKiRet(var.Obj2Str(pThis->operand.pVar, pstrPrg)); + } + CHKiRet(cstrAppendChar(pstrPrg, '\n')); + +finalize_it: + RETiRet; +} + + +/* set function + * rgerhards, 2009-04-06 + */ +static rsRetVal +vmopSetFunc(vmop_t *pThis, cstr_t *pcsFuncName) +{ + prsf_t rsf; /* pointer to function */ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmop); + CHKiRet(vm.FindRSFunction(pcsFuncName, &rsf)); /* check if function exists and obtain pointer to it */ + assert(rsf != NULL); /* just double-check, would be very hard to find! */ + pThis->operand.rsf = rsf; +finalize_it: + RETiRet; +} + + +/* set operand (variant case) + * rgerhards, 2008-02-20 + */ +static rsRetVal +vmopSetVar(vmop_t *pThis, var_t *pVar) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmop); + ISOBJ_TYPE_assert(pVar, var); + pThis->operand.pVar = pVar; + RETiRet; +} + + +/* set operation + * rgerhards, 2008-02-20 + */ +static rsRetVal +vmopSetOpcode(vmop_t *pThis, opcode_t opcode) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmop); + pThis->opcode = opcode; + RETiRet; +} + + +/* a way to turn an opcode into a readable string + */ +static rsRetVal +vmopOpcode2Str(vmop_t *pThis, uchar **ppName) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmop); + + switch(pThis->opcode) { + case opcode_OR: + *ppName = (uchar*) "or"; + break; + case opcode_AND: + *ppName = (uchar*) "and"; + break; + case opcode_PLUS: + *ppName = (uchar*) "add"; + break; + case opcode_MINUS: + *ppName = (uchar*) "sub"; + break; + case opcode_TIMES: + *ppName = (uchar*) "mul"; + break; + case opcode_DIV: + *ppName = (uchar*) "div"; + break; + case opcode_MOD: + *ppName = (uchar*) "mod"; + break; + case opcode_NOT: + *ppName = (uchar*) "not"; + break; + case opcode_CMP_EQ: + *ppName = (uchar*) "cmp_=="; + break; + case opcode_CMP_NEQ: + *ppName = (uchar*) "cmp_!="; + break; + case opcode_CMP_LT: + *ppName = (uchar*) "cmp_<"; + break; + case opcode_CMP_GT: + *ppName = (uchar*) "cmp_>"; + break; + case opcode_CMP_LTEQ: + *ppName = (uchar*) "cmp_<="; + break; + case opcode_CMP_CONTAINS: + *ppName = (uchar*) "contains"; + break; + case opcode_CMP_STARTSWITH: + *ppName = (uchar*) "startswith"; + break; + case opcode_CMP_GTEQ: + *ppName = (uchar*) "cmp_>="; + break; + case opcode_PUSHSYSVAR: + *ppName = (uchar*) "push_sysvar"; + break; + case opcode_PUSHMSGVAR: + *ppName = (uchar*) "push_msgvar"; + break; + case opcode_PUSHCONSTANT: + *ppName = (uchar*) "push_const"; + break; + case opcode_POP: + *ppName = (uchar*) "pop"; + break; + case opcode_UNARY_MINUS: + *ppName = (uchar*) "unary_minus"; + break; + case opcode_STRADD: + *ppName = (uchar*) "strconcat"; + break; + case opcode_FUNC_CALL: + *ppName = (uchar*) "func_call"; + break; + default: + *ppName = (uchar*) "!invalid_opcode!"; + break; + } + + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(vmop) +CODESTARTobjQueryInterface(vmop) + if(pIf->ifVersion != vmopCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = vmopConstruct; + pIf->ConstructFinalize = vmopConstructFinalize; + pIf->Destruct = vmopDestruct; + pIf->DebugPrint = vmopDebugPrint; + pIf->SetFunc = vmopSetFunc; + pIf->SetOpcode = vmopSetOpcode; + pIf->SetVar = vmopSetVar; + pIf->Opcode2Str = vmopOpcode2Str; + pIf->Obj2Str = Obj2Str; +finalize_it: +ENDobjQueryInterface(vmop) + + +/* Initialize the vmop class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(vmop, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(var, CORE_COMPONENT)); + CHKiRet(objUse(vm, CORE_COMPONENT)); + + OBJSetMethodHandler(objMethod_DEBUGPRINT, vmopDebugPrint); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, vmopConstructFinalize); +ENDObjClassInit(vmop) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/vmop.h rsyslog-5.10.1/runtime/vmop.h --- rsyslog-7.6.0/runtime/vmop.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vmop.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,126 @@ +/* The vmop object. + * + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_VMOP_H +#define INCLUDED_VMOP_H + +#include "ctok_token.h" +#include "vmstk.h" +#include "stringbuf.h" + +/* machine instructions types */ +typedef enum { /* do NOT start at 0 to detect uninitialized types after calloc() */ + opcode_INVALID = 0, + /* for simplicity of debugging and reading dumps, we use the same IDs + * that the tokenizer uses where this applicable. + */ + opcode_OR = ctok_OR, + opcode_AND = ctok_AND, + opcode_STRADD= ctok_STRADD, + opcode_PLUS = ctok_PLUS, + opcode_MINUS = ctok_MINUS, + opcode_TIMES = ctok_TIMES, /* "*" */ + opcode_DIV = ctok_DIV, + opcode_MOD = ctok_MOD, + opcode_NOT = ctok_NOT, + opcode_CMP_EQ = ctok_CMP_EQ, /* all compare operations must be in a row */ + opcode_CMP_NEQ = ctok_CMP_NEQ, + opcode_CMP_LT = ctok_CMP_LT, + opcode_CMP_GT = ctok_CMP_GT, + opcode_CMP_LTEQ = ctok_CMP_LTEQ, + opcode_CMP_CONTAINS = ctok_CMP_CONTAINS, + opcode_CMP_STARTSWITH = ctok_CMP_STARTSWITH, + opcode_CMP_CONTAINSI = ctok_CMP_CONTAINSI, + opcode_CMP_STARTSWITHI = ctok_CMP_STARTSWITHI, + opcode_CMP_GTEQ = ctok_CMP_GTEQ, /* end compare operations */ + /* here we start our own codes */ + opcode_POP = 1000, /* requires var operand to receive result */ + opcode_PUSHSYSVAR = 1001, /* requires var operand */ + opcode_PUSHMSGVAR = 1002, /* requires var operand */ + opcode_PUSHCONSTANT = 1003, /* requires var operand */ + opcode_UNARY_MINUS = 1010, + opcode_FUNC_CALL = 1012, + opcode_END_PROG = 2000 +} opcode_t; + + +/* Additional doc, operation specific + + FUNC_CALL + All parameter passing is via the stack. Parameters are placed onto the stack in reverse order, + that means the last parameter is on top of the stack, the first at the bottom location. + At the actual top of the stack is the number of parameters. This permits functions to be + called with variable number of arguments. The function itself is responsible for poping + the right number of parameters of the stack and complaining if the number is incorrect. + On exit, a single return value must be pushed onto the stack. The FUNC_CALL operation + is generic. Its pVar argument contains the function name string (TODO: very slow, make + faster in later releases). + + Sample Function call: sampleFunc(p1, p2, p3) ; returns number 4711 (sample) + Stacklayout on entry (order is top to bottom): + 3 + p3 + p2 + p1 + ... other vars ... + + Stack on exit + 4711 + ... other vars ... + + */ + + +/* the vmop object */ +typedef struct vmop_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + opcode_t opcode; + union { + var_t *pVar; + prsf_t rsf; /* pointer to function for "call" instruction */ + } operand; + struct vmop_s *pNext; /* next operation or NULL, if end of program (logically this belongs to vmprg) */ +} vmop_t; + + +/* interfaces */ +BEGINinterface(vmop) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(vmop); + rsRetVal (*Construct)(vmop_t **ppThis); + rsRetVal (*ConstructFinalize)(vmop_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(vmop_t **ppThis); + rsRetVal (*SetOpcode)(vmop_t *pThis, opcode_t opcode); + rsRetVal (*SetVar)(vmop_t *pThis, var_t *pVar); + rsRetVal (*Opcode2Str)(vmop_t *pThis, uchar **ppName); + rsRetVal (*Obj2Str)(vmop_t *pThis, cstr_t *pstr); + /* v2 */ + rsRetVal (*SetFunc)(vmop_t *pThis, cstr_t *pcsFuncName); +ENDinterface(vmop) +#define vmopCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ +/* interface changes, v1 -> v2 + * added SetFuct after existing function pointers -- rgerhards, 2009-04-06 + */ + +/* the remaining prototypes */ +PROTOTYPEObj(vmop); + +#endif /* #ifndef INCLUDED_VMOP_H */ diff -Nru rsyslog-7.6.0/runtime/vmprg.c rsyslog-5.10.1/runtime/vmprg.c --- rsyslog-7.6.0/runtime/vmprg.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vmprg.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,234 @@ +/* vmprg.c - abstracts a program (bytecode) for the rsyslog virtual machine + * + * Module begun 2008-02-20 by Rainer Gerhards + * + * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "vmprg.h" +#include "stringbuf.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(vmop) + + +/* Standard-Constructor + */ +BEGINobjConstruct(vmprg) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(vmprg) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +static rsRetVal +vmprgConstructFinalize(vmprg_t __attribute__((unused)) *pThis) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmprg); + RETiRet; +} + + +/* destructor for the vmprg object */ +BEGINobjDestruct(vmprg) /* be sure to specify the object type also in END and CODESTART macros! */ + vmop_t *pOp; + vmop_t *pTmp; +CODESTARTobjDestruct(vmprg) + /* we need to destruct the program elements! */ + for(pOp = pThis->vmopRoot ; pOp != NULL ; ) { + pTmp = pOp; + pOp = pOp->pNext; + vmop.Destruct(&pTmp); + } +ENDobjDestruct(vmprg) + + +/* destructor for the vmop object */ +BEGINobjDebugPrint(vmprg) /* be sure to specify the object type also in END and CODESTART macros! */ + vmop_t *pOp; +CODESTARTobjDebugPrint(vmprg) + dbgoprint((obj_t*) pThis, "VM Program:\n"); + for(pOp = pThis->vmopRoot ; pOp != NULL ; pOp = pOp->pNext) { + vmop.DebugPrint(pOp); + } +ENDobjDebugPrint(vmprg) + + +/* This function is similar to DebugPrint, but does not send its output to + * the debug log but instead to a caller-provided string. The idea here is that + * we can use this string to get a textual representation of a bytecode program. + * Among others, this is useful for creating testbenches, our first use case for + * it. Here, it enables simple comparison of the resulting program to a + * reference program by simple string compare. + * Note that the caller must initialize the string object. We always add + * data to it. So, it can be easily combined into a chain of methods + * to generate the final string. + * rgerhards, 2008-07-04 + */ +static rsRetVal +Obj2Str(vmprg_t *pThis, cstr_t *pstrPrg) +{ + uchar szAddr[12]; + vmop_t *pOp; + int i; + int lenAddr; + DEFiRet; + + ISOBJ_TYPE_assert(pThis, vmprg); + assert(pstrPrg != NULL); + i = 0; /* "program counter" */ + for(pOp = pThis->vmopRoot ; pOp != NULL ; pOp = pOp->pNext) { + lenAddr = snprintf((char*)szAddr, sizeof(szAddr), "%8.8d: ", i++); + CHKiRet(rsCStrAppendStrWithLen(pstrPrg, szAddr, lenAddr)); + vmop.Obj2Str(pOp, pstrPrg); + } + +finalize_it: + RETiRet; +} + + +/* add an operation (instruction) to the end of the current program. This + * function is expected to be called while creating the program, but never + * again after this is done and it is being executed. Results are undefined if + * it is called after execution. + */ +static rsRetVal +vmprgAddOperation(vmprg_t *pThis, vmop_t *pOp) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, vmprg); + ISOBJ_TYPE_assert(pOp, vmop); + + if(pThis->vmopRoot == NULL) { + pThis->vmopRoot = pOp; + } else { + pThis->vmopLast->pNext = pOp; + } + pThis->vmopLast = pOp; + + RETiRet; +} + + +/* this is a shortcut for high-level callers. It creates a new vmop, sets its + * parameters and adds it to the program - all in one big step. If there is no + * var associated with this operation, the caller can simply supply NULL as + * pVar. + */ +static rsRetVal +vmprgAddVarOperation(vmprg_t *pThis, opcode_t opcode, var_t *pVar) +{ + DEFiRet; + vmop_t *pOp; + + ISOBJ_TYPE_assert(pThis, vmprg); + + /* construct and fill vmop */ + CHKiRet(vmop.Construct(&pOp)); + CHKiRet(vmop.ConstructFinalize(pOp)); + CHKiRet(vmop.SetOpcode(pOp, opcode)); + if(pVar != NULL) + CHKiRet(vmop.SetVar(pOp, pVar)); + + /* and add it to the program */ + CHKiRet(vmprgAddOperation(pThis, pOp)); + +finalize_it: + RETiRet; +} + + +/* this is another shortcut for high-level callers. It is similar to vmprgAddVarOperation + * but adds a call operation. Among others, this include a check if the function + * is known. + */ +static rsRetVal +vmprgAddCallOperation(vmprg_t *pThis, cstr_t *pcsName) +{ + DEFiRet; + vmop_t *pOp; + + ISOBJ_TYPE_assert(pThis, vmprg); + + /* construct and fill vmop */ + CHKiRet(vmop.Construct(&pOp)); + CHKiRet(vmop.ConstructFinalize(pOp)); + CHKiRet(vmop.SetFunc(pOp, pcsName)); + CHKiRet(vmop.SetOpcode(pOp, opcode_FUNC_CALL)); + + /* and add it to the program */ + CHKiRet(vmprgAddOperation(pThis, pOp)); + +finalize_it: + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(vmprg) +CODESTARTobjQueryInterface(vmprg) + if(pIf->ifVersion != vmprgCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = vmprgConstruct; + pIf->ConstructFinalize = vmprgConstructFinalize; + pIf->Destruct = vmprgDestruct; + pIf->DebugPrint = vmprgDebugPrint; + pIf->Obj2Str = Obj2Str; + pIf->AddOperation = vmprgAddOperation; + pIf->AddVarOperation = vmprgAddVarOperation; + pIf->AddCallOperation = vmprgAddCallOperation; +finalize_it: +ENDobjQueryInterface(vmprg) + + +/* Initialize the vmprg class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(vmprg, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(vmop, CORE_COMPONENT)); + + /* set our own handlers */ + OBJSetMethodHandler(objMethod_DEBUGPRINT, vmprgDebugPrint); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, vmprgConstructFinalize); +ENDObjClassInit(vmprg) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/vmprg.h rsyslog-5.10.1/runtime/vmprg.h --- rsyslog-7.6.0/runtime/vmprg.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vmprg.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,67 @@ +/* The vmprg object. + * + * The program is made up of vmop_t's, one after another. When we support + * branching (or user-defined functions) at some time, well do this via + * special branch opcodes. They will then contain the actual memory + * address of a logical program entry that we shall branch to. Other than + * that, all execution is serial - that is one opcode is executed after + * the other. This class implements a logical program store, modelled + * after real main memory. A linked list of opcodes is used to implement it. + * In the future, we may use linked lists of array's to enhance performance, + * but for the time being we have taken the simplistic approach (which also + * reduces risk of bugs during initial development). The necessary pointers + * for this are already implemented in vmop. Though this is not the 100% + * correct place, we have opted this time in favor of performance, which + * made them go there. + * + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_VMPRG_H +#define INCLUDED_VMPRG_H + +#include "vmop.h" +#include "stringbuf.h" + +/* the vmprg object */ +typedef struct vmprg_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + vmop_t *vmopRoot; /* start of program */ + vmop_t *vmopLast; /* last vmop of program (for adding new ones) */ +} vmprg_t; + + +/* interfaces */ +BEGINinterface(vmprg) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(vmprg); + rsRetVal (*Construct)(vmprg_t **ppThis); + rsRetVal (*ConstructFinalize)(vmprg_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(vmprg_t **ppThis); + rsRetVal (*AddOperation)(vmprg_t *pThis, vmop_t *pOp); + rsRetVal (*AddVarOperation)(vmprg_t *pThis, opcode_t opcode, var_t *pVar); + rsRetVal (*Obj2Str)(vmprg_t *pThis, cstr_t *pstr); + /* v2 (4.1.7) */ + rsRetVal (*AddCallOperation)(vmprg_t *pThis, cstr_t *pVar); /* added 2009-04-06 */ +ENDinterface(vmprg) +#define vmprgCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(vmprg); + +#endif /* #ifndef INCLUDED_VMPRG_H */ diff -Nru rsyslog-7.6.0/runtime/vmstk.c rsyslog-5.10.1/runtime/vmstk.c --- rsyslog-7.6.0/runtime/vmstk.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vmstk.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,232 @@ +/* vmstk.c - the arithmetic stack of a virtual machine. + * + * Module begun 2008-02-21 by Rainer Gerhards + * + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "config.h" +#include +#include + +#include "rsyslog.h" +#include "obj.h" +#include "vmstk.h" + +/* static data */ +DEFobjStaticHelpers +DEFobjCurrIf(var) + + +/* Standard-Constructor + */ +BEGINobjConstruct(vmstk) /* be sure to specify the object type also in END macro! */ +ENDobjConstruct(vmstk) + + +/* ConstructionFinalizer + * rgerhards, 2008-01-09 + */ +static rsRetVal +vmstkConstructFinalize(vmstk_t __attribute__((unused)) *pThis) +{ + DEFiRet; + ISOBJ_TYPE_assert(pThis, vmstk); + RETiRet; +} + + +/* destructor for the vmstk object */ +BEGINobjDestruct(vmstk) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(vmstk) +ENDobjDestruct(vmstk) + + +/* debugprint for the vmstk object */ +BEGINobjDebugPrint(vmstk) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDebugPrint(vmstk) + dbgoprint((obj_t*) pThis, "stack contents:\n"); +ENDobjDebugPrint(vmstk) + + +/* push a value on the stack. The provided pVar is now owned + * by the stack. If the user intends to continue use it, it + * must be duplicated. + */ +static rsRetVal +push(vmstk_t *pThis, var_t *pVar) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, vmstk); + ISOBJ_TYPE_assert(pVar, var); + + if(pThis->iStkPtr >= VMSTK_SIZE) + ABORT_FINALIZE(RS_RET_OUT_OF_STACKSPACE); + + pThis->vStk[pThis->iStkPtr++] = pVar; + +finalize_it: + RETiRet; +} + + +/* pop a value from the stack + * IMPORTANT: the stack pointer always points to the NEXT FREE entry. So in + * order to pop, we must access the element one below the stack pointer. + * The user is responsible for destructing the ppVar returned. + */ +static rsRetVal +pop(vmstk_t *pThis, var_t **ppVar) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, vmstk); + ASSERT(ppVar != NULL); + + if(pThis->iStkPtr == 0) + ABORT_FINALIZE(RS_RET_STACK_EMPTY); + + *ppVar = pThis->vStk[--pThis->iStkPtr]; + +finalize_it: + RETiRet; +} + + +/* pop a boolean value from the stack + * The user is responsible for destructing the ppVar returned. + */ +static rsRetVal +popBool(vmstk_t *pThis, var_t **ppVar) +{ + DEFiRet; + + /* assertions are done in pop(), we do not duplicate here */ + CHKiRet(pop(pThis, ppVar)); + CHKiRet(var.ConvToBool(*ppVar)); + +finalize_it: + RETiRet; +} + + +/* pop a number value from the stack + * The user is responsible for destructing the ppVar returned. + */ +static rsRetVal +popNumber(vmstk_t *pThis, var_t **ppVar) +{ + DEFiRet; + + /* assertions are done in pop(), we do not duplicate here */ + CHKiRet(pop(pThis, ppVar)); + CHKiRet(var.ConvToNumber(*ppVar)); + +finalize_it: + RETiRet; +} + + +/* pop a number value from the stack + * The user is responsible for destructing the ppVar returned. + */ +static rsRetVal +popString(vmstk_t *pThis, var_t **ppVar) +{ + DEFiRet; + + /* assertions are done in pop(), we do not duplicate here */ + CHKiRet(pop(pThis, ppVar)); + CHKiRet(var.ConvToString(*ppVar)); + +finalize_it: + RETiRet; +} + + +/* pop two variables for a common operation, e.g. a compare. When this + * functions returns, both variables have the same type, but the type + * is not set to anything specific. + * The user is responsible for destructing the ppVar's returned. + * A quick note on the name: it means pop 2 variable for a common + * opertion - just in case you wonder (I don't really like the name, + * but I didn't come up with a better one...). + * rgerhards, 2008-02-25 + */ +static rsRetVal +pop2CommOp(vmstk_t *pThis, var_t **ppVar1, var_t **ppVar2) +{ + DEFiRet; + + /* assertions are done in pop(), we do not duplicate here */ + /* operand two must be popped first, because it is at the top of stack */ + CHKiRet(pop(pThis, ppVar2)); + CHKiRet(pop(pThis, ppVar1)); + CHKiRet(var.ConvForOperation(*ppVar1, *ppVar2)); + +finalize_it: + RETiRet; +} + + +/* queryInterface function + * rgerhards, 2008-02-21 + */ +BEGINobjQueryInterface(vmstk) +CODESTARTobjQueryInterface(vmstk) + if(pIf->ifVersion != vmstkCURR_IF_VERSION) { /* check for current version, increment on each change */ + ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); + } + + /* ok, we have the right interface, so let's fill it + * Please note that we may also do some backwards-compatibility + * work here (if we can support an older interface version - that, + * of course, also affects the "if" above). + */ + pIf->Construct = vmstkConstruct; + pIf->ConstructFinalize = vmstkConstructFinalize; + pIf->Destruct = vmstkDestruct; + pIf->DebugPrint = vmstkDebugPrint; + pIf->Push = push; + pIf->Pop = pop; + pIf->PopBool = popBool; + pIf->PopNumber = popNumber; + pIf->PopString = popString; + pIf->Pop2CommOp = pop2CommOp; + +finalize_it: +ENDobjQueryInterface(vmstk) + + +/* Initialize the vmstk class. Must be called as the very first method + * before anything else is called inside this class. + * rgerhards, 2008-02-19 + */ +BEGINObjClassInit(vmstk, 1, OBJ_IS_CORE_MODULE) /* class, version */ + /* request objects we use */ + CHKiRet(objUse(var, CORE_COMPONENT)); + + /* set our own handlers */ + OBJSetMethodHandler(objMethod_DEBUGPRINT, vmstkDebugPrint); + OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, vmstkConstructFinalize); +ENDObjClassInit(vmstk) + +/* vi:set ai: + */ diff -Nru rsyslog-7.6.0/runtime/vmstk.h rsyslog-5.10.1/runtime/vmstk.h --- rsyslog-7.6.0/runtime/vmstk.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/runtime/vmstk.h 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,54 @@ +/* The vmstk object. + * + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of the rsyslog runtime library. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * -or- + * see COPYING.ASL20 in the source distribution + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef INCLUDED_VMSTK_H +#define INCLUDED_VMSTK_H + +/* The max size of the stack - TODO: make configurable */ +#define VMSTK_SIZE 256 + +/* the vmstk object */ +struct vmstk_s { + BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ + var_t *vStk[VMSTK_SIZE];/* the actual stack */ + int iStkPtr; /* stack pointer, points to next free location, grows from 0 --> topend */ +}; + + +/* interfaces */ +BEGINinterface(vmstk) /* name must also be changed in ENDinterface macro! */ + INTERFACEObjDebugPrint(vmstk); + rsRetVal (*Construct)(vmstk_t **ppThis); + rsRetVal (*ConstructFinalize)(vmstk_t __attribute__((unused)) *pThis); + rsRetVal (*Destruct)(vmstk_t **ppThis); + rsRetVal (*Push)(vmstk_t *pThis, var_t *pVar); + rsRetVal (*Pop)(vmstk_t *pThis, var_t **ppVar); + rsRetVal (*PopBool)(vmstk_t *pThis, var_t **ppVar); + rsRetVal (*PopNumber)(vmstk_t *pThis, var_t **ppVar); + rsRetVal (*PopString)(vmstk_t *pThis, var_t **ppVar); + rsRetVal (*Pop2CommOp)(vmstk_t *pThis, var_t **ppVar1, var_t **ppVar2); +ENDinterface(vmstk) +#define vmstkCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ + + +/* prototypes */ +PROTOTYPEObj(vmstk); + +#endif /* #ifndef INCLUDED_VMSTK_H */ diff -Nru rsyslog-7.6.0/runtime/wti.c rsyslog-5.10.1/runtime/wti.c --- rsyslog-7.6.0/runtime/wti.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/wti.c 2012-10-17 14:41:20.000000000 +0000 @@ -121,7 +121,7 @@ if(wtiGetState(pThis)) { /* we first try the cooperative "cancel" interface */ pthread_kill(pThis->thrdID, SIGTTIN); - DBGPRINTF("sent SIGTTIN to worker thread 0x%x\n", (unsigned) pThis->thrdID); + dbgprintf("sent SIGTTIN to worker thread 0x%x\n", (unsigned) pThis->thrdID); } RETiRet; @@ -148,13 +148,13 @@ if(wtiGetState(pThis)) { /* we first try the cooperative "cancel" interface */ pthread_kill(pThis->thrdID, SIGTTIN); - DBGPRINTF("sent SIGTTIN to worker thread 0x%x, giving it a chance to terminate\n", (unsigned) pThis->thrdID); + dbgprintf("sent SIGTTIN to worker thread 0x%x, giving it a chance to terminate\n", (unsigned) pThis->thrdID); srSleep(0, 10000); } if(wtiGetState(pThis)) { - DBGPRINTF("cooperative worker termination failed, using cancellation...\n"); - DBGOPRINT((obj_t*) pThis, "canceling worker thread\n"); + dbgprintf("cooperative worker termination failed, using cancellation...\n"); + dbgoprint((obj_t*) pThis, "canceling worker thread\n"); pthread_cancel(pThis->thrdID); /* now wait until the thread terminates... */ while(wtiGetState(pThis)) { @@ -171,7 +171,6 @@ CODESTARTobjDestruct(wti) /* actual destruction */ batchFree(&pThis->batch); - pthread_cond_destroy(&pThis->pcondBusy); DESTROY_ATOMIC_HELPER_MUT(pThis->mutIsRunning); free(pThis->pszDbgHdr); @@ -182,7 +181,6 @@ */ BEGINobjConstruct(wti) /* be sure to specify the object type also in END macro! */ INIT_ATOMIC_HELPER_MUT(pThis->mutIsRunning); - pthread_cond_init(&pThis->pcondBusy, NULL); ENDobjConstruct(wti) @@ -197,7 +195,7 @@ ISOBJ_TYPE_assert(pThis, wti); - DBGPRINTF("%s: finalizing construction of worker instance data\n", wtiGetDbgHdr(pThis)); + dbgprintf("%s: finalizing construction of worker instance data\n", wtiGetDbgHdr(pThis)); /* initialize our thread instance descriptor (no concurrency here) */ pThis->bIsRunning = RSFALSE; @@ -251,15 +249,15 @@ if(pThis->bAlwaysRunning) { /* never shut down any started worker */ - d_pthread_cond_wait(&pThis->pcondBusy, pWtp->pmutUsr); + d_pthread_cond_wait(pWtp->pcondBusy, pWtp->pmutUsr); } else { timeoutComp(&t, pWtp->toWrkShutdown);/* get absolute timeout */ - if(d_pthread_cond_timedwait(&pThis->pcondBusy, pWtp->pmutUsr, &t) != 0) { + if(d_pthread_cond_timedwait(pWtp->pcondBusy, pWtp->pmutUsr, &t) != 0) { DBGPRINTF("%s: inactivity timeout, worker terminating...\n", wtiGetDbgHdr(pThis)); *pbInactivityTOOccured = 1; /* indicate we had a timeout */ } } - DBGOPRINT((obj_t*) pThis, "worker awoke from idle processing\n"); + dbgoprint((obj_t*) pThis, "worker awoke from idle processing\n"); ENDfunc } @@ -302,7 +300,7 @@ if(terminateRet == RS_RET_TERMINATE_NOW) { /* we now need to free the old batch */ localRet = pWtp->pfObjProcessed(pWtp->pUsr, pThis); - DBGOPRINT((obj_t*) pThis, "terminating worker because of TERMINATE_NOW mode, del iRet %d\n", + dbgoprint((obj_t*) pThis, "terminating worker because of TERMINATE_NOW mode, del iRet %d\n", localRet); d_pthread_mutex_unlock(pWtp->pmutUsr); break; @@ -320,7 +318,7 @@ } else if(localRet == RS_RET_IDLE) { if(terminateRet == RS_RET_TERMINATE_WHEN_IDLE || bInactivityTOOccured) { d_pthread_mutex_unlock(pWtp->pmutUsr); - DBGOPRINT((obj_t*) pThis, "terminating worker terminateRet=%d, bInactivityTOOccured=%d\n", + dbgoprint((obj_t*) pThis, "terminating worker terminateRet=%d, bInactivityTOOccured=%d\n", terminateRet, bInactivityTOOccured); break; /* end of loop */ } diff -Nru rsyslog-7.6.0/runtime/wti.h rsyslog-5.10.1/runtime/wti.h --- rsyslog-7.6.0/runtime/wti.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/wti.h 2012-09-23 10:29:49.000000000 +0000 @@ -37,7 +37,6 @@ wtp_t *pWtp; /* my worker thread pool (important if only the work thread instance is passed! */ batch_t batch; /* pointer to an object array meaningful for current user pointer (e.g. queue pUsr data elemt) */ uchar *pszDbgHdr; /* header string for debug messages */ - pthread_cond_t pcondBusy; /* condition to wake up the worker, protected by pmutUsr in wtp */ DEF_ATOMIC_HELPER_MUT(mutIsRunning); }; diff -Nru rsyslog-7.6.0/runtime/wtp.c rsyslog-5.10.1/runtime/wtp.c --- rsyslog-7.6.0/runtime/wtp.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/wtp.c 2012-09-26 09:31:30.000000000 +0000 @@ -233,9 +233,9 @@ /* lock mutex to prevent races (may otherwise happen during idle processing and such...) */ d_pthread_mutex_lock(pThis->pmutUsr); wtpSetState(pThis, tShutdownCmd); + pthread_cond_broadcast(pThis->pcondBusy); /* wake up all workers */ /* awake workers in retry loop */ for(i = 0 ; i < pThis->iNumWorkerThreads ; ++i) { - pthread_cond_signal(&pThis->pWrkr[i]->pcondBusy); wtiWakeupThrd(pThis->pWrkr[i]); } d_pthread_mutex_unlock(pThis->pmutUsr); @@ -381,7 +381,6 @@ if(prctl(PR_SET_NAME, thrdName, 0, 0, 0) != 0) { DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis)); } - dbgOutputTID((char*)thrdName); # endif pthread_cleanup_push(wtpWrkrExecCancelCleanup, pWti); @@ -455,7 +454,7 @@ { DEFiRet; int nMissing; /* number workers missing to run */ - int i, nRunning; + int i; ISOBJ_TYPE_assert(pThis, wtp); @@ -475,13 +474,7 @@ CHKiRet(wtpStartWrkr(pThis)); } } else { - /* we have needed number of workers, but they may be sleeping */ - for(i = 0, nRunning = 0; i < pThis->iNumWorkerThreads && nRunning < nMaxWrkr; ++i) { - if (wtiGetState(pThis->pWrkr[i]) != WRKTHRD_STOPPED) { - pthread_cond_signal(&pThis->pWrkr[i]->pcondBusy); - nRunning++; - } - } + pthread_cond_signal(pThis->pcondBusy); } @@ -496,6 +489,7 @@ DEFpropSetMeth(wtp, iNumWorkerThreads, int) DEFpropSetMeth(wtp, pUsr, void*) DEFpropSetMethPTR(wtp, pmutUsr, pthread_mutex_t) +DEFpropSetMethPTR(wtp, pcondBusy, pthread_cond_t) DEFpropSetMethFP(wtp, pfChkStopWrkr, rsRetVal(*pVal)(void*, int)) DEFpropSetMethFP(wtp, pfRateLimiter, rsRetVal(*pVal)(void*)) DEFpropSetMethFP(wtp, pfGetDeqBatchSize, rsRetVal(*pVal)(void*, int*)) diff -Nru rsyslog-7.6.0/runtime/wtp.h rsyslog-5.10.1/runtime/wtp.h --- rsyslog-7.6.0/runtime/wtp.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/runtime/wtp.h 2012-10-15 13:45:04.000000000 +0000 @@ -56,6 +56,7 @@ void *pUsr; /* pointer to user object (in this case, the queue the wtp belongs to) */ pthread_attr_t attrThrd;/* attribute for new threads (created just once and cached here) */ pthread_mutex_t *pmutUsr; + pthread_cond_t *pcondBusy; /* condition the user will signal "busy again, keep runing" on (awakes worker) */ rsRetVal (*pfChkStopWrkr)(void *pUsr, int); rsRetVal (*pfGetDeqBatchSize)(void *pUsr, int*); /* obtains max dequeue count from queue config */ rsRetVal (*pfObjProcessed)(void *pUsr, wti_t *pWti); /* indicate user object is processed */ @@ -94,5 +95,6 @@ PROTOTYPEpropSetMeth(wtp, pUsr, void*); PROTOTYPEpropSetMeth(wtp, iNumWorkerThreads, int); PROTOTYPEpropSetMethPTR(wtp, pmutUsr, pthread_mutex_t); +PROTOTYPEpropSetMethPTR(wtp, pcondBusy, pthread_cond_t); #endif /* #ifndef WTP_H_INCLUDED */ diff -Nru rsyslog-7.6.0/slackware/rc.rsyslogd rsyslog-5.10.1/slackware/rc.rsyslogd --- rsyslog-7.6.0/slackware/rc.rsyslogd 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/slackware/rc.rsyslogd 2012-01-24 16:37:09.000000000 +0000 @@ -0,0 +1,68 @@ +#!/bin/sh +# Start/stop/restart the system logging daemons. +# +# Written for Slackware Linux by Patrick J. Volkerding . +# Modded for rsyslogd by Chris Elvidge Sept 2005 +# + +create_xconsole() +{ + if [ ! -e /dev/xconsole ]; then + mknod -m 640 /dev/xconsole p + else + chmod 0640 /dev/xconsole + fi + chown 0:0 /dev/xconsole +} + +rsyslogd_start() { + if [ -x /usr/sbin/rsyslogd -a -x /usr/sbin/klogd ]; then + echo "Starting rsyslogd / klogd daemons: " +# this one listens on the "usual" socket /dev/log + echo "/usr/sbin/rsyslogd -i $pidfile1" + /usr/sbin/rsyslogd -i "$pidfile1" +# this one listens only to the UDP port + sleep 1 + echo "/usr/sbin/rsyslogd -o -r0 -f $confile2 -i $pidfile2" + /usr/sbin/rsyslogd -o -r0 -f "$confile2" -i "$pidfile2" + sleep 1 # prevent syslogd/klogd race condition on SMP kernels + echo "/usr/sbin/klogd -c 3 -x" + # '-c 3' = display level 'error' or higher messages on console + # '-x' = turn off broken EIP translation + /usr/sbin/klogd -c 3 -x + fi +} + +rsyslogd_stop() { + killall rsyslogd 2> /dev/null + killall klogd 2> /dev/null + /usr/bin/rm pidfile1 2> /dev/null + /usr/bin/rm pidfile2 2> /dev/null +} + +rsyslogd_restart() { + rsyslogd_stop + sleep 1 + rsyslogd_start +} + +confile1=/etc/rsyslog.conf +pidfile1=/var/run/rsyslogd.pid + +confile2=/etc/rsyslog.udp.conf +pidfile2=/var/run/rsyslogd.udp.pid + +case "$1" in +'start') + create_xconsole + rsyslogd_start + ;; +'stop') + rsyslogd_stop + ;; +'restart') + rsyslogd_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff -Nru rsyslog-7.6.0/tcpclt.c rsyslog-5.10.1/tcpclt.c --- rsyslog-7.6.0/tcpclt.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tcpclt.c 2012-10-17 14:41:20.000000000 +0000 @@ -307,7 +307,7 @@ CHKiRet(pThis->initFunc(pData)); iRet = pThis->sendFunc(pData, msg, len); - if(iRet == RS_RET_OK || iRet == RS_RET_DEFER_COMMIT || iRet == RS_RET_PREVIOUS_COMMITTED) { + if(iRet == RS_RET_OK) { /* we are done, we also use this as indication that the previous * message was succesfully received (it's not always the case, but its at * least our best shot at it -- rgerhards, 2008-03-12 diff -Nru rsyslog-7.6.0/tcpsrv.c rsyslog-5.10.1/tcpsrv.c --- rsyslog-7.6.0/tcpsrv.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tcpsrv.c 2012-10-17 14:41:20.000000000 +0000 @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #if HAVE_FCNTL_H @@ -72,10 +71,8 @@ #include "nspoll.h" #include "errmsg.h" #include "ruleset.h" -#include "ratelimit.h" #include "unicode-helper.h" - MODULE_TYPE_LIB MODULE_TYPE_NOKEEP @@ -98,26 +95,6 @@ DEFobjCurrIf(prop) DEFobjCurrIf(statsobj) -static void startWorkerPool(void); - -/* The following structure controls the worker threads. Global data is - * needed for their access. - */ -static struct wrkrInfo_s { - pthread_t tid; /* the worker's thread ID */ - pthread_cond_t run; - int idx; - tcpsrv_t *pSrv; /* pSrv == NULL -> idle */ - nspoll_t *pPoll; - void *pUsr; - sbool enabled; - long long unsigned numCalled; /* how often was this called */ -} wrkrInfo[4]; -static sbool bWrkrRunning; /* are the worker threads running? */ -static pthread_mutex_t wrkrMut; -static pthread_cond_t wrkrIdle; -static int wrkrMax = 4; -static int wrkrRunning; /* add new listener port to listener port list * rgerhards, 2009-05-21 @@ -133,8 +110,7 @@ /* create entry */ CHKmalloc(pEntry = MALLOC(sizeof(tcpLstnPortList_t))); - CHKmalloc(pEntry->pszPort = ustrdup(pszPort)); - strcpy((char*)pEntry->dfltTZ, (char*)pThis->dfltTZ); + pEntry->pszPort = pszPort; pEntry->pSrv = pThis; pEntry->pRuleset = pThis->pRuleset; pEntry->bSuppOctetFram = bSuppOctetFram; @@ -153,12 +129,9 @@ snprintf((char*)statname, sizeof(statname), "%s(%s)", pThis->pszInputName, pszPort); statname[sizeof(statname)-1] = '\0'; /* just to be on the save side... */ CHKiRet(statsobj.SetName(pEntry->stats, statname)); - CHKiRet(ratelimitNew(&pEntry->ratelimiter, "tcperver", NULL)); - ratelimitSetLinuxLike(pEntry->ratelimiter, pThis->ratelimitInterval, pThis->ratelimitBurst); - ratelimitSetThreadSafe(pEntry->ratelimiter); STATSCOUNTER_INIT(pEntry->ctrSubmit, pEntry->mutCtrSubmit); CHKiRet(statsobj.AddCounter(pEntry->stats, UCHAR_CONSTANT("submitted"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pEntry->ctrSubmit))); + ctrType_IntCtr, &(pEntry->ctrSubmit))); CHKiRet(statsobj.ConstructFinalize(pEntry->stats)); finalize_it: @@ -300,7 +273,6 @@ while(pEntry != NULL) { free(pEntry->pszPort); prop.Destruct(&pEntry->pInputName); - ratelimitDestruct(pEntry->ratelimiter); pDel = pEntry; pEntry = pEntry->pNext; free(pDel); @@ -425,7 +397,7 @@ int iSess = -1; struct sockaddr_storage *addr; uchar *fromHostFQDN = NULL; - prop_t *fromHostIP; + uchar *fromHostIP = NULL; ISOBJ_TYPE_assert(pThis, tcpsrv); assert(pLstnInfo != NULL); @@ -476,6 +448,7 @@ CHKiRet(tcps_sess.SetHost(pSess, fromHostFQDN)); fromHostFQDN = NULL; /* we handed this string over */ CHKiRet(tcps_sess.SetHostIP(pSess, fromHostIP)); + fromHostIP = NULL; /* we handed this string over */ CHKiRet(tcps_sess.SetStrm(pSess, pNewStrm)); pNewStrm = NULL; /* prevent it from being freed in error handler, now done in tcps_sess! */ CHKiRet(tcps_sess.SetMsgIdx(pSess, 0)); @@ -498,6 +471,7 @@ if(pNewStrm != NULL) netstrm.Destruct(&pNewStrm); free(fromHostFQDN); + free(fromHostIP); } RETiRet; @@ -586,137 +560,6 @@ RETiRet; } -/* process a single workset item - */ -static inline rsRetVal -processWorksetItem(tcpsrv_t *pThis, nspoll_t *pPoll, int idx, void *pUsr) -{ - tcps_sess_t *pNewSess = NULL; - DEFiRet; - - DBGPRINTF("tcpsrv: processing item %d, pUsr %p, bAbortConn\n", idx, pUsr); - if(pUsr == pThis->ppLstn) { - DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[idx]); - iRet = SessAccept(pThis, pThis->ppLstnPort[idx], &pNewSess, pThis->ppLstn[idx]); - if(iRet == RS_RET_OK) { - if(pPoll != NULL) { - CHKiRet(nspoll.Ctl(pPoll, pNewSess->pStrm, 0, pNewSess, NSDPOLL_IN, NSDPOLL_ADD)); - } - DBGPRINTF("New session created with NSD %p.\n", pNewSess); - } else { - DBGPRINTF("tcpsrv: error %d during accept\n", iRet); - } - } else { - pNewSess = (tcps_sess_t*) pUsr; - doReceive(pThis, &pNewSess, pPoll); - if(pPoll == NULL && pNewSess == NULL) { - pThis->pSessions[idx] = NULL; - } - } - -finalize_it: - RETiRet; -} - - -/* worker to process incoming requests - */ -static void * -wrkr(void *myself) -{ - struct wrkrInfo_s *me = (struct wrkrInfo_s*) myself; - - pthread_mutex_lock(&wrkrMut); - while(1) { - while(me->pSrv == NULL && glbl.GetGlobalInputTermState() == 0) { - pthread_cond_wait(&me->run, &wrkrMut); - } - if(glbl.GetGlobalInputTermState() == 1) { - --wrkrRunning; - break; - } - pthread_mutex_unlock(&wrkrMut); - - ++me->numCalled; - processWorksetItem(me->pSrv, me->pPoll, me->idx, me->pUsr); - - pthread_mutex_lock(&wrkrMut); - me->pSrv = NULL; /* indicate we are free again */ - --wrkrRunning; - pthread_cond_signal(&wrkrIdle); - } - me->enabled = 0; /* indicate we are no longer available */ - pthread_mutex_unlock(&wrkrMut); - - return NULL; -} - - -/* Process a workset, that is handle io. We become activated - * from either select or epoll handler. We split the workload - * out to a pool of threads, but try to avoid context switches - * as much as possible. - */ -static rsRetVal -processWorkset(tcpsrv_t *pThis, nspoll_t *pPoll, int numEntries, nsd_epworkset_t workset[]) -{ - int i; - int origEntries = numEntries; - DEFiRet; - - DBGPRINTF("tcpsrv: ready to process %d event entries\n", numEntries); - - while(numEntries > 0) { - if(glbl.GetGlobalInputTermState() == 1) - ABORT_FINALIZE(RS_RET_FORCE_TERM); - if(numEntries == 1) { - /* process self, save context switch */ - processWorksetItem(pThis, pPoll, workset[numEntries-1].id, workset[numEntries-1].pUsr); - } else { - pthread_mutex_lock(&wrkrMut); - /* check if there is a free worker */ - for(i = 0 ; (i < wrkrMax) && ((wrkrInfo[i].pSrv != NULL) || (wrkrInfo[i].enabled == 0)) ; ++i) - /*do search*/; - if(i < wrkrMax) { - /* worker free -> use it! */ - wrkrInfo[i].pSrv = pThis; - wrkrInfo[i].pPoll = pPoll; - wrkrInfo[i].idx = workset[numEntries -1].id; - wrkrInfo[i].pUsr = workset[numEntries -1].pUsr; - /* Note: we must increment wrkrRunning HERE and not inside the worker's - * code. This is because a worker may actually never start, and thus - * increment wrkrRunning, before we finish and check the running worker - * count. We can only avoid this by incrementing it here. - */ - ++wrkrRunning; - pthread_cond_signal(&wrkrInfo[i].run); - pthread_mutex_unlock(&wrkrMut); - } else { - pthread_mutex_unlock(&wrkrMut); - /* no free worker, so we process this one ourselfs */ - processWorksetItem(pThis, pPoll, workset[numEntries-1].id, - workset[numEntries-1].pUsr); - } - } - --numEntries; - } - - if(origEntries > 1) { - /* we now need to wait until all workers finish. This is because the - * rest of this module can not handle the concurrency introduced - * by workers running during the epoll call. - */ - pthread_mutex_lock(&wrkrMut); - while(wrkrRunning > 0) { - pthread_cond_wait(&wrkrIdle, &wrkrMut); - } - pthread_mutex_unlock(&wrkrMut); - } - -finalize_it: - RETiRet; -} - /* This function is called to gather input. * This variant here is only used if we need to work with a netstream driver @@ -724,14 +567,14 @@ */ #pragma GCC diagnostic ignored "-Wempty-body" static inline rsRetVal -RunSelect(tcpsrv_t *pThis, nsd_epworkset_t workset[], size_t sizeWorkset) +RunSelect(tcpsrv_t *pThis) { DEFiRet; int nfds; int i; - int iWorkset; int iTCPSess; int bIsReady; + tcps_sess_t *pNewSess; nssel_t *pSel = NULL; rsRetVal localRet; @@ -744,8 +587,7 @@ pthread_cleanup_push(RunCancelCleanup, (void*) &pSel); while(1) { CHKiRet(nssel.Construct(&pSel)); - if(pThis->pszDrvrName != NULL) - CHKiRet(nssel.SetDrvrName(pSel, pThis->pszDrvrName)); + // TODO: set driver CHKiRet(nssel.ConstructFinalize(pSel)); /* Add the TCP listen sockets to the list of read descriptors. */ @@ -767,21 +609,13 @@ if(glbl.GetGlobalInputTermState() == 1) break; /* terminate input! */ - iWorkset = 0; for(i = 0 ; i < pThis->iLstnCurr ; ++i) { if(glbl.GetGlobalInputTermState() == 1) ABORT_FINALIZE(RS_RET_FORCE_TERM); CHKiRet(nssel.IsReady(pSel, pThis->ppLstn[i], NSDSEL_RD, &bIsReady, &nfds)); if(bIsReady) { - workset[iWorkset].id = i; - workset[iWorkset].pUsr = (void*) pThis->ppLstn; /* this is a flag to indicate listen sock */ - ++iWorkset; - if(iWorkset >= (int) sizeWorkset) { - processWorkset(pThis, NULL, iWorkset, workset); - iWorkset = 0; - } - //DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[i]); - //SessAccept(pThis, pThis->ppLstnPort[i], &pNewSess, pThis->ppLstn[i]); + DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[i]); + SessAccept(pThis, pThis->ppLstnPort[i], &pNewSess, pThis->ppLstn[i]); --nfds; /* indicate we have processed one */ } } @@ -793,22 +627,11 @@ ABORT_FINALIZE(RS_RET_FORCE_TERM); localRet = nssel.IsReady(pSel, pThis->pSessions[iTCPSess]->pStrm, NSDSEL_RD, &bIsReady, &nfds); if(bIsReady || localRet != RS_RET_OK) { - workset[iWorkset].id = iTCPSess; - workset[iWorkset].pUsr = (void*) pThis->pSessions[iTCPSess]; - ++iWorkset; - if(iWorkset >= (int) sizeWorkset) { - processWorkset(pThis, NULL, iWorkset, workset); - iWorkset = 0; - } + doReceive(pThis, &pThis->pSessions[iTCPSess], NULL); --nfds; /* indicate we have processed one */ } iTCPSess = TCPSessGetNxtSess(pThis, iTCPSess); } - - if(iWorkset > 0) - processWorkset(pThis, NULL, iWorkset, workset); - - /* we need to copy back close descriptors */ CHKiRet(nssel.Destruct(&pSel)); finalize_it: /* this is a very special case - this time only we do not exit the function, * because that would not help us either. So we simply retry it. Let's see @@ -839,54 +662,42 @@ { DEFiRet; int i; - nsd_epworkset_t workset[128]; /* 128 is currently fixed num of concurrent requests */ - int numEntries; + tcps_sess_t *pNewSess; nspoll_t *pPoll = NULL; + void *pUsr; rsRetVal localRet; ISOBJ_TYPE_assert(pThis, tcpsrv); - /* check if we need to start the worker pool. Once it is running, all is - * well. Shutdown is done on modExit. - */ - d_pthread_mutex_lock(&wrkrMut); - if(!bWrkrRunning) { - bWrkrRunning = 1; - startWorkerPool(); - } - d_pthread_mutex_unlock(&wrkrMut); - /* this is an endless loop - it is terminated by the framework canelling * this thread. Thus, we also need to instantiate a cancel cleanup handler * to prevent us from leaking anything. -- rgerhards, 20080-04-24 */ if((localRet = nspoll.Construct(&pPoll)) == RS_RET_OK) { - if(pThis->pszDrvrName != NULL) - CHKiRet(nspoll.SetDrvrName(pPoll, pThis->pszDrvrName)); + // TODO: set driver localRet = nspoll.ConstructFinalize(pPoll); } if(localRet != RS_RET_OK) { /* fall back to select */ - DBGPRINTF("tcpsrv could not use epoll() interface, iRet=%d, using select()\n", localRet); - iRet = RunSelect(pThis, workset, sizeof(workset)/sizeof(nsd_epworkset_t)); + dbgprintf("tcpsrv could not use epoll() interface, iRet=%d, using select()\n", localRet); + iRet = RunSelect(pThis); FINALIZE; } - DBGPRINTF("tcpsrv uses epoll() interface, nsdpoll driver found\n"); + dbgprintf("tcpsrv uses epoll() interface, nsdpol driver found\n"); /* flag that we are in epoll mode */ pThis->bUsingEPoll = RSTRUE; /* Add the TCP listen sockets to the list of sockets to monitor */ for(i = 0 ; i < pThis->iLstnCurr ; ++i) { - DBGPRINTF("Trying to add listener %d, pUsr=%p\n", i, pThis->ppLstn); + dbgprintf("Trying to add listener %d, pUsr=%p\n", i, pThis->ppLstn); CHKiRet(nspoll.Ctl(pPoll, pThis->ppLstn[i], i, pThis->ppLstn, NSDPOLL_IN, NSDPOLL_ADD)); - DBGPRINTF("Added listener %d\n", i); + dbgprintf("Added listener %d\n", i); } while(1) { - numEntries = sizeof(workset)/sizeof(nsd_epworkset_t); - localRet = nspoll.Wait(pPoll, -1, &numEntries, workset); + localRet = nspoll.Wait(pPoll, -1, &i, &pUsr); if(glbl.GetGlobalInputTermState() == 1) break; /* terminate input! */ @@ -897,7 +708,17 @@ if(localRet != RS_RET_OK) continue; - processWorkset(pThis, pPoll, numEntries, workset); + dbgprintf("poll returned with i %d, pUsr %p\n", i, pUsr); + + if(pUsr == pThis->ppLstn) { + DBGPRINTF("New connect on NSD %p.\n", pThis->ppLstn[i]); + SessAccept(pThis, pThis->ppLstnPort[i], &pNewSess, pThis->ppLstn[i]); + CHKiRet(nspoll.Ctl(pPoll, pNewSess->pStrm, 0, pNewSess, NSDPOLL_IN, NSDPOLL_ADD)); + DBGPRINTF("New session created with NSD %p.\n", pNewSess); + } else { + pNewSess = (tcps_sess_t*) pUsr; + doReceive(pThis, &pNewSess, pPoll); + } } /* remove the tcp listen sockets from the epoll set */ @@ -919,11 +740,7 @@ pThis->addtlFrameDelim = TCPSRV_NO_ADDTL_DELIMITER; pThis->bDisableLFDelim = 0; pThis->OnMsgReceive = NULL; - pThis->dfltTZ[0] = '\0'; - pThis->ratelimitInterval = 0; - pThis->ratelimitBurst = 10000; pThis->bUseFlowControl = 1; - pThis->pszDrvrName = NULL; ENDobjConstruct(tcpsrv) @@ -936,13 +753,12 @@ /* prepare network stream subsystem */ CHKiRet(netstrms.Construct(&pThis->pNS)); - if(pThis->pszDrvrName != NULL) - CHKiRet(netstrms.SetDrvrName(pThis->pNS, pThis->pszDrvrName)); CHKiRet(netstrms.SetDrvrMode(pThis->pNS, pThis->iDrvrMode)); if(pThis->pszDrvrAuthMode != NULL) CHKiRet(netstrms.SetDrvrAuthMode(pThis->pNS, pThis->pszDrvrAuthMode)); if(pThis->pPermPeers != NULL) CHKiRet(netstrms.SetDrvrPermPeers(pThis->pNS, pThis->pPermPeers)); + // TODO: set driver! CHKiRet(netstrms.ConstructFinalize(pThis->pNS)); /* set up listeners */ @@ -954,8 +770,6 @@ if(iRet != RS_RET_OK) { if(pThis->pNS != NULL) netstrms.Destruct(&pThis->pNS); - errmsg.LogError(0, iRet, "tcpsrv could not create listener (inputname: '%s')", - (pThis->pszInputName == NULL) ? (uchar*)"*UNSET*" : pThis->pszInputName); } RETiRet; } @@ -971,7 +785,6 @@ if(pThis->pNS != NULL) netstrms.Destruct(&pThis->pNS); - free(pThis->pszDrvrName); free(pThis->pszDrvrAuthMode); free(pThis->ppLstn); free(pThis->ppLstnPort); @@ -1077,7 +890,7 @@ SetKeepAlive(tcpsrv_t *pThis, int iVal) { DEFiRet; - DBGPRINTF("tcpsrv: keep-alive set to %d\n", iVal); + dbgprintf("tcpsrv: keep-alive set to %d\n", iVal); pThis->bUseKeepAlive = iVal; RETiRet; } @@ -1116,15 +929,6 @@ } -static rsRetVal -SetDfltTZ(tcpsrv_t *pThis, uchar *tz) -{ - DEFiRet; - ISOBJ_TYPE_assert(pThis, tcpsrv); - strcpy((char*)pThis->dfltTZ, (char*)tz); - RETiRet; -} - /* Set the input name to use -- rgerhards, 2008-12-10 */ static rsRetVal SetInputName(tcpsrv_t *pThis, uchar *name) @@ -1143,17 +947,6 @@ } -/* Set the linux-like ratelimiter settings */ -static rsRetVal -SetLinuxLikeRatelimiters(tcpsrv_t *pThis, int ratelimitInterval, int ratelimitBurst) -{ - DEFiRet; - pThis->ratelimitInterval = ratelimitInterval; - pThis->ratelimitBurst = ratelimitBurst; - RETiRet; -} - - /* Set the ruleset (ptr) to use */ static rsRetVal SetRuleset(tcpsrv_t *pThis, ruleset_t *pRuleset) @@ -1189,16 +982,6 @@ RETiRet; } -static rsRetVal -SetDrvrName(tcpsrv_t *pThis, uchar *name) -{ - DEFiRet; - ISOBJ_TYPE_assert(pThis, tcpsrv); - free(pThis->pszDrvrName); - CHKmalloc(pThis->pszDrvrName = ustrdup(name)); -finalize_it: - RETiRet; -} /* set the driver authentication mode -- rgerhards, 2008-05-19 */ static rsRetVal @@ -1294,7 +1077,6 @@ pIf->SetKeepAlive = SetKeepAlive; pIf->SetUsrP = SetUsrP; pIf->SetInputName = SetInputName; - pIf->SetDfltTZ = SetDfltTZ; pIf->SetAddtlFrameDelim = SetAddtlFrameDelim; pIf->SetbDisableLFDelim = SetbDisableLFDelim; pIf->SetSessMax = SetSessMax; @@ -1302,7 +1084,6 @@ pIf->SetLstnMax = SetLstnMax; pIf->SetDrvrMode = SetDrvrMode; pIf->SetDrvrAuthMode = SetDrvrAuthMode; - pIf->SetDrvrName = SetDrvrName; pIf->SetDrvrPermPeers = SetDrvrPermPeers; pIf->SetCBIsPermittedHost = SetCBIsPermittedHost; pIf->SetCBOpenLstnSocks = SetCBOpenLstnSocks; @@ -1316,7 +1097,6 @@ pIf->SetCBOnErrClose = SetCBOnErrClose; pIf->SetOnMsgReceive = SetOnMsgReceive; pIf->SetRuleset = SetRuleset; - pIf->SetLinuxLikeRatelimiters = SetLinuxLikeRatelimiters; pIf->SetNotificationOnRemoteClose = SetNotificationOnRemoteClose; finalize_it: @@ -1368,67 +1148,14 @@ ENDObjClassInit(tcpsrv) -/* start worker threads - * Important: if we fork, this MUST be done AFTER forking - */ -static void -startWorkerPool(void) -{ - int i; - int r; - pthread_attr_t sessThrdAttr; - - wrkrRunning = 0; - pthread_cond_init(&wrkrIdle, NULL); - pthread_attr_init(&sessThrdAttr); - pthread_attr_setstacksize(&sessThrdAttr, 4096*1024); - for(i = 0 ; i < wrkrMax ; ++i) { - /* init worker info structure! */ - pthread_cond_init(&wrkrInfo[i].run, NULL); - wrkrInfo[i].pSrv = NULL; - wrkrInfo[i].numCalled = 0; - r = pthread_create(&wrkrInfo[i].tid, &sessThrdAttr, wrkr, &(wrkrInfo[i])); - if(r == 0) { - wrkrInfo[i].enabled = 1; - } else { - char errStr[1024]; - wrkrInfo[i].enabled = 0; - rs_strerror_r(errno, errStr, sizeof(errStr)); - errmsg.LogError(0, NO_ERRCODE, "tcpsrv error creating thread %d: " - "%s", i, errStr); - } - } - pthread_attr_destroy(&sessThrdAttr); -} - -/* destroy worker pool structures and wait for workers to terminate - */ -static void -stopWorkerPool(void) -{ - int i; - for(i = 0 ; i < wrkrMax ; ++i) { - pthread_cond_signal(&wrkrInfo[i].run); /* awake wrkr if not running */ - pthread_join(wrkrInfo[i].tid, NULL); - DBGPRINTF("tcpsrv: info: worker %d was called %llu times\n", i, wrkrInfo[i].numCalled); - pthread_cond_destroy(&wrkrInfo[i].run); - } - pthread_cond_destroy(&wrkrIdle); -} - - /* --------------- here now comes the plumbing that makes as a library module --------------- */ + BEGINmodExit CODESTARTmodExit - if(bWrkrRunning) { - stopWorkerPool(); - bWrkrRunning = 0; - } /* de-init in reverse order! */ tcpsrvClassExit(); tcps_sessClassExit(); - pthread_mutex_destroy(&wrkrMut); ENDmodExit @@ -1441,20 +1168,6 @@ BEGINmodInit() CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ - /* we just init the worker mutex, but do not start the workers themselves. This is deferred - * to the first call of Run(). Reasons for this: - * 1. depending on load order, tcpsrv gets loaded during rsyslog startup BEFORE - * it forks, in which case the workers would be running in the then-killed parent, - * leading to a defuncnt child (we actually had this bug). - * 2. depending on circumstances, Run() would possibly never be called, in which case - * the worker threads would be totally useless. - * Note that in order to guarantee a non-racy worker start, we need to guard the - * startup sequence by a mutex, which is why we init it here (no problem with fork() - * in this case as the mutex is a pure-memory structure). - * rgerhards, 2012-05-18 - */ - pthread_mutex_init(&wrkrMut, NULL); - bWrkrRunning = 0; /* Initialize all classes that are in our module - this includes ourselfs */ CHKiRet(tcps_sessClassInit(pModInfo)); diff -Nru rsyslog-7.6.0/tcpsrv.h rsyslog-5.10.1/tcpsrv.h --- rsyslog-7.6.0/tcpsrv.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tcpsrv.h 2012-10-17 14:41:20.000000000 +0000 @@ -42,8 +42,6 @@ ruleset_t *pRuleset; /**< associated ruleset */ statsobj_t *stats; /**< associated stats object */ sbool bSuppOctetFram; /**< do we support octect-counted framing? (if no->legay only!)*/ - ratelimit_t *ratelimiter; - uchar dfltTZ[8]; /**< default TZ if none in timestamp; '\0' =No Default */ STATSCOUNTER_DEF(ctrSubmit, mutCtrSubmit) tcpLstnPortList_t *pNext; /**< next port or NULL */ }; @@ -57,7 +55,6 @@ netstrms_t *pNS; /**< pointer to network stream subsystem */ int iDrvrMode; /**< mode of the stream driver to use */ uchar *pszDrvrAuthMode; /**< auth mode of the stream driver to use */ - uchar *pszDrvrName; /**< name of stream driver to use */ uchar *pszInputName; /**< value to be used as input name */ ruleset_t *pRuleset; /**< ruleset to bind to */ permittedPeers_t *pPermPeers;/**< driver's permitted peers */ @@ -65,17 +62,14 @@ sbool bUsingEPoll; /**< are we in epoll mode (means we do not need to keep track of sessions!) */ sbool bUseFlowControl; /**< use flow control (make light delayable) */ int iLstnCurr; /**< max nbr of listeners currently supported */ - netstrm_t **ppLstn; /**< our netstream listeners */ + netstrm_t **ppLstn; /**< our netstream listners */ tcpLstnPortList_t **ppLstnPort; /**< pointer to relevant listen port description */ - int iLstnMax; /**< max number of listeners supported */ + int iLstnMax; /**< max number of listners supported */ int iSessMax; /**< max number of sessions supported */ - uchar dfltTZ[8]; /**< default TZ if none in timestamp; '\0' =No Default */ tcpLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */ int addtlFrameDelim; /**< additional frame delimiter for plain TCP syslog framing (e.g. to handle NetScreen) */ int bDisableLFDelim; /**< if 1, standard LF frame delimiter is disabled (*very dangerous*) */ - int ratelimitInterval; - int ratelimitBurst; tcps_sess_t **pSessions;/**< array of all of our sessions */ void *pUsr; /**< a user-settable pointer (provides extensibility for "derived classes")*/ /* callbacks */ @@ -94,18 +88,6 @@ }; -/** - * The following structure is a set of descriptors that need to be processed. - * This set will be the result of the epoll or select call and be used - * in the actual request processing stage. It serves as a basis - * to run multiple request by concurrent threads. -- rgerhards, 2011-01-24 - */ -struct tcpsrv_workset_s { - int idx; /**< index into session table (or -1 if listener) */ - void *pUsr; -}; - - /* interfaces */ BEGINinterface(tcpsrv) /* name must also be changed in ENDinterface macro! */ INTERFACEObjDebugPrint(tcpsrv); @@ -113,6 +95,7 @@ rsRetVal (*ConstructFinalize)(tcpsrv_t __attribute__((unused)) *pThis); rsRetVal (*Destruct)(tcpsrv_t **ppThis); rsRetVal (*configureTCPListen)(tcpsrv_t*, uchar *pszPort, int bSuppOctetFram); + //rsRetVal (*SessAccept)(tcpsrv_t *pThis, tcpLstnPortList_t*, tcps_sess_t **ppSess, netstrm_t *pStrm); rsRetVal (*create_tcp_socket)(tcpsrv_t *pThis); rsRetVal (*Run)(tcpsrv_t *pThis); /* set methods */ @@ -147,14 +130,8 @@ rsRetVal (*SetUseFlowControl)(tcpsrv_t*, int); /* added v11 -- rgerhards, 2011-05-09 */ rsRetVal (*SetKeepAlive)(tcpsrv_t*, int); - /* added v13 -- rgerhards, 2012-10-15 */ - rsRetVal (*SetLinuxLikeRatelimiters)(tcpsrv_t *pThis, int interval, int burst); - /* added v14 -- rgerhards, 2013-07-28 */ - rsRetVal (*SetDfltTZ)(tcpsrv_t *pThis, uchar *dfltTZ); - /* added v15 -- rgerhards, 2013-09-17 */ - rsRetVal (*SetDrvrName)(tcpsrv_t *pThis, uchar *pszName); ENDinterface(tcpsrv) -#define tcpsrvCURR_IF_VERSION 15 /* increment whenever you change the interface structure! */ +#define tcpsrvCURR_IF_VERSION 12 /* increment whenever you change the interface structure! */ /* change for v4: * - SetAddtlFrameDelim() added -- rgerhards, 2008-12-10 * - SetInputName() added -- rgerhards, 2008-12-10 diff -Nru rsyslog-7.6.0/tcps_sess.c rsyslog-5.10.1/tcps_sess.c --- rsyslog-7.6.0/tcps_sess.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tcps_sess.c 2012-10-17 14:41:20.000000000 +0000 @@ -47,7 +47,6 @@ #include "msg.h" #include "datetime.h" #include "prop.h" -#include "ratelimit.h" #include "debug.h" @@ -96,7 +95,6 @@ /* destructor for the tcps_sess object */ BEGINobjDestruct(tcps_sess) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(tcps_sess) -//printf("sess %p destruct, pStrm %p\n", pThis, pThis->pStrm); if(pThis->pStrm != NULL) netstrm.Destruct(&pThis->pStrm); @@ -140,20 +138,24 @@ RETiRet; } -/* set the remote host's IP. Note that the caller *hands over* the property. That is, +/* set the remote host's IP. Note that the caller *hands over* the string. That is, * the caller no longer controls it once SetHostIP() has received it. Most importantly, - * the caller must not destruct it. -- rgerhards, 2008-05-16 + * the caller must not free it. -- rgerhards, 2008-05-16 */ static rsRetVal -SetHostIP(tcps_sess_t *pThis, prop_t *ip) +SetHostIP(tcps_sess_t *pThis, uchar *pszHostIP) { DEFiRet; + ISOBJ_TYPE_assert(pThis, tcps_sess); - if(pThis->fromHostIP != NULL) { - prop.Destruct(&pThis->fromHostIP); - } - pThis->fromHostIP = ip; + if(pThis->fromHostIP == NULL) + CHKiRet(prop.Construct(&pThis->fromHostIP)); + + CHKiRet(prop.SetString(pThis->fromHostIP, pszHostIP, ustrlen(pszHostIP))); + +finalize_it: + free(pszHostIP); RETiRet; } @@ -253,8 +255,6 @@ CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime)); MsgSetRawMsg(pMsg, (char*)pThis->pMsg, pThis->iMsg); MsgSetInputName(pMsg, pThis->pLstnInfo->pInputName); - if(pThis->pLstnInfo->dfltTZ != NULL) - MsgSetDfltTZ(pMsg, (char*) pThis->pLstnInfo->dfltTZ); MsgSetFlowControlType(pMsg, pThis->pSrv->bUseFlowControl ? eFLOWCTL_LIGHT_DELAY : eFLOWCTL_NO_DELAY); pMsg->msgFlags = NEEDS_PARSING | PARSE_HOSTNAME; @@ -263,7 +263,14 @@ MsgSetRuleset(pMsg, pThis->pLstnInfo->pRuleset); STATSCOUNTER_INC(pThis->pLstnInfo->ctrSubmit, pThis->pLstnInfo->mutCtrSubmit); - ratelimitAddMsg(pThis->pLstnInfo->ratelimiter, pMultiSub, pMsg); + if(pMultiSub == NULL) { + CHKiRet(submitMsg(pMsg)); + } else { + pMultiSub->ppMsgs[pMultiSub->nElem++] = pMsg; + if(pMultiSub->nElem == pMultiSub->maxElem) + CHKiRet(multiSubmitMsg(pMultiSub)); + } + finalize_it: /* reset status variables */ @@ -309,13 +316,13 @@ * generate an error message and discard the frame. */ errmsg.LogError(0, NO_ERRCODE, "Incomplete frame at end of stream in session %p - " - "ignoring extra data (a message may be lost).", pThis->pStrm); + "ignoring extra data (a message may be lost).\n", pThis->pStrm); /* nothing more to do */ } else { /* here, we have traditional framing. Missing LF at the end * of message may occur. As such, we process the message in * this case. */ - DBGPRINTF("Extra data at end of stream in legacy syslog/tcp message - processing\n"); + dbgprintf("Extra data at end of stream in legacy syslog/tcp message - processing\n"); datetime.getCurrTime(&stTime, &ttGenTime); defaultDoSubmitMessage(pThis, &stTime, ttGenTime, NULL); } @@ -334,7 +341,6 @@ { DEFiRet; -//printf("sess %p close\n", pThis); ISOBJ_TYPE_assert(pThis, tcps_sess); netstrm.Destruct(&pThis->pStrm); if(pThis->fromHost != NULL) { @@ -360,7 +366,7 @@ ISOBJ_TYPE_assert(pThis, tcps_sess); if(pThis->inputState == eAtStrtFram) { - if(pThis->bSuppOctetFram && c >= '0' && c <= '9') { + if(pThis->bSuppOctetFram && isdigit((int) c)) { pThis->inputState = eInOctetCnt; pThis->iOctetsRemain = 0; pThis->eFraming = TCP_FRAMING_OCTET_COUNTING; @@ -371,27 +377,27 @@ } if(pThis->inputState == eInOctetCnt) { - if(c >= '0' && c <= '9') { /* isdigit() the faster way */ + if(isdigit(c)) { pThis->iOctetsRemain = pThis->iOctetsRemain * 10 + c - '0'; } else { /* done with the octet count, so this must be the SP terminator */ - DBGPRINTF("TCP Message with octet-counter, size %d.\n", pThis->iOctetsRemain); + dbgprintf("TCP Message with octet-counter, size %d.\n", pThis->iOctetsRemain); if(c != ' ') { errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: " - "delimiter is not SP but has ASCII value %d.", c); + "delimiter is not SP but has ASCII value %d.\n", c); } if(pThis->iOctetsRemain < 1) { /* TODO: handle the case where the octet count is 0! */ - DBGPRINTF("Framing Error: invalid octet count\n"); + dbgprintf("Framing Error: invalid octet count\n"); errmsg.LogError(0, NO_ERRCODE, "Framing Error in received TCP message: " - "invalid octet count %d.", pThis->iOctetsRemain); + "invalid octet count %d.\n", pThis->iOctetsRemain); } else if(pThis->iOctetsRemain > iMaxLine) { /* while we can not do anything against it, we can at least log an indication * that something went wrong) -- rgerhards, 2008-03-14 */ - DBGPRINTF("truncating message with %d octets - max msg size is %d\n", + dbgprintf("truncating message with %d octets - max msg size is %d\n", pThis->iOctetsRemain, iMaxLine); errmsg.LogError(0, NO_ERRCODE, "received oversize message: size is %d bytes, " - "max msg size is %d, truncating...", pThis->iOctetsRemain, iMaxLine); + "max msg size is %d, truncating...\n", pThis->iOctetsRemain, iMaxLine); } pThis->inputState = eInMsg; } @@ -399,7 +405,7 @@ assert(pThis->inputState == eInMsg); if(pThis->iMsg >= iMaxLine) { /* emergency, we now need to flush, no matter if we are at end of message or not... */ - DBGPRINTF("error: message received is larger than max msg size, we split it\n"); + dbgprintf("error: message received is larger than max msg size, we split it\n"); defaultDoSubmitMessage(pThis, stTime, ttGenTime, pMultiSub); /* we might think if it is better to ignore the rest of the * message than to treat it as a new one. Maybe this is a good @@ -479,7 +485,11 @@ while(pData < pEnd) { CHKiRet(processDataRcvd(pThis, *pData++, &stTime, ttGenTime, &multiSub)); } - iRet = multiSubmitFlush(&multiSub); + + if(multiSub.nElem > 0) { + /* submit anything that was not yet submitted */ + CHKiRet(multiSubmitMsg(&multiSub)); + } finalize_it: RETiRet; diff -Nru rsyslog-7.6.0/tcps_sess.h rsyslog-5.10.1/tcps_sess.h --- rsyslog-7.6.0/tcps_sess.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tcps_sess.h 2012-10-15 13:45:04.000000000 +0000 @@ -66,18 +66,16 @@ rsRetVal (*SetLstnInfo)(tcps_sess_t *pThis, tcpLstnPortList_t *pLstnInfo); rsRetVal (*SetUsrP)(tcps_sess_t*, void*); rsRetVal (*SetHost)(tcps_sess_t *pThis, uchar*); - rsRetVal (*SetHostIP)(tcps_sess_t *pThis, prop_t*); + rsRetVal (*SetHostIP)(tcps_sess_t *pThis, uchar*); rsRetVal (*SetStrm)(tcps_sess_t *pThis, netstrm_t*); rsRetVal (*SetMsgIdx)(tcps_sess_t *pThis, int); rsRetVal (*SetOnMsgReceive)(tcps_sess_t *pThis, rsRetVal (*OnMsgReceive)(tcps_sess_t*, uchar*, int)); ENDinterface(tcps_sess) -#define tcps_sessCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */ +#define tcps_sessCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ /* interface changes * to version v2, rgerhards, 2009-05-22 * - Data structures changed * - SetLstnInfo entry point added - * version 3, rgerhards, 2013-01-21: - * - signature of SetHostIP() changed */ diff -Nru rsyslog-7.6.0/template.c rsyslog-5.10.1/template.c --- rsyslog-7.6.0/template.c 2014-02-12 11:59:00.000000000 +0000 +++ rsyslog-5.10.1/template.c 2012-10-17 14:41:20.000000000 +0000 @@ -1,7 +1,7 @@ /* This is the template processing code of rsyslog. * begun 2004-11-17 rgerhards * - * Copyright 2004-2013 Rainer Gerhards and Adiscon + * Copyright 2004-2012 Rainer Gerhards and Adiscon * * This file is part of rsyslog. * @@ -34,7 +34,6 @@ #include #include #include -#include #include "stringbuf.h" #include "syslogd-types.h" #include "template.h" @@ -43,8 +42,6 @@ #include "obj.h" #include "errmsg.h" #include "strgen.h" -#include "rsconf.h" -#include "msg.h" #include "unicode-helper.h" /* static data */ @@ -52,67 +49,22 @@ DEFobjCurrIf(errmsg) DEFobjCurrIf(strgen) -/* tables for interfacing with the v6 config system */ -static struct cnfparamdescr cnfparamdescr[] = { - { "name", eCmdHdlrString, 1 }, - { "type", eCmdHdlrString, 1 }, - { "string", eCmdHdlrString, 0 }, - { "plugin", eCmdHdlrString, 0 }, - { "subtree", eCmdHdlrString, 0 }, - { "option.stdsql", eCmdHdlrBinary, 0 }, - { "option.sql", eCmdHdlrBinary, 0 }, - { "option.json", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk pblk = - { CNFPARAMBLK_VERSION, - sizeof(cnfparamdescr)/sizeof(struct cnfparamdescr), - cnfparamdescr - }; - -static struct cnfparamdescr cnfparamdescrProperty[] = { - { "name", eCmdHdlrString, 1 }, - { "outname", eCmdHdlrString, 0 }, - { "dateformat", eCmdHdlrString, 0 }, - { "caseconversion", eCmdHdlrString, 0 }, - { "controlcharacters", eCmdHdlrString, 0 }, - { "securepath", eCmdHdlrString, 0 }, - { "format", eCmdHdlrString, 0 }, - { "position.from", eCmdHdlrInt, 0 }, - { "position.to", eCmdHdlrInt, 0 }, - { "position.relativetoend", eCmdHdlrBinary, 0 }, - { "field.number", eCmdHdlrInt, 0 }, - { "field.delimiter", eCmdHdlrInt, 0 }, - { "regex.expression", eCmdHdlrString, 0 }, - { "regex.type", eCmdHdlrString, 0 }, - { "regex.nomatchmode", eCmdHdlrString, 0 }, - { "regex.match", eCmdHdlrInt, 0 }, - { "regex.submatch", eCmdHdlrInt, 0 }, - { "droplastlf", eCmdHdlrBinary, 0 }, - { "mandatory", eCmdHdlrBinary, 0 }, - { "spifno1stsp", eCmdHdlrBinary, 0 } -}; -static struct cnfparamblk pblkProperty = - { CNFPARAMBLK_VERSION, - sizeof(cnfparamdescrProperty)/sizeof(struct cnfparamdescr), - cnfparamdescrProperty - }; - -static struct cnfparamdescr cnfparamdescrConstant[] = { - { "value", eCmdHdlrString, 1 }, - { "outname", eCmdHdlrString, 0 }, -}; -static struct cnfparamblk pblkConstant = - { CNFPARAMBLK_VERSION, - sizeof(cnfparamdescrConstant)/sizeof(struct cnfparamdescr), - cnfparamdescrConstant - }; - - #ifdef FEATURE_REGEXP DEFobjCurrIf(regexp) static int bFirstRegexpErrmsg = 1; /**< did we already do a "can't load regexp" error message? */ #endif +static struct template *tplRoot = NULL; /* the root of the template list */ +static struct template *tplLast = NULL; /* points to the last element of the template list */ +static struct template *tplLastStatic = NULL; /* last static element of the template list */ + +enum { + NO_ESCAPE = 0, + SQL_ESCAPE, + STDSQL_ESCAPE, + JSON_ESCAPE, +}; + /* helper to tplToString and strgen's, extends buffer */ #define ALLOC_INC 128 rsRetVal @@ -142,16 +94,14 @@ * offers big performance improvements. * rewritten 2009-06-19 rgerhards */ -rsRetVal -tplToString(struct template *pTpl, msg_t *pMsg, uchar **ppBuf, size_t *pLenBuf, - struct syslogTime *ttNow) +rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar **ppBuf, size_t *pLenBuf) { DEFiRet; struct templateEntry *pTpe; size_t iBuf; unsigned short bMustBeFreed = 0; uchar *pVal; - rs_size_t iLenVal = 0; + size_t iLenVal = 0; assert(pTpl != NULL); assert(pMsg != NULL); @@ -163,23 +113,6 @@ FINALIZE; } - if(pTpl->bHaveSubtree) { - /* only a single CEE subtree must be provided */ - /* note: we could optimize the code below, however, this is - * not worth the effort, as this passing mode is not expected - * in subtree mode and so most probably only used for debug & test. - */ - getJSONPropVal(pMsg, &pTpl->subtree, &pVal, &iLenVal, &bMustBeFreed); - if(iLenVal >= (rs_size_t)*pLenBuf) /* we reserve one char for the final \0! */ - CHKiRet(ExtendBuf(ppBuf, pLenBuf, iLenVal + 1)); - memcpy(*ppBuf, pVal, iLenVal+1); - if(bMustBeFreed) - free(pVal); - FINALIZE; - } - - /* we have a "regular" template with template entries */ - /* loop through the template. We obtain one value * and copy it over to our dynamic string buffer. Then, we * free the obtained value (if requested). We continue this @@ -193,8 +126,7 @@ iLenVal = pTpe->data.constant.iLenConstant; bMustBeFreed = 0; } else if(pTpe->eEntryType == FIELD) { - pVal = (uchar*) MsgGetProp(pMsg, pTpe, &pTpe->data.field.msgProp, - &iLenVal, &bMustBeFreed, ttNow); + pVal = (uchar*) MsgGetProp(pMsg, pTpe, pTpe->data.field.propid, &iLenVal, &bMustBeFreed); /* we now need to check if we should use SQL option. In this case, * we must go over the generated string and escape '\'' characters. * rgerhards, 2005-09-22: the option values below look somewhat misplaced, @@ -248,14 +180,13 @@ * is indicated by a NULL pointer. * rgerhards, 2009-04-03 */ -rsRetVal -tplToArray(struct template *pTpl, msg_t *pMsg, uchar*** ppArr, struct syslogTime *ttNow) +rsRetVal tplToArray(struct template *pTpl, msg_t *pMsg, uchar*** ppArr) { DEFiRet; struct templateEntry *pTpe; uchar **pArr; int iArr; - rs_size_t propLen; + size_t propLen; unsigned short bMustBeFreed; uchar *pVal; @@ -263,24 +194,11 @@ assert(pMsg != NULL); assert(ppArr != NULL); - if(pTpl->bHaveSubtree) { - /* Note: this mode is untested, as there is no official plugin - * using array passing, so I simply could not test it. - */ - CHKmalloc(pArr = calloc(2, sizeof(uchar*))); - getJSONPropVal(pMsg, &pTpl->subtree, &pVal, &propLen, &bMustBeFreed); - if(bMustBeFreed) { /* if it must be freed, it is our own private copy... */ - pArr[0] = pVal; /* ... so we can use it! */ - } else { - CHKmalloc(pArr[0] = (uchar*)strdup((char*) pVal)); - } - FINALIZE; - } - /* loop through the template. We obtain one value, create a * private copy (if necessary), add it to the string array * and then on to the next until we have processed everything. */ + CHKmalloc(pArr = calloc(pTpl->tpenElements + 1, sizeof(uchar*))); iArr = 0; @@ -289,8 +207,7 @@ if(pTpe->eEntryType == CONSTANT) { CHKmalloc(pArr[iArr] = (uchar*)strdup((char*) pTpe->data.constant.pConstant)); } else if(pTpe->eEntryType == FIELD) { - pVal = (uchar*) MsgGetProp(pMsg, pTpe, &pTpe->data.field.msgProp, - &propLen, &bMustBeFreed, ttNow); + pVal = (uchar*) MsgGetProp(pMsg, pTpe, pTpe->data.field.propid, &propLen, &bMustBeFreed); if(bMustBeFreed) { /* if it must be freed, it is our own private copy... */ pArr[iArr] = pVal; /* ... so we can use it! */ } else { @@ -308,74 +225,6 @@ } -/* This functions converts a template into a json object. - * For further general details, see the very similar funtion - * tpltoString(). - * rgerhards, 2012-08-29 - */ -rsRetVal -tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **pjson, struct syslogTime *ttNow) -{ - struct templateEntry *pTpe; - rs_size_t propLen; - unsigned short bMustBeFreed; - uchar *pVal; - struct json_object *json, *jsonf; - rsRetVal localRet; - DEFiRet; - - if(pTpl->bHaveSubtree){ - localRet = jsonFind(pMsg->json, &pTpl->subtree, pjson); - if(*pjson == NULL) { - /* we need to have a root object! */ - *pjson = json_object_new_object(); - } else { - json_object_get(*pjson); /* inc refcount */ - } - FINALIZE; - } - - json = json_object_new_object(); - for(pTpe = pTpl->pEntryRoot ; pTpe != NULL ; pTpe = pTpe->pNext) { - if(pTpe->eEntryType == CONSTANT) { - if(pTpe->fieldName == NULL) - continue; - jsonf = json_object_new_string((char*) pTpe->data.constant.pConstant); - json_object_object_add(json, (char*)pTpe->fieldName, jsonf); - } else if(pTpe->eEntryType == FIELD) { - if(pTpe->data.field.msgProp.id == PROP_CEE || - pTpe->data.field.msgProp.id == PROP_LOCAL_VAR || - pTpe->data.field.msgProp.id == PROP_GLOBAL_VAR ) { - localRet = msgGetJSONPropJSON(pMsg, &pTpe->data.field.msgProp, &jsonf); - if(localRet == RS_RET_OK) { - json_object_object_add(json, (char*)pTpe->fieldName, json_object_get(jsonf)); - } else { - DBGPRINTF("tplToJSON: error %d looking up property %s\n", - localRet, pTpe->fieldName); - if(pTpe->data.field.options.bMandatory) { - json_object_object_add(json, (char*)pTpe->fieldName, NULL); - } - } - } else { - pVal = (uchar*) MsgGetProp(pMsg, pTpe, &pTpe->data.field.msgProp, - &propLen, &bMustBeFreed, ttNow); - if(pTpe->data.field.options.bMandatory || propLen > 0) { - jsonf = json_object_new_string_len((char*)pVal, propLen+1); - json_object_object_add(json, (char*)pTpe->fieldName, jsonf); - } - if(bMustBeFreed) { /* json-c makes its own private copy! */ - free(pVal); - } - } - } - } - *pjson = (iRet == RS_RET_OK) ? json : NULL; - -finalize_it: - RETiRet; -} - - /* Helper to doEscape. This is called if doEscape * runs out of memory allocating the escaped string. * Then we are in trouble. We can @@ -429,7 +278,7 @@ * 2005-09-22 rgerhards */ rsRetVal -doEscape(uchar **pp, rs_size_t *pLen, unsigned short *pbMustBeFreed, int mode) +doEscape(uchar **pp, size_t *pLen, unsigned short *pbMustBeFreed, int mode) { DEFiRet; uchar *p = NULL; @@ -528,8 +377,7 @@ /* Constructs a template list object. Returns pointer to it * or NULL (if it fails). */ -static struct template* -tplConstruct(rsconf_t *conf) +struct template* tplConstruct(void) { struct template *pTpl; if((pTpl = calloc(1, sizeof(struct template))) == NULL) @@ -538,12 +386,12 @@ /* basic initialisation is done via calloc() - need to * initialize only values != 0. */ - if(conf->templates.last == NULL) { + if(tplLast == NULL) { /* we are the first element! */ - conf->templates.root = conf->templates.last = pTpl; + tplRoot = tplLast = pTpl; } else { - conf->templates.last->pNext = pTpl; - conf->templates.last = pTpl; + tplLast->pNext = pTpl; + tplLast = pTpl; } return(pTpl); @@ -552,20 +400,14 @@ /* helper to tplAddLine. Parses a constant and generates * the necessary structure. - * Paramter "bDoEscapes" is to support legacy vs. v6+ config system. In - * legacy, we must do escapes ourselves, whereas v6+ passes in already - * escaped strings (which we are NOT permitted to further escape, this would - * cause invalid result strings!). Note: if escapes are not permitted, - * quotes (") are just a regular character and do NOT terminate the constant! + * returns: 0 - ok, 1 - failure */ -static rsRetVal -do_Constant(unsigned char **pp, struct template *pTpl, int bDoEscapes) +static int do_Constant(unsigned char **pp, struct template *pTpl) { register unsigned char *p; cstr_t *pStrB; struct templateEntry *pTpe; int i; - DEFiRet; assert(pp != NULL); assert(*pp != NULL); @@ -573,12 +415,13 @@ p = *pp; - CHKiRet(cstrConstruct(&pStrB)); + if(cstrConstruct(&pStrB) != RS_RET_OK) + return 1; /* process the message and expand escapes * (additional escapes can be added here if needed) */ - while(*p && *p != '%' && !(bDoEscapes && *p == '\"')) { - if(bDoEscapes && *p == '\\') { + while(*p && *p != '%' && *p != '\"') { + if(*p == '\\') { switch(*++p) { case '\0': /* the best we can do - it's invalid anyhow... */ @@ -627,7 +470,7 @@ if((pTpe = tpeConstruct(pTpl)) == NULL) { rsCStrDestruct(&pStrB); - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + return 1; } pTpe->eEntryType = CONSTANT; cstrFinalize(pStrB); @@ -637,12 +480,12 @@ * 2005-09-09 rgerhards */ pTpe->data.constant.iLenConstant = rsCStrLen(pStrB); - CHKiRet(cstrConvSzStrAndDestruct(pStrB, &pTpe->data.constant.pConstant, 0)); + if(cstrConvSzStrAndDestruct(pStrB, &pTpe->data.constant.pConstant, 0) != RS_RET_OK) + return 1; *pp = p; -finalize_it: - RETiRet; + return 0; } @@ -662,18 +505,18 @@ p = *pp; - while(*p && *p != '%' && *p != ':') { + while(*p && *p != '%') { /* outer loop - until end of options */ i = 0; while((i < sizeof(Buf) / sizeof(char)) && - *p && *p != '%' && *p != ':' && *p != ',') { + *p && *p != '%' && *p != ',') { /* inner loop - until end of ONE option */ Buf[i++] = tolower((int)*p); ++p; } Buf[i] = '\0'; /* terminate */ /* check if we need to skip oversize option */ - while(*p && *p != '%' && *p != ':' && *p != ',') + while(*p && *p != '%' && *p != ',') ++p; /* just skip */ if(*p == ',') ++p; /* eat ',' */ @@ -690,8 +533,6 @@ pTpe->data.field.eDateFormat = tplFmtRFC3164BuggyDate; } else if(!strcmp((char*)Buf, "date-rfc3339")) { pTpe->data.field.eDateFormat = tplFmtRFC3339Date; - } else if(!strcmp((char*)Buf, "date-unixtimestamp")) { - pTpe->data.field.eDateFormat = tplFmtUnixDate; } else if(!strcmp((char*)Buf, "date-subseconds")) { pTpe->data.field.eDateFormat = tplFmtSecFrac; } else if(!strcmp((char*)Buf, "lowercase")) { @@ -712,34 +553,10 @@ pTpe->data.field.options.bSecPathDrop = 1; } else if(!strcmp((char*)Buf, "secpath-replace")) { pTpe->data.field.options.bSecPathReplace = 1; - } else if(!strcmp((char*)Buf, "pos-end-relative")) { - pTpe->data.field.options.bFromPosEndRelative = 1; } else if(!strcmp((char*)Buf, "csv")) { - if(pTpe->data.field.options.bJSON || pTpe->data.field.options.bJSONf) { - errmsg.LogError(0, NO_ERRCODE, "error: can only specify " - "one option out of (json, jsonf, csv) - csv ignored"); - } else { - pTpe->data.field.options.bCSV = 1; - } - } else if(!strcmp((char*)Buf, "json")) { - if(pTpe->data.field.options.bCSV || pTpe->data.field.options.bJSON) { - errmsg.LogError(0, NO_ERRCODE, "error: can only specify " - "one option out of (json, jsonf, csv) - json ignored"); - } else { - pTpe->data.field.options.bJSON = 1; - } - } else if(!strcmp((char*)Buf, "jsonf")) { - if(pTpe->data.field.options.bCSV || pTpe->data.field.options.bJSON) { - errmsg.LogError(0, NO_ERRCODE, "error: can only specify " - "one option out of (json, jsonf, csv) - jsonf ignored"); - } else { - pTpe->data.field.options.bJSONf = 1; - } - } else if(!strcmp((char*)Buf, "mandatory-field")) { - pTpe->data.field.options.bMandatory = 1; + pTpe->data.field.options.bCSV = 1; } else { - errmsg.LogError(0, NO_ERRCODE, "template error: invalid field option '%s' " - "specified - ignored", Buf); + dbgprintf("Invalid field option '%s' specified - ignored.\n", Buf); } } @@ -749,13 +566,12 @@ /* helper to tplAddLine. Parses a parameter and generates * the necessary structure. + * returns: 0 - ok, 1 - failure */ -static rsRetVal -do_Parameter(uchar **pp, struct template *pTpl) +static int do_Parameter(unsigned char **pp, struct template *pTpl) { - uchar *p; - cstr_t *pStrProp = NULL; - cstr_t *pStrField = NULL; + unsigned char *p; + cstr_t *pStrB; struct templateEntry *pTpe; int iNum; /* to compute numbers */ #ifdef FEATURE_REGEXP @@ -765,31 +581,39 @@ unsigned char *regex_char; unsigned char *regex_end; #endif - DEFiRet; assert(pp != NULL); assert(*pp != NULL); assert(pTpl != NULL); - p = (uchar*) *pp; - CHKiRet(cstrConstruct(&pStrProp)); - CHKmalloc(pTpe = tpeConstruct(pTpl)); + p = (unsigned char*) *pp; + + if(cstrConstruct(&pStrB) != RS_RET_OK) + return 1; + + if((pTpe = tpeConstruct(pTpl)) == NULL) { + /* TODO: add handler */ + dbgprintf("Could not allocate memory for template parameter!\n"); + return 1; + } pTpe->eEntryType = FIELD; while(*p && *p != '%' && *p != ':') { - cstrAppendChar(pStrProp, tolower(*p)); + cstrAppendChar(pStrB, tolower(*p)); ++p; /* do NOT do this in tolower()! */ } /* got the name */ - cstrFinalize(pStrProp); + cstrFinalize(pStrB); - CHKiRet(msgPropDescrFill(&pTpe->data.field.msgProp, cstrGetSzStrNoNULL(pStrProp), - cstrLen(pStrProp))); + if(propNameToID(pStrB, &pTpe->data.field.propid) != RS_RET_OK) { + cstrDestruct(&pStrB); + return 1; + } + cstrDestruct(&pStrB); /* no longer needed, now use ID */ /* Check frompos, if it has an R, then topos should be a regex */ if(*p == ':') { - pTpe->bComplexProcessing = 1; ++p; /* eat ':' */ #ifdef FEATURE_REGEXP if(*p == 'R') { @@ -849,8 +673,8 @@ * comma itself is already part of the next field. */ } else { - errmsg.LogError(0, NO_ERRCODE, "template %s error: invalid regular expression type, rest of line %s", - pTpl->pszName, (char*) p); + errmsg.LogError(0, NO_ERRCODE, "error: invalid regular expression type, rest of line %s", + (char*) p); } } @@ -956,7 +780,9 @@ #ifdef FEATURE_REGEXP if (pTpe->data.field.has_regex) { + dbgprintf("debug: has regex \n"); + /* APR 2005-09 I need the string that represent the regex */ /* The regex end is: "--end" */ /* TODO : this is hardcoded and cant be escaped, please change */ @@ -972,13 +798,16 @@ if(regex_char == NULL) { dbgprintf("Could not allocate memory for template parameter!\n"); pTpe->data.field.has_regex = 0; - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + return 1; + /* TODO: RGer: check if we can recover better... (probably not) */ } /* Get the regex string for compiling later */ memcpy(regex_char, p, longitud); regex_char[longitud] = '\0'; + dbgprintf("debug: regex detected: '%s'\n", regex_char); + /* Now i compile the regex */ /* Remember that the re is an attribute of the Template entry */ if((iRetLocal = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) { @@ -1048,63 +877,22 @@ #endif /* #ifdef FEATURE_REGEXP */ } - /* check options */ - if(*p == ':') { - ++p; /* eat ':' */ - doOptions(&p, pTpe); - } - - if(pTpe->data.field.options.bFromPosEndRelative) { - if(pTpe->data.field.iToPos > pTpe->data.field.iFromPos) { - iNum = pTpe->data.field.iToPos; - pTpe->data.field.iToPos = pTpe->data.field.iFromPos; - pTpe->data.field.iFromPos = iNum; - } - } else { - if(pTpe->data.field.iToPos < pTpe->data.field.iFromPos) { - iNum = pTpe->data.field.iToPos; - pTpe->data.field.iToPos = pTpe->data.field.iFromPos; - pTpe->data.field.iFromPos = iNum; - } + if(pTpe->data.field.iToPos < pTpe->data.field.iFromPos) { + iNum = pTpe->data.field.iToPos; + pTpe->data.field.iToPos = pTpe->data.field.iFromPos; + pTpe->data.field.iFromPos = iNum; } - - /* check field name */ + /* check options */ if(*p == ':') { ++p; /* eat ':' */ - CHKiRet(cstrConstruct(&pStrField)); - while(*p != ':' && *p != '%' && *p != '\0') { - cstrAppendChar(pStrField, *p); - ++p; - } - cstrFinalize(pStrField); + doOptions(&p, pTpe); } - /* save field name - if none was given, use the property name instead */ - if(pStrField == NULL) { - if(pTpe->data.field.msgProp.id == PROP_CEE || pTpe->data.field.msgProp.id == PROP_LOCAL_VAR) { - /* in CEE case, we remove "$!"/"$." from the fieldname - it's just our indicator */ - pTpe->fieldName = ustrdup(cstrGetSzStrNoNULL(pStrProp)+2); - pTpe->lenFieldName = cstrLen(pStrProp)-2; - } else { - pTpe->fieldName = ustrdup(cstrGetSzStrNoNULL(pStrProp)); - pTpe->lenFieldName = cstrLen(pStrProp); - } - } else { - pTpe->fieldName = ustrdup(cstrGetSzStrNoNULL(pStrField)); - pTpe->lenFieldName = ustrlen(pTpe->fieldName); - cstrDestruct(&pStrField); - } - if(pTpe->fieldName == NULL) { - DBGPRINTF("template/do_Parameter: fieldName is NULL!\n"); - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); - } if(*p) ++p; /* eat '%' */ + *pp = p; -finalize_it: - if(pStrProp != NULL) - cstrDestruct(&pStrProp); - RETiRet; + return 0; } @@ -1115,13 +903,14 @@ static rsRetVal tplAddTplMod(struct template *pTpl, uchar** ppRestOfConfLine) { - uchar *pSrc; + uchar *pSrc, *pDst; uchar szMod[2048]; unsigned lenMod; strgen_t *pStrgen; DEFiRet; pSrc = *ppRestOfConfLine; + pDst = szMod; lenMod = 0; while(*pSrc && !isspace(*pSrc) && lenMod < sizeof(szMod) - 1) { szMod[lenMod] = *pSrc++; @@ -1159,7 +948,7 @@ /* Add a new template line * returns pointer to new object if it succeeds, NULL otherwise. */ -struct template *tplAddLine(rsconf_t *conf, char* pName, uchar** ppRestOfConfLine) +struct template *tplAddLine(char* pName, uchar** ppRestOfConfLine) { struct template *pTpl; unsigned char *p; @@ -1170,10 +959,10 @@ assert(pName != NULL); assert(ppRestOfConfLine != NULL); - if((pTpl = tplConstruct(conf)) == NULL) + + if((pTpl = tplConstruct()) == NULL) return NULL; - DBGPRINTF("tplAddLine processing template '%s'\n", pName); pTpl->iLenName = strlen(pName); pTpl->pszName = (char*) MALLOC(sizeof(char) * (pTpl->iLenName + 1)); if(pTpl->pszName == NULL) { @@ -1233,13 +1022,10 @@ break; case '%': /* parameter */ ++p; /* eat '%' */ - if(do_Parameter(&p, pTpl) != RS_RET_OK) { - dbgprintf("tplAddLine error: parameter invalid"); - return NULL; - }; + do_Parameter(&p, pTpl); break; default: /* constant */ - do_Constant(&p, pTpl, 1); + do_Constant(&p, pTpl); break; } if(*p == '"') {/* end of template string? */ @@ -1296,605 +1082,6 @@ return(pTpl); } -static rsRetVal -createConstantTpe(struct template *pTpl, struct cnfobj *o) -{ - struct templateEntry *pTpe; - es_str_t *value = NULL; /* init just to keep compiler happy - mandatory parameter */ - int i; - struct cnfparamvals *pvals = NULL; - uchar *outname = NULL; - DEFiRet; - - /* pull params */ - pvals = nvlstGetParams(o->nvlst, &pblkConstant, NULL); - cnfparamsPrint(&pblkConstant, pvals); - - for(i = 0 ; i < pblkConstant.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblkConstant.descr[i].name, "value")) { - value = pvals[i].val.d.estr; - } else if(!strcmp(pblkConstant.descr[i].name, "outname")) { - outname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("template:constantTpe: program error, non-handled " - "param '%s'\n", pblkConstant.descr[i].name); - } - } - - /* sanity check */ - - /* apply */ - CHKmalloc(pTpe = tpeConstruct(pTpl)); - es_unescapeStr(value); - pTpe->eEntryType = CONSTANT; - pTpe->fieldName = outname; - if(outname != NULL) - pTpe->lenFieldName = ustrlen(outname); - pTpe->data.constant.iLenConstant = es_strlen(value); - pTpe->data.constant.pConstant = (uchar*)es_str2cstr(value, NULL); - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &pblkConstant); - RETiRet; -} - -static rsRetVal -createPropertyTpe(struct template *pTpl, struct cnfobj *o) -{ - struct templateEntry *pTpe; - cstr_t *name = NULL; - uchar *outname = NULL; - int i; - int droplastlf = 0; - int spifno1stsp = 0; - int mandatory = 0; - int frompos = -1; - int topos = -1; - int fieldnum = -1; - int fielddelim = 9; /* default is HT (USACSII 9) */ - int re_matchToUse = 0; - int re_submatchToUse = 0; - int bComplexProcessing = 0; - int bPosRelativeToEnd = 0; - char *re_expr = NULL; - struct cnfparamvals *pvals = NULL; - enum {F_NONE, F_CSV, F_JSON, F_JSONF} formatType = F_NONE; - enum {CC_NONE, CC_ESCAPE, CC_SPACE, CC_DROP} controlchr = CC_NONE; - enum {SP_NONE, SP_DROP, SP_REPLACE} secpath = SP_NONE; - enum tplFormatCaseConvTypes caseconv = tplCaseConvNo; - enum tplFormatTypes datefmt = tplFmtDefault; - enum tplRegexType re_type = TPL_REGEX_BRE; - enum tlpRegexNoMatchType re_nomatchType = TPL_REGEX_NOMATCH_USE_DFLTSTR; - DEFiRet; - - /* pull params */ - pvals = nvlstGetParams(o->nvlst, &pblkProperty, NULL); - cnfparamsPrint(&pblkProperty, pvals); - - for(i = 0 ; i < pblkProperty.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblkProperty.descr[i].name, "name")) { - uchar *tmpstr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - rsCStrConstructFromszStr(&name, tmpstr); - cstrFinalize(name); - free(tmpstr); - } else if(!strcmp(pblkProperty.descr[i].name, "droplastlf")) { - droplastlf = pvals[i].val.d.n; - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "mandatory")) { - mandatory = pvals[i].val.d.n; - } else if(!strcmp(pblkProperty.descr[i].name, "spifno1stsp")) { - spifno1stsp = pvals[i].val.d.n; - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "outname")) { - outname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblkProperty.descr[i].name, "position.from")) { - frompos = pvals[i].val.d.n; - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "position.to")) { - topos = pvals[i].val.d.n; - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "position.relativetoend")) { - bPosRelativeToEnd = pvals[i].val.d.n; - } else if(!strcmp(pblkProperty.descr[i].name, "field.number")) { - fieldnum = pvals[i].val.d.n; - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "field.delimiter")) { - fielddelim = pvals[i].val.d.n; - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "regex.expression")) { - re_expr = es_str2cstr(pvals[i].val.d.estr, NULL); - bComplexProcessing = 1; - } else if(!strcmp(pblkProperty.descr[i].name, "regex.type")) { - bComplexProcessing = 1; - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"BRE", sizeof("BRE")-1)) { - re_type = TPL_REGEX_BRE; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"ERE", sizeof("ERE")-1)) { - re_type = TPL_REGEX_ERE; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid regex.type '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblkProperty.descr[i].name, "regex.nomatchmode")) { - bComplexProcessing = 1; - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"DFLT", sizeof("DFLT")-1)) { - re_nomatchType = TPL_REGEX_NOMATCH_USE_DFLTSTR; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"BLANK", sizeof("BLANK")-1)) { - re_nomatchType = TPL_REGEX_NOMATCH_USE_BLANK; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"FIELD", sizeof("FIELD")-1)) { - re_nomatchType = TPL_REGEX_NOMATCH_USE_WHOLE_FIELD; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"ZERO", sizeof("ZERO")-1)) { - re_nomatchType = TPL_REGEX_NOMATCH_USE_ZERO; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid format type '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblkProperty.descr[i].name, "regex.match")) { - bComplexProcessing = 1; - re_matchToUse = pvals[i].val.d.n; - } else if(!strcmp(pblkProperty.descr[i].name, "regex.submatch")) { - bComplexProcessing = 1; - re_submatchToUse = pvals[i].val.d.n; - } else if(!strcmp(pblkProperty.descr[i].name, "format")) { - bComplexProcessing = 1; - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"csv", sizeof("csv")-1)) { - formatType = F_CSV; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"json", sizeof("json")-1)) { - formatType = F_JSON; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"jsonf", sizeof("jsonf")-1)) { - formatType = F_JSONF; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid format type '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblkProperty.descr[i].name, "controlcharacters")) { - bComplexProcessing = 1; - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"escape", sizeof("escape")-1)) { - controlchr = CC_ESCAPE; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"space", sizeof("space")-1)) { - controlchr = CC_SPACE; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"drop", sizeof("drop")-1)) { - controlchr = CC_DROP; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid controlcharacter mode '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblkProperty.descr[i].name, "securepath")) { - bComplexProcessing = 1; - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"drop", sizeof("drop")-1)) { - secpath = SP_DROP; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"replace", sizeof("replace")-1)) { - secpath = SP_REPLACE; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid securepath mode '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblkProperty.descr[i].name, "caseconversion")) { - bComplexProcessing = 1; - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"lower", sizeof("lower")-1)) { - caseconv = tplCaseConvLower; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"upper", sizeof("upper")-1)) { - caseconv = tplCaseConvUpper; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid caseconversion type '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblkProperty.descr[i].name, "dateformat")) { - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"mysql", sizeof("mysql")-1)) { - datefmt = tplFmtMySQLDate; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"pgsql", sizeof("pgsql")-1)) { - datefmt = tplFmtPgSQLDate; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"rfc3164", sizeof("rfc3164")-1)) { - datefmt = tplFmtRFC3164Date; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"rfc3164-buggyday", sizeof("rfc3164-buggyday")-1)) { - datefmt = tplFmtRFC3164BuggyDate; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"rfc3339", sizeof("rfc3339")-1)) { - datefmt = tplFmtRFC3339Date; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"unixtimestamp", sizeof("unixtimestamp")-1)) { - datefmt = tplFmtUnixDate; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"subseconds", sizeof("subseconds")-1)) { - datefmt = tplFmtSecFrac; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid date format '%s' for property", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - dbgprintf("template:propertyTpe: program error, non-handled " - "param '%s'\n", pblkProperty.descr[i].name); - } - } - if(outname == NULL) { - uchar *psz = cstrGetSzStrNoNULL(name); - /* we need to drop "$!" prefix, if present */ - if(!strncmp((char*)psz, "$!", 2)) - outname = ustrdup(psz + 2); - else - outname = ustrdup(psz); - } - - /* sanity check */ - if(topos == -1 && frompos != -1) - topos = 2000000000; /* large enough ;) */ - if(frompos == -1 && topos != -1) - frompos = 0; - if(bPosRelativeToEnd) { - if(topos > frompos) { - errmsg.LogError(0, RS_RET_ERR, "position.to=%d is higher than postion.from=%d in 'relativeToEnd' mode\n", - topos, frompos); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - if(topos < frompos) { - errmsg.LogError(0, RS_RET_ERR, "position.to=%d is lower than postion.from=%d\n", - topos, frompos); - ABORT_FINALIZE(RS_RET_ERR); - } - } - if(fieldnum != -1 && re_expr != NULL) { - errmsg.LogError(0, RS_RET_ERR, "both field extraction and regex extraction " - "specified - this is not possible, remove one"); - ABORT_FINALIZE(RS_RET_ERR); - } - - /* apply */ - CHKmalloc(pTpe = tpeConstruct(pTpl)); - pTpe->eEntryType = FIELD; - CHKiRet(msgPropDescrFill(&pTpe->data.field.msgProp, cstrGetSzStrNoNULL(name), - cstrLen(name))); - pTpe->data.field.options.bDropLastLF = droplastlf; - pTpe->data.field.options.bSPIffNo1stSP = spifno1stsp; - pTpe->data.field.options.bMandatory = mandatory; - pTpe->data.field.eCaseConv = caseconv; - switch(formatType) { - case F_NONE: - /* all set ;) */ - break; - case F_CSV: - pTpe->data.field.options.bCSV = 1; - break; - case F_JSON: - pTpe->data.field.options.bJSON = 1; - break; - case F_JSONF: - pTpe->data.field.options.bJSONf = 1; - break; - } - switch(controlchr) { - case CC_NONE: - /* all set ;) */ - break; - case CC_ESCAPE: - pTpe->data.field.options.bEscapeCC = 1; - break; - case CC_SPACE: - pTpe->data.field.options.bSpaceCC = 1; - break; - case CC_DROP: - pTpe->data.field.options.bDropCC = 1; - break; - } - switch(secpath) { - case SP_NONE: - /* all set ;) */ - break; - case SP_DROP: - pTpe->data.field.options.bSecPathDrop = 1; - break; - case SP_REPLACE: - pTpe->data.field.options.bSecPathReplace = 1; - break; - } - pTpe->fieldName = outname; - if(outname != NULL) - pTpe->lenFieldName = ustrlen(outname); - pTpe->bComplexProcessing = bComplexProcessing; - pTpe->data.field.eDateFormat = datefmt; - if(fieldnum != -1) { - pTpe->data.field.has_fields = 1; - pTpe->data.field.iFieldNr = fieldnum; - pTpe->data.field.field_delim = fielddelim; - } - if(frompos != -1) { - pTpe->data.field.iFromPos = frompos; - pTpe->data.field.iToPos = topos; - pTpe->data.field.options.bFromPosEndRelative = bPosRelativeToEnd; - } - if(re_expr != NULL) { - rsRetVal iRetLocal; - pTpe->data.field.typeRegex = re_type; - pTpe->data.field.nomatchAction = re_nomatchType; - pTpe->data.field.iMatchToUse = re_matchToUse; - pTpe->data.field.iSubMatchToUse = re_submatchToUse; - pTpe->data.field.has_regex = 1; - if((iRetLocal = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) { - int iOptions; - iOptions = (pTpe->data.field.typeRegex == TPL_REGEX_ERE) ? REG_EXTENDED : 0; - if(regexp.regcomp(&(pTpe->data.field.re), (char*) re_expr, iOptions) != 0) { - dbgprintf("error: can not compile regex: '%s'\n", re_expr); - errmsg.LogError(0, NO_ERRCODE, "error compiling regex '%s'", re_expr); - pTpe->data.field.has_regex = 2; - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - /* regexp object could not be loaded */ - if(bFirstRegexpErrmsg) { /* prevent flood of messages, maybe even an endless loop! */ - bFirstRegexpErrmsg = 0; - errmsg.LogError(0, NO_ERRCODE, "regexp library could not be loaded (error %d), " - "regexp ignored", iRetLocal); - } - pTpe->data.field.has_regex = 2; - ABORT_FINALIZE(RS_RET_ERR); - } - } - -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &pblkProperty); - if(name != NULL) - rsCStrDestruct(&name); - RETiRet; -} - -/* create a template in list mode, is build from sub-objects */ -static rsRetVal -createListTpl(struct template *pTpl, struct cnfobj *o) -{ - struct objlst *lst; - DEFiRet; - - dbgprintf("create template from subobjs\n"); - objlstPrint(o->subobjs); - - for(lst = o->subobjs ; lst != NULL ; lst = lst->next) { - switch(lst->obj->objType) { - case CNFOBJ_PROPERTY: - CHKiRet(createPropertyTpe(pTpl, lst->obj)); - break; - case CNFOBJ_CONSTANT: - CHKiRet(createConstantTpe(pTpl, lst->obj)); - break; - default:dbgprintf("program error: invalid object type %d " - "in createLstTpl\n", lst->obj->objType); - break; - } - nvlstChkUnused(lst->obj->nvlst); - } -finalize_it: - RETiRet; -} - -/* Add a new template via the v6 config system. */ -rsRetVal -tplProcessCnf(struct cnfobj *o) -{ - struct template *pTpl = NULL; - struct cnfparamvals *pvals = NULL; - int lenName = 0; /* init just to keep compiler happy: mandatory parameter */ - char *name = NULL; - uchar *tplStr = NULL; - uchar *plugin = NULL; - uchar *p; - msgPropDescr_t subtree; - sbool bHaveSubtree = 0; - enum { T_STRING, T_PLUGIN, T_LIST, T_SUBTREE } - tplType = T_STRING; /* init just to keep compiler happy: mandatory parameter */ - int i; - int o_sql=0, o_stdsql=0, o_json=0; /* options */ - int numopts; - rsRetVal localRet; - DEFiRet; - - pvals = nvlstGetParams(o->nvlst, &pblk, NULL); - cnfparamsPrint(&pblk, pvals); - - for(i = 0 ; i < pblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(pblk.descr[i].name, "name")) { - lenName = es_strlen(pvals[i].val.d.estr); - name = es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblk.descr[i].name, "type")) { - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"string", sizeof("string")-1)) { - tplType = T_STRING; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"plugin", sizeof("plugin")-1)) { - tplType = T_PLUGIN; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"list", sizeof("list")-1)) { - tplType = T_LIST; - } else if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"subtree", sizeof("subtree")-1)) { - tplType = T_SUBTREE; - } else { - uchar *typeStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid template type '%s'", - typeStr); - free(typeStr); - ABORT_FINALIZE(RS_RET_ERR); - } - } else if(!strcmp(pblk.descr[i].name, "string")) { - tplStr = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblk.descr[i].name, "subtree")) { - uchar *st_str = es_getBufAddr(pvals[i].val.d.estr); - if(st_str[0] != '$' || st_str[1] != '!') { - char *cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_ERR, "invalid subtree " - "parameter, variable must start with '$!' but " - "var name is '%s'", cstr); - free(cstr); - free(name); /* overall assigned */ - ABORT_FINALIZE(RS_RET_ERR); - } else { - uchar *cstr; - cstr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - CHKiRet(msgPropDescrFill(&subtree, cstr, ustrlen(cstr))); - free(cstr); - bHaveSubtree = 1; - } - } else if(!strcmp(pblk.descr[i].name, "plugin")) { - plugin = (uchar*) es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(pblk.descr[i].name, "option.stdsql")) { - o_stdsql = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "option.sql")) { - o_sql = pvals[i].val.d.n; - } else if(!strcmp(pblk.descr[i].name, "option.json")) { - o_json = pvals[i].val.d.n; - } else { - dbgprintf("template: program error, non-handled " - "param '%s'\n", pblk.descr[i].name); - } - } - - /* do config sanity checks */ - if(tplStr == NULL) { - if(tplType == T_STRING) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' of type string needs " - "string parameter", name); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - if(tplType != T_STRING) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' is not a string " - "template but has a string specified - ignored", name); - } - } - - if(plugin == NULL) { - if(tplType == T_PLUGIN) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' of type plugin needs " - "plugin parameter", name); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - if(tplType != T_PLUGIN) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' is not a plugin " - "template but has a plugin specified - ignored", name); - } - } - - if(!bHaveSubtree) { - if(tplType == T_SUBTREE) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' of type subtree needs " - "subtree parameter", name); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - if(tplType != T_SUBTREE) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' is not a subtree " - "template but has a subtree specified - ignored", name); - } - } - - if(o->subobjs == NULL) { - if(tplType == T_LIST) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' of type list has " - "has no parameters specified", name); - ABORT_FINALIZE(RS_RET_ERR); - } - } else { - if(tplType != T_LIST) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' is not a list " - "template but has parameters specified - ignored", name); - } - } - - numopts = 0; - if(o_sql) ++numopts; - if(o_stdsql) ++numopts; - if(o_json) ++numopts; - if(numopts > 1) { - errmsg.LogError(0, RS_RET_ERR, "template '%s' has multiple incompatible " - "options of sql, stdsql or json specified", name); - ABORT_FINALIZE(RS_RET_ERR); - } - - /* config ok */ - if((pTpl = tplConstruct(loadConf)) == NULL) { - DBGPRINTF("template.c: tplConstruct failed!\n"); - ABORT_FINALIZE(RS_RET_ERR); - } - pTpl->pszName = name; - pTpl->iLenName = lenName; - - switch(tplType) { - case T_STRING: p = tplStr; - while(*p) { - switch(*p) { - case '%': /* parameter */ - ++p; /* eat '%' */ - CHKiRet(do_Parameter(&p, pTpl)); - break; - default: /* constant */ - do_Constant(&p, pTpl, 0); - break; - } - } - break; - case T_PLUGIN: p = plugin; - /* TODO: the use of tplAddTplMod() can be improved! */ - localRet = tplAddTplMod(pTpl, &p); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, "template '%s': error %d " - "defining template via plugin (strgen) module", - pTpl->pszName, localRet); - ABORT_FINALIZE(localRet); - } - break; - case T_LIST: createListTpl(pTpl, o); - break; - case T_SUBTREE: memcpy(&pTpl->subtree, &subtree, sizeof(msgPropDescr_t)); - pTpl->bHaveSubtree = 1; - break; - } - - pTpl->optFormatEscape = NO_ESCAPE; - if(o_stdsql) - pTpl->optFormatEscape = STDSQL_ESCAPE; - else if(o_sql) - pTpl->optFormatEscape = SQL_ESCAPE; - else if(o_json) - pTpl->optFormatEscape = JSON_ESCAPE; - -finalize_it: - free(tplStr); - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &pblk); - if(iRet != RS_RET_OK) { - if(pTpl != NULL) { - /* we simply make the template defunct in this case by setting - * its name to a zero-string. We do not free it, as this would - * require additional code and causes only a very small memory - * consumption. TODO: maybe in next iteration... - */ - *pTpl->pszName = '\0'; - } - } - - RETiRet; -} - /* Find a template object based on name. Search * currently is case-senstive (should we change?). @@ -1902,13 +1089,13 @@ * NULL otherwise. * rgerhards 2004-11-17 */ -struct template *tplFind(rsconf_t *conf, char *pName, int iLenName) +struct template *tplFind(char *pName, int iLenName) { struct template *pTpl; assert(pName != NULL); - pTpl = conf->templates.root; + pTpl = tplRoot; while(pTpl != NULL && !(pTpl->iLenName == iLenName && !strcmp(pTpl->pszName, pName) @@ -1926,13 +1113,13 @@ * "normal" debugging. Uncomment them, if they are needed. * rgerhards, 2007-07-05 */ -void tplDeleteAll(rsconf_t *conf) +void tplDeleteAll(void) { struct template *pTpl, *pTplDel; struct templateEntry *pTpe, *pTpeDel; BEGINfunc - pTpl = conf->templates.root; + pTpl = tplRoot; while(pTpl != NULL) { /* dbgprintf("Delete Template: Name='%s'\n ", pTpl->pszName == NULL? "NULL" : pTpl->pszName);*/ pTpe = pTpl->pEntryRoot; @@ -1958,18 +1145,15 @@ } } #endif - msgPropDescrDestruct(&pTpeDel->data.field.msgProp); break; } - free(pTpeDel->fieldName); /*dbgprintf("\n");*/ free(pTpeDel); } pTplDel = pTpl; pTpl = pTpl->pNext; - free(pTplDel->pszName); - if(pTplDel->bHaveSubtree) - msgPropDescrDestruct(&pTplDel->subtree); + if(pTplDel->pszName != NULL) + free(pTplDel->pszName); free(pTplDel); } ENDfunc @@ -1979,19 +1163,19 @@ /* Destroy all templates obtained from conf file * preserving hardcoded ones. This is called from init(). */ -void tplDeleteNew(rsconf_t *conf) +void tplDeleteNew(void) { struct template *pTpl, *pTplDel; struct templateEntry *pTpe, *pTpeDel; BEGINfunc - if(conf->templates.root == NULL || conf->templates.lastStatic == NULL) + if(tplRoot == NULL || tplLastStatic == NULL) return; - pTpl = conf->templates.lastStatic->pNext; - conf->templates.lastStatic->pNext = NULL; - conf->templates.last = conf->templates.lastStatic; + pTpl = tplLastStatic->pNext; + tplLastStatic->pNext = NULL; + tplLast = tplLastStatic; while(pTpl != NULL) { /* dbgprintf("Delete Template: Name='%s'\n ", pTpl->pszName == NULL? "NULL" : pTpl->pszName);*/ pTpe = pTpl->pEntryRoot; @@ -2017,7 +1201,6 @@ } } #endif - msgPropDescrDestruct(&pTpeDel->data.field.msgProp); break; } /*dbgprintf("\n");*/ @@ -2025,29 +1208,28 @@ } pTplDel = pTpl; pTpl = pTpl->pNext; - free(pTplDel->pszName); - if(pTplDel->bHaveSubtree) - msgPropDescrDestruct(&pTplDel->subtree); + if(pTplDel->pszName != NULL) + free(pTplDel->pszName); free(pTplDel); } ENDfunc } /* Store the pointer to the last hardcoded teplate */ -void tplLastStaticInit(rsconf_t *conf, struct template *tpl) +void tplLastStaticInit(struct template *tpl) { - conf->templates.lastStatic = tpl; + tplLastStatic = tpl; } /* Print the template structure. This is more or less a * debug or test aid, but anyhow I think it's worth it... */ -void tplPrintList(rsconf_t *conf) +void tplPrintList(void) { struct template *pTpl; struct templateEntry *pTpe; - pTpl = conf->templates.root; + pTpl = tplRoot; while(pTpl != NULL) { dbgprintf("Template: Name='%s' ", pTpl->pszName == NULL? "NULL" : pTpl->pszName); if(pTpl->optFormatEscape == SQL_ESCAPE) @@ -2069,14 +1251,7 @@ pTpe->data.constant.pConstant); break; case FIELD: - dbgprintf("(FIELD), value: '%d' ", pTpe->data.field.msgProp.id); - if(pTpe->data.field.msgProp.id == PROP_CEE) { - dbgprintf("[EE-Property: '%s'] ", pTpe->data.field.msgProp.name); - } else if(pTpe->data.field.msgProp.id == PROP_LOCAL_VAR) { - dbgprintf("[Local Var: '%s'] ", pTpe->data.field.msgProp.name); - //} else if(pTpe->data.field.propid == PROP_GLOBAL_VAR) { - // dbgprintf("[Global Var: '%s'] ", pTpe->data.field.propName); - } + dbgprintf("(FIELD), value: '%d' ", pTpe->data.field.propid); switch(pTpe->data.field.eDateFormat) { case tplFmtDefault: break; @@ -2092,17 +1267,8 @@ case tplFmtRFC3339Date: dbgprintf("[Format as RFC3339-Date] "); break; - case tplFmtUnixDate: - dbgprintf("[Format as Unix timestamp] "); - break; - case tplFmtSecFrac: - dbgprintf("[fractional seconds, only] "); - break; - case tplFmtRFC3164BuggyDate: - dbgprintf("[Format as buggy RFC3164-Date] "); - break; default: - dbgprintf("[UNKNOWN eDateFormat %d] ", pTpe->data.field.eDateFormat); + dbgprintf("[INVALID eDateFormat %d] ", pTpe->data.field.eDateFormat); } switch(pTpe->data.field.eCaseConv) { case tplCaseConvNo: @@ -2135,15 +1301,6 @@ if(pTpe->data.field.options.bCSV) { dbgprintf("[format as CSV (RFC4180)]"); } - if(pTpe->data.field.options.bJSON) { - dbgprintf("[format as JSON] "); - } - if(pTpe->data.field.options.bJSONf) { - dbgprintf("[format as JSON field] "); - } - if(pTpe->data.field.options.bMandatory) { - dbgprintf("[mandatory field] "); - } if(pTpe->data.field.options.bDropLastLF) { dbgprintf("[drop last LF in msg] "); } @@ -2158,8 +1315,6 @@ } break; } - if(pTpe->bComplexProcessing) - dbgprintf("[COMPLEX]"); dbgprintf("\n"); pTpe = pTpe->pNext; } @@ -2173,6 +1328,8 @@ return(pTpl->tpenElements); } +/* our init function. TODO: remove once converted to a class + */ rsRetVal templateInit() { DEFiRet; diff -Nru rsyslog-7.6.0/template.h rsyslog-5.10.1/template.h --- rsyslog-7.6.0/template.h 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/template.h 2012-10-17 14:41:20.000000000 +0000 @@ -1,7 +1,7 @@ /* This is the header for template processing code of rsyslog. * begun 2004-11-17 rgerhards * - * Copyright (C) 2004-2012 by Rainer Gerhards and Adiscon GmbH + * Copyright 2004-2012 Rainer Gerhards and Adiscon * * This file is part of rsyslog. * @@ -30,8 +30,6 @@ #ifndef TEMPLATE_H_INCLUDED #define TEMPLATE_H_INCLUDED 1 -#include -#include #include "regexp.h" #include "stringbuf.h" @@ -39,17 +37,15 @@ struct template *pNext; char *pszName; int iLenName; - rsRetVal (*pStrgen)(msg_t*, uchar**, size_t *); - sbool bHaveSubtree; - msgPropDescr_t subtree; /* subtree property name for subtree-type templates */ + rsRetVal (*pStrgen)(msg_t*, uchar**, size_t *); /* name of strgen to use (bound if non-NULL!) */ int tpenElements; /* number of elements in templateEntry list */ struct templateEntry *pEntryRoot; struct templateEntry *pEntryLast; - char optFormatEscape; /* in text fields, */ -# define NO_ESCAPE 0 /* 0 - do not escape, */ -# define SQL_ESCAPE 1 /* 1 - escape "the MySQL way" */ -# define STDSQL_ESCAPE 2 /* 2 - escape quotes by double quotes, */ -# define JSON_ESCAPE 3 /* 3 - escape double quotes for JSON. */ + char optFormatEscape; /* in text fields, 0 - do not escape, + * 1 - escape "the MySQL way" + * 2 - escape quotes by double quotes, + * 3 - escape double quotes for JSON. + */ /* following are options. All are 0/1 defined (either on or off). * we use chars because they are faster than bit fields and smaller * than short... @@ -59,11 +55,8 @@ enum EntryTypes { UNDEFINED = 0, CONSTANT = 1, FIELD = 2 }; enum tplFormatTypes { tplFmtDefault = 0, tplFmtMySQLDate = 1, tplFmtRFC3164Date = 2, tplFmtRFC3339Date = 3, tplFmtPgSQLDate = 4, - tplFmtSecFrac = 5, tplFmtRFC3164BuggyDate = 6, tplFmtUnixDate}; + tplFmtSecFrac = 5, tplFmtRFC3164BuggyDate = 6}; enum tplFormatCaseConvTypes { tplCaseConvNo = 0, tplCaseConvUpper = 1, tplCaseConvLower = 2 }; -enum tplRegexType { TPL_REGEX_BRE = 0, /* posix BRE */ - TPL_REGEX_ERE = 1 /* posix ERE */ - }; #include "msg.h" @@ -71,16 +64,13 @@ struct templateEntry { struct templateEntry *pNext; enum EntryTypes eEntryType; - uchar *fieldName; /**< field name to be used for structured output */ - int lenFieldName; - sbool bComplexProcessing; /**< set if complex processing (options, etc) is required */ union { struct { uchar *pConstant; /* pointer to constant value */ int iLenConstant; /* its length */ } constant; struct { - msgPropDescr_t msgProp; /* property to be used */ + propid_t propid; /* property to be used */ unsigned iFromPos; /* for partial strings only chars from this position ... */ unsigned iToPos; /* up to that one... */ unsigned iFieldNr; /* for field extraction: field to extract */ @@ -89,8 +79,11 @@ short has_regex; short iMatchToUse;/* which match should be obtained (10 max) */ short iSubMatchToUse;/* which submatch should be obtained (10 max) */ - enum tplRegexType typeRegex; - enum tlpRegexNoMatchType { + enum { + TPL_REGEX_BRE = 0, /* posix BRE */ + TPL_REGEX_ERE = 1 /* posix ERE */ + } typeRegex; + enum { TPL_REGEX_NOMATCH_USE_DFLTSTR = 0, /* use the (old style) default "**NO MATCH**" string */ TPL_REGEX_NOMATCH_USE_BLANK = 1, /* use a blank string */ TPL_REGEX_NOMATCH_USE_WHOLE_FIELD = 2, /* use the full field contents that we were searching in*/ @@ -104,7 +97,6 @@ int field_expand; /* use multiple instances of the field delimiter as a single one? */ #endif - enum tplFormatTypes eDateFormat; enum tplFormatCaseConvTypes eCaseConv; struct { /* bit fields! */ @@ -114,12 +106,8 @@ unsigned bDropLastLF: 1; /* drop last LF char in msg (PIX!) */ unsigned bSecPathDrop: 1; /* drop slashes, replace dots, empty string */ unsigned bSecPathReplace: 1; /* replace slashes, replace dots, empty string */ - unsigned bSPIffNo1stSP: 1; /* be a space if 1st pos if field is no space*/ + unsigned bSPIffNo1stSP: 1; /* replace slashes, replace dots, empty string */ unsigned bCSV: 1; /* format field in CSV (RFC 4180) format */ - unsigned bJSON: 1; /* format field JSON escaped */ - unsigned bJSONf: 1; /* format field JSON *field* (n/v pair) */ - unsigned bMandatory: 1; /* mandatory field - emit even if empty */ - unsigned bFromPosEndRelative: 1;/* is From/To-Pos relative to end of string? */ } options; /* options as bit fields */ } field; } data; @@ -135,28 +123,25 @@ PROTOTYPEObj(tpl); -//struct template* tplConstruct(void); -struct template *tplAddLine(rsconf_t *conf, char* pName, unsigned char** pRestOfConfLine); -struct template *tplFind(rsconf_t *conf, char *pName, int iLenName); +struct template* tplConstruct(void); +struct template *tplAddLine(char* pName, unsigned char** pRestOfConfLine); +struct template *tplFind(char *pName, int iLenName); int tplGetEntryCount(struct template *pTpl); -void tplDeleteAll(rsconf_t *conf); -void tplDeleteNew(rsconf_t *conf); -void tplPrintList(rsconf_t *conf); -void tplLastStaticInit(rsconf_t *conf, struct template *tpl); +void tplDeleteAll(void); +void tplDeleteNew(void); +void tplPrintList(void); +void tplLastStaticInit(struct template *tpl); rsRetVal ExtendBuf(uchar **pBuf, size_t *pLenBuf, size_t iMinSize); -int tplRequiresDateCall(struct template *pTpl); /* note: if a compiler warning for undefined type tells you to look at this * code line below, the actual cause is that you currently MUST include template.h * BEFORE msg.h, even if your code file does not actually need it. * rgerhards, 2007-08-06 */ -rsRetVal tplToArray(struct template *pTpl, msg_t *pMsg, uchar*** ppArr, struct syslogTime *ttNow); -rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar** ppSz, size_t *, struct syslogTime *ttNow); -rsRetVal tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **, struct syslogTime *ttNow); -rsRetVal doEscape(uchar **pp, rs_size_t *pLen, unsigned short *pbMustBeFreed, int escapeMode); +rsRetVal tplToArray(struct template *pTpl, msg_t *pMsg, uchar*** ppArr); +rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar** ppSz, size_t *); +rsRetVal doEscape(uchar **pp, size_t *pLen, unsigned short *pbMustBeFreed, int escapeMode); rsRetVal templateInit(); -rsRetVal tplProcessCnf(struct cnfobj *o); #endif /* #ifndef TEMPLATE_H_INCLUDED */ /* vim:set ai: diff -Nru rsyslog-7.6.0/tests/cee_diskqueue.sh rsyslog-5.10.1/tests/cee_diskqueue.sh --- rsyslog-7.6.0/tests/cee_diskqueue.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/cee_diskqueue.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# check if CEE properties are properly saved & restored to/from disk queue -# added 2012-09-19 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[cee_diskqueue.sh\]: CEE and diskqueue test -source $srcdir/diag.sh init -source $srcdir/diag.sh startup cee_diskqueue.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/cee_simple.sh rsyslog-5.10.1/tests/cee_simple.sh --- rsyslog-7.6.0/tests/cee_simple.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/cee_simple.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-19 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[cee_simple.sh\]: basic CEE property test -source $srcdir/diag.sh init -source $srcdir/diag.sh startup cee_simple.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/cfg.sh rsyslog-5.10.1/tests/cfg.sh --- rsyslog-7.6.0/tests/cfg.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/cfg.sh 2012-10-17 14:41:20.000000000 +0000 @@ -37,7 +37,7 @@ # # check empty config file # -../tools/rsyslogd -c4 -N1 -f/dev/null -M../runtime/.libs:../.libs 2>&1 |./ourtail |head -2 > tmp +../tools/rsyslogd -c4 -N1 -f/dev/null 2>&1 |./ourtail |head -2 > tmp cmp tmp $srcdir/DevNull.cfgtest if [ ! $? -eq 0 ]; then echo "DevNull.cfgtest failed" @@ -52,7 +52,7 @@ # # check missing config file # -../tools/rsyslogd -c4 -N1 -M../runtime/.libs:../.libs -f/This/does/not/exist 2>&1 |./ourtail |head -2 > tmp +../tools/rsyslogd -c4 -N1 -f/This/does/not/exist 2>&1 |./ourtail |head -2 > tmp cmp tmp $srcdir/NoExistFile.cfgtest if [ ! $? -eq 0 ]; then echo "NoExistFile.cfgtest failed" diff -Nru rsyslog-7.6.0/tests/chkseq.c rsyslog-5.10.1/tests/chkseq.c --- rsyslog-7.6.0/tests/chkseq.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/chkseq.c 2012-09-10 16:28:20.000000000 +0000 @@ -48,10 +48,8 @@ int start = 0, end = 0; int opt; int nDups = 0; - int reachedEOF; int edLen; /* length of extra data */ static char edBuf[500*1024]; /* buffer for extra data (pretty large to be on the save side...) */ - static char ioBuf[sizeof(edBuf)+1024]; char *file = NULL; while((opt = getopt(argc, argv, "e:f:ds:vE")) != EOF) { @@ -104,22 +102,14 @@ for(i = start ; i < end+1 ; ++i) { if(bHaveExtraData) { - if(fgets(ioBuf, sizeof(ioBuf), fp) == NULL) { - scanfOK = 0; - } else { - scanfOK = sscanf(ioBuf, "%d,%d,%s\n", &val, &edLen, edBuf) == 3 ? 1 : 0; - } + scanfOK = fscanf(fp, "%d,%d,%s\n", &val, &edLen, edBuf) == 3 ? 1 : 0; if(edLen != (int) strlen(edBuf)) { printf("extra data length specified %d, but actually is %ld in record %d\n", edLen, (long) strlen(edBuf), i); exit(1); } } else { - if(fgets(ioBuf, sizeof(ioBuf), fp) == NULL) { - scanfOK = 0; - } else { - scanfOK = sscanf(ioBuf, "%d\n", &val) == 1 ? 1 : 0; - } + scanfOK = fscanf(fp, "%d\n", &val) == 1 ? 1 : 0; } if(!scanfOK) { printf("scanf error in index i=%d\n", i); @@ -136,57 +126,15 @@ } } + if(nDups != 0) + printf("info: had %d duplicates (this is no error)\n", nDups); + if(i - 1 != end) { printf("only %d records in file, expected %d\n", i - 1, end); exit(1); } - int c = getc(fp); - if(c == EOF) { - reachedEOF = 1; - } else { - ungetc(c, fp); - /* if duplicates are permitted, we need to do a final check if we have duplicates at the - * end of file. - */ - if(dupsPermitted) { - i = end; - while(!feof(fp)) { - if(bHaveExtraData) { - if(fgets(ioBuf, sizeof(ioBuf), fp) == NULL) { - scanfOK = 0; - } else { - scanfOK = sscanf(ioBuf, "%d,%d,%s\n", &val, &edLen, edBuf) == 3 ? 1 : 0; - } - if(edLen != (int) strlen(edBuf)) { - printf("extra data length specified %d, but actually is %ld in record %d\n", - edLen, (long) strlen(edBuf), i); - exit(1); - } - } else { - if(fgets(ioBuf, sizeof(ioBuf), fp) == NULL) { - scanfOK = 0; - } else { - scanfOK = sscanf(ioBuf, "%d\n", &val) == 1 ? 1 : 0; - } - } - - if(val != i) { - reachedEOF = 0; - goto breakIF; - } - } - reachedEOF = feof(fp) ? 1 : 0; - } else { - reachedEOF = 0; - } - } - -breakIF: - if(nDups != 0) - printf("info: had %d duplicates (this is no error)\n", nDups); - - if(!reachedEOF) { + if(!feof(fp)) { printf("end of processing, but NOT end of file!\n"); exit(1); } diff -Nru rsyslog-7.6.0/tests/daqueue-persist.sh rsyslog-5.10.1/tests/daqueue-persist.sh --- rsyslog-7.6.0/tests/daqueue-persist.sh 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/daqueue-persist.sh 2012-09-18 15:03:58.000000000 +0000 @@ -2,7 +2,6 @@ # to carry out multiple tests with different queue modes # added 2009-05-27 by Rgerhards # This file is part of the rsyslog project, released under GPLv3 -echo =============================================================================== echo \[daqueue-persist.sh\]: test data persisting at shutdown source $srcdir/daqueue-persist-drvr.sh LinkedList source $srcdir/daqueue-persist-drvr.sh FixedArray diff -Nru rsyslog-7.6.0/tests/diag.sh rsyslog-5.10.1/tests/diag.sh --- rsyslog-7.6.0/tests/diag.sh 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/tests/diag.sh 2012-10-17 14:41:20.000000000 +0000 @@ -10,12 +10,13 @@ #valgrind="valgrind --tool=helgrind --log-fd=1" #valgrind="valgrind --tool=exp-ptrcheck --log-fd=1" #set -o xtrace -#export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout" +#export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction stdout" #export RSYSLOG_DEBUGLOG="log" case $1 in 'init') $srcdir/killrsyslog.sh # kill rsyslogd if it runs for some reason cp $srcdir/testsuites/diag-common.conf diag-common.conf cp $srcdir/testsuites/diag-common2.conf diag-common2.conf + rm -f rsyslog.action.*.include rm -f rsyslogd.started work-*.conf rsyslog.random.data rm -f rsyslogd2.started work-*.conf rm -f work rsyslog.out.log rsyslog2.out.log rsyslog.out.log.save # common work files @@ -23,10 +24,6 @@ rm -f rsyslog.out.*.log work-presort rsyslog.pipe rm -f rsyslog.input rsyslog.empty rm -f core.* vgcore.* - # Note: rsyslog.action.*.include must NOT be deleted, as it - # is used to setup some parameters BEFORE calling init. This - # happens in chained test scripts. Delete on exit is fine, - # though. mkdir test-spool ;; 'exit') rm -f rsyslogd.started work-*.conf diag-common.conf @@ -34,17 +31,17 @@ rm -f work rsyslog.out.log rsyslog2.out.log rsyslog.out.log.save # common work files rm -rf test-spool test-logdir stat-file1 rm -f rsyslog.out.*.log rsyslog.random.data work-presort rsyslog.pipe - rm -f rsyslog.input rsyslog.conf.tlscert stat-file1 rsyslog.empty + rm -f rsyslog.input stat-file1 #rsyslog.empty echo ------------------------------------------------------------------------------- ;; 'startup') # start rsyslogd with default params. $2 is the config file name to use # returns only after successful startup, $3 is the instance (blank or 2!) - $valgrind ../tools/rsyslogd -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 & + $valgrind ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 & $srcdir/diag.sh wait-startup $3 ;; 'startup-vg') # start rsyslogd with default params under valgrind control. $2 is the config file name to use # returns only after successful startup, $3 is the instance (blank or 2!) - valgrind --log-fd=1 --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=full ../tools/rsyslogd -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 & + valgrind --error-exitcode=10 --malloc-fill=ff --free-fill=fe --leak-check=full ../tools/rsyslogd -c6 -u2 -n -irsyslog$3.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/$2 & $srcdir/diag.sh wait-startup $3 ;; 'wait-startup') # wait for rsyslogd startup ($2 is the instance) @@ -109,7 +106,6 @@ echo Shutting down instance 2 fi $srcdir/diag.sh wait-queueempty $2 - ./msleep 100 # wait 100 milliseconds kill `cat rsyslog$2.pid` # note: we do not wait for the actual termination! ;; diff -Nru rsyslog-7.6.0/tests/diskqueue.sh rsyslog-5.10.1/tests/diskqueue.sh --- rsyslog-7.6.0/tests/diskqueue.sh 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/diskqueue.sh 2012-09-18 15:03:58.000000000 +0000 @@ -5,7 +5,6 @@ # added 2009-04-17 by Rgerhards # This file is part of the rsyslog project, released under GPLv3 # uncomment for debugging support: -echo =============================================================================== echo \[diskqueue.sh\]: testing queue disk-only mode # uncomment for debugging support: #export RSYSLOG_DEBUG="debug nostdout noprintmutexaction" diff -Nru rsyslog-7.6.0/tests/imptcp_addtlframedelim.sh rsyslog-5.10.1/tests/imptcp_addtlframedelim.sh --- rsyslog-7.6.0/tests/imptcp_addtlframedelim.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imptcp_addtlframedelim.sh 2012-09-10 16:28:20.000000000 +0000 @@ -3,6 +3,7 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imptcp_addtlframedelim.sh\]: test imptcp additional frame delimiter +cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imptcp_addtlframedelim.conf source $srcdir/diag.sh tcpflood -m20000 -F0 -P129 diff -Nru rsyslog-7.6.0/tests/imptcp_conndrop.sh rsyslog-5.10.1/tests/imptcp_conndrop.sh --- rsyslog-7.6.0/tests/imptcp_conndrop.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imptcp_conndrop.sh 2012-09-10 16:28:20.000000000 +0000 @@ -4,8 +4,9 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imptcp_conndrop.sh\]: test imptcp with random connection drops +cat rsyslog.action.1.include source $srcdir/diag.sh init -source $srcdir/diag.sh startup imptcp_conndrop.conf +source $srcdir/diag.sh startup imptcp_large.conf # 100 byte messages to gain more practical data use source $srcdir/diag.sh tcpflood -c20 -m50000 -r -d100 -P129 -D sleep 4 # due to large messages, we need this time for the tcp receiver to settle... diff -Nru rsyslog-7.6.0/tests/imptcp_large.sh rsyslog-5.10.1/tests/imptcp_large.sh --- rsyslog-7.6.0/tests/imptcp_large.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imptcp_large.sh 2012-09-10 16:28:20.000000000 +0000 @@ -4,6 +4,7 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imptcp_large.sh\]: test imptcp with large-size messages +cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imptcp_large.conf # send 4000 messages of 10.000bytes plus header max, randomized diff -Nru rsyslog-7.6.0/tests/imtcp_addtlframedelim.sh rsyslog-5.10.1/tests/imtcp_addtlframedelim.sh --- rsyslog-7.6.0/tests/imtcp_addtlframedelim.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imtcp_addtlframedelim.sh 2012-09-10 16:28:20.000000000 +0000 @@ -3,6 +3,7 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imtcp_addtlframedelim.sh\]: test imtcp additional frame delimiter +cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imtcp_addtlframedelim.conf source $srcdir/diag.sh tcpflood -m20000 -F0 -P129 diff -Nru rsyslog-7.6.0/tests/imtcp_conndrop.sh rsyslog-5.10.1/tests/imtcp_conndrop.sh --- rsyslog-7.6.0/tests/imtcp_conndrop.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imtcp_conndrop.sh 2012-10-17 14:41:20.000000000 +0000 @@ -4,6 +4,7 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imtcp_conndrop.sh\]: test imtcp with random connection drops +cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imtcp_conndrop.conf # 100 byte messages to gain more practical data use diff -Nru rsyslog-7.6.0/tests/imtcp_conndrop_tls.sh rsyslog-5.10.1/tests/imtcp_conndrop_tls.sh --- rsyslog-7.6.0/tests/imtcp_conndrop_tls.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imtcp_conndrop_tls.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -# Test imtcp/TLS with many dropping connections -# added 2011-06-09 by Rgerhards -# -# This file is part of the rsyslog project, released under GPLv3 -echo ==================================================================================== -echo TEST: \[imtcp_conndrop_tls.sh\]: test imtcp/tls with random connection drops -cat rsyslog.action.1.include -source $srcdir/diag.sh init -source $srcdir/diag.sh startup imtcp_conndrop.conf -# 100 byte messages to gain more practical data use -source $srcdir/diag.sh tcpflood -c20 -m50000 -r -d100 -P129 -D -sleep 10 # due to large messages, we need this time for the tcp receiver to settle... -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown # and wait for it to terminate -source $srcdir/diag.sh seq-check 0 49999 -E -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/imtcp_conndrop_tls-vg.sh rsyslog-5.10.1/tests/imtcp_conndrop_tls-vg.sh --- rsyslog-7.6.0/tests/imtcp_conndrop_tls-vg.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imtcp_conndrop_tls-vg.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# Test imtcp/TLS with many dropping connections -# added 2011-06-09 by Rgerhards -# -# This file is part of the rsyslog project, released under GPLv3 -echo ==================================================================================== -echo TEST: \[imtcp_conndrop_tls-vg.sh\]: test imtcp/tls with random connection drops -cat rsyslog.action.1.include -source $srcdir/diag.sh init -source $srcdir/diag.sh startup-vg imtcp_conndrop.conf -# 100 byte messages to gain more practical data use -source $srcdir/diag.sh tcpflood -c20 -m50000 -r -d100 -P129 -D -sleep 10 # due to large messages, we need this time for the tcp receiver to settle... -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown-vg # and wait for it to terminate -source $srcdir/diag.sh check-exit-vg -source $srcdir/diag.sh seq-check 0 49999 -E -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/imtcp-tls-basic.sh rsyslog-5.10.1/tests/imtcp-tls-basic.sh --- rsyslog-7.6.0/tests/imtcp-tls-basic.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imtcp-tls-basic.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# added 2011-02-28 by Rgerhards -# This file is part of the rsyslog project, released under GPLv3 -echo =============================================================================== -echo \[imtcp-tls-basic.sh\]: testing imtcp in TLS mode - basic test -source $srcdir/diag.sh init -echo \$DefaultNetstreamDriverCAFile $srcdir/tls-certs/ca.pem >rsyslog.conf.tlscert -echo \$DefaultNetstreamDriverCertFile $srcdir/tls-certs/cert.pem >>rsyslog.conf.tlscert -echo \$DefaultNetstreamDriverKeyFile $srcdir/tls-certs/key.pem >>rsyslog.conf.tlscert -source $srcdir/diag.sh startup imtcp-tls-basic.conf -source $srcdir/diag.sh tcpflood -p13514 -m50000 -Ttls -Z$srcdir/tls-certs/cert.pem -z$srcdir/tls-certs/key.pem -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 49999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/imtcp-tls-basic-vg.sh rsyslog-5.10.1/tests/imtcp-tls-basic-vg.sh --- rsyslog-7.6.0/tests/imtcp-tls-basic-vg.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imtcp-tls-basic-vg.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -# added 2011-02-28 by Rgerhards -# This file is part of the rsyslog project, released under GPLv3 -echo =============================================================================== -echo \[imtcp-tls-basic-vg.sh\]: testing imtcp in TLS mode - basic test -source $srcdir/diag.sh init -echo \$DefaultNetstreamDriverCAFile $srcdir/tls-certs/ca.pem >rsyslog.conf.tlscert -echo \$DefaultNetstreamDriverCertFile $srcdir/tls-certs/cert.pem >>rsyslog.conf.tlscert -echo \$DefaultNetstreamDriverKeyFile $srcdir/tls-certs/key.pem >>rsyslog.conf.tlscert -source $srcdir/diag.sh startup-vg imtcp-tls-basic.conf -source $srcdir/diag.sh tcpflood -p13514 -m50000 -Ttls -Z$srcdir/tls-certs/cert.pem -z$srcdir/tls-certs/key.pem -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown-vg -source $srcdir/diag.sh check-exit-vg -source $srcdir/diag.sh seq-check 0 49999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/imuxsock_ccmiddle_root.sh rsyslog-5.10.1/tests/imuxsock_ccmiddle_root.sh --- rsyslog-7.6.0/tests/imuxsock_ccmiddle_root.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imuxsock_ccmiddle_root.sh 2012-10-17 14:41:20.000000000 +0000 @@ -2,9 +2,6 @@ # carry out this test echo \[imuxsock_ccmiddle_root.sh\]: test trailing LF handling in imuxsock echo This test must be run as root with no other active syslogd -if [ "$EUID" -ne 0 ]; then - exit 77 # Not root, skip this test -fi source $srcdir/diag.sh init source $srcdir/diag.sh startup imuxsock_ccmiddle_root.conf # send a message with trailing LF diff -Nru rsyslog-7.6.0/tests/imuxsock_logger_root.sh rsyslog-5.10.1/tests/imuxsock_logger_root.sh --- rsyslog-7.6.0/tests/imuxsock_logger_root.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imuxsock_logger_root.sh 2012-10-17 14:41:20.000000000 +0000 @@ -2,9 +2,6 @@ # carry out this test. echo \[imuxsock_logger_root.sh\]: test trailing LF handling in imuxsock echo This test must be run as root with no other active syslogd -if [ "$EUID" -ne 0 ]; then - exit 77 # Not root, skip this test -fi source $srcdir/diag.sh init source $srcdir/diag.sh startup imuxsock_logger_root.conf # send a message with trailing LF diff -Nru rsyslog-7.6.0/tests/imuxsock_traillf_root.sh rsyslog-5.10.1/tests/imuxsock_traillf_root.sh --- rsyslog-7.6.0/tests/imuxsock_traillf_root.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/imuxsock_traillf_root.sh 2012-10-17 14:41:20.000000000 +0000 @@ -2,9 +2,6 @@ # carry out this test echo \[imuxsock_traillf_root.sh\]: test trailing LF handling in imuxsock echo This test must be run as root with no other active syslogd -if [ "$EUID" -ne 0 ]; then - exit 77 # Not root, skip this test -fi source $srcdir/diag.sh init source $srcdir/diag.sh startup imuxsock_traillf_root.conf # send a message with trailing LF diff -Nru rsyslog-7.6.0/tests/incltest_dir_empty_wildcard.sh rsyslog-5.10.1/tests/incltest_dir_empty_wildcard.sh --- rsyslog-7.6.0/tests/incltest_dir_empty_wildcard.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/incltest_dir_empty_wildcard.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# This test checks if an empty includeConfig directory causes problems. It -# should not, as this is a valid situation that by default exists on many -# distros. -echo =============================================================================== -echo \[incltest_dir_empty_wildcard.sh\]: test $IncludeConfig for \"empty\" wildcard -source $srcdir/diag.sh init -source $srcdir/diag.sh startup incltest_dir_empty_wildcard.conf -# 100 messages are enough - the question is if the include is read ;) -source $srcdir/diag.sh injectmsg 0 100 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/incltest_dir.sh rsyslog-5.10.1/tests/incltest_dir.sh --- rsyslog-7.6.0/tests/incltest_dir.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/incltest_dir.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -echo =============================================================================== -echo \[incltest_dir.sh\]: test $IncludeConfig for directories - -source $srcdir/diag.sh init -source $srcdir/diag.sh startup incltest_dir.conf -# 100 messages are enough - the question is if the include is read ;) -source $srcdir/diag.sh injectmsg 0 100 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/incltest_dir_wildcard.sh rsyslog-5.10.1/tests/incltest_dir_wildcard.sh --- rsyslog-7.6.0/tests/incltest_dir_wildcard.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/incltest_dir_wildcard.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -echo =============================================================================== -echo \[incltest_dir_wildcard.sh\]: test $IncludeConfig for directories with wildcards - -source $srcdir/diag.sh init -source $srcdir/diag.sh startup incltest_dir_wildcard.conf -# 100 messages are enough - the question is if the include is read ;) -source $srcdir/diag.sh injectmsg 0 100 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/incltest.sh rsyslog-5.10.1/tests/incltest.sh --- rsyslog-7.6.0/tests/incltest.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/incltest.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -echo =============================================================================== -echo \[incltest.sh\]: test $IncludeConfig for specific file - -source $srcdir/diag.sh init -source $srcdir/diag.sh startup incltest.conf -# 100 messages are enough - the question is if the include is read ;) -source $srcdir/diag.sh injectmsg 0 100 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/Makefile.am rsyslog-5.10.1/tests/Makefile.am --- rsyslog-7.6.0/tests/Makefile.am 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -1,14 +1,10 @@ if ENABLE_TESTBENCH -# TODO: reenable TESTRUNS = rt_init rscript -check_PROGRAMS = $(TESTRUNS) ourtail nettester tcpflood chkseq msleep randomgen diagtalker uxsockrcvr syslog_caller syslog_inject inputfilegen minitcpsrv -TESTS = $(TESTRUNS) -#TESTS = $(TESTRUNS) cfg.sh +TESTRUNS = rt_init rscript +check_PROGRAMS = $(TESTRUNS) ourtail nettester tcpflood chkseq msleep randomgen diagtalker uxsockrcvr syslog_caller syslog_inject inputfilegen +TESTS = $(TESTRUNS) cfg.sh if ENABLE_IMDIAG TESTS += \ - stop-localvar.sh \ - stop-msgvar.sh \ - rfc5424parser.sh \ arrayqueue.sh \ da-mainmsg-q.sh \ validation-run.sh \ @@ -54,9 +50,6 @@ imuxsock_logger_root.sh \ imuxsock_traillf_root.sh \ imuxsock_ccmiddle_root.sh \ - udp-msgreduc-vg.sh \ - udp-msgreduc-orgmsg-vg.sh \ - queue-persist.sh \ discard-rptdmsg.sh \ discard-allmark.sh \ discard.sh \ @@ -67,21 +60,8 @@ failover-no-rptd.sh \ failover-no-basic.sh \ rcvr_fail_restore.sh \ - rscript_contains.sh \ - rscript_field.sh \ - rscript_stop.sh \ - rscript_stop2.sh \ - rscript_prifilt.sh \ - rscript_optimizer1.sh \ - rscript_ruleset_call.sh \ - rs_optimizer_pri.sh \ - cee_simple.sh \ - cee_diskqueue.sh \ - incltest.sh \ - incltest_dir.sh \ - incltest_dir_wildcard.sh \ - incltest_dir_empty_wildcard.sh \ linkedlistqueue.sh +endif if HAVE_VALGRIND TESTS += \ @@ -92,14 +72,12 @@ failover-no-basic-vg.sh \ failover-no-rptd-vg.sh \ tcp-msgreduc-vg.sh -endif # HAVE_VALGRIND -endif # ENABLE_IMDIAG +endif if ENABLE_MYSQL_TESTS TESTS += \ mysql-basic.sh \ - mysql-basic-cnf6.sh \ mysql-asyn.sh if ENABLE_OMLIBDBI TESTS += \ @@ -121,21 +99,10 @@ imptcp_conndrop.sh endif -if ENABLE_MMPSTRUCDATA -TESTS += \ - mmpstrucdata.sh -endif - if ENABLE_GNUTLS -# TODO: re-enable in newer version -#TESTS += \ - #sndrcv_tls_anon.sh \ - #sndrcv_tls_anon_rebind.sh \ - #imtcp-tls-basic.sh if HAVE_VALGRIND -TESTS += imtcp-tls-basic-vg.sh \ - imtcp_conndrop_tls-vg.sh - manytcp-too-few-tls-vg.sh +# This test does not work on v5 as we keep DH params +#TESTS += manytcp-too-few-tls.sh endif endif @@ -190,16 +157,6 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ validation-run.sh \ - tls-certs/ca-key.pem \ - tls-certs/ca.pem \ - tls-certs/cert.pem \ - tls-certs/key.pem \ - testsuites/x.509/ca.pem \ - testsuites/x.509/ca-key.pem \ - testsuites/x.509/client-cert.pem \ - testsuites/x.509/client-key.pem \ - testsuites/x.509/machine-cert.pem \ - testsuites/x.509/machine-key.pem \ testsuites/invalid.conf \ testsuites/valid.conf \ cfg.sh \ @@ -290,70 +247,14 @@ testsuites/diskqueue.conf \ arrayqueue.sh \ testsuites/arrayqueue.conf \ - rscript_contains.sh \ - testsuites/rscript_contains.conf \ - rscript_field.sh \ - testsuites/rscript_field.conf \ - rscript_stop.sh \ - testsuites/rscript_stop.conf \ - rscript_stop2.sh \ - testsuites/rscript_stop2.conf \ - rscript_le.sh \ - testsuites/rscript_le.conf \ - rscript_ge.sh \ - testsuites/rscript_ge.conf \ - rscript_lt.sh \ - testsuites/rscript_lt.conf \ - rscript_gt.sh \ - testsuites/rscript_gt.conf \ - rscript_ne.sh \ - testsuites/rscript_ne.conf \ - rscript_eq.sh \ - testsuites/rscript_eq.conf \ - stop-localvar.sh \ - testsuites/stop-localvar.conf \ - stop-msgvar.sh \ - testsuites/stop-msgvar.conf \ - rfc5424parser.sh \ - testsuites/rfc5424parser.conf \ - rs_optimizer_pri.sh \ - testsuites/rs_optimizer_pri.conf \ - rscript_prifilt.sh \ - testsuites/rscript_prifilt.conf \ - rscript_optimizer1.sh \ - testsuites/rscript_optimizer1.conf \ - rscript_ruleset_call.sh \ - testsuites/rscript_ruleset_call.conf \ - cee_simple.sh \ - testsuites/cee_simple.conf \ - cee_diskqueue.sh \ - testsuites/cee_diskqueue.conf \ - incltest.sh \ - testsuites/incltest.conf \ - incltest_dir.sh \ - testsuites/incltest_dir.conf \ - incltest_dir_empty_wildcard.sh \ - testsuites/incltest_dir_empty_wildcard.conf \ - incltest_dir_wildcard.sh \ - testsuites/incltest_dir_wildcard.conf \ - testsuites/incltest.d/include.conf \ linkedlistqueue.sh \ testsuites/linkedlistqueue.conf \ da-mainmsg-q.sh \ testsuites/da-mainmsg-q.conf \ diskqueue-fsync.sh \ testsuites/diskqueue-fsync.conf \ - imtcp-tls-basic.sh \ - imtcp-tls-basic-vg.sh \ - testsuites/imtcp-tls-basic.conf \ imtcp-multiport.sh \ testsuites/imtcp-multiport.conf \ - udp-msgreduc-orgmsg-vg.sh \ - testsuites/udp-msgreduc-orgmsg-vg.conf \ - udp-msgreduc-vg.sh \ - testsuites/udp-msgreduc-vg.conf \ - manytcp-too-few-tls.sh \ - testsuites/manytcp-too-few-tls.conf \ manytcp.sh \ testsuites/manytcp.conf \ manyptcp.sh \ @@ -366,9 +267,6 @@ testsuites/imptcp_conndrop.conf \ imtcp_conndrop.sh \ testsuites/imtcp_conndrop.conf \ - imtcp_conndrop_tls.sh \ - imtcp_conndrop_tls-vg.sh \ - testsuites/imtcp_conndrop.conf \ imtcp_addtlframedelim.sh \ testsuites/imtcp_addtlframedelim.conf \ tcp-msgreduc-vg.sh \ @@ -533,26 +431,13 @@ libdbi-asyn.sh \ testsuites/libdbi-asyn.conf \ mysql-basic.sh \ - mysql-basic-cnf6.sh \ mysql-basic-vg.sh \ testsuites/mysql-basic.conf \ - testsuites/mysql-basic-cnf6.conf \ mysql-asyn.sh \ mysql-asyn-vg.sh \ testsuites/mysql-asyn.conf \ - mmpstrucdata.sh \ - testsuites/mmpstrucdata.conf \ cfg.sh -# TODO: re-enable -#sndrcv_tls_anon_rebind.sh \ -#testsuites/sndrcv_tls_anon_rebind_sender.conf \ -#testsuites/sndrcv_tls_anon_rebind_rcvr.conf \ -#sndrcv_tls_anon.sh \ -#testsuites/sndrcv_tls_anon_sender.conf \ -#testsuites/sndrcv_tls_anon_rcvr.conf \ -# - ourtail_SOURCES = ourtail.c msleep_SOURCES = msleep.c chkseq_SOURCES = chkseq.c @@ -561,14 +446,8 @@ uxsockrcvr_LDADD = $(SOL_LIBS) tcpflood_SOURCES = tcpflood.c -tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) $(GNUTLS_CFLAGS) -tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) $(GNUTLS_LIBS) -if ENABLE_GNUTLS -tcpflood_LDADD += -lgcrypt -endif - -minitcpsrv_SOURCES = minitcpsrvr.c -minitcpsrv_LDADD = $(SOL_LIBS) +tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) +tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) syslog_caller_SOURCES = syslog_caller.c syslog_caller_LDADD = $(SOL_LIBS) @@ -588,15 +467,12 @@ nettester_SOURCES = nettester.c getline.c nettester_LDADD = $(SOL_LIBS) -# rtinit tests disabled for the moment - also questionable if they -# really provide value (after all, everything fails if rtinit fails...) -#rt_init_SOURCES = rt-init.c $(test_files) -#rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -#rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) -#rt_init_LDFLAGS = -export-dynamic - -# same for basic rscript tests -#rscript_SOURCES = rscript.c getline.c $(test_files) -#rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -#rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) -#rscript_LDFLAGS = -export-dynamic +rt_init_SOURCES = rt-init.c $(test_files) +rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) +rt_init_LDFLAGS = -export-dynamic + +rscript_SOURCES = rscript.c getline.c $(test_files) +rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) +rscript_LDFLAGS = -export-dynamic diff -Nru rsyslog-7.6.0/tests/Makefile.in rsyslog-5.10.1/tests/Makefile.in --- rsyslog-7.6.0/tests/Makefile.in 2014-02-12 12:06:38.000000000 +0000 +++ rsyslog-5.10.1/tests/Makefile.in 2012-10-17 14:42:46.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -33,27 +33,22 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@ENABLE_TESTBENCH_TRUE@check_PROGRAMS = ourtail$(EXEEXT) \ -@ENABLE_TESTBENCH_TRUE@ nettester$(EXEEXT) tcpflood$(EXEEXT) \ -@ENABLE_TESTBENCH_TRUE@ chkseq$(EXEEXT) msleep$(EXEEXT) \ -@ENABLE_TESTBENCH_TRUE@ randomgen$(EXEEXT) diagtalker$(EXEEXT) \ -@ENABLE_TESTBENCH_TRUE@ uxsockrcvr$(EXEEXT) \ +@ENABLE_TESTBENCH_TRUE@check_PROGRAMS = $(am__EXEEXT_1) \ +@ENABLE_TESTBENCH_TRUE@ ourtail$(EXEEXT) nettester$(EXEEXT) \ +@ENABLE_TESTBENCH_TRUE@ tcpflood$(EXEEXT) chkseq$(EXEEXT) \ +@ENABLE_TESTBENCH_TRUE@ msleep$(EXEEXT) randomgen$(EXEEXT) \ +@ENABLE_TESTBENCH_TRUE@ diagtalker$(EXEEXT) uxsockrcvr$(EXEEXT) \ @ENABLE_TESTBENCH_TRUE@ syslog_caller$(EXEEXT) \ @ENABLE_TESTBENCH_TRUE@ syslog_inject$(EXEEXT) \ -@ENABLE_TESTBENCH_TRUE@ inputfilegen$(EXEEXT) \ -@ENABLE_TESTBENCH_TRUE@ minitcpsrv$(EXEEXT) -@ENABLE_TESTBENCH_TRUE@TESTS = $(am__append_1) $(am__append_2) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_3) $(am__append_4) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_5) $(am__append_6) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_7) $(am__append_8) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_9) $(am__append_10) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_11) $(am__append_12) \ -@ENABLE_TESTBENCH_TRUE@ $(am__append_13) $(am__append_14) -#TESTS = $(TESTRUNS) cfg.sh +@ENABLE_TESTBENCH_TRUE@ inputfilegen$(EXEEXT) +@ENABLE_TESTBENCH_TRUE@TESTS = $(am__EXEEXT_1) cfg.sh $(am__append_1) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_2) $(am__append_3) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_4) $(am__append_5) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_6) $(am__append_7) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_8) $(am__append_9) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_10) $(am__append_11) \ +@ENABLE_TESTBENCH_TRUE@ $(am__append_12) @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_1 = \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ stop-localvar.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ stop-msgvar.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rfc5424parser.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ arrayqueue.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ da-mainmsg-q.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ validation-run.sh \ @@ -99,9 +94,6 @@ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imuxsock_logger_root.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imuxsock_traillf_root.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ imuxsock_ccmiddle_root.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ udp-msgreduc-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ udp-msgreduc-orgmsg-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ queue-persist.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ discard-rptdmsg.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ discard-allmark.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ discard.sh \ @@ -112,34 +104,19 @@ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ failover-no-rptd.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ failover-no-basic.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rcvr_fail_restore.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_contains.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_field.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_stop.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_stop2.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_prifilt.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_optimizer1.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rscript_ruleset_call.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ rs_optimizer_pri.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ cee_simple.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ cee_diskqueue.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ incltest.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ incltest_dir.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ incltest_dir_wildcard.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ incltest_dir_empty_wildcard.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@ linkedlistqueue.sh -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_2 = \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ discard-rptdmsg-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ discard-allmark-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-basic-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-rptd-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-no-basic-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-no-rptd-vg.sh \ -@ENABLE_IMDIAG_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ tcp-msgreduc-vg.sh +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_2 = \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ discard-rptdmsg-vg.sh \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ discard-allmark-vg.sh \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-basic-vg.sh \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-rptd-vg.sh \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-no-basic-vg.sh \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ failover-no-rptd-vg.sh \ +@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ tcp-msgreduc-vg.sh @ENABLE_MYSQL_TESTS_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_3 = \ @ENABLE_MYSQL_TESTS_TRUE@@ENABLE_TESTBENCH_TRUE@ mysql-basic.sh \ -@ENABLE_MYSQL_TESTS_TRUE@@ENABLE_TESTBENCH_TRUE@ mysql-basic-cnf6.sh \ @ENABLE_MYSQL_TESTS_TRUE@@ENABLE_TESTBENCH_TRUE@ mysql-asyn.sh @ENABLE_MYSQL_TESTS_TRUE@@ENABLE_OMLIBDBI_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_4 = \ @@ -156,23 +133,14 @@ @ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_addtlframedelim.sh \ @ENABLE_IMPTCP_TRUE@@ENABLE_TESTBENCH_TRUE@ imptcp_conndrop.sh -@ENABLE_MMPSTRUCDATA_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_7 = \ -@ENABLE_MMPSTRUCDATA_TRUE@@ENABLE_TESTBENCH_TRUE@ mmpstrucdata.sh - -# TODO: re-enable in newer version -#TESTS += \ -# #sndrcv_tls_anon.sh \ -# #sndrcv_tls_anon_rebind.sh \ -# #imtcp-tls-basic.sh -@ENABLE_GNUTLS_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_8 = imtcp-tls-basic-vg.sh \ -@ENABLE_GNUTLS_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ imtcp_conndrop_tls-vg.sh - -@ENABLE_OMUXSOCK_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_9 = uxsock_simple.sh -@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_10 = sndrcv_omudpspoof.sh \ +# This test does not work on v5 as we keep DH params +#TESTS += manytcp-too-few-tls.sh +@ENABLE_OMUXSOCK_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_7 = uxsock_simple.sh +@ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_8 = sndrcv_omudpspoof.sh \ @ENABLE_OMUDPSPOOF_TRUE@@ENABLE_TESTBENCH_TRUE@ sndrcv_omudpspoof_nonstdpt.sh -@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_11 = omod-if-array.sh \ +@ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_9 = omod-if-array.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ proprepltest.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ parsertest.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ timestamp.sh \ @@ -184,16 +152,15 @@ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ tabescape_off.sh \ @ENABLE_OMSTDOUT_TRUE@@ENABLE_TESTBENCH_TRUE@ fieldtest.sh -@ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_12 = omruleset.sh \ +@ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_10 = omruleset.sh \ @ENABLE_IMDIAG_TRUE@@ENABLE_OMRULESET_TRUE@@ENABLE_TESTBENCH_TRUE@ omruleset-queue.sh # random.sh is temporarily disabled as it needs some work # to rsyslog core to complete in reasonable time #TESTS += random.sh -@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_13 = imfile-basic.sh -@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_14 = imfile-basic-vg.sh -@ENABLE_GNUTLS_TRUE@am__append_15 = -lgcrypt +@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@am__append_11 = imfile-basic.sh +@ENABLE_IMFILE_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@am__append_12 = imfile-basic-vg.sh subdir = tests DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -208,11 +175,13 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +@ENABLE_TESTBENCH_TRUE@am__EXEEXT_1 = rt_init$(EXEEXT) \ +@ENABLE_TESTBENCH_TRUE@ rscript$(EXEEXT) am_chkseq_OBJECTS = chkseq.$(OBJEXT) chkseq_OBJECTS = $(am_chkseq_OBJECTS) chkseq_LDADD = $(LDADD) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent am_diagtalker_OBJECTS = diagtalker.$(OBJEXT) diagtalker_OBJECTS = $(am_diagtalker_OBJECTS) @@ -221,9 +190,6 @@ am_inputfilegen_OBJECTS = inputfilegen.$(OBJEXT) inputfilegen_OBJECTS = $(am_inputfilegen_OBJECTS) inputfilegen_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_minitcpsrv_OBJECTS = minitcpsrvr.$(OBJEXT) -minitcpsrv_OBJECTS = $(am_minitcpsrv_OBJECTS) -minitcpsrv_DEPENDENCIES = $(am__DEPENDENCIES_1) am_msleep_OBJECTS = msleep.$(OBJEXT) msleep_OBJECTS = $(am_msleep_OBJECTS) msleep_LDADD = $(LDADD) @@ -236,6 +202,23 @@ am_randomgen_OBJECTS = randomgen.$(OBJEXT) randomgen_OBJECTS = $(am_randomgen_OBJECTS) randomgen_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__objects_1 = rscript-runtime-dummy.$(OBJEXT) +am_rscript_OBJECTS = rscript-rscript.$(OBJEXT) \ + rscript-getline.$(OBJEXT) $(am__objects_1) +rscript_OBJECTS = $(am_rscript_OBJECTS) +rscript_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +rscript_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(rscript_LDFLAGS) $(LDFLAGS) -o $@ +am__objects_2 = rt_init-runtime-dummy.$(OBJEXT) +am_rt_init_OBJECTS = rt_init-rt-init.$(OBJEXT) $(am__objects_2) +rt_init_OBJECTS = $(am_rt_init_OBJECTS) +rt_init_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +rt_init_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(rt_init_LDFLAGS) $(LDFLAGS) -o $@ am_syslog_caller_OBJECTS = syslog_caller.$(OBJEXT) syslog_caller_OBJECTS = $(am_syslog_caller_OBJECTS) syslog_caller_DEPENDENCIES = $(am__DEPENDENCIES_1) @@ -244,8 +227,7 @@ syslog_inject_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tcpflood_OBJECTS = tcpflood-tcpflood.$(OBJEXT) tcpflood_OBJECTS = $(am_tcpflood_OBJECTS) -tcpflood_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +tcpflood_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_uxsockrcvr_OBJECTS = uxsockrcvr.$(OBJEXT) uxsockrcvr_OBJECTS = $(am_uxsockrcvr_OBJECTS) uxsockrcvr_DEPENDENCIES = $(am__DEPENDENCIES_1) @@ -259,32 +241,32 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(chkseq_SOURCES) $(diagtalker_SOURCES) \ - $(inputfilegen_SOURCES) $(minitcpsrv_SOURCES) \ - $(msleep_SOURCES) $(nettester_SOURCES) $(ourtail_SOURCES) \ - $(randomgen_SOURCES) $(syslog_caller_SOURCES) \ + $(inputfilegen_SOURCES) $(msleep_SOURCES) $(nettester_SOURCES) \ + $(ourtail_SOURCES) $(randomgen_SOURCES) $(rscript_SOURCES) \ + $(rt_init_SOURCES) $(syslog_caller_SOURCES) \ $(syslog_inject_SOURCES) $(tcpflood_SOURCES) \ $(uxsockrcvr_SOURCES) DIST_SOURCES = $(chkseq_SOURCES) $(diagtalker_SOURCES) \ - $(inputfilegen_SOURCES) $(minitcpsrv_SOURCES) \ - $(msleep_SOURCES) $(nettester_SOURCES) $(ourtail_SOURCES) \ - $(randomgen_SOURCES) $(syslog_caller_SOURCES) \ + $(inputfilegen_SOURCES) $(msleep_SOURCES) $(nettester_SOURCES) \ + $(ourtail_SOURCES) $(randomgen_SOURCES) $(rscript_SOURCES) \ + $(rt_init_SOURCES) $(syslog_caller_SOURCES) \ $(syslog_inject_SOURCES) $(tcpflood_SOURCES) \ $(uxsockrcvr_SOURCES) ETAGS = etags @@ -308,11 +290,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -326,56 +305,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -383,8 +336,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -404,16 +355,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -425,14 +371,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -466,6 +409,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -483,21 +427,12 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +@ENABLE_TESTBENCH_TRUE@TESTRUNS = rt_init rscript TESTS_ENVIRONMENT = RSYSLOG_MODDIR='$(abs_top_builddir)'/runtime/.libs/ DISTCLEANFILES = rsyslog.pid test_files = testbench.h runtime-dummy.c EXTRA_DIST = 1.rstest 2.rstest 3.rstest err1.rstest \ validation-run.sh \ - tls-certs/ca-key.pem \ - tls-certs/ca.pem \ - tls-certs/cert.pem \ - tls-certs/key.pem \ - testsuites/x.509/ca.pem \ - testsuites/x.509/ca-key.pem \ - testsuites/x.509/client-cert.pem \ - testsuites/x.509/client-key.pem \ - testsuites/x.509/machine-cert.pem \ - testsuites/x.509/machine-key.pem \ testsuites/invalid.conf \ testsuites/valid.conf \ cfg.sh \ @@ -588,70 +523,14 @@ testsuites/diskqueue.conf \ arrayqueue.sh \ testsuites/arrayqueue.conf \ - rscript_contains.sh \ - testsuites/rscript_contains.conf \ - rscript_field.sh \ - testsuites/rscript_field.conf \ - rscript_stop.sh \ - testsuites/rscript_stop.conf \ - rscript_stop2.sh \ - testsuites/rscript_stop2.conf \ - rscript_le.sh \ - testsuites/rscript_le.conf \ - rscript_ge.sh \ - testsuites/rscript_ge.conf \ - rscript_lt.sh \ - testsuites/rscript_lt.conf \ - rscript_gt.sh \ - testsuites/rscript_gt.conf \ - rscript_ne.sh \ - testsuites/rscript_ne.conf \ - rscript_eq.sh \ - testsuites/rscript_eq.conf \ - stop-localvar.sh \ - testsuites/stop-localvar.conf \ - stop-msgvar.sh \ - testsuites/stop-msgvar.conf \ - rfc5424parser.sh \ - testsuites/rfc5424parser.conf \ - rs_optimizer_pri.sh \ - testsuites/rs_optimizer_pri.conf \ - rscript_prifilt.sh \ - testsuites/rscript_prifilt.conf \ - rscript_optimizer1.sh \ - testsuites/rscript_optimizer1.conf \ - rscript_ruleset_call.sh \ - testsuites/rscript_ruleset_call.conf \ - cee_simple.sh \ - testsuites/cee_simple.conf \ - cee_diskqueue.sh \ - testsuites/cee_diskqueue.conf \ - incltest.sh \ - testsuites/incltest.conf \ - incltest_dir.sh \ - testsuites/incltest_dir.conf \ - incltest_dir_empty_wildcard.sh \ - testsuites/incltest_dir_empty_wildcard.conf \ - incltest_dir_wildcard.sh \ - testsuites/incltest_dir_wildcard.conf \ - testsuites/incltest.d/include.conf \ linkedlistqueue.sh \ testsuites/linkedlistqueue.conf \ da-mainmsg-q.sh \ testsuites/da-mainmsg-q.conf \ diskqueue-fsync.sh \ testsuites/diskqueue-fsync.conf \ - imtcp-tls-basic.sh \ - imtcp-tls-basic-vg.sh \ - testsuites/imtcp-tls-basic.conf \ imtcp-multiport.sh \ testsuites/imtcp-multiport.conf \ - udp-msgreduc-orgmsg-vg.sh \ - testsuites/udp-msgreduc-orgmsg-vg.conf \ - udp-msgreduc-vg.sh \ - testsuites/udp-msgreduc-vg.conf \ - manytcp-too-few-tls.sh \ - testsuites/manytcp-too-few-tls.conf \ manytcp.sh \ testsuites/manytcp.conf \ manyptcp.sh \ @@ -664,9 +543,6 @@ testsuites/imptcp_conndrop.conf \ imtcp_conndrop.sh \ testsuites/imtcp_conndrop.conf \ - imtcp_conndrop_tls.sh \ - imtcp_conndrop_tls-vg.sh \ - testsuites/imtcp_conndrop.conf \ imtcp_addtlframedelim.sh \ testsuites/imtcp_addtlframedelim.conf \ tcp-msgreduc-vg.sh \ @@ -831,37 +707,21 @@ libdbi-asyn.sh \ testsuites/libdbi-asyn.conf \ mysql-basic.sh \ - mysql-basic-cnf6.sh \ mysql-basic-vg.sh \ testsuites/mysql-basic.conf \ - testsuites/mysql-basic-cnf6.conf \ mysql-asyn.sh \ mysql-asyn-vg.sh \ testsuites/mysql-asyn.conf \ - mmpstrucdata.sh \ - testsuites/mmpstrucdata.conf \ cfg.sh - -# TODO: re-enable -#sndrcv_tls_anon_rebind.sh \ -#testsuites/sndrcv_tls_anon_rebind_sender.conf \ -#testsuites/sndrcv_tls_anon_rebind_rcvr.conf \ -#sndrcv_tls_anon.sh \ -#testsuites/sndrcv_tls_anon_sender.conf \ -#testsuites/sndrcv_tls_anon_rcvr.conf \ -# ourtail_SOURCES = ourtail.c msleep_SOURCES = msleep.c chkseq_SOURCES = chkseq.c uxsockrcvr_SOURCES = uxsockrcvr.c uxsockrcvr_LDADD = $(SOL_LIBS) tcpflood_SOURCES = tcpflood.c -tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) $(GNUTLS_CFLAGS) -tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) $(GNUTLS_LIBS) \ - $(am__append_15) -minitcpsrv_SOURCES = minitcpsrvr.c -minitcpsrv_LDADD = $(SOL_LIBS) +tcpflood_CPPFLAGS = $(PTHREADS_CFLAGS) +tcpflood_LDADD = $(SOL_LIBS) $(PTHREADS_LIBS) syslog_caller_SOURCES = syslog_caller.c syslog_caller_LDADD = $(SOL_LIBS) syslog_inject_SOURCES = syslog_inject.c @@ -874,6 +734,14 @@ inputfilegen_LDADD = $(SOL_LIBS) nettester_SOURCES = nettester.c getline.c nettester_LDADD = $(SOL_LIBS) +rt_init_SOURCES = rt-init.c $(test_files) +rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) +rt_init_LDFLAGS = -export-dynamic +rscript_SOURCES = rscript.c getline.c $(test_files) +rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) +rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) +rscript_LDFLAGS = -export-dynamic all: all-am .SUFFIXES: @@ -917,40 +785,43 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -chkseq$(EXEEXT): $(chkseq_OBJECTS) $(chkseq_DEPENDENCIES) $(EXTRA_chkseq_DEPENDENCIES) +chkseq$(EXEEXT): $(chkseq_OBJECTS) $(chkseq_DEPENDENCIES) @rm -f chkseq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(chkseq_OBJECTS) $(chkseq_LDADD) $(LIBS) -diagtalker$(EXEEXT): $(diagtalker_OBJECTS) $(diagtalker_DEPENDENCIES) $(EXTRA_diagtalker_DEPENDENCIES) +diagtalker$(EXEEXT): $(diagtalker_OBJECTS) $(diagtalker_DEPENDENCIES) @rm -f diagtalker$(EXEEXT) $(AM_V_CCLD)$(LINK) $(diagtalker_OBJECTS) $(diagtalker_LDADD) $(LIBS) -inputfilegen$(EXEEXT): $(inputfilegen_OBJECTS) $(inputfilegen_DEPENDENCIES) $(EXTRA_inputfilegen_DEPENDENCIES) +inputfilegen$(EXEEXT): $(inputfilegen_OBJECTS) $(inputfilegen_DEPENDENCIES) @rm -f inputfilegen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inputfilegen_OBJECTS) $(inputfilegen_LDADD) $(LIBS) -minitcpsrv$(EXEEXT): $(minitcpsrv_OBJECTS) $(minitcpsrv_DEPENDENCIES) $(EXTRA_minitcpsrv_DEPENDENCIES) - @rm -f minitcpsrv$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(minitcpsrv_OBJECTS) $(minitcpsrv_LDADD) $(LIBS) -msleep$(EXEEXT): $(msleep_OBJECTS) $(msleep_DEPENDENCIES) $(EXTRA_msleep_DEPENDENCIES) +msleep$(EXEEXT): $(msleep_OBJECTS) $(msleep_DEPENDENCIES) @rm -f msleep$(EXEEXT) $(AM_V_CCLD)$(LINK) $(msleep_OBJECTS) $(msleep_LDADD) $(LIBS) -nettester$(EXEEXT): $(nettester_OBJECTS) $(nettester_DEPENDENCIES) $(EXTRA_nettester_DEPENDENCIES) +nettester$(EXEEXT): $(nettester_OBJECTS) $(nettester_DEPENDENCIES) @rm -f nettester$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nettester_OBJECTS) $(nettester_LDADD) $(LIBS) -ourtail$(EXEEXT): $(ourtail_OBJECTS) $(ourtail_DEPENDENCIES) $(EXTRA_ourtail_DEPENDENCIES) +ourtail$(EXEEXT): $(ourtail_OBJECTS) $(ourtail_DEPENDENCIES) @rm -f ourtail$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ourtail_OBJECTS) $(ourtail_LDADD) $(LIBS) -randomgen$(EXEEXT): $(randomgen_OBJECTS) $(randomgen_DEPENDENCIES) $(EXTRA_randomgen_DEPENDENCIES) +randomgen$(EXEEXT): $(randomgen_OBJECTS) $(randomgen_DEPENDENCIES) @rm -f randomgen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(randomgen_OBJECTS) $(randomgen_LDADD) $(LIBS) -syslog_caller$(EXEEXT): $(syslog_caller_OBJECTS) $(syslog_caller_DEPENDENCIES) $(EXTRA_syslog_caller_DEPENDENCIES) +rscript$(EXEEXT): $(rscript_OBJECTS) $(rscript_DEPENDENCIES) + @rm -f rscript$(EXEEXT) + $(AM_V_CCLD)$(rscript_LINK) $(rscript_OBJECTS) $(rscript_LDADD) $(LIBS) +rt_init$(EXEEXT): $(rt_init_OBJECTS) $(rt_init_DEPENDENCIES) + @rm -f rt_init$(EXEEXT) + $(AM_V_CCLD)$(rt_init_LINK) $(rt_init_OBJECTS) $(rt_init_LDADD) $(LIBS) +syslog_caller$(EXEEXT): $(syslog_caller_OBJECTS) $(syslog_caller_DEPENDENCIES) @rm -f syslog_caller$(EXEEXT) $(AM_V_CCLD)$(LINK) $(syslog_caller_OBJECTS) $(syslog_caller_LDADD) $(LIBS) -syslog_inject$(EXEEXT): $(syslog_inject_OBJECTS) $(syslog_inject_DEPENDENCIES) $(EXTRA_syslog_inject_DEPENDENCIES) +syslog_inject$(EXEEXT): $(syslog_inject_OBJECTS) $(syslog_inject_DEPENDENCIES) @rm -f syslog_inject$(EXEEXT) $(AM_V_CCLD)$(LINK) $(syslog_inject_OBJECTS) $(syslog_inject_LDADD) $(LIBS) -tcpflood$(EXEEXT): $(tcpflood_OBJECTS) $(tcpflood_DEPENDENCIES) $(EXTRA_tcpflood_DEPENDENCIES) +tcpflood$(EXEEXT): $(tcpflood_OBJECTS) $(tcpflood_DEPENDENCIES) @rm -f tcpflood$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tcpflood_OBJECTS) $(tcpflood_LDADD) $(LIBS) -uxsockrcvr$(EXEEXT): $(uxsockrcvr_OBJECTS) $(uxsockrcvr_DEPENDENCIES) $(EXTRA_uxsockrcvr_DEPENDENCIES) +uxsockrcvr$(EXEEXT): $(uxsockrcvr_OBJECTS) $(uxsockrcvr_DEPENDENCIES) @rm -f uxsockrcvr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(uxsockrcvr_OBJECTS) $(uxsockrcvr_LDADD) $(LIBS) @@ -964,11 +835,15 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diagtalker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputfilegen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minitcpsrvr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msleep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nettester.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ourtail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randomgen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rscript-getline.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rscript-rscript.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rscript-runtime-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_init-rt-init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_init-runtime-dummy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog_caller.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog_inject.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpflood-tcpflood.Po@am__quote@ @@ -977,37 +852,122 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +rscript-rscript.o: rscript.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscript-rscript.o -MD -MP -MF $(DEPDIR)/rscript-rscript.Tpo -c -o rscript-rscript.o `test -f 'rscript.c' || echo '$(srcdir)/'`rscript.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscript-rscript.Tpo $(DEPDIR)/rscript-rscript.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rscript.c' object='rscript-rscript.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscript-rscript.o `test -f 'rscript.c' || echo '$(srcdir)/'`rscript.c + +rscript-rscript.obj: rscript.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscript-rscript.obj -MD -MP -MF $(DEPDIR)/rscript-rscript.Tpo -c -o rscript-rscript.obj `if test -f 'rscript.c'; then $(CYGPATH_W) 'rscript.c'; else $(CYGPATH_W) '$(srcdir)/rscript.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscript-rscript.Tpo $(DEPDIR)/rscript-rscript.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rscript.c' object='rscript-rscript.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscript-rscript.obj `if test -f 'rscript.c'; then $(CYGPATH_W) 'rscript.c'; else $(CYGPATH_W) '$(srcdir)/rscript.c'; fi` + +rscript-getline.o: getline.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscript-getline.o -MD -MP -MF $(DEPDIR)/rscript-getline.Tpo -c -o rscript-getline.o `test -f 'getline.c' || echo '$(srcdir)/'`getline.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscript-getline.Tpo $(DEPDIR)/rscript-getline.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getline.c' object='rscript-getline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscript-getline.o `test -f 'getline.c' || echo '$(srcdir)/'`getline.c + +rscript-getline.obj: getline.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscript-getline.obj -MD -MP -MF $(DEPDIR)/rscript-getline.Tpo -c -o rscript-getline.obj `if test -f 'getline.c'; then $(CYGPATH_W) 'getline.c'; else $(CYGPATH_W) '$(srcdir)/getline.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscript-getline.Tpo $(DEPDIR)/rscript-getline.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getline.c' object='rscript-getline.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscript-getline.obj `if test -f 'getline.c'; then $(CYGPATH_W) 'getline.c'; else $(CYGPATH_W) '$(srcdir)/getline.c'; fi` + +rscript-runtime-dummy.o: runtime-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscript-runtime-dummy.o -MD -MP -MF $(DEPDIR)/rscript-runtime-dummy.Tpo -c -o rscript-runtime-dummy.o `test -f 'runtime-dummy.c' || echo '$(srcdir)/'`runtime-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscript-runtime-dummy.Tpo $(DEPDIR)/rscript-runtime-dummy.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime-dummy.c' object='rscript-runtime-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscript-runtime-dummy.o `test -f 'runtime-dummy.c' || echo '$(srcdir)/'`runtime-dummy.c + +rscript-runtime-dummy.obj: runtime-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscript-runtime-dummy.obj -MD -MP -MF $(DEPDIR)/rscript-runtime-dummy.Tpo -c -o rscript-runtime-dummy.obj `if test -f 'runtime-dummy.c'; then $(CYGPATH_W) 'runtime-dummy.c'; else $(CYGPATH_W) '$(srcdir)/runtime-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscript-runtime-dummy.Tpo $(DEPDIR)/rscript-runtime-dummy.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime-dummy.c' object='rscript-runtime-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscript_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscript-runtime-dummy.obj `if test -f 'runtime-dummy.c'; then $(CYGPATH_W) 'runtime-dummy.c'; else $(CYGPATH_W) '$(srcdir)/runtime-dummy.c'; fi` + +rt_init-rt-init.o: rt-init.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rt_init-rt-init.o -MD -MP -MF $(DEPDIR)/rt_init-rt-init.Tpo -c -o rt_init-rt-init.o `test -f 'rt-init.c' || echo '$(srcdir)/'`rt-init.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rt_init-rt-init.Tpo $(DEPDIR)/rt_init-rt-init.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rt-init.c' object='rt_init-rt-init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rt_init-rt-init.o `test -f 'rt-init.c' || echo '$(srcdir)/'`rt-init.c + +rt_init-rt-init.obj: rt-init.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rt_init-rt-init.obj -MD -MP -MF $(DEPDIR)/rt_init-rt-init.Tpo -c -o rt_init-rt-init.obj `if test -f 'rt-init.c'; then $(CYGPATH_W) 'rt-init.c'; else $(CYGPATH_W) '$(srcdir)/rt-init.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rt_init-rt-init.Tpo $(DEPDIR)/rt_init-rt-init.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='rt-init.c' object='rt_init-rt-init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rt_init-rt-init.obj `if test -f 'rt-init.c'; then $(CYGPATH_W) 'rt-init.c'; else $(CYGPATH_W) '$(srcdir)/rt-init.c'; fi` + +rt_init-runtime-dummy.o: runtime-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rt_init-runtime-dummy.o -MD -MP -MF $(DEPDIR)/rt_init-runtime-dummy.Tpo -c -o rt_init-runtime-dummy.o `test -f 'runtime-dummy.c' || echo '$(srcdir)/'`runtime-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rt_init-runtime-dummy.Tpo $(DEPDIR)/rt_init-runtime-dummy.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime-dummy.c' object='rt_init-runtime-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rt_init-runtime-dummy.o `test -f 'runtime-dummy.c' || echo '$(srcdir)/'`runtime-dummy.c + +rt_init-runtime-dummy.obj: runtime-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rt_init-runtime-dummy.obj -MD -MP -MF $(DEPDIR)/rt_init-runtime-dummy.Tpo -c -o rt_init-runtime-dummy.obj `if test -f 'runtime-dummy.c'; then $(CYGPATH_W) 'runtime-dummy.c'; else $(CYGPATH_W) '$(srcdir)/runtime-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rt_init-runtime-dummy.Tpo $(DEPDIR)/rt_init-runtime-dummy.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime-dummy.c' object='rt_init-runtime-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rt_init_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rt_init-runtime-dummy.obj `if test -f 'runtime-dummy.c'; then $(CYGPATH_W) 'runtime-dummy.c'; else $(CYGPATH_W) '$(srcdir)/runtime-dummy.c'; fi` tcpflood-tcpflood.o: tcpflood.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tcpflood_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcpflood-tcpflood.o -MD -MP -MF $(DEPDIR)/tcpflood-tcpflood.Tpo -c -o tcpflood-tcpflood.o `test -f 'tcpflood.c' || echo '$(srcdir)/'`tcpflood.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tcpflood-tcpflood.Tpo $(DEPDIR)/tcpflood-tcpflood.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcpflood.c' object='tcpflood-tcpflood.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tcpflood.c' object='tcpflood-tcpflood.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tcpflood_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcpflood-tcpflood.o `test -f 'tcpflood.c' || echo '$(srcdir)/'`tcpflood.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tcpflood_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcpflood-tcpflood.o `test -f 'tcpflood.c' || echo '$(srcdir)/'`tcpflood.c tcpflood-tcpflood.obj: tcpflood.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tcpflood_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcpflood-tcpflood.obj -MD -MP -MF $(DEPDIR)/tcpflood-tcpflood.Tpo -c -o tcpflood-tcpflood.obj `if test -f 'tcpflood.c'; then $(CYGPATH_W) 'tcpflood.c'; else $(CYGPATH_W) '$(srcdir)/tcpflood.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tcpflood-tcpflood.Tpo $(DEPDIR)/tcpflood-tcpflood.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tcpflood.c' object='tcpflood-tcpflood.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tcpflood.c' object='tcpflood-tcpflood.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tcpflood_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcpflood-tcpflood.obj `if test -f 'tcpflood.c'; then $(CYGPATH_W) 'tcpflood.c'; else $(CYGPATH_W) '$(srcdir)/tcpflood.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tcpflood_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcpflood-tcpflood.obj `if test -f 'tcpflood.c'; then $(CYGPATH_W) 'tcpflood.c'; else $(CYGPATH_W) '$(srcdir)/tcpflood.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -1148,15 +1108,14 @@ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - col="$$grn"; \ + echo "$$grn$$dashes"; \ else \ - col="$$red"; \ + echo "$$red$$dashes"; \ fi; \ - echo "$${col}$$dashes$${std}"; \ - echo "$${col}$$banner$${std}"; \ - test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ - test -z "$$report" || echo "$${col}$$report$${std}"; \ - echo "$${col}$$dashes$${std}"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi @@ -1206,15 +1165,10 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: @@ -1314,20 +1268,6 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am -@ENABLE_GNUTLS_TRUE@@ENABLE_TESTBENCH_TRUE@@HAVE_VALGRIND_TRUE@ manytcp-too-few-tls-vg.sh - -# rtinit tests disabled for the moment - also questionable if they -# really provide value (after all, everything fails if rtinit fails...) -#rt_init_SOURCES = rt-init.c $(test_files) -#rt_init_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -#rt_init_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) -#rt_init_LDFLAGS = -export-dynamic - -# same for basic rscript tests -#rscript_SOURCES = rscript.c getline.c $(test_files) -#rscript_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -#rscript_LDADD = $(RSRT_LIBS) $(ZLIB_LIBS) $(PTHREADS_LIBS) $(SOL_LIBS) -#rscript_LDFLAGS = -export-dynamic # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru rsyslog-7.6.0/tests/manytcp-too-few-tls.sh rsyslog-5.10.1/tests/manytcp-too-few-tls.sh --- rsyslog-7.6.0/tests/manytcp-too-few-tls.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/manytcp-too-few-tls.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# test many concurrent tcp connections -echo \[manytcp-too-few-tls.sh\]: test concurrent tcp connections -source $srcdir/diag.sh init -source $srcdir/diag.sh startup-vg manytcp-too-few-tls.conf -# the config file specifies exactly 1100 connections -source $srcdir/diag.sh tcpflood -c1000 -m40000 -# the sleep below is needed to prevent too-early termination of the tcp listener -sleep 1 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown-vg # we need to wait until rsyslogd is finished! -source $srcdir/diag.sh check-exit-vg -# we do not do a seq check, as of the design of this test some messages -# will be lost. So there is no point in checking if all were received. The -# point is that we look at the valgrind result, to make sure we do not -# have a mem leak in those error cases (we had in the past, thus the test -# to prevent that in the future). -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/minitcpsrvr.c rsyslog-5.10.1/tests/minitcpsrvr.c --- rsyslog-7.6.0/tests/minitcpsrvr.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/minitcpsrvr.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static void -errout(char *reason) -{ - perror(reason); - exit(1); -} - -int -main(int argc, char *argv[]) -{ - int fds; - int fdc; - int fdf; - struct sockaddr_in srvAddr; - struct sockaddr_in cliAddr; - unsigned int srvAddrLen; - unsigned int cliAddrLen; - char wrkBuf[4096]; - ssize_t nRead; - - if(argc != 4) { - fprintf(stderr, "usage: minitcpsrvr ip-addr port outfile\n"); - exit(1); - } - - if(!strcmp(argv[3], "-")) { - fdf = 1; - } else { - fdf = open(argv[3], O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR); - if(fdf == -1) errout(argv[3]); - } - - fds = socket(AF_INET, SOCK_STREAM, 0); - srvAddr.sin_family = AF_INET; - srvAddr.sin_addr.s_addr = inet_addr(argv[1]); - srvAddr.sin_port = htons(atoi(argv[2])); - srvAddrLen = sizeof(srvAddr); - if(bind(fds, (struct sockaddr *)&srvAddr, srvAddrLen) != 0) - errout("bind"); - if(listen(fds, 20) != 0) errout("listen"); - cliAddrLen = sizeof(cliAddr); - - fdc = accept(fds, (struct sockaddr *)&cliAddr, &cliAddrLen); - while(1) { - nRead = read(fdc, wrkBuf, sizeof(wrkBuf)); - if(nRead == 0) break; - if(write(fdf, wrkBuf, nRead) != nRead) - errout("write"); - } - /* let the OS do the cleanup */ - return 0; -} diff -Nru rsyslog-7.6.0/tests/mmpstrucdata.sh rsyslog-5.10.1/tests/mmpstrucdata.sh --- rsyslog-7.6.0/tests/mmpstrucdata.sh 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/mmpstrucdata.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# This file is part of the rsyslog project, released under ASL 2.0 -# rgerhards, 2013-11-22 -echo =============================================================================== -echo \[mmpstrucdata.sh\]: testing mmpstrucdata -source $srcdir/diag.sh init -source $srcdir/diag.sh startup mmpstrucdata.conf -sleep 1 -source $srcdir/diag.sh tcpflood -m100 -y -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/mysql-basic-cnf6.sh rsyslog-5.10.1/tests/mysql-basic-cnf6.sh --- rsyslog-7.6.0/tests/mysql-basic-cnf6.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/mysql-basic-cnf6.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# This file is part of the rsyslog project, released under GPLv3 -echo =============================================================================== -echo \[mysql-basic.sh\]: basic test for mysql-basic functionality -source $srcdir/diag.sh init -mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql -source $srcdir/diag.sh startup mysql-basic-cnf6.conf -source $srcdir/diag.sh injectmsg 0 5000 -source $srcdir/diag.sh shutdown-when-empty -source $srcdir/diag.sh wait-shutdown -# note "-s" is requried to suppress the select "field header" -mysql -s --user=rsyslog --password=testbench < testsuites/mysql-select-msg.sql > rsyslog.out.log -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/nettester.c rsyslog-5.10.1/tests/nettester.c --- rsyslog-7.6.0/tests/nettester.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/nettester.c 2012-09-18 15:03:58.000000000 +0000 @@ -243,7 +243,7 @@ { int pipefd[2]; pid_t cpid; - char *newargv[] = {"../tools/rsyslogd", "dummy", "-u2", "-n", "-irsyslog.pid", + char *newargv[] = {"../tools/rsyslogd", "dummy", "-c4", "-u2", "-n", "-irsyslog.pid", "-M../runtime/.libs:../.libs", NULL, NULL}; char confFile[1024]; diff -Nru rsyslog-7.6.0/tests/queue-persist-drvr.sh rsyslog-5.10.1/tests/queue-persist-drvr.sh --- rsyslog-7.6.0/tests/queue-persist-drvr.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/queue-persist-drvr.sh 2012-09-18 15:03:58.000000000 +0000 @@ -24,12 +24,6 @@ echo "#" > work-delay.conf source $srcdir/diag.sh startup queue-persist.conf source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -./msleep 500 $srcdir/diag.sh wait-shutdown -# note: we need to permit duplicate messages, as due to the forced -# shutdown some messages may be flagged as "unprocessed" while they -# actually were processed. This is inline with rsyslog's philosophy -# to better duplicate than loose messages. Duplicate messages are -# permitted by the -d seq-check option. -source $srcdir/diag.sh seq-check 0 4999 -d +source $srcdir/diag.sh seq-check 0 4999 source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rfc5424parser.sh rsyslog-5.10.1/tests/rfc5424parser.sh --- rsyslog-7.6.0/tests/rfc5424parser.sh 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/rfc5424parser.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# This file is part of the rsyslog project, released under ASL 2.0 -# rgerhards, 2013-11-22 -echo =============================================================================== -echo \[rfc5424parser.sh\]: testing mmpstrucdata -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rfc5424parser.conf -sleep 1 -source $srcdir/diag.sh tcpflood -m100 -y -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript.c rsyslog-5.10.1/tests/rscript.c --- rsyslog-7.6.0/tests/rscript.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,263 @@ +/* This test checks runtime initialization and exit. Other than that, it + * also serves as the most simplistic sample of how a test can be coded. + * + * Part of the testbench for rsyslog. + * + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" +#include +#include +#include +#include + +#include "rsyslog.h" +#include "testbench.h" +#include "ctok.h" +#include "expr.h" + +MODULE_TYPE_TESTBENCH +/* define addtional objects we need for our tests */ +DEFobjCurrIf(expr) +DEFobjCurrIf(ctok) +DEFobjCurrIf(ctok_token) +DEFobjCurrIf(vmprg) + + +BEGINInit +CODESTARTInit + pErrObj = "expr"; CHKiRet(objUse(expr, CORE_COMPONENT)); + pErrObj = "ctok"; CHKiRet(objUse(ctok, CORE_COMPONENT)); + pErrObj = "ctok_token"; CHKiRet(objUse(ctok_token, CORE_COMPONENT)); + pErrObj = "vmprg"; CHKiRet(objUse(vmprg, CORE_COMPONENT)); +ENDInit + +BEGINExit +CODESTARTExit +ENDExit + + +/* perform a single test. This involves compiling the test script, + * checking the result of the compilation (iRet) and a check of the + * generated program (via a simple strcmp). The resulting program + * check is only done if the test should not detect a syntax error + * (for obvious reasons, there is no point in checking the result of + * a failed compilation). + * rgerhards, 2008-07--07 + */ +static rsRetVal +PerformTest(cstr_t *pstrIn, rsRetVal iRetExpected, cstr_t *pstrOut) +{ + cstr_t *pstrPrg = NULL; + ctok_t *tok = NULL; + ctok_token_t *pToken = NULL; + expr_t *pExpr; + rsRetVal localRet; + DEFiRet; + + /* we first need a tokenizer... */ + CHKiRet(ctok.Construct(&tok)); + CHKiRet(ctok.Setpp(tok, rsCStrGetSzStr(pstrIn))); + CHKiRet(ctok.ConstructFinalize(tok)); + + /* now construct our expression */ + CHKiRet(expr.Construct(&pExpr)); + CHKiRet(expr.ConstructFinalize(pExpr)); + + /* ready to go... */ + localRet = expr.Parse(pExpr, tok); + + /* check if we expected an error */ + if(localRet != iRetExpected) { + printf("Error in compile return code. Expected %d, received %d\n", + iRetExpected, localRet); + CHKiRet(rsCStrConstruct(&pstrPrg)); + CHKiRet(vmprg.Obj2Str(pExpr->pVmprg, pstrPrg)); + printf("generated vmprg:\n%s\n", rsCStrGetSzStr(pstrPrg)); + ABORT_FINALIZE(iRetExpected == RS_RET_OK ? localRet : RS_RET_ERR); + } + + if(iRetExpected != RS_RET_OK) + FINALIZE; /* if we tested an error case, we are done */ + + /* OK, we got a compiled program, so now let's compare that */ + + CHKiRet(rsCStrConstruct(&pstrPrg)); + CHKiRet(vmprg.Obj2Str(pExpr->pVmprg, pstrPrg)); + + if(strcmp((char*)rsCStrGetSzStr(pstrPrg), (char*)rsCStrGetSzStr(pstrOut))) { + printf("error: compiled program different from expected result!\n"); + printf("generated vmprg (%d bytes):\n%s\n", (int)strlen((char*)rsCStrGetSzStr(pstrPrg)), rsCStrGetSzStr(pstrPrg)); + printf("expected (%d bytes):\n%s\n", (int)strlen((char*)rsCStrGetSzStr(pstrOut)), rsCStrGetSzStr(pstrOut)); + ABORT_FINALIZE(RS_RET_ERR); + } + +finalize_it: + /* we are done, so we now need to restore things */ + if(pToken != NULL) + ctok_token.Destruct(&pToken); /* no longer needed */ + if(pstrPrg != NULL) + rsCStrDestruct(&pstrPrg); + if(tok != NULL) + ctok.Destruct(&tok); + RETiRet; +} + + +/* a helper macro to generate some often-used code... */ +#define CHKEOF \ + if(feof(fp)) { \ + printf("error: unexpected end of control file %s\n", pszFileName); \ + ABORT_FINALIZE(RS_RET_ERR); \ + } +/* process a single test file + * Note that we do not do a real parser here. The effort is not + * justified by what we need to do. So it is a quick shot. + * rgerhards, 2008-07-07 + */ +static rsRetVal +ProcessTestFile(uchar *pszFileName) +{ + FILE *fp; + char *lnptr = NULL; + size_t lenLn; + cstr_t *pstrIn = NULL; + cstr_t *pstrOut = NULL; + int iParse; + rsRetVal iRetExpected; + DEFiRet; + + if((fp = fopen((char*)pszFileName, "r")) == NULL) { + perror((char*)pszFileName); + ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); + } + + /* skip comments at start of file */ + + getline(&lnptr, &lenLn, fp); + while(!feof(fp)) { + if(*lnptr == '#') + getline(&lnptr, &lenLn, fp); + else + break; /* first non-comment */ + } + CHKEOF; + + /* once we had a comment, the next line MUST be "result: ". Anything + * after nbr is simply ignored. + */ + if(sscanf(lnptr, "result: %d", &iParse) != 1) { + printf("error in result line, scanf failed, line: '%s'\n", lnptr); + ABORT_FINALIZE(RS_RET_ERR); + } + iRetExpected = iParse; + getline(&lnptr, &lenLn, fp); CHKEOF; + + /* and now we look for "in:" (and again ignore the rest...) */ + if(strncmp(lnptr, "in:", 3)) { + printf("error: expected 'in:'-line, but got: '%s'\n", lnptr); + ABORT_FINALIZE(RS_RET_ERR); + } + /* if we reach this point, we need to read in the input script. It is + * terminated by a line with three sole $ ($$$\n) + */ + CHKiRet(rsCStrConstruct(&pstrIn)); + getline(&lnptr, &lenLn, fp); CHKEOF; + while(strncmp(lnptr, "$$$\n", 4)) { + CHKiRet(rsCStrAppendStr(pstrIn, (uchar*)lnptr)); + getline(&lnptr, &lenLn, fp); CHKEOF; + } + getline(&lnptr, &lenLn, fp); CHKEOF; /* skip $$$-line */ + + /* and now we look for "out:" (and again ignore the rest...) */ + if(strncmp(lnptr, "out:", 4)) { + printf("error: expected 'out:'-line, but got: '%s'\n", lnptr); + ABORT_FINALIZE(RS_RET_ERR); + } + /* if we reach this point, we need to read in the expected program code. It is + * terminated by a line with three sole $ ($$$\n) + */ + CHKiRet(rsCStrConstruct(&pstrOut)); + getline(&lnptr, &lenLn, fp); CHKEOF; + while(strncmp(lnptr, "$$$\n", 4)) { + CHKiRet(rsCStrAppendStr(pstrOut, (uchar*)lnptr)); + getline(&lnptr, &lenLn, fp); CHKEOF; + } + + /* un-comment for testing: + * printf("iRet: %d, script: %s\n, out: %s\n", iRetExpected, rsCStrGetSzStr(pstrIn),rsCStrGetSzStr(pstrOut)); + */ + if(rsCStrGetSzStr(pstrIn) == NULL) { + printf("error: input script is empty!\n"); + ABORT_FINALIZE(RS_RET_ERR); + } + if(rsCStrGetSzStr(pstrOut) == NULL && iRetExpected == RS_RET_OK) { + printf("error: output script is empty!\n"); + ABORT_FINALIZE(RS_RET_ERR); + } + + CHKiRet(PerformTest(pstrIn, iRetExpected, pstrOut)); + +finalize_it: + if(pstrIn != NULL) + rsCStrDestruct(&pstrIn); + if(pstrOut != NULL) + rsCStrDestruct(&pstrOut); + RETiRet; +} + + +/* This test is parameterized. It search for test control files and + * loads all that it finds. To add tests, simply create new .rstest + * files. + * rgerhards, 2008-07-07 + */ +BEGINTest + uchar *testFile; + glob_t testFiles; + size_t i = 0; + struct stat fileInfo; +CODESTARTTest + glob("*.rstest", GLOB_MARK, NULL, &testFiles); + + for(i = 0; i < testFiles.gl_pathc; i++) { + testFile = (uchar*) testFiles.gl_pathv[i]; + + if(stat((char*) testFile, &fileInfo) != 0) + continue; /* continue with the next file if we can't stat() the file */ + + /* all regular files are run through the test logic. Symlinks don't work. */ + if(S_ISREG(fileInfo.st_mode)) { /* config file */ + printf("processing RainerScript test file '%s'...\n", testFile); + iRet = ProcessTestFile((uchar*) testFile); + if(iRet != RS_RET_OK) { + /* in this case, re-run with debugging on */ + printf("processing test case failed with %d, re-running with debug messages:\n", + iRet); + Debug = 1; /* these two are dirty, but we need them today... */ + debugging_on = 1; + CHKiRet(ProcessTestFile((uchar*) testFile)); + } + } + } + globfree(&testFiles); + +finalize_it: +ENDTest diff -Nru rsyslog-7.6.0/tests/rscript_contains.sh rsyslog-5.10.1/tests/rscript_contains.sh --- rsyslog-7.6.0/tests/rscript_contains.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_contains.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-14 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_contains.sh\]: test for contains script-filter -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_contains.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_eq.sh rsyslog-5.10.1/tests/rscript_eq.sh --- rsyslog-7.6.0/tests/rscript_eq.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_eq.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2014-01-17 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_eq.sh\]: testing rainerscript EQ statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_eq.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 5000 5002 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_field.sh rsyslog-5.10.1/tests/rscript_field.sh --- rsyslog-7.6.0/tests/rscript_field.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_field.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-20 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_field.sh\]: testing rainerscript field\(\) function -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_field.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_ge.sh rsyslog-5.10.1/tests/rscript_ge.sh --- rsyslog-7.6.0/tests/rscript_ge.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_ge.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2014-01-17 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_ge.sh\]: testing rainerscript GE statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_ge.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_gt.sh rsyslog-5.10.1/tests/rscript_gt.sh --- rsyslog-7.6.0/tests/rscript_gt.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_gt.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2014-01-17 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_gt.sh\]: testing rainerscript GT statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_gt.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 5000 7999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_le.sh rsyslog-5.10.1/tests/rscript_le.sh --- rsyslog-7.6.0/tests/rscript_le.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_le.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2014-01-17 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_le.sh\]: testing rainerscript LE statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_le.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 5000 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_lt.sh rsyslog-5.10.1/tests/rscript_lt.sh --- rsyslog-7.6.0/tests/rscript_lt.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_lt.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2014-01-17 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_lt.sh\]: testing rainerscript LT statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_lt.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_ne.sh rsyslog-5.10.1/tests/rscript_ne.sh --- rsyslog-7.6.0/tests/rscript_ne.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_ne.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2014-01-17 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_ne.sh\]: testing rainerscript NE statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_ne.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 5000 5002 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_optimizer1.sh rsyslog-5.10.1/tests/rscript_optimizer1.sh --- rsyslog-7.6.0/tests/rscript_optimizer1.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_optimizer1.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-20 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_optimizer1.sh\]: testing rainerscript optimizer -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_optimizer1.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_prifilt.sh rsyslog-5.10.1/tests/rscript_prifilt.sh --- rsyslog-7.6.0/tests/rscript_prifilt.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_prifilt.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-20 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_prifilt.sh\]: testing rainerscript prifield\(\) function -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_prifilt.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_ruleset_call.sh rsyslog-5.10.1/tests/rscript_ruleset_call.sh --- rsyslog-7.6.0/tests/rscript_ruleset_call.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_ruleset_call.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-10-29 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_ruleset_call.sh\]: testing rainerscript ruleset\(\) and call statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_ruleset_call.conf -source $srcdir/diag.sh injectmsg 0 5000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_stop2.sh rsyslog-5.10.1/tests/rscript_stop2.sh --- rsyslog-7.6.0/tests/rscript_stop2.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_stop2.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-20 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_stop2.sh\]: testing rainerscript STOP statement, alternate method -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_stop2.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rscript_stop.sh rsyslog-5.10.1/tests/rscript_stop.sh --- rsyslog-7.6.0/tests/rscript_stop.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/rscript_stop.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# added 2012-09-20 by rgerhards -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[rscript_stop.sh\]: testing rainerscript STOP statement -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rscript_stop.conf -source $srcdir/diag.sh injectmsg 0 8000 -echo doing shutdown -source $srcdir/diag.sh shutdown-when-empty -echo wait on shutdown -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 4999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rs_optimizer_pri.sh rsyslog-5.10.1/tests/rs_optimizer_pri.sh --- rsyslog-7.6.0/tests/rs_optimizer_pri.sh 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/rs_optimizer_pri.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# Test for the RainerScript optimizer, folding of -# syslogfacility/priority-text to prifilt. Unfortunately, we cannot yet -# automatically detect if the optimizer does not correctly fold, but we -# can at least detect if it segfaults or otherwise creates incorrect code. -# This file is part of the rsyslog project, released under ASL 2.0 -# rgerhards, 2013-11-20 -echo =============================================================================== -echo \[rs_optimizer_pri.sh\]: testing RainerScript PRI optimizer -source $srcdir/diag.sh init -source $srcdir/diag.sh startup rs_optimizer_pri.conf -sleep 1 -source $srcdir/diag.sh tcpflood -m100 # correct facility -source $srcdir/diag.sh tcpflood -m100 -P175 # incorrect facility --> must be ignored -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 0 99 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/rt-init.c rsyslog-5.10.1/tests/rt-init.c --- rsyslog-7.6.0/tests/rt-init.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/tests/rt-init.c 2012-10-17 14:41:20.000000000 +0000 @@ -0,0 +1,43 @@ +/* This test checks runtime initialization and exit. Other than that, it + * also serves as the most simplistic sample of how a test can be coded. + * + * Part of the testbench for rsyslog. + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" +#include "rsyslog.h" +#include "testbench.h" +#include /* must be last, else we get a zlib compile error on some platforms */ + +MODULE_TYPE_TESTBENCH + +BEGINInit +CODESTARTInit +ENDInit + +BEGINExit +CODESTARTExit +ENDExit + +BEGINTest +CODESTARTTest +/*finalize_it:*/ + /* room for custom error reporter, leave blank if not needed */ +ENDTest diff -Nru rsyslog-7.6.0/tests/runtime-dummy.c rsyslog-5.10.1/tests/runtime-dummy.c --- rsyslog-7.6.0/tests/runtime-dummy.c 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/tests/runtime-dummy.c 2012-09-18 15:03:58.000000000 +0000 @@ -0,0 +1,46 @@ +/* Testbench for rsyslog + * + * This are dummy calls for "runtime" routines which are not yet properly + * abstracted and part of the actual runtime libraries. This module tries + * to make the linker happy. Please note that it does NOT provide anything + * more but the symbols. If a test requires these functions (or functions + * that depend on them), this dummy can not be used. + * + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" +#include +#include "rsyslog.h" + +int bReduceRepeatMsgs = 0; +int repeatinterval = 30; +int bActExecWhenPrevSusp = 0; +int iActExecOnceInterval = 1; +int MarkInterval = 30; +void *pMsgQueue = NULL; + +void cflineClassic(void) {}; +void selectorAddList(void) {}; +void selectorConstruct(void) {}; +void selectorDestruct(void) {}; +rsRetVal createMainQueue(void) { return RS_RET_ERR; } + +ruleset_t *pCurrRuleset; +/* these are required by some dynamically loaded modules */ diff -Nru rsyslog-7.6.0/tests/sndrcv_drvr.sh rsyslog-5.10.1/tests/sndrcv_drvr.sh --- rsyslog-7.6.0/tests/sndrcv_drvr.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/sndrcv_drvr.sh 2012-10-17 14:41:20.000000000 +0000 @@ -1 +1,2 @@ source $srcdir/sndrcv_drvr_noexit.sh $1 $2 +source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/sndrcv_omudpspoof_nonstdpt.sh rsyslog-5.10.1/tests/sndrcv_omudpspoof_nonstdpt.sh --- rsyslog-7.6.0/tests/sndrcv_omudpspoof_nonstdpt.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/sndrcv_omudpspoof_nonstdpt.sh 2012-10-17 14:41:20.000000000 +0000 @@ -7,8 +7,4 @@ # This file is part of the rsyslog project, released under GPLv3 echo =============================================================================== echo \[sndrcv_omudpspoof_nonstdpt.sh\]: testing sending and receiving via omudp -echo This test must be run as root [raw socket access required] -if [ "$EUID" -ne 0 ]; then - exit 77 # Not root, skip this test -fi source $srcdir/sndrcv_drvr.sh sndrcv_omudpspoof_nonstdpt 50 diff -Nru rsyslog-7.6.0/tests/sndrcv_omudpspoof.sh rsyslog-5.10.1/tests/sndrcv_omudpspoof.sh --- rsyslog-7.6.0/tests/sndrcv_omudpspoof.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/sndrcv_omudpspoof.sh 2012-10-17 14:41:20.000000000 +0000 @@ -7,8 +7,4 @@ # This file is part of the rsyslog project, released under GPLv3 echo =============================================================================== echo \[sndrcv_omudpspoof.sh\]: testing sending and receiving via omudp -echo This test must be run as root [raw socket access required] -if [ "$EUID" -ne 0 ]; then - exit 77 # Not root, skip this test -fi source $srcdir/sndrcv_drvr.sh sndrcv_omudpspoof 50 diff -Nru rsyslog-7.6.0/tests/sndrcv_udp.sh rsyslog-5.10.1/tests/sndrcv_udp.sh --- rsyslog-7.6.0/tests/sndrcv_udp.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/sndrcv_udp.sh 2012-10-17 14:41:20.000000000 +0000 @@ -7,7 +7,4 @@ # This file is part of the rsyslog project, released under GPLv3 echo =============================================================================== echo \[sndrcv_udp.sh\]: testing sending and receiving via udp -if [ "$EUID" -ne 0 ]; then - exit 77 # Not root, skip this test -fi source $srcdir/sndrcv_drvr.sh sndrcv_udp 50 diff -Nru rsyslog-7.6.0/tests/stop-localvar.sh rsyslog-5.10.1/tests/stop-localvar.sh --- rsyslog-7.6.0/tests/stop-localvar.sh 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/stop-localvar.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# Test for "stop" statement -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[stop-localvar.sh\]: testing stop statement together with local variables -source $srcdir/diag.sh init -source $srcdir/diag.sh startup stop-localvar.conf -sleep 1 -source $srcdir/diag.sh tcpflood -m2000 -i1 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 100 999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/stop-msgvar.sh rsyslog-5.10.1/tests/stop-msgvar.sh --- rsyslog-7.6.0/tests/stop-msgvar.sh 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/stop-msgvar.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# Test for "stop" statement -# This file is part of the rsyslog project, released under ASL 2.0 -echo =============================================================================== -echo \[stop-msgvar.sh\]: testing stop statement together with message variables -source $srcdir/diag.sh init -source $srcdir/diag.sh startup stop-msgvar.conf -sleep 1 -source $srcdir/diag.sh tcpflood -m2000 -i1 -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown -source $srcdir/diag.sh seq-check 100 999 -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/tcpflood.c rsyslog-5.10.1/tests/tcpflood.c --- rsyslog-7.6.0/tests/tcpflood.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/tcpflood.c 2012-10-15 13:45:04.000000000 +0000 @@ -48,14 +48,13 @@ * -b number of messages within a batch (default: 100,000,000 millions) * -Y use multiple threads, one per connection (which means 1 if one only connection * is configured!) - * -y use RFC5424 style test message * -z private key file for TLS mode * -Z cert (public key) file for TLS mode * -L loglevel to use for GnuTLS troubleshooting (0-off to 10-all, 0 default) * * Part of the testbench for rsyslog. * - * Copyright 2009, 2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2009, 2010 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -112,7 +111,6 @@ static int numTargetPorts = 1; static int dynFileIDs = 0; static int extraDataLen = 0; /* amount of extra data to add to message */ -static int useRFC5424Format = 0; /* should the test message be in RFC5424 format? */ static int bRandomizeExtraData = 0; /* randomize amount of extra data added */ static int numMsgsToSend; /* number of messages to send */ static unsigned numConnections = 1; /* number of connections to create */ @@ -260,7 +258,7 @@ return setupUDP(); if(bShowProgress) - if(write(1, " open connections", sizeof(" open connections")-1)){} + write(1, " open connections", sizeof(" open connections")-1); # ifdef ENABLE_GNUTLS sessArray = calloc(numConnections, sizeof(gnutls_session_t)); # endif @@ -280,7 +278,7 @@ } if(bShowProgress) { lenMsg = sprintf(msgBuf, "\r%5.5d open connections\n", i); - if(write(1, msgBuf, lenMsg)) {} + write(1, msgBuf, lenMsg); } return 0; @@ -305,12 +303,12 @@ return; if(bShowProgress) - if(write(1, " close connections", sizeof(" close connections")-1)){} + write(1, " close connections", sizeof(" close connections")-1); for(i = 0 ; i < numConnections ; ++i) { if(i % 10 == 0) { if(bShowProgress) { lenMsg = sprintf(msgBuf, "\r%5.5d", i); - if(write(1, msgBuf, lenMsg)){} + write(1, msgBuf, lenMsg); } } if(sockArray[i] != -1) { @@ -327,7 +325,7 @@ } if(bShowProgress) { lenMsg = sprintf(msgBuf, "\r%5.5d close connections\n", i); - if(write(1, msgBuf, lenMsg)){} + write(1, msgBuf, lenMsg); } } @@ -349,7 +347,7 @@ /* get message from file */ do { done = 1; - *pLenBuf = fread(buf, 1, MAX_EXTRADATA_LEN + 1024, dataFP); + *pLenBuf = fread(buf, 1, 1024, dataFP); if(*pLenBuf == 0) { if(--numFileIterations > 0) { rewind(dataFP); @@ -365,14 +363,8 @@ snprintf(dynFileIDBuf, sizeof(dynFileIDBuf), "%d:", rand() % dynFileIDs); } if(extraDataLen == 0) { - if(useRFC5424Format) { - *pLenBuf = snprintf(buf, maxBuf, "<%s>1 2003-03-01T01:00:00.000Z mymachine.example.com tcpflood " - "- tag [tcpflood@32473 MSGNUM=\"%8.8d\"] msgnum:%s%8.8d:%c", - msgPRI, msgNum, dynFileIDBuf, msgNum, frameDelim); - } else { - *pLenBuf = snprintf(buf, maxBuf, "<%s>Mar 1 01:00:00 172.20.245.8 tag msgnum:%s%8.8d:%c", - msgPRI, dynFileIDBuf, msgNum, frameDelim); - } + *pLenBuf = snprintf(buf, maxBuf, "<%s>Mar 1 01:00:00 172.20.245.8 tag msgnum:%s%8.8d:%c", + msgPRI, dynFileIDBuf, msgNum, frameDelim); } else { if(bRandomizeExtraData) edLen = ((long) rand() + extraDataLen) % extraDataLen + 1; @@ -380,14 +372,8 @@ edLen = extraDataLen; memset(extraData, 'X', edLen); extraData[edLen] = '\0'; - if(useRFC5424Format) { - *pLenBuf = snprintf(buf, maxBuf, "<%s>1 2003-03-01T01:00:00.000Z mymachine.example.com tcpflood " - "- tag [tcpflood@32473 MSGNUM=\"%8.8d\"] msgnum:%s%8.8d:%c", - msgPRI, msgNum, dynFileIDBuf, msgNum, frameDelim); - } else { - *pLenBuf = snprintf(buf, maxBuf, "<%s>Mar 1 01:00:00 172.20.245.8 tag msgnum:%s%8.8d:%d:%s%c", - msgPRI, dynFileIDBuf, msgNum, edLen, extraData, frameDelim); - } + *pLenBuf = snprintf(buf, maxBuf, "<%s>Mar 1 01:00:00 172.20.245.8 tag msgnum:%s%8.8d:%d:%s%c", + msgPRI, dynFileIDBuf, msgNum, edLen, extraData, frameDelim); } } else { /* use fixed message format from command line */ @@ -443,8 +429,6 @@ } } genMsg(buf, sizeof(buf), &lenBuf, inst); /* generate the message to send according to params */ - if(lenBuf == 0) - break; /* terminate when no message could be generated */ if(transport == TP_TCP) { if(sockArray[socknum] == -1) { /* connection was dropped, need to re-establish */ @@ -844,7 +828,7 @@ setvbuf(stdout, buf, _IONBF, 48); - while((opt = getopt(argc, argv, "b:ef:F:t:p:c:C:m:i:I:P:d:Dn:L:M:rsBR:S:T:XW:yYz:Z:")) != -1) { + while((opt = getopt(argc, argv, "b:ef:F:t:p:c:C:m:i:I:P:d:Dn:L:M:rsBR:S:T:XW:Yz:Z:")) != -1) { switch (opt) { case 'b': batchsize = atoll(optarg); break; @@ -922,8 +906,6 @@ break; case 'Y': runMultithreaded = 1; break; - case 'y': useRFC5424Format = 1; - break; case 'z': tlsKeyFile = optarg; break; case 'Z': tlsCertFile = optarg; diff -Nru rsyslog-7.6.0/tests/testbench.h rsyslog-5.10.1/tests/testbench.h --- rsyslog-7.6.0/tests/testbench.h 1970-01-01 00:00:00.000000000 +0000 +++ rsyslog-5.10.1/tests/testbench.h 2012-09-10 16:28:20.000000000 +0000 @@ -0,0 +1,103 @@ +/* Defines for a rsyslog standard testbench application. + * + * Work begun 2008-06-13 by Rainer Gerhards (written from scratch) + * + * Copyright 2008 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see . + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include + +/* everything we need to begin a testbench */ +#define MODULE_TYPE_TESTBENCH \ +/* definitions for objects we access */ \ +DEFobjCurrIf(obj) \ +\ +static rsRetVal doInit(void); \ +static rsRetVal doTest(void); \ +static rsRetVal doExit(void); \ +\ +/* Below is the driver, which is always the same */ \ +int main(int __attribute__((unused)) argc, char __attribute__((unused)) *argv[]) \ +{ \ + DEFiRet; \ + CHKiRet(doInit()); \ + CHKiRet(doTest()); \ + CHKiRet(doExit()); \ +finalize_it: \ + if(iRet != RS_RET_OK) \ + printf("test returns iRet %d\n", iRet); \ + RETiRet; \ +} + + +/* Initialize everything (most importantly the runtime objects) for the test. The framework + * initializes the global runtime, user must add those objects that it needs additionally. + */ +#define BEGINInit \ +static rsRetVal doInit(void) \ +{ \ + DEFiRet; \ + char *pErrObj; /* tells us which object failed if that happens */ \ + putenv("RSYSLOG_MODDIR=../runtime/.libs/"); /* this is a bit hackish... */ \ + \ + dbgClassInit(); \ + /* Intialize the runtime system */ \ + pErrObj = "rsyslog runtime"; /* set in case the runtime errors before setting an object */ \ + CHKiRet(rsrtInit(&pErrObj, &obj)); \ + +#define CODESTARTInit + +#define ENDInit \ +finalize_it: \ + if(iRet != RS_RET_OK) { \ + printf("failure occured during init of object '%s'\n", pErrObj); \ + } \ + \ + RETiRet; \ +} + + + +/* Carry out the actual test... + */ +#define BEGINTest \ +rsRetVal doTest(void) \ +{ \ + DEFiRet; + +#define CODESTARTTest + +#define ENDTest \ + RETiRet; \ +} + + +/* De-init everything (most importantly the runtime objects) for the test. */ +#define BEGINExit \ +rsRetVal doExit(void) \ +{ \ + DEFiRet; \ + CHKiRet(rsrtExit()); + +#define CODESTARTExit + +#define ENDExit \ +finalize_it: \ + RETiRet; \ +} diff -Nru rsyslog-7.6.0/tests/testsuites/cee_diskqueue.conf rsyslog-5.10.1/tests/testsuites/cee_diskqueue.conf --- rsyslog-7.6.0/tests/testsuites/cee_diskqueue.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/cee_diskqueue.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -$IncludeConfig diag-common.conf - -global(workDirectory="/tmp") -template(name="outfmt" type="string" string="%$!usr!msg:F,58:2%\n") - -set $!usr!msg = $msg; -if $msg contains 'msgnum' then - action(type="omfile" file="./rsyslog.out.log" template="outfmt" - queue.type="disk" queue.filename="rsyslog-act1") diff -Nru rsyslog-7.6.0/tests/testsuites/cee_simple.conf rsyslog-5.10.1/tests/testsuites/cee_simple.conf --- rsyslog-7.6.0/tests/testsuites/cee_simple.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/cee_simple.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="string" string="%$!usr!msg:F,58:2%\n") -set $!usr!msg = $msg; -if $msg contains 'msgnum' then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") diff -Nru rsyslog-7.6.0/tests/testsuites/complex1.conf rsyslog-5.10.1/tests/testsuites/complex1.conf --- rsyslog-7.6.0/tests/testsuites/complex1.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/complex1.conf 2012-04-21 08:50:11.000000000 +0000 @@ -3,8 +3,6 @@ $MaxMessageSize 10k $IncludeConfig diag-common.conf -$MainMsgQueueTimeoutEnqueue 5000 - $ModLoad ../plugins/imtcp/.libs/imtcp $MainMsgQueueTimeoutShutdown 10000 @@ -15,7 +13,6 @@ $Ruleset R13514 # queue params: $ActionQueueTimeoutShutdown 60000 -$ActionQueueTimeoutEnqueue 5000 $ActionQueueSize 5000 $ActionQueueSaveOnShutdown on $ActionQueueHighWaterMark 4900 @@ -39,7 +36,6 @@ $Ruleset R13515 # queue params: $ActionQueueTimeoutShutdown 60000 -$ActionQueueTimeoutEnqueue 5000 $ActionQueueSize 5000 $ActionQueueSaveOnShutdown on $ActionQueueHighWaterMark 4900 @@ -64,7 +60,6 @@ $Ruleset R13516 # queue params: $ActionQueueTimeoutShutdown 60000 -$ActionQueueTimeoutEnqueue 5000 $ActionQueueSize 5000 $ActionQueueSaveOnShutdown on $ActionQueueHighWaterMark 4900 diff -Nru rsyslog-7.6.0/tests/testsuites/imptcp_addtlframedelim.conf rsyslog-5.10.1/tests/testsuites/imptcp_addtlframedelim.conf --- rsyslog-7.6.0/tests/testsuites/imptcp_addtlframedelim.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/imptcp_addtlframedelim.conf 2012-04-26 13:53:21.000000000 +0000 @@ -9,4 +9,5 @@ $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k +$IncludeConfig rsyslog.action.1.include local0.* ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/imptcp_conndrop.conf rsyslog-5.10.1/tests/testsuites/imptcp_conndrop.conf --- rsyslog-7.6.0/tests/testsuites/imptcp_conndrop.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/imptcp_conndrop.conf 2012-04-26 13:53:21.000000000 +0000 @@ -12,4 +12,5 @@ $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k +$IncludeConfig rsyslog.action.1.include local0.* ?dynfile;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/imptcp_large.conf rsyslog-5.10.1/tests/testsuites/imptcp_large.conf --- rsyslog-7.6.0/tests/testsuites/imptcp_large.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/imptcp_large.conf 2012-04-26 13:53:21.000000000 +0000 @@ -12,4 +12,5 @@ $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k +$IncludeConfig rsyslog.action.1.include local0.* ?dynfile;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/imtcp_addtlframedelim.conf rsyslog-5.10.1/tests/testsuites/imtcp_addtlframedelim.conf --- rsyslog-7.6.0/tests/testsuites/imtcp_addtlframedelim.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/imtcp_addtlframedelim.conf 2012-04-26 13:53:21.000000000 +0000 @@ -9,4 +9,5 @@ $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k +$IncludeConfig rsyslog.action.1.include local0.* ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/imtcp_conndrop.conf rsyslog-5.10.1/tests/testsuites/imtcp_conndrop.conf --- rsyslog-7.6.0/tests/testsuites/imtcp_conndrop.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/imtcp_conndrop.conf 2012-10-17 14:41:20.000000000 +0000 @@ -12,4 +12,5 @@ $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k +$IncludeConfig rsyslog.action.1.include local0.* ?dynfile;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/imtcp-tls-basic.conf rsyslog-5.10.1/tests/testsuites/imtcp-tls-basic.conf --- rsyslog-7.6.0/tests/testsuites/imtcp-tls-basic.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/imtcp-tls-basic.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -# Test for queue disk mode (see .sh file for details) -# rgerhards, 2009-05-22 -$IncludeConfig diag-common.conf - -$ModLoad ../plugins/imtcp/.libs/imtcp -$MainMsgQueueTimeoutShutdown 10000 - -$DefaultNetstreamDriver gtls - -# certificate files - just CA for a client -$IncludeConfig rsyslog.conf.tlscert -$InputTCPServerStreamDriverMode 1 -$InputTCPServerStreamDriverAuthMode anon -$InputTCPServerRun 13514 - -$template outfmt,"%msg:F,58:2%\n" -$OMFileFlushOnTXEnd off -$OMFileFlushInterval 2 -$OMFileAsyncWriting on -$OMFileIOBufferSize 16k -:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/incltest.conf rsyslog-5.10.1/tests/testsuites/incltest.conf --- rsyslog-7.6.0/tests/testsuites/incltest.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/incltest.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# see .sh file for description -# rgerhards, 2009-11-30 -$IncludeConfig diag-common.conf - -$IncludeConfig testsuites/incltest.d/include.conf diff -Nru rsyslog-7.6.0/tests/testsuites/incltest.d/include.conf rsyslog-5.10.1/tests/testsuites/incltest.d/include.conf --- rsyslog-7.6.0/tests/testsuites/incltest.d/include.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/incltest.d/include.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -$template outfmt,"%msg:F,58:2%\n" -:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/incltest_dir.conf rsyslog-5.10.1/tests/testsuites/incltest_dir.conf --- rsyslog-7.6.0/tests/testsuites/incltest_dir.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/incltest_dir.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# see .sh file for description -# rgerhards, 2009-11-30 -$IncludeConfig diag-common.conf - -$IncludeConfig testsuites/incltest.d/ diff -Nru rsyslog-7.6.0/tests/testsuites/incltest_dir_empty_wildcard.conf rsyslog-5.10.1/tests/testsuites/incltest_dir_empty_wildcard.conf --- rsyslog-7.6.0/tests/testsuites/incltest_dir_empty_wildcard.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/incltest_dir_empty_wildcard.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# see .sh file for description -# rgerhards, 2009-11-30 -$IncludeConfig diag-common.conf - -# the following include leads to no files actually being included -# but MUST NOT abort rsyslog's startup sequence. No files matching -# the wildcard is valid (as long as the path exists)! -$IncludeConfig testsuites/incltest.d/*.conf-not-there - -$template outfmt,"%msg:F,58:2%\n" -:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/incltest_dir_wildcard.conf rsyslog-5.10.1/tests/testsuites/incltest_dir_wildcard.conf --- rsyslog-7.6.0/tests/testsuites/incltest_dir_wildcard.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/incltest_dir_wildcard.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -# see .sh file for description -# rgerhards, 2009-11-30 -$IncludeConfig diag-common.conf - -$IncludeConfig testsuites/incltest.d/*.conf diff -Nru rsyslog-7.6.0/tests/testsuites/manytcp-too-few-tls.conf rsyslog-5.10.1/tests/testsuites/manytcp-too-few-tls.conf --- rsyslog-7.6.0/tests/testsuites/manytcp-too-few-tls.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/manytcp-too-few-tls.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -# Test for tcp "flood" testing -# rgerhards, 2009-04-08 -$IncludeConfig diag-common.conf - -$ModLoad ../plugins/imtcp/.libs/imtcp -$MainMsgQueueTimeoutShutdown 10000 -$MaxOpenFiles 200 -$InputTCPMaxSessions 1100 -# certificates -$DefaultNetstreamDriverCAFile testsuites/x.509/ca.pem -$DefaultNetstreamDriverCertFile testsuites/x.509/client-cert.pem -$DefaultNetstreamDriverKeyFile testsuites/x.509/client-key.pem - -$DefaultNetstreamDriver gtls # use gtls netstream driver - -$InputTCPServerStreamDriverMode 1 -$InputTCPServerStreamDriverAuthMode anon -$InputTCPServerRun 13514 - -$template outfmt,"%msg:F,58:2%\n" -$template dynfile,"rsyslog.out.log" # trick to use relative path names! -:msg, contains, "msgnum:" ?dynfile;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/mmpstrucdata.conf rsyslog-5.10.1/tests/testsuites/mmpstrucdata.conf --- rsyslog-7.6.0/tests/testsuites/mmpstrucdata.conf 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/mmpstrucdata.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -$IncludeConfig diag-common.conf - -module(load="../plugins/mmpstrucdata/.libs/mmpstrucdata") -module(load="../plugins/imtcp/.libs/imtcp") - -template(name="outfmt" type="string" string="%$!rfc5424-sd!tcpflood@32473!msgnum%\n") - -input(type="imtcp" port="13514") - -action(type="mmpstrucdata") -if $msg contains "msgnum" then - action(type="omfile" template="outfmt" file="rsyslog.out.log") diff -Nru rsyslog-7.6.0/tests/testsuites/mysql-basic-cnf6.conf rsyslog-5.10.1/tests/testsuites/mysql-basic-cnf6.conf --- rsyslog-7.6.0/tests/testsuites/mysql-basic-cnf6.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/mysql-basic-cnf6.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -$IncludeConfig diag-common.conf - -$ModLoad ../plugins/ommysql/.libs/ommysql -if $msg contains 'msgnum' then { - action(type="ommysql" server="127.0.0.1" - db="Syslog" uid="rsyslog" pwd="testbench") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rfc5424parser.conf rsyslog-5.10.1/tests/testsuites/rfc5424parser.conf --- rsyslog-7.6.0/tests/testsuites/rfc5424parser.conf 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rfc5424parser.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -$IncludeConfig diag-common.conf - -module(load="../plugins/imtcp/.libs/imtcp") - -template(name="outfmt" type="string" string="%msg:F,58:2%\n") - -input(type="imtcp" port="13514") - -if $msg contains "msgnum" then - action(type="omfile" template="outfmt" file="rsyslog.out.log") diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_contains.conf rsyslog-5.10.1/tests/testsuites/rscript_contains.conf --- rsyslog-7.6.0/tests/testsuites/rscript_contains.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_contains.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -$IncludeConfig diag-common.conf - -$template outfmt,"%msg:F,58:2%\n" -if $msg contains 'msgnum' then ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_eq.conf rsyslog-5.10.1/tests/testsuites/rscript_eq.conf --- rsyslog-7.6.0/tests/testsuites/rscript_eq.conf 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_eq.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if $!usr!msgnum == "00005000" or - $!usr!msgnum == "00005001" or - $!usr!msgnum == "00005002" then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_field.conf rsyslog-5.10.1/tests/testsuites/rscript_field.conf --- rsyslog-7.6.0/tests/testsuites/rscript_field.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_field.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_ge.conf rsyslog-5.10.1/tests/testsuites/rscript_ge.conf --- rsyslog-7.6.0/tests/testsuites/rscript_ge.conf 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_ge.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if $!usr!msgnum >= "00005000" then - stop - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_gt.conf rsyslog-5.10.1/tests/testsuites/rscript_gt.conf --- rsyslog-7.6.0/tests/testsuites/rscript_gt.conf 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_gt.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if $!usr!msgnum > "00004999" then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_le.conf rsyslog-5.10.1/tests/testsuites/rscript_le.conf --- rsyslog-7.6.0/tests/testsuites/rscript_le.conf 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_le.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if $!usr!msgnum <= "00005000" then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_lt.conf rsyslog-5.10.1/tests/testsuites/rscript_lt.conf --- rsyslog-7.6.0/tests/testsuites/rscript_lt.conf 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_lt.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if $!usr!msgnum < "00005000" then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_ne.conf rsyslog-5.10.1/tests/testsuites/rscript_ne.conf --- rsyslog-7.6.0/tests/testsuites/rscript_ne.conf 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_ne.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if $!usr!msgnum != "00005000" and - $!usr!msgnum != "00005001" and - $!usr!msgnum != "00005002" then - set $!usr!write = 0; - else - set $!usr!write = 1; - if $!usr!write == 1 then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_optimizer1.conf rsyslog-5.10.1/tests/testsuites/rscript_optimizer1.conf --- rsyslog-7.6.0/tests/testsuites/rscript_optimizer1.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_optimizer1.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="msg" field.delimiter="58" field.number="2") - constant(value="\n") -} - -/* tcpflood uses local4.=debug */ -if prifilt("syslog.*") then - stop # it actually doesn't matter what we do here -else - action(type="omfile" file="./rsyslog.out.log" template="outfmt") diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_prifilt.conf rsyslog-5.10.1/tests/testsuites/rscript_prifilt.conf --- rsyslog-7.6.0/tests/testsuites/rscript_prifilt.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_prifilt.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="msg" field.delimiter="58" field.number="2") - constant(value="\n") -} - -/* tcpflood uses local4.=debug, we use a bit more generic filter */ -if prifilt("local4.*") then - action(type="omfile" file="./rsyslog.out.log" template="outfmt") diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_ruleset_call.conf rsyslog-5.10.1/tests/testsuites/rscript_ruleset_call.conf --- rsyslog-7.6.0/tests/testsuites/rscript_ruleset_call.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_ruleset_call.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="msg" field.delimiter="58" field.number="2") - constant(value="\n") -} - - -# we deliberately include continue/stop to make sure we have more than -# one statement. This catches grammar erorrs -ruleset(name="rs2") { - continue - action(type="omfile" file="./rsyslog.out.log" template="outfmt") - stop -} - -# this time we make sure a single statement is properly supported -ruleset(name="rs1") { - call rs2 -} - -if $msg contains 'msgnum' then call rs1 diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_stop2.conf rsyslog-5.10.1/tests/testsuites/rscript_stop2.conf --- rsyslog-7.6.0/tests/testsuites/rscript_stop2.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_stop2.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if not ($msg contains 'msgnum') then - stop - -set $!usr!msgnum = field($msg, 58, 2); -if cnum($!usr!msgnum) >= 5000 then - stop -/* We could use yet another method, but we like to have the action statement - * without a filter in rsyslog.conf top level hierarchy - so this test, as - * a side-effect, also tests this ability. - */ -action(type="omfile" file="./rsyslog.out.log" template="outfmt") diff -Nru rsyslog-7.6.0/tests/testsuites/rscript_stop.conf rsyslog-5.10.1/tests/testsuites/rscript_stop.conf --- rsyslog-7.6.0/tests/testsuites/rscript_stop.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rscript_stop.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -$IncludeConfig diag-common.conf - -template(name="outfmt" type="list") { - property(name="$!usr!msgnum") - constant(value="\n") -} - -if $msg contains 'msgnum' then { - set $!usr!msgnum = field($msg, 58, 2); - if cnum($!usr!msgnum) >= 5000 then - stop - action(type="omfile" file="./rsyslog.out.log" template="outfmt") -} diff -Nru rsyslog-7.6.0/tests/testsuites/rs_optimizer_pri.conf rsyslog-5.10.1/tests/testsuites/rs_optimizer_pri.conf --- rsyslog-7.6.0/tests/testsuites/rs_optimizer_pri.conf 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/rs_optimizer_pri.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -$IncludeConfig diag-common.conf -template(name="outfmt" type="string" string="%msg:F,58:2%\n") - -module(load="../plugins/imtcp/.libs/imtcp") -input(type="imtcp" port="13514") - -if $syslogfacility-text == "local4" then - action(type="omfile" template="outfmt" file="rsyslog.out.log") diff -Nru rsyslog-7.6.0/tests/testsuites/stop-localvar.conf rsyslog-5.10.1/tests/testsuites/stop-localvar.conf --- rsyslog-7.6.0/tests/testsuites/stop-localvar.conf 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/stop-localvar.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* note: variables are strings (at least in v7), so we need to convert - * to a number when we check the conditon. - * Even if we change the variable representation at some later point, - * we should NOT change this test here, but better add a new one. - * rgerhards, 2013-11-19 - */ -$IncludeConfig diag-common.conf -template(name="outfmt" type="string" string="%$.nbr%\n") - -module(load="../plugins/imtcp/.libs/imtcp") -input(type="imtcp" port="13514") - -if $msg contains "msgnum:" then { - set $.nbr = field($msg, 58, 2); - if cnum($.nbr) < 100 then - stop - /* check is intentionally more complex than needed! */ - else if not (cnum($.nbr) > 999) then { - action(type="omfile" file="rsyslog.out.log" template="outfmt") - } -} diff -Nru rsyslog-7.6.0/tests/testsuites/stop-msgvar.conf rsyslog-5.10.1/tests/testsuites/stop-msgvar.conf --- rsyslog-7.6.0/tests/testsuites/stop-msgvar.conf 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/stop-msgvar.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* note: variables are strings (at least in v7), so we need to convert - * to a number when we check the conditon. - * Even if we change the variable representation at some later point, - * we should NOT change this test here, but better add a new one. - * rgerhards, 2013-11-19 - */ -$IncludeConfig diag-common.conf -template(name="outfmt" type="string" string="%$!nbr%\n") - -module(load="../plugins/imtcp/.libs/imtcp") -input(type="imtcp" port="13514") - -if $msg contains "msgnum:" then { - set $!nbr = field($msg, 58, 2); - if cnum($!nbr) < 100 then - stop - /* check is intentionally more complex than needed! */ - else if not (cnum($!nbr) > 999) then { - action(type="omfile" file="rsyslog.out.log" template="outfmt") - } -} diff -Nru rsyslog-7.6.0/tests/testsuites/udp-msgreduc-orgmsg-vg.conf rsyslog-5.10.1/tests/testsuites/udp-msgreduc-orgmsg-vg.conf --- rsyslog-7.6.0/tests/testsuites/udp-msgreduc-orgmsg-vg.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/udp-msgreduc-orgmsg-vg.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# Test for queue disk mode (see .sh file for details) -# rgerhards, 2009-05-22 -$IncludeConfig diag-common.conf - -$ModLoad ../plugins/imudp/.libs/imudp -$UDPServerRun 13514 -$RepeatedMsgReduction on -$RepeatedMsgContainsOriginalMsg on - -$template outfmt,"%msg:F,58:2%\n" -*.* ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/udp-msgreduc-vg.conf rsyslog-5.10.1/tests/testsuites/udp-msgreduc-vg.conf --- rsyslog-7.6.0/tests/testsuites/udp-msgreduc-vg.conf 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/udp-msgreduc-vg.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# Test for queue disk mode (see .sh file for details) -# rgerhards, 2009-05-22 -$IncludeConfig diag-common.conf - -$ModLoad ../plugins/imudp/.libs/imudp -$UDPServerRun 13514 -$RepeatedMsgReduction on - -$template outfmt,"%msg:F,58:2%\n" -*.* ./rsyslog.out.log;outfmt -#:msg, contains, "msgnum:" ./rsyslog.out.log;outfmt diff -Nru rsyslog-7.6.0/tests/testsuites/x.509/ca-key.pem rsyslog-5.10.1/tests/testsuites/x.509/ca-key.pem --- rsyslog-7.6.0/tests/testsuites/x.509/ca-key.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/x.509/ca-key.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDZnIJGJH80j2DPBXdxgmFmBRMoBnpwQb8yhRJcJacaWigRAhp4 -wdo07rR+EpuBJHD/5ImIygUwCj/XWAs4JKm3LqK2ih1gUy/s6Tg2O5t3k11kdjEH -MKUxDOLs441dEwERPQtePEoy2POzViIyy959ZJorkdnwC4LBKdQVLEELlwIDAQAB -AoGAEQWvoRoAw1VF3tvQHJZ01Pyno3ViRX63HJYROhkN6b9MrAvsky6iyYo0nzoI -ZQE7P6EaaxNWdYwPs2IlOoaPqeos1sGVDaK/JFuja/DduoXBdCy9RFWRaugDX/1U -iMtjtu29euvegP0r2RIxaIl9dapF5alNH5MLMyBl7XTB+/kCQQDiwHnW8jS1paSc -/risF6Ie5rKuUfVDG8hqMEiKyczSHwUVYushwCclshjM6E1TBFZqMz/8PbFW51pK -OzFS2s6/AkEA9a4044RL3AWe37LIU4hbz2Y+auRvPh8x4i2cWLzdok8Rc1EHDGLN -eHBoOQ3Q2nQS94cOx6HxpRztzBgiwpTRKQJADX9BgV7nbkyO0N2EppG9j7NRvXiZ -bcYwlsmK99/tNjCsf8pkjpy+d8rzGPdW6vMeJbIpQ910OeUJhdOiKvllRwJBAIw3 -rP/dVd5xZseNpj/mp1+rnxwq3EK8UyAfoAgVYvlr3y3NpRQwn8yJezJ07CqB7QFR -F+JgTyZJaH7/l3cusGECQQCM3HmkADAKxX6RwKe8X0Kj/36rjXEMNoq0ZdXOB7Qz -f5N6og4Da9y/ZO+XMo6P3XR/TYIYrMD8nuoR33X69kb1 ------END RSA PRIVATE KEY----- diff -Nru rsyslog-7.6.0/tests/testsuites/x.509/ca.pem rsyslog-5.10.1/tests/testsuites/x.509/ca.pem --- rsyslog-7.6.0/tests/testsuites/x.509/ca.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/x.509/ca.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICyzCCAjagAwIBAgIESFo2XjALBgkqhkiG9w0BAQUwezELMAkGA1UEBhMCVVMx -EDAOBgNVBAoTB1NvbWVPcmcxDzANBgNVBAsTBlNvbWVPVTESMBAGA1UEBxMJU29t -ZXdoZXJlMQswCQYDVQQIEwJDQTEoMCYGA1UEAxMfc29tZU5hbWUgKG5vdCBuZWNl -c3NhcmlseSBETlMhKTAeFw0wODA2MTkxMDM1MTJaFw0xODA2MTcxMDM1MjVaMHsx -CzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdTb21lT3JnMQ8wDQYDVQQLEwZTb21lT1Ux -EjAQBgNVBAcTCVNvbWV3aGVyZTELMAkGA1UECBMCQ0ExKDAmBgNVBAMTH3NvbWVO -YW1lIChub3QgbmVjZXNzYXJpbHkgRE5TISkwgZwwCwYJKoZIhvcNAQEBA4GMADCB -iAKBgNmcgkYkfzSPYM8Fd3GCYWYFEygGenBBvzKFElwlpxpaKBECGnjB2jTutH4S -m4EkcP/kiYjKBTAKP9dYCzgkqbcuoraKHWBTL+zpODY7m3eTXWR2MQcwpTEM4uzj -jV0TARE9C148SjLY87NWIjLL3n1kmiuR2fALgsEp1BUsQQuXAgMBAAGjYzBhMA8G -A1UdEwEB/wQFMAMBAf8wHgYDVR0RBBcwFYETc29tZW9uZUBleGFtcGxlLm5ldDAP -BgNVHQ8BAf8EBQMDBwQAMB0GA1UdDgQWBBT7/paNEKc65bcNe0NIhsj4cpl7iTAL -BgkqhkiG9w0BAQUDgYEAlv9ge8Koways837OLoZIam0s7wQCcwd9rWE05caps7BU -T4bfgab9U/e9mmrf3V/zXmtU6y8hhTXF5AcZv3/EmCVwsPRotgrJ+rHXTv5e2PO7 -/8C3K2Lhc89gF4qf4xZwlZU70RasKgCzZa5ivS2Y8pW6LUu6eqqgVw3pPJbW3TE= ------END CERTIFICATE----- diff -Nru rsyslog-7.6.0/tests/testsuites/x.509/client-cert.pem rsyslog-5.10.1/tests/testsuites/x.509/client-cert.pem --- rsyslog-7.6.0/tests/testsuites/x.509/client-cert.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/x.509/client-cert.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICijCCAfWgAwIBAgIESFo7ITALBgkqhkiG9w0BAQUwezELMAkGA1UEBhMCVVMx -EDAOBgNVBAoTB1NvbWVPcmcxDzANBgNVBAsTBlNvbWVPVTESMBAGA1UEBxMJU29t -ZXdoZXJlMQswCQYDVQQIEwJDQTEoMCYGA1UEAxMfc29tZU5hbWUgKG5vdCBuZWNl -c3NhcmlseSBETlMhKTAeFw0wODA2MTkxMDU1MzJaFw0xMTAzMTYxMDU1MzlaMA0x -CzAJBgNVBAYTAlVTMIGcMAsGCSqGSIb3DQEBAQOBjAAwgYgCgYC+f6yCet2WJgmw -tgukOReI+avRHOfr2hLhIQkSzCOiNi0tNWMKmaQWw/D+y1FvLRq0wLDUyJK/36rB -67HKfscoNeClKTS8jhAs1mPjT57iyuoqK6VW/d2JoofklRCgDIZQrNfxHiOO+kN3 -ShLmkGqxkA3YyUty/JmF6PKWYIhQWQIDAQABo4GPMIGMMAwGA1UdEwEB/wQCMAAw -HQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMB0GA1UdEQQWMBSCEmNsaWVu -dC5leGFtcGxlLm5ldDAdBgNVHQ4EFgQUrDcwsuOF4RiHn0eboCplJSiUhfcwHwYD -VR0jBBgwFoAU+/6WjRCnOuW3DXtDSIbI+HKZe4kwCwYJKoZIhvcNAQEFA4GBAAAh -niy9ORW2AIb6lk/sa3iYczeYpGzxDM9bLZ1xSoIdoHM/v9gPG/WpAZ4ECHjx+Yk8 -4B/9gvaAmMi0FmcoIBQaEOe2P8tcIuzmum3N2F27F2+J4httiNDLJoseWVnXJUvS -dPyVOrKXdl5vVFpmViI5P+VzzMqbAQ6oNlMXIh6e ------END CERTIFICATE----- diff -Nru rsyslog-7.6.0/tests/testsuites/x.509/client-key.pem rsyslog-5.10.1/tests/testsuites/x.509/client-key.pem --- rsyslog-7.6.0/tests/testsuites/x.509/client-key.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/x.509/client-key.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQC+f6yCet2WJgmwtgukOReI+avRHOfr2hLhIQkSzCOiNi0tNWMK -maQWw/D+y1FvLRq0wLDUyJK/36rB67HKfscoNeClKTS8jhAs1mPjT57iyuoqK6VW -/d2JoofklRCgDIZQrNfxHiOO+kN3ShLmkGqxkA3YyUty/JmF6PKWYIhQWQIDAQAB -AoGAVxrM+BqTIJlC/Ay5lP1QAB9di3ACserUkCFJY1F5h63rCU1sfIfVKl2s3+x6 -z3GZ0QV8tccCpv5wN1x8vqEqkbOvddM3rzpGkEC5PoyfCzuQBun1wnHK/JKjrfk5 -PvcaP60eTNjHZC7w78gOJJCzgzsEMrndtE+55diPmqGVtXMCQQDTZBy5WK8gZwMO -rRz1BKKyBeMYMfTJoJafGfxp0H8AUbTa0V2eb+el3kuzPCm3FQ6IgaHyGj2WqkAw -M0bfAfdXAkEA5rLna1t+2SCtgSd1DotndA4EsH4skBq9kFeD2/8T6Pf13zmBOq6O -4aNEOhgBE/R9/MI4XoU9MbOlkZvKvDuXzwJADdWSb6rXIza6o34+0+Yuw5nRB+dV -DtD8qoLn2wDzHtE6Fcv35YOLVHac26kHTd0J63MYZyDCgRa5Rq5EaBnX1wJAQYRF -XKPbXmZ9X9SI1dyZQMhKZKUwmqw9caSo+e1zBhKFbSOzo6q3QTVQxv7SL4ybyxCN -WaqVOmw+dR+9b7+s2QJAdNAw3r418rWKFKJJNTSqSqr1sYqiKvrQL6w2dpdpAeY4 -3VDCz/7/F9AEn3R7K3fZLQ7W6M62LSEjxxc1Y3LIpQ== ------END RSA PRIVATE KEY----- diff -Nru rsyslog-7.6.0/tests/testsuites/x.509/machine-cert.pem rsyslog-5.10.1/tests/testsuites/x.509/machine-cert.pem --- rsyslog-7.6.0/tests/testsuites/x.509/machine-cert.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/x.509/machine-cert.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC7TCCAligAwIBAgIESFo4GTALBgkqhkiG9w0BAQUwezELMAkGA1UEBhMCVVMx -EDAOBgNVBAoTB1NvbWVPcmcxDzANBgNVBAsTBlNvbWVPVTESMBAGA1UEBxMJU29t -ZXdoZXJlMQswCQYDVQQIEwJDQTEoMCYGA1UEAxMfc29tZU5hbWUgKG5vdCBuZWNl -c3NhcmlseSBETlMhKTAeFw0wODA2MTkxMDQyNTRaFw0xMTAzMTYxMDQyNTdaMG8x -CzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdTb21lT3JnMQ8wDQYDVQQLEwZTb21lT1Ux -EjAQBgNVBAcTCVNvbWV3aGVyZTELMAkGA1UECBMCQ0ExHDAaBgNVBAMTE21hY2hp -bmUuZXhhbXBsZS5uZXQwgZwwCwYJKoZIhvcNAQEBA4GMADCBiAKBgLJOW6lIHv8u -c6Ez7tiir64vI3aRuDmUACPybyWtyWqrLebzYtg+borWHj9y5di54NB5wpQhZQsQ -U2awNqanzUYeLGqbecbuxuLtsKlZ4knax+PwHOBTmIcN1SjbpII27Toe0VwHE5Vd -sygFFyorto6OeNLPrIcTFfwXQ2sVw325AgMBAAGjgZAwgY0wDAYDVR0TAQH/BAIw -ADAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwHgYDVR0RBBcwFYITbWFj -aGluZS5leGFtcGxlLm5ldDAdBgNVHQ4EFgQUDOHD29GdMfoDWwev4uDvItkLKKww -HwYDVR0jBBgwFoAU+/6WjRCnOuW3DXtDSIbI+HKZe4kwCwYJKoZIhvcNAQEFA4GB -AMt1iED7QzFL2Qk6VivoFY15S2XGF8rJTd3l00bwyLA5qLyLBGlB6z4qkYu7/7SW -5r7tet+1DezgHrj/1eU289m410wnQB8fGwcVLp6OX2PAlhNmVLcsipiN6rielAcP -aIg/VlBtoCFp/ymTLKgvh6DLKWhRUkFPqO2WtcQ3UUo+ ------END CERTIFICATE----- diff -Nru rsyslog-7.6.0/tests/testsuites/x.509/machine-key.pem rsyslog-5.10.1/tests/testsuites/x.509/machine-key.pem --- rsyslog-7.6.0/tests/testsuites/x.509/machine-key.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/testsuites/x.509/machine-key.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQCyTlupSB7/LnOhM+7Yoq+uLyN2kbg5lAAj8m8lrclqqy3m82LY -Pm6K1h4/cuXYueDQecKUIWULEFNmsDamp81GHixqm3nG7sbi7bCpWeJJ2sfj8Bzg -U5iHDdUo26SCNu06HtFcBxOVXbMoBRcqK7aOjnjSz6yHExX8F0NrFcN9uQIDAQAB -AoGABHJs2c95Km8bpikX62I/VG5LiaD/wbvdtwfMWtm3PMhRKEHotLD169OERJvW -fK3CHCD1R+F/ViPNmLGLY2Oq/GqKjhKjg4sqAznw8TImBSgXCFho4sl38z+luP1o -TXFDgfV5HDDW1/F5kJlBIfXBLFdl4VO7E0ZnFt4FqSDRW2MCQQDRun/sBGM4i9hM -QdC+QwrdcgCScBpzbz4YXtI9TyGEqNahg8kXgIVUbzDdRmG68G2M98USzRs5DWB7 -YvYwmRoPAkEA2aUdUpFRb/n7XfsAiFLYOk96C82iCCQpJi0si34zlCAEbCRbQ6zw -gVDMCMSccnnWrVzqtxfN+rXycFTNyDFTtwJAPRwymfrNTnSxGcczo7y1NcE6GXFA -w9HuLfuzFtov0g/AOl/EAG0abHfZrSAM6gOUaDbp3YiWHhGfw1QamB6EUQJAClTb -MnsxeXZNZ2Wt3crI9uOk8IB/a5GD3osQbUK9Yg+vBg8nweuoswrJ1LS4lHqSJUKe -5bgckAUpEAoGhrVIuwJBAKIuqx/cSjF4Oa9xT6DzBRe7vAlKFq62lUV5SLfoSEgY -L5dvPBgAD0Styglny1s0Bu5FTlkxlFOMvUAD/O5hsQw= ------END RSA PRIVATE KEY----- diff -Nru rsyslog-7.6.0/tests/threadingmq.sh rsyslog-5.10.1/tests/threadingmq.sh --- rsyslog-7.6.0/tests/threadingmq.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/threadingmq.sh 2012-09-18 15:03:58.000000000 +0000 @@ -11,9 +11,6 @@ source $srcdir/diag.sh startup threadingmq.conf source $srcdir/diag.sh injectmsg 0 100000 source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -# we give an extra seconds for things to settle, especially -# important on slower test machines -./msleep 1000 source $srcdir/diag.sh wait-shutdown source $srcdir/diag.sh seq-check 0 99999 source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/tls-certs/ca-key.pem rsyslog-5.10.1/tests/tls-certs/ca-key.pem --- rsyslog-7.6.0/tests/tls-certs/ca-key.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/tls-certs/ca-key.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDDaz5X5YIruPH0wukMPik7xIKqrpCcr8Gm28oz5h4GtX253eWr -piBuk2a/f/CKDjeuqmiWqTs90PFNb+Z1c+Yzvagqv80VzZwDI4RcrwlNaKrBz/9X -iowCcoV8s7GvV2vtZEPSThNzz4FYkxCMvbOYZeJIYQVhZggUcuadfhmDIwIDAQAB -AoGAIG5AUD2jmYDzD+UhiultVgtkifyNaEtsuQsZu/zbt85P2VQ0z4SINlbvrXvc -iJ9tEzzEPa3udHGj/MTDe3OAB4TK5tImX1pe2gw+zaOB/DaH5i4QhXeltU7epCHF -oUv9EVNzL8Bl00MFiWcLY0LisQVfHeW5rcN9U7EbvTlWbRkCQQDR2/Qn1ceavwDU -qYt2TbEicJVC8aQMYYyc6Xvi4mZaNa8gGCpWpurgQop0Ln0QE8vA0601UVs6N3tm -g8FJ8rXpAkEA7mKCtp2MXCbHMdkZCyQt6drUYCyU9N/HtmBEtFGpqt1PdMyUI07m -rlVFDwUH9JFmg18RP1X2ufj7+ZbJzaMtKwJBAJgbw1Z0P19Mfj+mPC2dlnyN+cIx -/2Px+Mdq/J6w1tsf+jVbDqUMC0ZNNKmNYJycnJzBUNRKicMin9DoQttkjrECQQCC -s/aRY+6adBSRi0QE7NBTwUzicm81mCDrKPtilsfdTDyNgMHUXiVy/oO/yXVkLfi0 -HQLa5CpEK3UUkw2Qt2BDAkA0XXvQzW0+tEHiktLNljIluhiyOAx2bBywY/9Qmn6C -hv4sOSCzTR39jNmuNZ0X6ZZvt4VsWTHhpche/ud1+3p6 ------END RSA PRIVATE KEY----- diff -Nru rsyslog-7.6.0/tests/tls-certs/ca.pem rsyslog-5.10.1/tests/tls-certs/ca.pem --- rsyslog-7.6.0/tests/tls-certs/ca.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/tls-certs/ca.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICYjCCAc2gAwIBAgIBATALBgkqhkiG9w0BAQUwWDELMAkGA1UEBhMCREUxHTAb -BgNVBAoTFHJzeXNsb2cgdGVzdCByb290IENBMQswCQYDVQQLEwJDQTEdMBsGA1UE -AxMUcnN5c2xvZy10ZXN0LXJvb3QtY2EwHhcNMDgwNTIwMTI1ODEyWhcNMTgwNTE4 -MTI1ODI0WjBYMQswCQYDVQQGEwJERTEdMBsGA1UEChMUcnN5c2xvZyB0ZXN0IHJv -b3QgQ0ExCzAJBgNVBAsTAkNBMR0wGwYDVQQDExRyc3lzbG9nLXRlc3Qtcm9vdC1j -YTCBnDALBgkqhkiG9w0BAQEDgYwAMIGIAoGAw2s+V+WCK7jx9MLpDD4pO8SCqq6Q -nK/BptvKM+YeBrV9ud3lq6YgbpNmv3/wig43rqpolqk7PdDxTW/mdXPmM72oKr/N -Fc2cAyOEXK8JTWiqwc//V4qMAnKFfLOxr1dr7WRD0k4Tc8+BWJMQjL2zmGXiSGEF -YWYIFHLmnX4ZgyMCAwEAAaNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNVHQ8BAf8E -BQMDBwYAMB0GA1UdDgQWBBQzYQQgUm0YLNdarJnc2c1LxYVClDALBgkqhkiG9w0B -AQUDgYEAuGWtH7Jkpa0n/izqQ5ddDQP/LT6taivCwlpEYEU9aumpQPWWxtYywKaP -RfM1JTMLAiYd8MS7TJ8TYRvvR32Y02Y+OhXn11xERkWvBT2M9yzqX6hDfRueN7RT -fPWsfm/NBTVojzjaECcTFenZid7PC5JiFbcU6PSUMZ49/JPhxAo= ------END CERTIFICATE----- diff -Nru rsyslog-7.6.0/tests/tls-certs/cert.pem rsyslog-5.10.1/tests/tls-certs/cert.pem --- rsyslog-7.6.0/tests/tls-certs/cert.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/tls-certs/cert.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChjCCAfGgAwIBAgIBADALBgkqhkiG9w0BAQUwWDELMAkGA1UEBhMCREUxHTAb -BgNVBAoTFHJzeXNsb2cgdGVzdCByb290IENBMQswCQYDVQQLEwJDQTEdMBsGA1UE -AxMUcnN5c2xvZy10ZXN0LXJvb3QtY2EwHhcNMDgwNTIwMTMwNDE5WhcNMTgwNTE4 -MTMwNDI2WjA6MQswCQYDVQQGEwJERTEQMA4GA1UEChMHcnN5c2xvZzEZMBcGA1UE -CxMQdGVzdCBjZXJ0aWZpY2F0ZTCBnDALBgkqhkiG9w0BAQEDgYwAMIGIAoGAxmHe -fztJgaGxFYEceiUg0hdMlRVWBqoZelJ8BeXTDnXcu/5F2HtM+l+QDyDaGjKlx+NI -K4rkj7d6Wd3AKPgOYS0VSDZe3a1xf9rRYzOthWTv7tYi4/LTqPXqN5lKE71dgrB/ -/gOmvV/1YD776FIxVGCSAT0hHwkFC3slmpJSwD8CAwEAAaOBhDCBgTAMBgNVHRMB -Af8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATASBgNVHREECzAJ -ggdyc3lzbG9nMB0GA1UdDgQWBBQYu6eC9UALvC+5K5VOnFRi5OC98TAfBgNVHSME -GDAWgBQzYQQgUm0YLNdarJnc2c1LxYVClDALBgkqhkiG9w0BAQUDgYEAXaymqsG9 -PNBhhWIRFvXCDMaDM71vUtgSFoNUbxIV607ua2HQosPPM4EHIda6N6hdBK1bMQoG -yqBwhvw0JVaVaO70Kbs2m2Ypk3YcpJtRqyp8q8+2y/w1Mk1QazFZC29aYgX2iNVf -X4/x38YEL7Gu5vqPrTn++agnV4ZXECKuvLQ= ------END CERTIFICATE----- diff -Nru rsyslog-7.6.0/tests/tls-certs/key.pem rsyslog-5.10.1/tests/tls-certs/key.pem --- rsyslog-7.6.0/tests/tls-certs/key.pem 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/tls-certs/key.pem 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQDGYd5/O0mBobEVgRx6JSDSF0yVFVYGqhl6UnwF5dMOddy7/kXY -e0z6X5APINoaMqXH40griuSPt3pZ3cAo+A5hLRVINl7drXF/2tFjM62FZO/u1iLj -8tOo9eo3mUoTvV2CsH/+A6a9X/VgPvvoUjFUYJIBPSEfCQULeyWaklLAPwIDAQAB -AoGARIwKqmHc+0rYenq7UUVE+vMMBjNyHyllVkvsCMmpzMRS+i5ZCf1I0vZ0O5X5 -ZrX7bH8PL+R1J2eZgjXKMR3NMZBuyKHewItD9t2rIC0eD/ITlwq3VybbaMsw666e -INxSmax+dS5CEcLevHHP3c+Q7S7QAFiWV43TdFUGXWJktIkCQQDPQ5WAZ+/Tvv0Q -vtRjXMeTVaw/bSuKNUeDzFkmGyePnFeCReNFtJLE9PFSQWcPuYcbZgU59JTfA5ac -Un+cHm31AkEA9Qek+q7PcJ+kON9E6SNodCZn6gLyHjnWrq4tf8pZO3NvoX2QiuD4 -rwF7KWjr6q1JzADpLtwXnuYEhyiLFjJA4wJAcElMCEnG2y+ASH8p7z7HfKGQdLg/ -O1wMB3JA5e0WLK5lllUogI4IaZ3N02NNY25+rLBDqpc/w+ZcxQnIypqNtQJATs9p -ofON5wSB1oUBbhckZo9fxuWxqEUkJsUA/2Q+9R843XE8h166vdc1HOmRT8bywHne -hmLl+gazmCFTMw1wzwJAHng+3zGUl4D8Ov3MPFD6hwYYK6/pEdtz/NUsCSazF7eK -XuuP+DXPHNhXOuF1A3tP74pfc/fC1uCUH2G5z3Fy0Q== ------END RSA PRIVATE KEY----- diff -Nru rsyslog-7.6.0/tests/udp-msgreduc-orgmsg-vg.sh rsyslog-5.10.1/tests/udp-msgreduc-orgmsg-vg.sh --- rsyslog-7.6.0/tests/udp-msgreduc-orgmsg-vg.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/udp-msgreduc-orgmsg-vg.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -# check if valgrind violations occur. Correct output is not checked. -# added 2011-03-01 by Rgerhards -# This file is part of the rsyslog project, released under GPLv3 -echo =============================================================================== -echo \[udp-msgreduc-orgmsg-vg.sh\]: testing msg reduction via udp, with org message -source $srcdir/diag.sh init -source $srcdir/diag.sh startup-vg udp-msgreduc-orgmsg-vg.conf -source $srcdir/diag.sh wait-startup -./tcpflood -t 127.0.0.1 -m 4 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ..." -./tcpflood -t 127.0.0.1 -m 1 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ...x" -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown-vg -if [ "$RSYSLOGD_EXIT" -eq "10" ] -then - echo "udp-msgreduc-orgmsg-vg.sh FAILED" - exit 1 -fi -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/udp-msgreduc-vg.sh rsyslog-5.10.1/tests/udp-msgreduc-vg.sh --- rsyslog-7.6.0/tests/udp-msgreduc-vg.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/udp-msgreduc-vg.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -# check if valgrind violations occur. Correct output is not checked. -# added 2011-03-01 by Rgerhards -# This file is part of the rsyslog project, released under GPLv3 -echo =============================================================================== -echo \[udp-msgreduc-vg.sh\]: testing imtcp multiple listeners -source $srcdir/diag.sh init -source $srcdir/diag.sh startup-vg udp-msgreduc-vg.conf -source $srcdir/diag.sh wait-startup -./tcpflood -t 127.0.0.1 -m 4 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ..." -./tcpflood -t 127.0.0.1 -m 1 -r -Tudp -M "<133>2011-03-01T11:22:12Z host tag msgh ...x" -source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages -source $srcdir/diag.sh wait-shutdown-vg -if [ "$RSYSLOGD_EXIT" -eq "10" ] -then - echo "udp-msgreduc-vg.sh FAILED" - exit 1 -fi -source $srcdir/diag.sh exit diff -Nru rsyslog-7.6.0/tests/validation-run.sh rsyslog-5.10.1/tests/validation-run.sh --- rsyslog-7.6.0/tests/validation-run.sh 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tests/validation-run.sh 2012-10-17 14:41:20.000000000 +0000 @@ -25,19 +25,16 @@ echo "testing a failed configuration verification run" ../tools/rsyslogd -dn -u2 -c4 -N1 -f$srcdir/testsuites/invalid.conf -M../runtime/.libs:../.libs if [ $? -ne 1 ]; then - echo "after test 1: return code ne 1" exit 1 fi echo testing a valid config verification run ../tools/rsyslogd -u2 -c4 -N1 -f$srcdir/testsuites/valid.conf -M../runtime/.libs:../.libs if [ $? -ne 0 ]; then - echo "after test 2: return code ne 0" exit 1 fi echo testing empty config file ../tools/rsyslogd -u2 -c4 -N1 -f/dev/null -M../runtime/.libs:../.libs if [ $? -ne 1 ]; then - echo "after test 3: return code ne 1" exit 1 fi echo SUCCESS: validation run tests diff -Nru rsyslog-7.6.0/threads.c rsyslog-5.10.1/threads.c --- rsyslog-7.6.0/threads.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/threads.c 2012-10-17 14:41:20.000000000 +0000 @@ -31,16 +31,12 @@ #include #include #include -#if HAVE_SYS_PRCTL_H -# include -#endif #include "rsyslog.h" #include "dirty.h" #include "linkedlist.h" #include "threads.h" #include "srUtils.h" -#include "unicode-helper.h" /* linked list of currently-known threads */ static linkedList_t llThrds; @@ -81,7 +77,6 @@ } pthread_mutex_destroy(&pThis->mutThrd); pthread_cond_destroy(&pThis->condThrdTerm); - free(pThis->name); free(pThis); RETiRet; @@ -100,8 +95,7 @@ DEFiRet; assert(pThis != NULL); - DBGPRINTF("request term via SIGTTIN for input thread '%s' 0x%x\n", - pThis->name, (unsigned) pThis->thrdID); + DBGPRINTF("request term via SIGTTIN for input thread 0x%x\n", (unsigned) pThis->thrdID); pThis->bShallStop = RSTRUE; do { d_pthread_mutex_lock(&pThis->mutThrd); @@ -111,11 +105,11 @@ d_pthread_mutex_unlock(&pThis->mutThrd); if(Debug) { if(ret == ETIMEDOUT) { - dbgprintf("input thread term: timeout expired waiting on thread %s termination - canceling\n", pThis->name); + dbgprintf("input thread term: timeout expired waiting on thread termination - canceling\n"); pthread_cancel(pThis->thrdID); pThis->bIsActive = 0; } else if(ret == 0) { - dbgprintf("input thread term: thread %s returned normally and is terminated\n", pThis->name); + dbgprintf("input thread term: thread returned normally and is terminated\n"); } else { char errStr[1024]; int err = errno; @@ -125,8 +119,7 @@ } } } while(pThis->bIsActive); - DBGPRINTF("non-cancel input thread termination succeeded for thread %s 0x%x\n", - pThis->name, (unsigned) pThis->thrdID); + DBGPRINTF("non-cancel input thread termination succeeded for thread 0x%x\n", (unsigned) pThis->thrdID); RETiRet; } @@ -176,25 +169,10 @@ { DEFiRet; thrdInfo_t *pThis = (thrdInfo_t*) arg; -# if HAVE_PRCTL && defined PR_SET_NAME - uchar thrdName[32] = "in:"; -# endif assert(pThis != NULL); assert(pThis->pUsrThrdMain != NULL); -# if HAVE_PRCTL && defined PR_SET_NAME - ustrncpy(thrdName+3, pThis->name, 20); - dbgOutputTID((char*)thrdName); - - /* set thread name - we ignore if the call fails, has no harsh consequences... */ - if(prctl(PR_SET_NAME, thrdName, 0, 0, 0) != 0) { - DBGPRINTF("prctl failed, not setting thread name for '%s'\n", pThis->name); - } else { - DBGPRINTF("set thread name to '%s'\n", thrdName); - } -# endif - /* block all signals */ sigset_t sigSet; sigfillset(&sigSet); @@ -211,8 +189,7 @@ */ iRet = pThis->pUsrThrdMain(pThis); - dbgprintf("thrdStarter: usrThrdMain %s - 0x%lx returned with iRet %d, exiting now.\n", - pThis->name, (unsigned long) pThis->thrdID, iRet); + dbgprintf("thrdStarter: usrThrdMain 0x%lx returned with iRet %d, exiting now.\n", (unsigned long) pThis->thrdID, iRet); /* signal master control that we exit (we do the mutex lock mostly to * keep the thread debugger happer, it would not really be necessary with @@ -231,7 +208,7 @@ * executing threads. It is added at the end of the list. * rgerhards, 2007-12-14 */ -rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), sbool bNeedsCancel, uchar *name) +rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), sbool bNeedsCancel) { DEFiRet; thrdInfo_t *pThis; @@ -243,7 +220,6 @@ pThis->pUsrThrdMain = thrdMain; pThis->pAfterRun = afterRun; pThis->bNeedsCancel = bNeedsCancel; - pThis->name = ustrdup(name); pthread_create(&pThis->thrdID, #ifdef HAVE_PTHREAD_SETSCHEDPARAM &default_thread_attr, diff -Nru rsyslog-7.6.0/threads.h rsyslog-5.10.1/threads.h --- rsyslog-7.6.0/threads.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/threads.h 2012-10-17 14:41:20.000000000 +0000 @@ -32,7 +32,6 @@ rsRetVal (*pAfterRun)(struct thrdInfo*); /* cleanup function */ pthread_t thrdID; sbool bNeedsCancel; /* must input be terminated by pthread_cancel()? */ - uchar *name; /* a thread name, mainly for user interaction */ }; /* prototypes */ @@ -40,7 +39,7 @@ rsRetVal thrdInit(void); rsRetVal thrdTerminate(thrdInfo_t *pThis); rsRetVal thrdTerminateAll(void); -rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), sbool, uchar*); +rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), sbool); /* macros (replace inline functions) */ diff -Nru rsyslog-7.6.0/tools/logctl.c rsyslog-5.10.1/tools/logctl.c --- rsyslog-7.6.0/tools/logctl.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/logctl.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,456 +0,0 @@ -/** - * logctl - a tool to access lumberjack logs in MongoDB - * ... and potentially other sources in the future. - * - * Copyright 2012 Ulrike Gerhards and Adiscon GmbH. - * - * long short - - * level l read records with level x - * severity s read records with severity x - * ret r number of records to return - * skip k number of records to skip - * sys y read records of system x - * msg m read records with message containing x - * datef f read records starting on time received x - * dateu u read records until time received x - * - * examples: - * - * logctl -f 15/05/2012-12:00:00 -u 15/05/2012-12:37:00 - * logctl -s 50 --ret 10 - * logctl -m "closed" - * logctl -l "INFO" - * logctl -s 3 - * logctl -y "ubuntu" - * - * This file is part of rsyslog. - * - * Rsyslog 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. - * - * Rsyslog 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 Rsyslog. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#define N 80 - -static struct option long_options[] = -{ - {"level", required_argument, NULL, 'l'}, - {"severity", required_argument, NULL, 's'}, - {"ret", required_argument, NULL, 'r'}, - {"skip", required_argument, NULL, 'k'}, - {"sys", required_argument, NULL, 'y'}, - {"msg", required_argument, NULL, 'm'}, - {"datef", required_argument, NULL, 'f'}, - {"dateu", required_argument, NULL, 'u'}, - {NULL, 0, NULL, 0} -}; - -struct queryopt -{ - gint32 e_sever; - gint32 e_ret; - gint32 e_skip; - char *e_date; - char *e_level; - char *e_msg; - char *e_sys; - char *e_dateu; - int bsever; - int blevel; - int bskip; - int bret; - int bsys; - int bmsg; - int bdate; - int bdatef; - int bdateu; -}; - -struct ofields -{ - const char *msg; - const char *syslog_tag; - const char *prog; - char *date; - gint64 date_r; -}; - -struct query_doc -{ - bson *query; -}; - -struct select_doc -{ - bson *select; -}; - -struct db_connect -{ - mongo_sync_connection *conn; -}; - -struct output -{ - mongo_packet *p; -}; - -struct db_cursor -{ - mongo_sync_cursor *cursor; -}; - -struct results -{ - bson *result; -}; - - - -void formater(struct ofields *fields) -{ - time_t rtime; - rtime = (time_t) (fields->date_r / 1000); - char str[N]; - strftime(str, N, "%b %d %H:%M:%S", gmtime(&rtime)); - printf("%s %s %s %s\n", str, fields->prog, fields->syslog_tag, fields->msg); - -} - -struct ofields* get_data(struct results *res) -{ - struct ofields *fields; - const char *msg; - const char *prog; - const char *syslog_tag; - gint64 date_r; - bson_cursor *c; - - fields = malloc(sizeof(struct ofields)); - - c = bson_find (res->result, "msg"); - if (!bson_cursor_get_string (c, &msg)) - { - perror ("bson_cursor_get_string()"); - exit (1); - } - bson_cursor_free (c); - - c = bson_find (res->result, "sys"); - if (!bson_cursor_get_string (c, &prog)) - { - perror ("bson_cursor_get_string()"); - exit (1); - } - bson_cursor_free (c); - - c = bson_find (res->result, "syslog_tag"); - if (!bson_cursor_get_string (c, &syslog_tag)) - { - perror ("bson_cursor_get_string()"); - exit (1); - } - bson_cursor_free (c); - - c = bson_find (res->result, "time_rcvd"); - if (!bson_cursor_get_utc_datetime (c, &date_r)) - { - perror ("bson_cursor_get_utc_datetime()"); - exit (1); - } - - bson_cursor_free (c); - fields->msg = msg; - fields->prog = prog; - fields->syslog_tag = syslog_tag; - fields->date_r = date_r; - - return fields; - -} - -void getoptions(int argc, char *argv[], struct queryopt *opt) -{ - int iarg; - while ((iarg = getopt_long(argc, argv, "l:s:r:k:y:f:u:m:", long_options, NULL)) != -1) - { - // check to see if a single character or long option came through - switch (iarg) - { - // short option 's' - case 's': - opt->bsever = 1; - opt->e_sever = atoi(optarg); - break; - // short option 'r' - case 'r': - opt->bret = 1; - opt->e_ret = atoi(optarg); - break; - // short option 'f' : date from - case 'f': - opt->bdate = 1; - opt->bdatef = 1; - opt->e_date = optarg; - break; - // short option 'u': date until - case 'u': - opt->bdate = 1; - opt->bdateu = 1; - opt->e_dateu = optarg; - break; - // short option 'k' - case 'k': - opt->bskip = 1; - opt->e_skip = atoi(optarg); - break; - // short option 'l' - case 'l': - opt->blevel = 1; - opt->e_level = optarg; - break; - // short option 'm' - case 'm': - opt->bmsg = 1; - opt->e_msg = optarg; - break; - // short option 'y' - case 'y': - opt->bsys = 1; - opt->e_sys = optarg; - break; - } // end switch iarg - } // end while - -} // end void getoptions - -struct select_doc* create_select() -// BSON object indicating the fields to return -{ - struct select_doc *s_doc; - s_doc = malloc(sizeof(struct select_doc)); - s_doc->select = bson_new (); - bson_append_string (s_doc->select, "syslog_tag", "s", -1); - bson_append_string (s_doc->select, "msg", "ERROR", -1); - bson_append_string (s_doc->select, "sys", "sys", -1); - bson_append_utc_datetime (s_doc->select, "time_rcvd", 1ll); - bson_finish (s_doc->select); - return s_doc; -} - -struct query_doc* create_query(struct queryopt *opt) -{ - struct query_doc *qu_doc; - bson *query_what, *order_what, *msg_what, *date_what; - struct tm tm; - time_t t; - gint64 ts; - qu_doc = malloc(sizeof(struct query_doc)); - qu_doc->query = bson_new (); - - query_what = bson_new (); - if (opt->bsever == 1) - { - bson_append_int32 (query_what, "syslog_sever", opt->e_sever); - } - if (opt->blevel == 1) - { - bson_append_string (query_what, "level", opt->e_level, -1); - } - - if (opt->bmsg == 1) - { - msg_what = bson_new (); - bson_append_string (msg_what, "$regex", opt->e_msg, -1); - bson_append_string (msg_what, "$options", "i", -1); - bson_finish (msg_what); - bson_append_document (query_what, "msg", msg_what); - } - - if (opt->bdate == 1) - { - date_what = bson_new (); - if (opt->bdatef == 1) - { - tm.tm_isdst = -1; - strptime(opt->e_date, "%d/%m/%Y-%H:%M:%S", &tm); - tm.tm_hour = tm.tm_hour + 1; - t = mktime(&tm); - ts = 1000 * (gint64) t; - - bson_append_utc_datetime (date_what,"$gt", ts) ; - } - - if (opt->bdateu == 1) - { - tm.tm_isdst = -1; - strptime(opt->e_dateu, "%d/%m/%Y-%H:%M:%S", &tm); - tm.tm_hour = tm.tm_hour +1; - t = mktime(&tm); - ts = 1000 * (gint64) t; - bson_append_utc_datetime (date_what,"$lt", ts); - - } - bson_finish (date_what); - bson_append_document (query_what, "time_rcvd", date_what); - } - - if (opt->bsys == 1) - { - bson_append_string (query_what, "sys", opt->e_sys, -1); - } - - bson_finish (query_what); - - order_what = bson_new (); - bson_append_utc_datetime (order_what, "time_rcvd", 1ll); - bson_finish (order_what); - - bson_append_document (qu_doc->query, "$query", query_what); - bson_append_document (qu_doc->query, "$orderby", order_what); - bson_finish (qu_doc->query); - bson_free (order_what); - return qu_doc; -} - -struct db_connect* create_conn() -{ - struct db_connect *db_conn; - db_conn = malloc(sizeof(struct db_connect)); - db_conn->conn = mongo_sync_connect ("localhost", 27017, TRUE); - - if (!db_conn->conn) - { - perror ("mongo_sync_connect()"); - exit (1); - } - return db_conn; -} - -void close_conn(struct db_connect *db_conn) -{ - mongo_sync_disconnect (db_conn->conn); -} - -void free_cursor(struct db_cursor *db_c) -{ - mongo_sync_cursor_free (db_c->cursor); -} - -struct output* launch_query(struct queryopt *opt, struct select_doc *s_doc, - struct query_doc *qu_doc, - struct db_connect *db_conn) -{ - struct output *out; - out = malloc(sizeof(struct output)); - out->p = mongo_sync_cmd_query (db_conn->conn, "syslog.log", 0, - opt->e_skip, opt->e_ret, qu_doc->query, s_doc->select); - if (!out->p) - { - perror ("mongo_sync_cmd_query()"); - printf("no records found\n"); - exit (1); - } - return out; -} - -struct db_cursor* open_cursor(struct db_connect *db_conn, struct output *out) -{ - struct db_cursor *db_c; - db_c = malloc(sizeof(struct db_cursor)); - - db_c->cursor = mongo_sync_cursor_new (db_conn->conn, "syslog.log", out->p); - if (!db_c->cursor) - { - perror ("mongo_sync_cursor_new()"); - exit (1); - } - return db_c; -} - -struct results* read_data(struct db_cursor *db_c) -{ - struct results *res; - res = malloc(sizeof(struct results)); - res->result = mongo_sync_cursor_get_data (db_c->cursor); - if (!res->result) - { - perror ("mongo_sync_cursor_get_data()"); - exit (1); - } - return res; -} - -gboolean cursor_next (struct db_cursor *db_c) -{ - if (!mongo_sync_cursor_next (db_c->cursor)) - return FALSE; - else - return TRUE; - -} - -int main (int argc, char *argv[]) -{ - - struct queryopt opt; - struct ofields *fields; - struct select_doc *s_doc; - struct query_doc *qu_doc; - struct db_connect *db_conn; - struct output *out; - struct db_cursor *db_c; - struct results *res; - - opt.e_skip = 0; // standard - opt.e_ret = 0; // standard - opt.bsever = 0; - opt.blevel = 0; - opt.bdate = 0; - opt.bdateu = 0; - opt.bdatef = 0; - opt.bmsg = 0; - opt.bskip = 0; - opt.bsys = 0; - - getoptions(argc, argv, &opt); - qu_doc = create_query(&opt); // crate query - s_doc = create_select(); - db_conn = create_conn(); // create connection - out = launch_query(&opt, s_doc, qu_doc, db_conn); // launch the query - db_c = open_cursor(db_conn, out); // open cursor - - while (cursor_next(db_c)) - { - res = read_data(db_c); - fields = get_data(res); - formater(fields); // formate output - free(fields); - } - - free_cursor(db_c); - close_conn(db_conn); - - return (0); -} diff -Nru rsyslog-7.6.0/tools/Makefile.am rsyslog-5.10.1/tools/Makefile.am --- rsyslog-7.6.0/tools/Makefile.am 2014-02-12 11:59:00.000000000 +0000 +++ rsyslog-5.10.1/tools/Makefile.am 2012-10-17 14:41:20.000000000 +0000 @@ -1,7 +1,4 @@ sbin_PROGRAMS = -bin_PROGRAMS = -CLEANFILES = -man1_MANS = man_MANS = rsyslogd.8 rsyslog.conf.5 sbin_PROGRAMS += rsyslogd @@ -39,19 +36,9 @@ \ ../dirty.h rsyslogd_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -# note: it looks like librsyslog.la must be explicitely given on LDDADD, -# otherwise dependencies are not properly calculated (resulting in a -# potentially incomplete build, a problem we had several times...) -rsyslogd_LDADD = ../grammar/libgrammar.la ../runtime/librsyslog.la $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS) $(SOL_LIBS) $(LIBUUID_LIBS) $(LIBLOGGING_STDLOG_LIBS) +rsyslogd_LDADD = $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS) $(SOL_LIBS) rsyslogd_LDFLAGS = -export-dynamic -EXTRA_DIST = $(man_MANS) \ - rsgtutil.rst \ - rsgtutil.1 \ - rscryutil.rst \ - rscryutil.1 \ - recover_qi.pl - if ENABLE_DIAGTOOLS sbin_PROGRAMS += rsyslog_diag_hostname msggen zpipe rsyslog_diag_hostname_SOURCES = gethostn.c @@ -60,33 +47,5 @@ msggen_SOURCES = msggen.c endif -if ENABLE_USERTOOLS -if ENABLE_OMMONGODB -bin_PROGRAMS += logctl -logctl_SOURCES = logctl.c -logctl_CPPFLAGS = $(LIBMONGO_CLIENT_CFLAGS) -logctl_LDADD = $(LIBMONGO_CLIENT_LIBS) -endif -if ENABLE_GUARDTIME -bin_PROGRAMS += rsgtutil -rsgtutil = rsgtutil.c -rsgtutil_CPPFLAGS = $(RSRT_CFLAGS) $(GUARDTIME_CFLAGS) -rsgtutil_LDADD = ../runtime/librsgt.la $(GUARDTIME_LIBS) -rsgtutil.1: rsgtutil.rst - $(AM_V_GEN) $(RST2MAN) $< $@ -man1_MANS += rsgtutil.1 -CLEANFILES += rsgtutil.1 -EXTRA_DIST+= rsgtutil.1 -endif -if ENABLE_LIBGCRYPT -bin_PROGRAMS += rscryutil -rscryutil = rscryutil.c -rscryutil_CPPFLAGS = -I../runtime $(RSRT_CFLAGS) $(LIBGCRYPT_CFLAGS) -rscryutil_LDADD = ../runtime/libgcry.la $(LIBGCRYPT_LIBS) -rscryutil.1: rscryutil.rst - $(AM_V_GEN) $(RST2MAN) $< $@ -man1_MANS += rscryutil.1 -CLEANFILES += rscryutil.1 -EXTRA_DIST+= rscryutil.1 -endif -endif +EXTRA_DIST = $(man_MANS) \ + recover_qi.pl diff -Nru rsyslog-7.6.0/tools/Makefile.in rsyslog-5.10.1/tools/Makefile.in --- rsyslog-7.6.0/tools/Makefile.in 2014-02-12 12:06:38.000000000 +0000 +++ rsyslog-5.10.1/tools/Makefile.in 2012-10-17 14:42:46.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in 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. @@ -34,18 +34,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -sbin_PROGRAMS = rsyslogd$(EXEEXT) $(am__EXEEXT_4) -bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) +sbin_PROGRAMS = rsyslogd$(EXEEXT) $(am__EXEEXT_1) @ENABLE_DIAGTOOLS_TRUE@am__append_1 = rsyslog_diag_hostname msggen zpipe -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_2 = logctl -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_3 = rsgtutil -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_4 = rsgtutil.1 -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_5 = rsgtutil.1 -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_6 = rsgtutil.1 -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_7 = rscryutil -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_8 = rscryutil.1 -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_9 = rscryutil.1 -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@am__append_10 = rscryutil.1 subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -60,36 +50,18 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@am__EXEEXT_1 = \ -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@ logctl$(EXEEXT) -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@am__EXEEXT_2 = rsgtutil$(EXEEXT) -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@am__EXEEXT_3 = rscryutil$(EXEEXT) -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ - "$(DESTDIR)$(man8dir)" -@ENABLE_DIAGTOOLS_TRUE@am__EXEEXT_4 = rsyslog_diag_hostname$(EXEEXT) \ +@ENABLE_DIAGTOOLS_TRUE@am__EXEEXT_1 = rsyslog_diag_hostname$(EXEEXT) \ @ENABLE_DIAGTOOLS_TRUE@ msggen$(EXEEXT) zpipe$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) -am__logctl_SOURCES_DIST = logctl.c -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@am_logctl_OBJECTS = logctl-logctl.$(OBJEXT) -logctl_OBJECTS = $(am_logctl_OBJECTS) -am__DEPENDENCIES_1 = -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@logctl_DEPENDENCIES = $(am__DEPENDENCIES_1) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent +am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \ + "$(DESTDIR)$(man8dir)" +PROGRAMS = $(sbin_PROGRAMS) am__msggen_SOURCES_DIST = msggen.c @ENABLE_DIAGTOOLS_TRUE@am_msggen_OBJECTS = msggen.$(OBJEXT) msggen_OBJECTS = $(am_msggen_OBJECTS) msggen_LDADD = $(LDADD) -rscryutil_SOURCES = rscryutil.c -rscryutil_OBJECTS = rscryutil-rscryutil.$(OBJEXT) -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@rscryutil_DEPENDENCIES = ../runtime/libgcry.la \ -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@ $(am__DEPENDENCIES_1) -rsgtutil_SOURCES = rsgtutil.c -rsgtutil_OBJECTS = rsgtutil-rsgtutil.$(OBJEXT) -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@rsgtutil_DEPENDENCIES = ../runtime/librsgt.la \ -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@ $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent am__rsyslog_diag_hostname_SOURCES_DIST = gethostn.c @ENABLE_DIAGTOOLS_TRUE@am_rsyslog_diag_hostname_OBJECTS = \ @ENABLE_DIAGTOOLS_TRUE@ gethostn.$(OBJEXT) @@ -104,11 +76,9 @@ rsyslogd-smfwd.$(OBJEXT) rsyslogd-smtradfwd.$(OBJEXT) \ rsyslogd-iminternal.$(OBJEXT) rsyslogd-pidfile.$(OBJEXT) rsyslogd_OBJECTS = $(am_rsyslogd_OBJECTS) -rsyslogd_DEPENDENCIES = ../grammar/libgrammar.la \ - ../runtime/librsyslog.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +am__DEPENDENCIES_1 = +rsyslogd_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) rsyslogd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(rsyslogd_LDFLAGS) $(LDFLAGS) -o $@ @@ -126,27 +96,25 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(logctl_SOURCES) $(msggen_SOURCES) rscryutil.c rsgtutil.c \ - $(rsyslog_diag_hostname_SOURCES) $(rsyslogd_SOURCES) \ - $(zpipe_SOURCES) -DIST_SOURCES = $(am__logctl_SOURCES_DIST) $(am__msggen_SOURCES_DIST) \ - rscryutil.c rsgtutil.c \ +SOURCES = $(msggen_SOURCES) $(rsyslog_diag_hostname_SOURCES) \ + $(rsyslogd_SOURCES) $(zpipe_SOURCES) +DIST_SOURCES = $(am__msggen_SOURCES_DIST) \ $(am__rsyslog_diag_hostname_SOURCES_DIST) $(rsyslogd_SOURCES) \ $(am__zpipe_SOURCES_DIST) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -170,17 +138,10 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff -MANS = $(man1_MANS) $(man_MANS) +MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -200,11 +161,8 @@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ -CZMQ_CFLAGS = @CZMQ_CFLAGS@ -CZMQ_LIBS = @CZMQ_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ @@ -218,56 +176,30 @@ GNUTLS_LIBS = @GNUTLS_LIBS@ GREP = @GREP@ GSS_LIBS = @GSS_LIBS@ -GUARDTIME_CFLAGS = @GUARDTIME_CFLAGS@ -GUARDTIME_LIBS = @GUARDTIME_LIBS@ -HAVE_LIBGCRYPT_CONFIG = @HAVE_LIBGCRYPT_CONFIG@ +HAVE_CURL_CONFIG = @HAVE_CURL_CONFIG@ +HAVE_JAVAC = @HAVE_JAVAC@ HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@ HAVE_ORACLE_CONFIG = @HAVE_ORACLE_CONFIG@ HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@ -HIREDIS_CFLAGS = @HIREDIS_CFLAGS@ -HIREDIS_LIBS = @HIREDIS_LIBS@ IMUDP_LIBS = @IMUDP_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON_C_CFLAGS = @JSON_C_CFLAGS@ -JSON_C_LIBS = @JSON_C_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDBI_CFLAGS = @LIBDBI_CFLAGS@ LIBDBI_LIBS = @LIBDBI_LIBS@ -LIBEE_CFLAGS = @LIBEE_CFLAGS@ -LIBEE_LIBS = @LIBEE_LIBS@ -LIBESTR_CFLAGS = @LIBESTR_CFLAGS@ -LIBESTR_LIBS = @LIBESTR_LIBS@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@ LIBLOGGING_LIBS = @LIBLOGGING_LIBS@ -LIBLOGGING_STDLOG_CFLAGS = @LIBLOGGING_STDLOG_CFLAGS@ -LIBLOGGING_STDLOG_LIBS = @LIBLOGGING_STDLOG_LIBS@ -LIBLOGNORM_CFLAGS = @LIBLOGNORM_CFLAGS@ -LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@ -LIBM = @LIBM@ -LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@ -LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@ -LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@ LIBTOOL = @LIBTOOL@ -LIBUUID_CFLAGS = @LIBUUID_CFLAGS@ -LIBUUID_LIBS = @LIBUUID_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL_CFLAGS = @MYSQL_CFLAGS@ MYSQL_LIBS = @MYSQL_LIBS@ @@ -275,8 +207,6 @@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ ORACLE_CFLAGS = @ORACLE_CFLAGS@ ORACLE_LIBS = @ORACLE_LIBS@ OTOOL = @OTOOL@ @@ -296,16 +226,11 @@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PTHREADS_CFLAGS = @PTHREADS_CFLAGS@ PTHREADS_LIBS = @PTHREADS_LIBS@ -RABBITMQ_CFLAGS = @RABBITMQ_CFLAGS@ -RABBITMQ_LIBS = @RABBITMQ_LIBS@ RANLIB = @RANLIB@ RELP_CFLAGS = @RELP_CFLAGS@ RELP_LIBS = @RELP_LIBS@ RSRT_CFLAGS = @RSRT_CFLAGS@ -RSRT_CFLAGS1 = @RSRT_CFLAGS1@ RSRT_LIBS = @RSRT_LIBS@ -RSRT_LIBS1 = @RSRT_LIBS1@ -RST2MAN = @RST2MAN@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -317,14 +242,11 @@ UDPSPOOF_CFLAGS = @UDPSPOOF_CFLAGS@ UDPSPOOF_LIBS = @UDPSPOOF_LIBS@ VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ @@ -358,6 +280,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moddirs = @moddirs@ @@ -375,8 +298,6 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -CLEANFILES = $(am__append_5) $(am__append_9) -man1_MANS = $(am__append_4) $(am__append_8) man_MANS = rsyslogd.8 rsyslog.conf.5 rsyslogd_SOURCES = \ syslogd.c \ @@ -413,26 +334,15 @@ ../dirty.h rsyslogd_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) -# note: it looks like librsyslog.la must be explicitely given on LDDADD, -# otherwise dependencies are not properly calculated (resulting in a -# potentially incomplete build, a problem we had several times...) -rsyslogd_LDADD = ../grammar/libgrammar.la ../runtime/librsyslog.la $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS) $(SOL_LIBS) $(LIBUUID_LIBS) $(LIBLOGGING_STDLOG_LIBS) +rsyslogd_LDADD = $(ZLIB_LIBS) $(PTHREADS_LIBS) $(RSRT_LIBS) $(SOL_LIBS) rsyslogd_LDFLAGS = -export-dynamic -EXTRA_DIST = $(man_MANS) rsgtutil.rst rsgtutil.1 rscryutil.rst \ - rscryutil.1 recover_qi.pl $(am__append_6) $(am__append_10) @ENABLE_DIAGTOOLS_TRUE@rsyslog_diag_hostname_SOURCES = gethostn.c @ENABLE_DIAGTOOLS_TRUE@zpipe_SOURCES = zpipe.c @ENABLE_DIAGTOOLS_TRUE@zpipe_LDADD = -lz @ENABLE_DIAGTOOLS_TRUE@msggen_SOURCES = msggen.c -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@logctl_SOURCES = logctl.c -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@logctl_CPPFLAGS = $(LIBMONGO_CLIENT_CFLAGS) -@ENABLE_OMMONGODB_TRUE@@ENABLE_USERTOOLS_TRUE@logctl_LDADD = $(LIBMONGO_CLIENT_LIBS) -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@rsgtutil = rsgtutil.c -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@rsgtutil_CPPFLAGS = $(RSRT_CFLAGS) $(GUARDTIME_CFLAGS) -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@rsgtutil_LDADD = ../runtime/librsgt.la $(GUARDTIME_LIBS) -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@rscryutil = rscryutil.c -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@rscryutil_CPPFLAGS = -I../runtime $(RSRT_CFLAGS) $(LIBGCRYPT_CFLAGS) -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@rscryutil_LDADD = ../runtime/libgcry.la $(LIBGCRYPT_LIBS) +EXTRA_DIST = $(man_MANS) \ + recover_qi.pl + all: all-am .SUFFIXES: @@ -467,49 +377,6 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @@ -553,25 +420,16 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -logctl$(EXEEXT): $(logctl_OBJECTS) $(logctl_DEPENDENCIES) $(EXTRA_logctl_DEPENDENCIES) - @rm -f logctl$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(logctl_OBJECTS) $(logctl_LDADD) $(LIBS) -msggen$(EXEEXT): $(msggen_OBJECTS) $(msggen_DEPENDENCIES) $(EXTRA_msggen_DEPENDENCIES) +msggen$(EXEEXT): $(msggen_OBJECTS) $(msggen_DEPENDENCIES) @rm -f msggen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(msggen_OBJECTS) $(msggen_LDADD) $(LIBS) -rscryutil$(EXEEXT): $(rscryutil_OBJECTS) $(rscryutil_DEPENDENCIES) $(EXTRA_rscryutil_DEPENDENCIES) - @rm -f rscryutil$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(rscryutil_OBJECTS) $(rscryutil_LDADD) $(LIBS) -rsgtutil$(EXEEXT): $(rsgtutil_OBJECTS) $(rsgtutil_DEPENDENCIES) $(EXTRA_rsgtutil_DEPENDENCIES) - @rm -f rsgtutil$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(rsgtutil_OBJECTS) $(rsgtutil_LDADD) $(LIBS) -rsyslog_diag_hostname$(EXEEXT): $(rsyslog_diag_hostname_OBJECTS) $(rsyslog_diag_hostname_DEPENDENCIES) $(EXTRA_rsyslog_diag_hostname_DEPENDENCIES) +rsyslog_diag_hostname$(EXEEXT): $(rsyslog_diag_hostname_OBJECTS) $(rsyslog_diag_hostname_DEPENDENCIES) @rm -f rsyslog_diag_hostname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rsyslog_diag_hostname_OBJECTS) $(rsyslog_diag_hostname_LDADD) $(LIBS) -rsyslogd$(EXEEXT): $(rsyslogd_OBJECTS) $(rsyslogd_DEPENDENCIES) $(EXTRA_rsyslogd_DEPENDENCIES) +rsyslogd$(EXEEXT): $(rsyslogd_OBJECTS) $(rsyslogd_DEPENDENCIES) @rm -f rsyslogd$(EXEEXT) $(AM_V_CCLD)$(rsyslogd_LINK) $(rsyslogd_OBJECTS) $(rsyslogd_LDADD) $(LIBS) -zpipe$(EXEEXT): $(zpipe_OBJECTS) $(zpipe_DEPENDENCIES) $(EXTRA_zpipe_DEPENDENCIES) +zpipe$(EXEEXT): $(zpipe_OBJECTS) $(zpipe_DEPENDENCIES) @rm -f zpipe$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zpipe_OBJECTS) $(zpipe_LDADD) $(LIBS) @@ -582,10 +440,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gethostn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logctl-logctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msggen.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rscryutil-rscryutil.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsgtutil-rsgtutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsyslogd-iminternal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsyslogd-omdiscard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsyslogd-omfile.Po@am__quote@ @@ -606,317 +461,272 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -logctl-logctl.o: logctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(logctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT logctl-logctl.o -MD -MP -MF $(DEPDIR)/logctl-logctl.Tpo -c -o logctl-logctl.o `test -f 'logctl.c' || echo '$(srcdir)/'`logctl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/logctl-logctl.Tpo $(DEPDIR)/logctl-logctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logctl.c' object='logctl-logctl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(logctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o logctl-logctl.o `test -f 'logctl.c' || echo '$(srcdir)/'`logctl.c - -logctl-logctl.obj: logctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(logctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT logctl-logctl.obj -MD -MP -MF $(DEPDIR)/logctl-logctl.Tpo -c -o logctl-logctl.obj `if test -f 'logctl.c'; then $(CYGPATH_W) 'logctl.c'; else $(CYGPATH_W) '$(srcdir)/logctl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/logctl-logctl.Tpo $(DEPDIR)/logctl-logctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logctl.c' object='logctl-logctl.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(logctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o logctl-logctl.obj `if test -f 'logctl.c'; then $(CYGPATH_W) 'logctl.c'; else $(CYGPATH_W) '$(srcdir)/logctl.c'; fi` - -rscryutil-rscryutil.o: rscryutil.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscryutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscryutil-rscryutil.o -MD -MP -MF $(DEPDIR)/rscryutil-rscryutil.Tpo -c -o rscryutil-rscryutil.o `test -f 'rscryutil.c' || echo '$(srcdir)/'`rscryutil.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscryutil-rscryutil.Tpo $(DEPDIR)/rscryutil-rscryutil.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rscryutil.c' object='rscryutil-rscryutil.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscryutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscryutil-rscryutil.o `test -f 'rscryutil.c' || echo '$(srcdir)/'`rscryutil.c - -rscryutil-rscryutil.obj: rscryutil.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscryutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rscryutil-rscryutil.obj -MD -MP -MF $(DEPDIR)/rscryutil-rscryutil.Tpo -c -o rscryutil-rscryutil.obj `if test -f 'rscryutil.c'; then $(CYGPATH_W) 'rscryutil.c'; else $(CYGPATH_W) '$(srcdir)/rscryutil.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rscryutil-rscryutil.Tpo $(DEPDIR)/rscryutil-rscryutil.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rscryutil.c' object='rscryutil-rscryutil.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rscryutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rscryutil-rscryutil.obj `if test -f 'rscryutil.c'; then $(CYGPATH_W) 'rscryutil.c'; else $(CYGPATH_W) '$(srcdir)/rscryutil.c'; fi` - -rsgtutil-rsgtutil.o: rsgtutil.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsgtutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsgtutil-rsgtutil.o -MD -MP -MF $(DEPDIR)/rsgtutil-rsgtutil.Tpo -c -o rsgtutil-rsgtutil.o `test -f 'rsgtutil.c' || echo '$(srcdir)/'`rsgtutil.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsgtutil-rsgtutil.Tpo $(DEPDIR)/rsgtutil-rsgtutil.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rsgtutil.c' object='rsgtutil-rsgtutil.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsgtutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsgtutil-rsgtutil.o `test -f 'rsgtutil.c' || echo '$(srcdir)/'`rsgtutil.c - -rsgtutil-rsgtutil.obj: rsgtutil.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsgtutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsgtutil-rsgtutil.obj -MD -MP -MF $(DEPDIR)/rsgtutil-rsgtutil.Tpo -c -o rsgtutil-rsgtutil.obj `if test -f 'rsgtutil.c'; then $(CYGPATH_W) 'rsgtutil.c'; else $(CYGPATH_W) '$(srcdir)/rsgtutil.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsgtutil-rsgtutil.Tpo $(DEPDIR)/rsgtutil-rsgtutil.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rsgtutil.c' object='rsgtutil-rsgtutil.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsgtutil_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsgtutil-rsgtutil.obj `if test -f 'rsgtutil.c'; then $(CYGPATH_W) 'rsgtutil.c'; else $(CYGPATH_W) '$(srcdir)/rsgtutil.c'; fi` +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< rsyslogd-syslogd.o: syslogd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-syslogd.o -MD -MP -MF $(DEPDIR)/rsyslogd-syslogd.Tpo -c -o rsyslogd-syslogd.o `test -f 'syslogd.c' || echo '$(srcdir)/'`syslogd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-syslogd.Tpo $(DEPDIR)/rsyslogd-syslogd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syslogd.c' object='rsyslogd-syslogd.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='syslogd.c' object='rsyslogd-syslogd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-syslogd.o `test -f 'syslogd.c' || echo '$(srcdir)/'`syslogd.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-syslogd.o `test -f 'syslogd.c' || echo '$(srcdir)/'`syslogd.c rsyslogd-syslogd.obj: syslogd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-syslogd.obj -MD -MP -MF $(DEPDIR)/rsyslogd-syslogd.Tpo -c -o rsyslogd-syslogd.obj `if test -f 'syslogd.c'; then $(CYGPATH_W) 'syslogd.c'; else $(CYGPATH_W) '$(srcdir)/syslogd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-syslogd.Tpo $(DEPDIR)/rsyslogd-syslogd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='syslogd.c' object='rsyslogd-syslogd.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='syslogd.c' object='rsyslogd-syslogd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-syslogd.obj `if test -f 'syslogd.c'; then $(CYGPATH_W) 'syslogd.c'; else $(CYGPATH_W) '$(srcdir)/syslogd.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-syslogd.obj `if test -f 'syslogd.c'; then $(CYGPATH_W) 'syslogd.c'; else $(CYGPATH_W) '$(srcdir)/syslogd.c'; fi` rsyslogd-omshell.o: omshell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omshell.o -MD -MP -MF $(DEPDIR)/rsyslogd-omshell.Tpo -c -o rsyslogd-omshell.o `test -f 'omshell.c' || echo '$(srcdir)/'`omshell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omshell.Tpo $(DEPDIR)/rsyslogd-omshell.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omshell.c' object='rsyslogd-omshell.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omshell.c' object='rsyslogd-omshell.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omshell.o `test -f 'omshell.c' || echo '$(srcdir)/'`omshell.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omshell.o `test -f 'omshell.c' || echo '$(srcdir)/'`omshell.c rsyslogd-omshell.obj: omshell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omshell.obj -MD -MP -MF $(DEPDIR)/rsyslogd-omshell.Tpo -c -o rsyslogd-omshell.obj `if test -f 'omshell.c'; then $(CYGPATH_W) 'omshell.c'; else $(CYGPATH_W) '$(srcdir)/omshell.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omshell.Tpo $(DEPDIR)/rsyslogd-omshell.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omshell.c' object='rsyslogd-omshell.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omshell.c' object='rsyslogd-omshell.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omshell.obj `if test -f 'omshell.c'; then $(CYGPATH_W) 'omshell.c'; else $(CYGPATH_W) '$(srcdir)/omshell.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omshell.obj `if test -f 'omshell.c'; then $(CYGPATH_W) 'omshell.c'; else $(CYGPATH_W) '$(srcdir)/omshell.c'; fi` rsyslogd-omusrmsg.o: omusrmsg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omusrmsg.o -MD -MP -MF $(DEPDIR)/rsyslogd-omusrmsg.Tpo -c -o rsyslogd-omusrmsg.o `test -f 'omusrmsg.c' || echo '$(srcdir)/'`omusrmsg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omusrmsg.Tpo $(DEPDIR)/rsyslogd-omusrmsg.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omusrmsg.c' object='rsyslogd-omusrmsg.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omusrmsg.c' object='rsyslogd-omusrmsg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omusrmsg.o `test -f 'omusrmsg.c' || echo '$(srcdir)/'`omusrmsg.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omusrmsg.o `test -f 'omusrmsg.c' || echo '$(srcdir)/'`omusrmsg.c rsyslogd-omusrmsg.obj: omusrmsg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omusrmsg.obj -MD -MP -MF $(DEPDIR)/rsyslogd-omusrmsg.Tpo -c -o rsyslogd-omusrmsg.obj `if test -f 'omusrmsg.c'; then $(CYGPATH_W) 'omusrmsg.c'; else $(CYGPATH_W) '$(srcdir)/omusrmsg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omusrmsg.Tpo $(DEPDIR)/rsyslogd-omusrmsg.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omusrmsg.c' object='rsyslogd-omusrmsg.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omusrmsg.c' object='rsyslogd-omusrmsg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omusrmsg.obj `if test -f 'omusrmsg.c'; then $(CYGPATH_W) 'omusrmsg.c'; else $(CYGPATH_W) '$(srcdir)/omusrmsg.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omusrmsg.obj `if test -f 'omusrmsg.c'; then $(CYGPATH_W) 'omusrmsg.c'; else $(CYGPATH_W) '$(srcdir)/omusrmsg.c'; fi` rsyslogd-omfwd.o: omfwd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omfwd.o -MD -MP -MF $(DEPDIR)/rsyslogd-omfwd.Tpo -c -o rsyslogd-omfwd.o `test -f 'omfwd.c' || echo '$(srcdir)/'`omfwd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omfwd.Tpo $(DEPDIR)/rsyslogd-omfwd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omfwd.c' object='rsyslogd-omfwd.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omfwd.c' object='rsyslogd-omfwd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfwd.o `test -f 'omfwd.c' || echo '$(srcdir)/'`omfwd.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfwd.o `test -f 'omfwd.c' || echo '$(srcdir)/'`omfwd.c rsyslogd-omfwd.obj: omfwd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omfwd.obj -MD -MP -MF $(DEPDIR)/rsyslogd-omfwd.Tpo -c -o rsyslogd-omfwd.obj `if test -f 'omfwd.c'; then $(CYGPATH_W) 'omfwd.c'; else $(CYGPATH_W) '$(srcdir)/omfwd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omfwd.Tpo $(DEPDIR)/rsyslogd-omfwd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omfwd.c' object='rsyslogd-omfwd.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omfwd.c' object='rsyslogd-omfwd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfwd.obj `if test -f 'omfwd.c'; then $(CYGPATH_W) 'omfwd.c'; else $(CYGPATH_W) '$(srcdir)/omfwd.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfwd.obj `if test -f 'omfwd.c'; then $(CYGPATH_W) 'omfwd.c'; else $(CYGPATH_W) '$(srcdir)/omfwd.c'; fi` rsyslogd-omfile.o: omfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omfile.o -MD -MP -MF $(DEPDIR)/rsyslogd-omfile.Tpo -c -o rsyslogd-omfile.o `test -f 'omfile.c' || echo '$(srcdir)/'`omfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omfile.Tpo $(DEPDIR)/rsyslogd-omfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omfile.c' object='rsyslogd-omfile.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omfile.c' object='rsyslogd-omfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfile.o `test -f 'omfile.c' || echo '$(srcdir)/'`omfile.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfile.o `test -f 'omfile.c' || echo '$(srcdir)/'`omfile.c rsyslogd-omfile.obj: omfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omfile.obj -MD -MP -MF $(DEPDIR)/rsyslogd-omfile.Tpo -c -o rsyslogd-omfile.obj `if test -f 'omfile.c'; then $(CYGPATH_W) 'omfile.c'; else $(CYGPATH_W) '$(srcdir)/omfile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omfile.Tpo $(DEPDIR)/rsyslogd-omfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omfile.c' object='rsyslogd-omfile.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omfile.c' object='rsyslogd-omfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfile.obj `if test -f 'omfile.c'; then $(CYGPATH_W) 'omfile.c'; else $(CYGPATH_W) '$(srcdir)/omfile.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omfile.obj `if test -f 'omfile.c'; then $(CYGPATH_W) 'omfile.c'; else $(CYGPATH_W) '$(srcdir)/omfile.c'; fi` rsyslogd-ompipe.o: ompipe.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-ompipe.o -MD -MP -MF $(DEPDIR)/rsyslogd-ompipe.Tpo -c -o rsyslogd-ompipe.o `test -f 'ompipe.c' || echo '$(srcdir)/'`ompipe.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-ompipe.Tpo $(DEPDIR)/rsyslogd-ompipe.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ompipe.c' object='rsyslogd-ompipe.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ompipe.c' object='rsyslogd-ompipe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-ompipe.o `test -f 'ompipe.c' || echo '$(srcdir)/'`ompipe.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-ompipe.o `test -f 'ompipe.c' || echo '$(srcdir)/'`ompipe.c rsyslogd-ompipe.obj: ompipe.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-ompipe.obj -MD -MP -MF $(DEPDIR)/rsyslogd-ompipe.Tpo -c -o rsyslogd-ompipe.obj `if test -f 'ompipe.c'; then $(CYGPATH_W) 'ompipe.c'; else $(CYGPATH_W) '$(srcdir)/ompipe.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-ompipe.Tpo $(DEPDIR)/rsyslogd-ompipe.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ompipe.c' object='rsyslogd-ompipe.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ompipe.c' object='rsyslogd-ompipe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-ompipe.obj `if test -f 'ompipe.c'; then $(CYGPATH_W) 'ompipe.c'; else $(CYGPATH_W) '$(srcdir)/ompipe.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-ompipe.obj `if test -f 'ompipe.c'; then $(CYGPATH_W) 'ompipe.c'; else $(CYGPATH_W) '$(srcdir)/ompipe.c'; fi` rsyslogd-omdiscard.o: omdiscard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omdiscard.o -MD -MP -MF $(DEPDIR)/rsyslogd-omdiscard.Tpo -c -o rsyslogd-omdiscard.o `test -f 'omdiscard.c' || echo '$(srcdir)/'`omdiscard.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omdiscard.Tpo $(DEPDIR)/rsyslogd-omdiscard.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omdiscard.c' object='rsyslogd-omdiscard.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omdiscard.c' object='rsyslogd-omdiscard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omdiscard.o `test -f 'omdiscard.c' || echo '$(srcdir)/'`omdiscard.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omdiscard.o `test -f 'omdiscard.c' || echo '$(srcdir)/'`omdiscard.c rsyslogd-omdiscard.obj: omdiscard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-omdiscard.obj -MD -MP -MF $(DEPDIR)/rsyslogd-omdiscard.Tpo -c -o rsyslogd-omdiscard.obj `if test -f 'omdiscard.c'; then $(CYGPATH_W) 'omdiscard.c'; else $(CYGPATH_W) '$(srcdir)/omdiscard.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-omdiscard.Tpo $(DEPDIR)/rsyslogd-omdiscard.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='omdiscard.c' object='rsyslogd-omdiscard.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='omdiscard.c' object='rsyslogd-omdiscard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omdiscard.obj `if test -f 'omdiscard.c'; then $(CYGPATH_W) 'omdiscard.c'; else $(CYGPATH_W) '$(srcdir)/omdiscard.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-omdiscard.obj `if test -f 'omdiscard.c'; then $(CYGPATH_W) 'omdiscard.c'; else $(CYGPATH_W) '$(srcdir)/omdiscard.c'; fi` rsyslogd-pmrfc5424.o: pmrfc5424.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-pmrfc5424.o -MD -MP -MF $(DEPDIR)/rsyslogd-pmrfc5424.Tpo -c -o rsyslogd-pmrfc5424.o `test -f 'pmrfc5424.c' || echo '$(srcdir)/'`pmrfc5424.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-pmrfc5424.Tpo $(DEPDIR)/rsyslogd-pmrfc5424.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmrfc5424.c' object='rsyslogd-pmrfc5424.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmrfc5424.c' object='rsyslogd-pmrfc5424.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc5424.o `test -f 'pmrfc5424.c' || echo '$(srcdir)/'`pmrfc5424.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc5424.o `test -f 'pmrfc5424.c' || echo '$(srcdir)/'`pmrfc5424.c rsyslogd-pmrfc5424.obj: pmrfc5424.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-pmrfc5424.obj -MD -MP -MF $(DEPDIR)/rsyslogd-pmrfc5424.Tpo -c -o rsyslogd-pmrfc5424.obj `if test -f 'pmrfc5424.c'; then $(CYGPATH_W) 'pmrfc5424.c'; else $(CYGPATH_W) '$(srcdir)/pmrfc5424.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-pmrfc5424.Tpo $(DEPDIR)/rsyslogd-pmrfc5424.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmrfc5424.c' object='rsyslogd-pmrfc5424.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmrfc5424.c' object='rsyslogd-pmrfc5424.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc5424.obj `if test -f 'pmrfc5424.c'; then $(CYGPATH_W) 'pmrfc5424.c'; else $(CYGPATH_W) '$(srcdir)/pmrfc5424.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc5424.obj `if test -f 'pmrfc5424.c'; then $(CYGPATH_W) 'pmrfc5424.c'; else $(CYGPATH_W) '$(srcdir)/pmrfc5424.c'; fi` rsyslogd-pmrfc3164.o: pmrfc3164.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-pmrfc3164.o -MD -MP -MF $(DEPDIR)/rsyslogd-pmrfc3164.Tpo -c -o rsyslogd-pmrfc3164.o `test -f 'pmrfc3164.c' || echo '$(srcdir)/'`pmrfc3164.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-pmrfc3164.Tpo $(DEPDIR)/rsyslogd-pmrfc3164.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmrfc3164.c' object='rsyslogd-pmrfc3164.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmrfc3164.c' object='rsyslogd-pmrfc3164.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc3164.o `test -f 'pmrfc3164.c' || echo '$(srcdir)/'`pmrfc3164.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc3164.o `test -f 'pmrfc3164.c' || echo '$(srcdir)/'`pmrfc3164.c rsyslogd-pmrfc3164.obj: pmrfc3164.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-pmrfc3164.obj -MD -MP -MF $(DEPDIR)/rsyslogd-pmrfc3164.Tpo -c -o rsyslogd-pmrfc3164.obj `if test -f 'pmrfc3164.c'; then $(CYGPATH_W) 'pmrfc3164.c'; else $(CYGPATH_W) '$(srcdir)/pmrfc3164.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-pmrfc3164.Tpo $(DEPDIR)/rsyslogd-pmrfc3164.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pmrfc3164.c' object='rsyslogd-pmrfc3164.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pmrfc3164.c' object='rsyslogd-pmrfc3164.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc3164.obj `if test -f 'pmrfc3164.c'; then $(CYGPATH_W) 'pmrfc3164.c'; else $(CYGPATH_W) '$(srcdir)/pmrfc3164.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pmrfc3164.obj `if test -f 'pmrfc3164.c'; then $(CYGPATH_W) 'pmrfc3164.c'; else $(CYGPATH_W) '$(srcdir)/pmrfc3164.c'; fi` rsyslogd-smtradfile.o: smtradfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smtradfile.o -MD -MP -MF $(DEPDIR)/rsyslogd-smtradfile.Tpo -c -o rsyslogd-smtradfile.o `test -f 'smtradfile.c' || echo '$(srcdir)/'`smtradfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smtradfile.Tpo $(DEPDIR)/rsyslogd-smtradfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smtradfile.c' object='rsyslogd-smtradfile.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smtradfile.c' object='rsyslogd-smtradfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfile.o `test -f 'smtradfile.c' || echo '$(srcdir)/'`smtradfile.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfile.o `test -f 'smtradfile.c' || echo '$(srcdir)/'`smtradfile.c rsyslogd-smtradfile.obj: smtradfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smtradfile.obj -MD -MP -MF $(DEPDIR)/rsyslogd-smtradfile.Tpo -c -o rsyslogd-smtradfile.obj `if test -f 'smtradfile.c'; then $(CYGPATH_W) 'smtradfile.c'; else $(CYGPATH_W) '$(srcdir)/smtradfile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smtradfile.Tpo $(DEPDIR)/rsyslogd-smtradfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smtradfile.c' object='rsyslogd-smtradfile.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smtradfile.c' object='rsyslogd-smtradfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfile.obj `if test -f 'smtradfile.c'; then $(CYGPATH_W) 'smtradfile.c'; else $(CYGPATH_W) '$(srcdir)/smtradfile.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfile.obj `if test -f 'smtradfile.c'; then $(CYGPATH_W) 'smtradfile.c'; else $(CYGPATH_W) '$(srcdir)/smtradfile.c'; fi` rsyslogd-smfile.o: smfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smfile.o -MD -MP -MF $(DEPDIR)/rsyslogd-smfile.Tpo -c -o rsyslogd-smfile.o `test -f 'smfile.c' || echo '$(srcdir)/'`smfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smfile.Tpo $(DEPDIR)/rsyslogd-smfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smfile.c' object='rsyslogd-smfile.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smfile.c' object='rsyslogd-smfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfile.o `test -f 'smfile.c' || echo '$(srcdir)/'`smfile.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfile.o `test -f 'smfile.c' || echo '$(srcdir)/'`smfile.c rsyslogd-smfile.obj: smfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smfile.obj -MD -MP -MF $(DEPDIR)/rsyslogd-smfile.Tpo -c -o rsyslogd-smfile.obj `if test -f 'smfile.c'; then $(CYGPATH_W) 'smfile.c'; else $(CYGPATH_W) '$(srcdir)/smfile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smfile.Tpo $(DEPDIR)/rsyslogd-smfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smfile.c' object='rsyslogd-smfile.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smfile.c' object='rsyslogd-smfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfile.obj `if test -f 'smfile.c'; then $(CYGPATH_W) 'smfile.c'; else $(CYGPATH_W) '$(srcdir)/smfile.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfile.obj `if test -f 'smfile.c'; then $(CYGPATH_W) 'smfile.c'; else $(CYGPATH_W) '$(srcdir)/smfile.c'; fi` rsyslogd-smfwd.o: smfwd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smfwd.o -MD -MP -MF $(DEPDIR)/rsyslogd-smfwd.Tpo -c -o rsyslogd-smfwd.o `test -f 'smfwd.c' || echo '$(srcdir)/'`smfwd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smfwd.Tpo $(DEPDIR)/rsyslogd-smfwd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smfwd.c' object='rsyslogd-smfwd.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smfwd.c' object='rsyslogd-smfwd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfwd.o `test -f 'smfwd.c' || echo '$(srcdir)/'`smfwd.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfwd.o `test -f 'smfwd.c' || echo '$(srcdir)/'`smfwd.c rsyslogd-smfwd.obj: smfwd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smfwd.obj -MD -MP -MF $(DEPDIR)/rsyslogd-smfwd.Tpo -c -o rsyslogd-smfwd.obj `if test -f 'smfwd.c'; then $(CYGPATH_W) 'smfwd.c'; else $(CYGPATH_W) '$(srcdir)/smfwd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smfwd.Tpo $(DEPDIR)/rsyslogd-smfwd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smfwd.c' object='rsyslogd-smfwd.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smfwd.c' object='rsyslogd-smfwd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfwd.obj `if test -f 'smfwd.c'; then $(CYGPATH_W) 'smfwd.c'; else $(CYGPATH_W) '$(srcdir)/smfwd.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smfwd.obj `if test -f 'smfwd.c'; then $(CYGPATH_W) 'smfwd.c'; else $(CYGPATH_W) '$(srcdir)/smfwd.c'; fi` rsyslogd-smtradfwd.o: smtradfwd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smtradfwd.o -MD -MP -MF $(DEPDIR)/rsyslogd-smtradfwd.Tpo -c -o rsyslogd-smtradfwd.o `test -f 'smtradfwd.c' || echo '$(srcdir)/'`smtradfwd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smtradfwd.Tpo $(DEPDIR)/rsyslogd-smtradfwd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smtradfwd.c' object='rsyslogd-smtradfwd.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smtradfwd.c' object='rsyslogd-smtradfwd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfwd.o `test -f 'smtradfwd.c' || echo '$(srcdir)/'`smtradfwd.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfwd.o `test -f 'smtradfwd.c' || echo '$(srcdir)/'`smtradfwd.c rsyslogd-smtradfwd.obj: smtradfwd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-smtradfwd.obj -MD -MP -MF $(DEPDIR)/rsyslogd-smtradfwd.Tpo -c -o rsyslogd-smtradfwd.obj `if test -f 'smtradfwd.c'; then $(CYGPATH_W) 'smtradfwd.c'; else $(CYGPATH_W) '$(srcdir)/smtradfwd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-smtradfwd.Tpo $(DEPDIR)/rsyslogd-smtradfwd.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='smtradfwd.c' object='rsyslogd-smtradfwd.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='smtradfwd.c' object='rsyslogd-smtradfwd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfwd.obj `if test -f 'smtradfwd.c'; then $(CYGPATH_W) 'smtradfwd.c'; else $(CYGPATH_W) '$(srcdir)/smtradfwd.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-smtradfwd.obj `if test -f 'smtradfwd.c'; then $(CYGPATH_W) 'smtradfwd.c'; else $(CYGPATH_W) '$(srcdir)/smtradfwd.c'; fi` rsyslogd-iminternal.o: iminternal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-iminternal.o -MD -MP -MF $(DEPDIR)/rsyslogd-iminternal.Tpo -c -o rsyslogd-iminternal.o `test -f 'iminternal.c' || echo '$(srcdir)/'`iminternal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-iminternal.Tpo $(DEPDIR)/rsyslogd-iminternal.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iminternal.c' object='rsyslogd-iminternal.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='iminternal.c' object='rsyslogd-iminternal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-iminternal.o `test -f 'iminternal.c' || echo '$(srcdir)/'`iminternal.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-iminternal.o `test -f 'iminternal.c' || echo '$(srcdir)/'`iminternal.c rsyslogd-iminternal.obj: iminternal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-iminternal.obj -MD -MP -MF $(DEPDIR)/rsyslogd-iminternal.Tpo -c -o rsyslogd-iminternal.obj `if test -f 'iminternal.c'; then $(CYGPATH_W) 'iminternal.c'; else $(CYGPATH_W) '$(srcdir)/iminternal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-iminternal.Tpo $(DEPDIR)/rsyslogd-iminternal.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iminternal.c' object='rsyslogd-iminternal.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='iminternal.c' object='rsyslogd-iminternal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-iminternal.obj `if test -f 'iminternal.c'; then $(CYGPATH_W) 'iminternal.c'; else $(CYGPATH_W) '$(srcdir)/iminternal.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-iminternal.obj `if test -f 'iminternal.c'; then $(CYGPATH_W) 'iminternal.c'; else $(CYGPATH_W) '$(srcdir)/iminternal.c'; fi` rsyslogd-pidfile.o: pidfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-pidfile.o -MD -MP -MF $(DEPDIR)/rsyslogd-pidfile.Tpo -c -o rsyslogd-pidfile.o `test -f 'pidfile.c' || echo '$(srcdir)/'`pidfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-pidfile.Tpo $(DEPDIR)/rsyslogd-pidfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pidfile.c' object='rsyslogd-pidfile.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pidfile.c' object='rsyslogd-pidfile.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pidfile.o `test -f 'pidfile.c' || echo '$(srcdir)/'`pidfile.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pidfile.o `test -f 'pidfile.c' || echo '$(srcdir)/'`pidfile.c rsyslogd-pidfile.obj: pidfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rsyslogd-pidfile.obj -MD -MP -MF $(DEPDIR)/rsyslogd-pidfile.Tpo -c -o rsyslogd-pidfile.obj `if test -f 'pidfile.c'; then $(CYGPATH_W) 'pidfile.c'; else $(CYGPATH_W) '$(srcdir)/pidfile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rsyslogd-pidfile.Tpo $(DEPDIR)/rsyslogd-pidfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pidfile.c' object='rsyslogd-pidfile.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pidfile.c' object='rsyslogd-pidfile.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pidfile.obj `if test -f 'pidfile.c'; then $(CYGPATH_W) 'pidfile.c'; else $(CYGPATH_W) '$(srcdir)/pidfile.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rsyslogd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rsyslogd-pidfile.obj `if test -f 'pidfile.c'; then $(CYGPATH_W) 'pidfile.c'; else $(CYGPATH_W) '$(srcdir)/pidfile.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -install-man1: $(man1_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @@ -952,7 +762,9 @@ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } install-man8: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @@ -988,7 +800,9 @@ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) + test -z "$$files" || { \ + echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(man8dir)" && rm -f $$files; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -1089,7 +903,7 @@ check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ + for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1102,19 +916,13 @@ installcheck: installcheck-am install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -1125,8 +933,8 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-sbinPROGRAMS mostlyclean-am +clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1152,7 +960,7 @@ install-dvi-am: -install-exec-am: install-binPROGRAMS install-sbinPROGRAMS +install-exec-am: install-sbinPROGRAMS install-html: install-html-am @@ -1162,7 +970,7 @@ install-info-am: -install-man: install-man1 install-man5 install-man8 +install-man: install-man5 install-man8 install-pdf: install-pdf-am @@ -1192,34 +1000,27 @@ ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-man \ - uninstall-sbinPROGRAMS +uninstall-am: uninstall-man uninstall-sbinPROGRAMS -uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 +uninstall-man: uninstall-man5 uninstall-man8 .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-man5 \ - install-man8 install-pdf install-pdf-am install-ps \ - install-ps-am install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man5 install-man8 install-pdf install-pdf-am \ + install-ps install-ps-am install-sbinPROGRAMS install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-man uninstall-man1 uninstall-man5 uninstall-man8 \ - uninstall-sbinPROGRAMS - -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@rsgtutil.1: rsgtutil.rst -@ENABLE_GUARDTIME_TRUE@@ENABLE_USERTOOLS_TRUE@ $(AM_V_GEN) $(RST2MAN) $< $@ -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@rscryutil.1: rscryutil.rst -@ENABLE_LIBGCRYPT_TRUE@@ENABLE_USERTOOLS_TRUE@ $(AM_V_GEN) $(RST2MAN) $< $@ + tags uninstall uninstall-am uninstall-man uninstall-man5 \ + uninstall-man8 uninstall-sbinPROGRAMS + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru rsyslog-7.6.0/tools/omdiscard.c rsyslog-5.10.1/tools/omdiscard.c --- rsyslog-7.6.0/tools/omdiscard.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/tools/omdiscard.c 2012-10-17 14:41:20.000000000 +0000 @@ -35,7 +35,6 @@ #include "syslogd-types.h" #include "omdiscard.h" #include "module-template.h" -#include "errmsg.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP @@ -43,10 +42,9 @@ /* internal structures */ DEF_OMOD_STATIC_DATA -DEFobjCurrIf(errmsg); typedef struct _instanceData { - EMPTY_STRUCT + char dummy; } instanceData; /* we do not need a createInstance()! @@ -94,10 +92,8 @@ p = *pp; if(*p == '~') { + /* TODO: check the rest of the selector line - error reporting */ dbgprintf("discard\n"); - errmsg.LogError(0, RS_RET_DEPRECATED, "warning: ~ action " - "is deprecated, consider using the 'stop' " - "statement instead"); } else { iRet = RS_RET_CONFLINE_UNPROCESSED; } @@ -107,7 +103,6 @@ BEGINmodExit CODESTARTmodExit - objRelease(errmsg, CORE_COMPONENT); ENDmodExit @@ -121,7 +116,6 @@ CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr - CHKiRet(objUse(errmsg, CORE_COMPONENT)); ENDmodInit /* * vi:set ai: diff -Nru rsyslog-7.6.0/tools/omfile.c rsyslog-5.10.1/tools/omfile.c --- rsyslog-7.6.0/tools/omfile.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tools/omfile.c 2012-10-17 14:41:20.000000000 +0000 @@ -17,7 +17,7 @@ * pipes. These have been moved to ompipe, to reduced the entanglement * between the two different functionalities. -- rgerhards * - * Copyright 2007-2013 Adiscon GmbH. + * Copyright 2007-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -68,23 +68,15 @@ #include "stream.h" #include "unicode-helper.h" #include "atomic.h" -#include "statsobj.h" -#include "sigprov.h" -#include "cryprov.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omfile") - -/* forward definitions */ -static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal); /* internal structures */ DEF_OMOD_STATIC_DATA DEFobjCurrIf(errmsg) DEFobjCurrIf(strm) -DEFobjCurrIf(statsobj) /* for our current LRU mechanism, we need a monotonically increasing counters. We use * it much like a "Lamport logical clock": we do not need the actual time, we just need @@ -120,22 +112,40 @@ struct s_dynaFileCacheEntry { uchar *pName; /* name currently open, if dynamic name */ strm_t *pStrm; /* our output stream */ - void *sigprovFileData; /* opaque data ptr for provider use */ uint64 clkTickAccessed;/* for LRU - based on clockFileAccess */ }; typedef struct s_dynaFileCacheEntry dynaFileCacheEntry; -#define IOBUF_DFLT_SIZE 4096 /* default size for io buffers */ +#define IOBUF_DFLT_SIZE 1024 /* default size for io buffers */ #define FLUSH_INTRVL_DFLT 1 /* default buffer flush interval (in seconds) */ #define USE_ASYNCWRITER_DFLT 0 /* default buffer use async writer */ #define FLUSHONTX_DFLT 1 /* default for flush on TX end */ +/* globals for default values */ +static int iDynaFileCacheSize = 10; /* max cache for dynamic files */ +static int fCreateMode = 0644; /* mode to use when creating files */ +static int fDirCreateMode = 0700; /* mode to use when creating files */ +static int bFailOnChown; /* fail if chown fails? */ +static uid_t fileUID; /* UID to be used for newly created files */ +static uid_t fileGID; /* GID to be used for newly created files */ +static uid_t dirUID; /* UID to be used for newly created directories */ +static uid_t dirGID; /* GID to be used for newly created directories */ +static int bCreateDirs = 1;/* auto-create directories for dynaFiles: 0 - no, 1 - yes */ +static int bEnableSync = 0;/* enable syncing of files (no dash in front of pathname in conf): 0 - no, 1 - yes */ +static int iZipLevel = 0; /* zip compression mode (0..9 as usual) */ +static sbool bFlushOnTXEnd = FLUSHONTX_DFLT;/* flush write buffers when transaction has ended? */ +static int64 iIOBufSize = IOBUF_DFLT_SIZE; /* size of an io buffer */ +static int iFlushInterval = FLUSH_INTRVL_DFLT; /* how often flush the output buffer on inactivity? */ +static int bUseAsyncWriter = USE_ASYNCWRITER_DFLT; /* should we enable asynchronous writing? */ +uchar *pszFileDfltTplName = NULL; /* name of the default template to use */ +/* end globals for default values */ + typedef struct _instanceData { - uchar *fname; /* file or template name (display only) */ - uchar *tplName; /* name of assigned template */ + uchar f_fname[MAXFNAME];/* file or template name (display only) */ strm_t *pStrm; /* our output stream */ + strmType_t strmType; /* stream type, used for named pipes */ char bDynamicName; /* 0 - static name, 1 - dynamic name (with properties) */ int fCreateMode; /* file creation mode for open() */ int fDirCreateMode; /* creation mode for mkdir() */ @@ -146,17 +156,6 @@ gid_t fileGID; gid_t dirGID; int bFailOnChown; /* fail creation if chown fails? */ - uchar *sigprovName; /* signature provider */ - uchar *sigprovNameFull;/* full internal signature provider name */ - sigprov_if_t sigprov; /* ptr to signature provider interface */ - void *sigprovData; /* opaque data ptr for provider use */ - void *sigprovFileData;/* opaque data ptr for file instance */ - sbool useSigprov; /* quicker than checkig ptr (1 vs 8 bytes!) */ - uchar *cryprovName; /* crypto provider */ - uchar *cryprovNameFull;/* full internal crypto provider name */ - void *cryprovData; /* opaque data ptr for provider use */ - cryprov_if_t cryprov; /* ptr to crypto provider interface */ - sbool useCryprov; /* quicker than checkig ptr (1 vs 8 bytes!) */ int iCurrElt; /* currently active cache element (-1 = none) */ int iCurrCacheSize; /* currently cache size (1-based) */ int iDynaFileCacheSize; /* size of file handle cache */ @@ -172,116 +171,9 @@ int iFlushInterval; /* how fast flush buffer on inactivity? */ sbool bFlushOnTXEnd; /* flush write buffers when transaction has ended? */ sbool bUseAsyncWriter; /* use async stream writer? */ - sbool bVeryRobustZip; - statsobj_t *stats; /* dynafile, primarily cache stats */ - STATSCOUNTER_DEF(ctrRequests, mutCtrRequests); - STATSCOUNTER_DEF(ctrLevel0, mutCtrLevel0); - STATSCOUNTER_DEF(ctrEvict, mutCtrEvict); - STATSCOUNTER_DEF(ctrMiss, mutCtrMiss); - STATSCOUNTER_DEF(ctrMax, mutCtrMax); } instanceData; -typedef struct configSettings_s { - int iDynaFileCacheSize; /* max cache for dynamic files */ - int fCreateMode; /* mode to use when creating files */ - int fDirCreateMode; /* mode to use when creating files */ - int bFailOnChown; /* fail if chown fails? */ - uid_t fileUID; /* UID to be used for newly created files */ - uid_t fileGID; /* GID to be used for newly created files */ - uid_t dirUID; /* UID to be used for newly created directories */ - uid_t dirGID; /* GID to be used for newly created directories */ - int bCreateDirs;/* auto-create directories for dynaFiles: 0 - no, 1 - yes */ - int bEnableSync;/* enable syncing of files (no dash in front of pathname in conf): 0 - no, 1 - yes */ - int iZipLevel; /* zip compression mode (0..9 as usual) */ - sbool bFlushOnTXEnd;/* flush write buffers when transaction has ended? */ - int64 iIOBufSize; /* size of an io buffer */ - int iFlushInterval; /* how often flush the output buffer on inactivity? */ - int bUseAsyncWriter; /* should we enable asynchronous writing? */ - EMPTY_STRUCT -} configSettings_t; -static configSettings_t cs; -uchar *pszFileDfltTplName; /* name of the default template to use */ - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - uchar *tplName; /* default template */ - int fCreateMode; /* default mode to use when creating files */ - int fDirCreateMode; /* default mode to use when creating files */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - -/* tables for interfacing with the v6 config system */ -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "template", eCmdHdlrGetWord, 0 }, - { "dircreatemode", eCmdHdlrFileCreateMode, 0 }, - { "filecreatemode", eCmdHdlrFileCreateMode, 0 } -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "dynafilecachesize", eCmdHdlrInt, 0 }, /* legacy: dynafilecachesize */ - { "ziplevel", eCmdHdlrInt, 0 }, /* legacy: omfileziplevel */ - { "flushinterval", eCmdHdlrInt, 0 }, /* legacy: omfileflushinterval */ - { "asyncwriting", eCmdHdlrBinary, 0 }, /* legacy: omfileasyncwriting */ - { "veryrobustzip", eCmdHdlrBinary, 0 }, - { "flushontxend", eCmdHdlrBinary, 0 }, /* legacy: omfileflushontxend */ - { "iobuffersize", eCmdHdlrSize, 0 }, /* legacy: omfileiobuffersize */ - { "dirowner", eCmdHdlrUID, 0 }, /* legacy: dirowner */ - { "dirownernum", eCmdHdlrInt, 0 }, /* legacy: dirownernum */ - { "dirgroup", eCmdHdlrGID, 0 }, /* legacy: dirgroup */ - { "dirgroupnum", eCmdHdlrInt, 0 }, /* legacy: dirgroupnum */ - { "fileowner", eCmdHdlrUID, 0 }, /* legacy: fileowner */ - { "fileownernum", eCmdHdlrInt, 0 }, /* legacy: fileownernum */ - { "filegroup", eCmdHdlrGID, 0 }, /* legacy: filegroup */ - { "filegroupnum", eCmdHdlrInt, 0 }, /* legacy: filegroupnum */ - { "dircreatemode", eCmdHdlrFileCreateMode, 0 }, /* legacy: dircreatemode */ - { "filecreatemode", eCmdHdlrFileCreateMode, 0 }, /* legacy: filecreatemode */ - { "failonchownfailure", eCmdHdlrBinary, 0 }, /* legacy: failonchownfailure */ - { "createdirs", eCmdHdlrBinary, 0 }, /* legacy: createdirs */ - { "sync", eCmdHdlrBinary, 0 }, /* legacy: actionfileenablesync */ - { "file", eCmdHdlrString, 0 }, /* either "file" or ... */ - { "dynafile", eCmdHdlrString, 0 }, /* "dynafile" MUST be present */ - { "sig.provider", eCmdHdlrGetWord, 0 }, - { "cry.provider", eCmdHdlrGetWord, 0 }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - - -/* this function gets the default template. It coordinates action between - * old-style and new-style configuration parts. - */ -static inline uchar* -getDfltTpl(void) -{ - if(loadModConf != NULL && loadModConf->tplName != NULL) - return loadModConf->tplName; - else if(pszFileDfltTplName == NULL) - return (uchar*)"RSYSLOG_FileFormat"; - else - return pszFileDfltTplName; -} - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - pszFileDfltTplName = NULL; /* make sure this can be free'ed! */ - iRet = resetConfigVariables(NULL, NULL); /* params are dummies */ -ENDinitConfVars - BEGINisCompatibleWithFeature CODESTARTisCompatibleWithFeature if(eFeat == sFEATURERepeatedMsgReduction) @@ -294,17 +186,16 @@ if(pData->bDynamicName) { dbgprintf("[dynamic]\n"); } else { /* regular file */ - dbgprintf("%s%s\n", pData->fname, - (pData->pStrm == NULL) ? " (closed)" : ""); + dbgprintf("%s%s\n", pData->f_fname, + (pData->pStrm == NULL) ? " (unused)" : ""); } - dbgprintf("\ttemplate='%s'\n", pData->fname); + dbgprintf("\ttemplate='%s'\n", pData->f_fname); dbgprintf("\tuse async writer=%d\n", pData->bUseAsyncWriter); dbgprintf("\tflush on TX end=%d\n", pData->bFlushOnTXEnd); dbgprintf("\tflush interval=%d\n", pData->iFlushInterval); dbgprintf("\tfile cache size=%d\n", pData->iDynaFileCacheSize); - dbgprintf("\tcreate directories: %s\n", pData->bCreateDirs ? "on" : "off"); - dbgprintf("\tvery robust zip: %s\n", pData->bCreateDirs ? "on" : "off"); + dbgprintf("\tcreate directories: %s\n", pData->bCreateDirs ? "yes" : "no"); dbgprintf("\tfile owner %d, group %d\n", (int) pData->fileUID, (int) pData->fileGID); dbgprintf("\tdirectory owner %d, group %d\n", (int) pData->dirUID, (int) pData->dirGID); dbgprintf("\tdir create mode 0%3.3o, file create mode 0%3.3o\n", @@ -313,31 +204,6 @@ ENDdbgPrintInstInfo - -/* set the default template to be used - * This is a module-global parameter, and as such needs special handling. It needs to - * be coordinated with values set via the v2 config system (rsyslog v6+). What we do - * is we do not permit this directive after the v2 config system has been used to set - * the parameter. - */ -rsRetVal -setLegacyDfltTpl(void __attribute__((unused)) *pVal, uchar* newVal) -{ - DEFiRet; - - if(loadModConf != NULL && loadModConf->tplName != NULL) { - free(newVal); - errmsg.LogError(0, RS_RET_ERR, "omfile: default template already set via module " - "global parameter - can no longer be changed"); - ABORT_FINALIZE(RS_RET_ERR); - } - free(pszFileDfltTplName); - pszFileDfltTplName = newVal; -finalize_it: - RETiRet; -} - - /* set the dynaFile cache size. Does some limit checking. * rgerhards, 2007-07-31 */ @@ -362,13 +228,21 @@ iNewVal = 1000; } - cs.iDynaFileCacheSize = iNewVal; + iDynaFileCacheSize = iNewVal; DBGPRINTF("DynaFileCacheSize changed to %d.\n", iNewVal); RETiRet; } +rsRetVal goneAway(void __attribute__((unused)) *pVal, + int __attribute__((unused)) iNewVal) +{ + errmsg.LogError(0, RS_RET_ERR, "directive $omfileForceChown is no longer supported"); + return RS_RET_ERR; +} + + /* Helper to cfline(). Parses a output channel name up until the first * comma and then looks for the template specifier. Tries * to find that template. Maps the output channel to the @@ -418,14 +292,15 @@ } /* OK, we finally got a correct template. So let's use it... */ - pData->fname = ustrdup(pOch->pszFileTemplate); + ustrncpy(pData->f_fname, pOch->pszFileTemplate, MAXFNAME); pData->iSizeLimit = pOch->uSizeLimit; /* WARNING: It is dangerous "just" to pass the pointer. As we * never rebuild the output channel description, this is acceptable here. */ pData->pszSizeLimitCmd = pOch->cmdOnSizeLimit; - iRet = cflineParseTemplateName(&p, pOMSR, iEntry, iTplOpts, getDfltTpl()); + iRet = cflineParseTemplateName(&p, pOMSR, iEntry, iTplOpts, + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName); finalize_it: RETiRet; @@ -440,16 +315,15 @@ * if the entry should be d_free()ed and 0 if not. */ static rsRetVal -dynaFileDelCacheEntry(instanceData *pData, int iEntry, int bFreeEntry) +dynaFileDelCacheEntry(dynaFileCacheEntry **pCache, int iEntry, int bFreeEntry) { - dynaFileCacheEntry **pCache = pData->dynCache; DEFiRet; ASSERT(pCache != NULL); if(pCache[iEntry] == NULL) FINALIZE; - DBGPRINTF("Removing entry %d for file '%s' from dynaCache.\n", iEntry, + DBGPRINTF("Removed entry %d for file '%s' from dynaCache.\n", iEntry, pCache[iEntry]->pName == NULL ? UCHAR_CONSTANT("[OPEN FAILED]") : pCache[iEntry]->pName); if(pCache[iEntry]->pName != NULL) { @@ -459,10 +333,8 @@ if(pCache[iEntry]->pStrm != NULL) { strm.Destruct(&pCache[iEntry]->pStrm); - if(pData->useSigprov) { - pData->sigprov.OnFileClose(pCache[iEntry]->sigprovFileData); - pCache[iEntry]->sigprovFileData = NULL; - } + if(pCache[iEntry]->pStrm != NULL) /* safety check -- TODO: remove if no longer necessary */ + abort(); } if(bFreeEntry) { @@ -487,7 +359,7 @@ BEGINfunc; for(i = 0 ; i < pData->iCurrCacheSize ; ++i) { - dynaFileDelCacheEntry(pData, i, 1); + dynaFileDelCacheEntry(pData->dynCache, i, 1); } pData->iCurrElt = -1; /* invalidate current element */ ENDfunc; @@ -508,29 +380,6 @@ } -/* close current file */ -static rsRetVal -closeFile(instanceData *pData) -{ - DEFiRet; - if(pData->useSigprov) { - pData->sigprov.OnFileClose(pData->sigprovFileData); - pData->sigprovFileData = NULL; - } - strm.Destruct(&pData->pStrm); - RETiRet; -} - - -/* This prepares the signature provider to process a file */ -static rsRetVal -sigprovPrepare(instanceData *pData, uchar *fn) -{ - DEFiRet; - pData->sigprov.OnFileOpen(pData->sigprovData, fn, &pData->sigprovFileData); - RETiRet; -} - /* This is now shared code for all types of files. It simply prepares * file access, which, among others, means the the file wil be opened * and any directories in between will be created (based on config, of @@ -597,17 +446,12 @@ CHKiRet(strm.SetFName(pData->pStrm, szBaseName, ustrlen(szBaseName))); CHKiRet(strm.SetDir(pData->pStrm, szDirName, ustrlen(szDirName))); CHKiRet(strm.SetiZipLevel(pData->pStrm, pData->iZipLevel)); - CHKiRet(strm.SetbVeryReliableZip(pData->pStrm, pData->bVeryRobustZip)); CHKiRet(strm.SetsIOBufSize(pData->pStrm, (size_t) pData->iIOBufSize)); CHKiRet(strm.SettOperationsMode(pData->pStrm, STREAMMODE_WRITE_APPEND)); - CHKiRet(strm.SettOpenMode(pData->pStrm, cs.fCreateMode)); + CHKiRet(strm.SettOpenMode(pData->pStrm, fCreateMode)); CHKiRet(strm.SetbSync(pData->pStrm, pData->bSyncFile)); - CHKiRet(strm.SetsType(pData->pStrm, STREAMTYPE_FILE_SINGLE)); + CHKiRet(strm.SetsType(pData->pStrm, pData->strmType)); CHKiRet(strm.SetiSizeLimit(pData->pStrm, pData->iSizeLimit)); - if(pData->useCryprov) { - CHKiRet(strm.Setcryprov(pData->pStrm, &pData->cryprov)); - CHKiRet(strm.SetcryprovData(pData->pStrm, pData->cryprovData)); - } /* set the flush interval only if we actually use it - otherwise it will activate * async processing, which is a real performance waste if we do not do buffered * writes! -- rgerhards, 2009-07-06 @@ -617,14 +461,11 @@ if(pData->pszSizeLimitCmd != NULL) CHKiRet(strm.SetpszSizeLimitCmd(pData->pStrm, ustrdup(pData->pszSizeLimitCmd))); CHKiRet(strm.ConstructFinalize(pData->pStrm)); - - if(pData->useSigprov) - sigprovPrepare(pData, szNameBuf); finalize_it: if(iRet != RS_RET_OK) { if(pData->pStrm != NULL) { - closeFile(pData); + strm.Destruct(&pData->pStrm); } } RETiRet; @@ -655,13 +496,14 @@ pCache = pData->dynCache; - /* first check, if we still have the current file */ + /* first check, if we still have the current file + * I *hope* this will be a performance enhancement. + */ if( (pData->iCurrElt != -1) && !ustrcmp(newFileName, pCache[pData->iCurrElt]->pName)) { /* great, we are all set */ pCache[pData->iCurrElt]->clkTickAccessed = getClockFileAccess(); - STATSCOUNTER_INC(pData->ctrLevel0, pData->mutCtrLevel0); - /* LRU needs only a strictly monotonically increasing counter, so such a one could do */ + // LRU needs only a strictly monotonically increasing counter, so such a one could do FINALIZE; } @@ -677,11 +519,9 @@ if(iFirstFree == -1) iFirstFree = i; } else { /* got an element, let's see if it matches */ - if(!ustrcmp(newFileName, pCache[i]->pName)) { + if(!ustrcmp(newFileName, pCache[i]->pName)) { // RG: name == NULL? /* we found our element! */ pData->pStrm = pCache[i]->pStrm; - if(pData->useSigprov) - pData->sigprovFileData = pCache[i]->sigprovFileData; pData->iCurrElt = i; pCache[i]->clkTickAccessed = getClockFileAccess(); /* update "timestamp" for LRU */ FINALIZE; @@ -695,7 +535,6 @@ } /* we have not found an entry */ - STATSCOUNTER_INC(pData->ctrMiss, pData->mutCtrMiss); /* invalidate iCurrElt as we may error-exit out of this function when the currrent * iCurrElt has been freed or otherwise become unusable. This is a precaution, and @@ -708,12 +547,11 @@ * but it could be triggered in the common case of a failed open() system call. * rgerhards, 2010-03-22 */ - pData->pStrm = NULL, pData->sigprovFileData = NULL; + pData->pStrm = NULL; if(iFirstFree == -1 && (pData->iCurrCacheSize < pData->iDynaFileCacheSize)) { /* there is space left, so set it to that index */ iFirstFree = pData->iCurrCacheSize++; - STATSCOUNTER_SETMAX_NOMUT(pData->ctrMax, (unsigned) pData->iCurrCacheSize); } /* Note that the following code sequence does not work with the cache entry itself, @@ -721,11 +559,13 @@ * The cache array is only updated after the open was successful. -- rgerhards, 2010-03-21 */ if(iFirstFree == -1) { - dynaFileDelCacheEntry(pData, iOldest, 0); - STATSCOUNTER_INC(pData->ctrEvict, pData->mutCtrEvict); + dynaFileDelCacheEntry(pCache, iOldest, 0); iFirstFree = iOldest; /* this one *is* now free ;) */ } else { /* we need to allocate memory for the cache structure */ + /* TODO: performance note: we could alloc all entries on startup, thus saving malloc + * overhead -- this may be something to consider in v5... + */ CHKmalloc(pCache[iFirstFree] = (dynaFileCacheEntry*) calloc(1, sizeof(dynaFileCacheEntry))); } @@ -748,12 +588,10 @@ } if((pCache[iFirstFree]->pName = ustrdup(newFileName)) == NULL) { - closeFile(pData); /* need to free failed entry! */ + strm.Destruct(&pData->pStrm); /* need to free failed entry! */ ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); } pCache[iFirstFree]->pStrm = pData->pStrm; - if(pData->useSigprov) - pCache[iFirstFree]->sigprovFileData = pData->sigprovFileData; pCache[iFirstFree]->clkTickAccessed = getClockFileAccess(); pData->iCurrElt = iFirstFree; DBGPRINTF("Added new entry %d for file cache, file '%s'.\n", iFirstFree, newFileName); @@ -775,12 +613,10 @@ ASSERT(pData != NULL); ASSERT(pszBuf != NULL); - DBGPRINTF("write to stream, pData->pStrm %p, lenBuf %d\n", pData->pStrm, lenBuf); +dbgprintf("write to stream, pData->pStrm %p, lenBuf %d\n", pData->pStrm, lenBuf); if(pData->pStrm != NULL){ CHKiRet(strm.Write(pData->pStrm, pszBuf, lenBuf)); - if(pData->useSigprov) { - CHKiRet(pData->sigprov.OnRecordWrite(pData->sigprovFileData, pszBuf, lenBuf)); - } + FINALIZE; } finalize_it: @@ -788,7 +624,10 @@ } -/* rgerhards 2004-11-11: write to a file output. */ +/* rgerhards 2004-11-11: write to a file output. This + * will be called for all outputs using file semantics, + * for example also for pipes. + */ static rsRetVal writeFile(uchar **ppString, unsigned iMsgOpts, instanceData *pData) { @@ -803,9 +642,9 @@ CHKiRet(prepareDynFile(pData, ppString[1], iMsgOpts)); } else { /* "regular", non-dynafile */ if(pData->pStrm == NULL) { - CHKiRet(prepareFile(pData, pData->fname)); + CHKiRet(prepareFile(pData, pData->f_fname)); if(pData->pStrm == NULL) { - errmsg.LogError(0, RS_RET_NO_FILE_ACCESS, "Could no open output file '%s'", pData->fname); + errmsg.LogError(0, RS_RET_NO_FILE_ACCESS, "Could no open output file '%s'", pData->f_fname); } } } @@ -813,82 +652,15 @@ CHKiRet(doWrite(pData, ppString[0], strlen(CHAR_CONVERT(ppString[0])))); finalize_it: + if(iRet != RS_RET_OK) { + /* in v5, we shall return different states for message-caused failure (but only there!) */ + if(pData->strmType == STREAMTYPE_NAMED_PIPE) + iRet = RS_RET_DISABLE_ACTION; /* this is the traditional semantic -- rgerhards, 2010-01-15 */ + } RETiRet; } -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->tplName = NULL; - pModConf->fCreateMode = 0644; - pModConf->fDirCreateMode = 0700; -ENDbeginCnfLoad - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for omfile:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "template")) { - loadModConf->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - if(pszFileDfltTplName != NULL) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "omfile: warning: default template " - "was already set via legacy directive - may lead to inconsistent " - "results."); - } - } else if(!strcmp(modpblk.descr[i].name, "dircreatemode")) { - loadModConf->fDirCreateMode = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "filecreatemode")) { - loadModConf->fCreateMode = (int) pvals[i].val.d.n; - } else { - dbgprintf("omfile: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(pszFileDfltTplName); - pszFileDfltTplName = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf - free(pModConf->tplName); -ENDfreeCnf - - BEGINcreateInstance CODESTARTcreateInstance pData->pStrm = NULL; @@ -897,26 +669,10 @@ BEGINfreeInstance CODESTARTfreeInstance - free(pData->tplName); - free(pData->fname); if(pData->bDynamicName) { dynaFileFreeCache(pData); } else if(pData->pStrm != NULL) - closeFile(pData); - if(pData->useSigprov) { - pData->sigprov.Destruct(&pData->sigprovData); - obj.ReleaseObj(__FILE__, pData->sigprovNameFull+2, pData->sigprovNameFull, - (void*) &pData->sigprov); - free(pData->sigprovName); - free(pData->sigprovNameFull); - } - if(pData->useCryprov) { - pData->cryprov.Destruct(&pData->cryprovData); - obj.ReleaseObj(__FILE__, pData->cryprovNameFull+2, pData->cryprovNameFull, - (void*) &pData->cryprov); - free(pData->cryprovName); - free(pData->cryprovNameFull); - } + strm.Destruct(&pData->pStrm); ENDfreeInstance @@ -934,12 +690,7 @@ CODESTARTendTransaction /* Note: pStrm may be NULL if there was an error opening the stream */ if(pData->bFlushOnTXEnd && pData->pStrm != NULL) { - /* if we have an async writer, it controls the flush via - * a timeout. However, without it, we actually need to flush, - * else incomplete records are written. - */ - if(!pData->bUseAsyncWriter) - CHKiRet(strm.Flush(pData->pStrm)); + CHKiRet(strm.Flush(pData->pStrm)); } finalize_it: ENDendTransaction @@ -947,10 +698,7 @@ BEGINdoAction CODESTARTdoAction - DBGPRINTF("file to log to: %s\n", - (pData->bDynamicName) ? ppString[1] : pData->fname); - DBGPRINTF("omfile: start of data: '%.128s'\n", ppString[0]); - STATSCOUNTER_INC(pData->ctrRequests, pData->mutCtrRequests); + DBGPRINTF("file to log to: %s\n", pData->f_fname); CHKiRet(writeFile(ppString, iMsgOpts, pData)); if(!bCoreSupportsBatching && pData->bFlushOnTXEnd) { CHKiRet(strm.Flush(pData->pStrm)); @@ -961,279 +709,7 @@ ENDdoAction -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->fname = NULL; - pData->tplName = NULL; - pData->fileUID = -1; - pData->fileGID = -1; - pData->dirUID = -1; - pData->dirGID = -1; - pData->bFailOnChown = 1; - pData->iDynaFileCacheSize = 10; - pData->fCreateMode = loadModConf->fCreateMode; - pData->fDirCreateMode = loadModConf->fDirCreateMode; - pData->bCreateDirs = 1; - pData->bSyncFile = 0; - pData->iZipLevel = 0; - pData->bVeryRobustZip = 0; - pData->bFlushOnTXEnd = FLUSHONTX_DFLT; - pData->iIOBufSize = IOBUF_DFLT_SIZE; - pData->iFlushInterval = FLUSH_INTRVL_DFLT; - pData->bUseAsyncWriter = USE_ASYNCWRITER_DFLT; - pData->sigprovName = NULL; - pData->cryprovName = NULL; - pData->useSigprov = 0; - pData->useCryprov = 0; -} - - -static rsRetVal -setupInstStatsCtrs(instanceData *pData) -{ - uchar ctrName[512]; - DEFiRet; - - if(!pData->bDynamicName) { - FINALIZE; - } - - /* support statistics gathering */ - snprintf((char*)ctrName, sizeof(ctrName), "dynafile cache %s", pData->fname); - ctrName[sizeof(ctrName)-1] = '\0'; /* be on the save side */ - CHKiRet(statsobj.Construct(&(pData->stats))); - CHKiRet(statsobj.SetName(pData->stats, ctrName)); - STATSCOUNTER_INIT(pData->ctrRequests, pData->mutCtrRequests); - CHKiRet(statsobj.AddCounter(pData->stats, UCHAR_CONSTANT("requests"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pData->ctrRequests))); - STATSCOUNTER_INIT(pData->ctrLevel0, pData->mutCtrLevel0); - CHKiRet(statsobj.AddCounter(pData->stats, UCHAR_CONSTANT("level0"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pData->ctrLevel0))); - STATSCOUNTER_INIT(pData->ctrMiss, pData->mutCtrMiss); - CHKiRet(statsobj.AddCounter(pData->stats, UCHAR_CONSTANT("missed"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pData->ctrMiss))); - STATSCOUNTER_INIT(pData->ctrEvict, pData->mutCtrEvict); - CHKiRet(statsobj.AddCounter(pData->stats, UCHAR_CONSTANT("evicted"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pData->ctrEvict))); - STATSCOUNTER_INIT(pData->ctrMax, pData->mutCtrMax); - CHKiRet(statsobj.AddCounter(pData->stats, UCHAR_CONSTANT("maxused"), - ctrType_IntCtr, CTR_FLAG_RESETTABLE, &(pData->ctrMax))); - CHKiRet(statsobj.ConstructFinalize(pData->stats)); - -finalize_it: - RETiRet; -} - -static inline void -initSigprov(instanceData *pData, struct nvlst *lst) -{ - uchar szDrvrName[1024]; - - if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmsig_%s", pData->sigprovName) - == sizeof(szDrvrName)) { - errmsg.LogError(0, RS_RET_ERR, "omfile: signature provider " - "name is too long: '%s' - signatures disabled", - pData->sigprovName); - goto done; - } - pData->sigprovNameFull = ustrdup(szDrvrName); - - pData->sigprov.ifVersion = sigprovCURR_IF_VERSION; - /* The pDrvrName+2 below is a hack to obtain the object name. It - * safes us to have yet another variable with the name without "lm" in - * front of it. If we change the module load interface, we may re-think - * about this hack, but for the time being it is efficient and clean enough. - */ - if(obj.UseObj(__FILE__, szDrvrName, szDrvrName, (void*) &pData->sigprov) - != RS_RET_OK) { - errmsg.LogError(0, RS_RET_LOAD_ERROR, "omfile: could not load " - "signature provider '%s' - signatures disabled", - szDrvrName); - goto done; - } - - if(pData->sigprov.Construct(&pData->sigprovData) != RS_RET_OK) { - errmsg.LogError(0, RS_RET_SIGPROV_ERR, "omfile: error constructing " - "signature provider %s dataset - signatures disabled", - szDrvrName); - goto done; - } - pData->sigprov.SetCnfParam(pData->sigprovData, lst); - - dbgprintf("loaded signature provider %s, data instance at %p\n", - szDrvrName, pData->sigprovData); - pData->useSigprov = 1; -done: return; -} - -static inline rsRetVal -initCryprov(instanceData *pData, struct nvlst *lst) -{ - uchar szDrvrName[1024]; - DEFiRet; - - if(snprintf((char*)szDrvrName, sizeof(szDrvrName), "lmcry_%s", pData->cryprovName) - == sizeof(szDrvrName)) { - errmsg.LogError(0, RS_RET_ERR, "omfile: crypto provider " - "name is too long: '%s' - encryption disabled", - pData->cryprovName); - ABORT_FINALIZE(RS_RET_ERR); - } - pData->cryprovNameFull = ustrdup(szDrvrName); - - pData->cryprov.ifVersion = cryprovCURR_IF_VERSION; - /* The pDrvrName+2 below is a hack to obtain the object name. It - * safes us to have yet another variable with the name without "lm" in - * front of it. If we change the module load interface, we may re-think - * about this hack, but for the time being it is efficient and clean enough. - */ - if(obj.UseObj(__FILE__, szDrvrName, szDrvrName, (void*) &pData->cryprov) - != RS_RET_OK) { - errmsg.LogError(0, RS_RET_LOAD_ERROR, "omfile: could not load " - "crypto provider '%s' - encryption disabled", - szDrvrName); - ABORT_FINALIZE(RS_RET_CRYPROV_ERR); - } - - if(pData->cryprov.Construct(&pData->cryprovData) != RS_RET_OK) { - errmsg.LogError(0, RS_RET_CRYPROV_ERR, "omfile: error constructing " - "crypto provider %s dataset - encryption disabled", - szDrvrName); - ABORT_FINALIZE(RS_RET_CRYPROV_ERR); - } - CHKiRet(pData->cryprov.SetCnfParam(pData->cryprovData, lst, CRYPROV_PARAMTYPE_REGULAR)); - - dbgprintf("loaded crypto provider %s, data instance at %p\n", - szDrvrName, pData->cryprovData); - pData->useCryprov = 1; -finalize_it: - RETiRet; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - uchar *tplToUse; - int i; -CODESTARTnewActInst - DBGPRINTF("newActInst (omfile)\n"); - - pvals = nvlstGetParams(lst, &actpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "omfile: either the \"file\" or " - "\"dynfile\" parameter must be given"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("action param blk in omfile:\n"); - cnfparamsPrint(&actpblk, pvals); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "dynafilecachesize")) { - pData->iDynaFileCacheSize = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "ziplevel")) { - pData->iZipLevel = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "flushinterval")) { - pData->iFlushInterval = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "veryrobustzip")) { - pData->bVeryRobustZip = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "asyncwriting")) { - pData->bUseAsyncWriter = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "flushontxend")) { - pData->bFlushOnTXEnd = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "iobuffersize")) { - pData->iIOBufSize = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dirowner")) { - pData->dirUID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dirownernum")) { - pData->dirUID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dirgroup")) { - pData->dirGID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dirgroupnum")) { - pData->dirGID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "fileowner")) { - pData->fileUID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "fileownernum")) { - pData->fileUID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "filegroup")) { - pData->fileGID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "filegroupnum")) { - pData->fileGID = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "dircreatemode")) { - pData->fDirCreateMode = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "filecreatemode")) { - pData->fCreateMode = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "failonchownfailure")) { - pData->bFailOnChown = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "sync")) { - pData->bSyncFile = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "createdirs")) { - pData->bCreateDirs = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "file")) { - pData->fname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - CODE_STD_STRING_REQUESTnewActInst(1) - pData->bDynamicName = 0; - } else if(!strcmp(actpblk.descr[i].name, "dynafile")) { - pData->fname = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - CODE_STD_STRING_REQUESTnewActInst(2) - pData->bDynamicName = 1; - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "sig.provider")) { - pData->sigprovName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "cry.provider")) { - pData->cryprovName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omfile: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->fname == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "omfile: either the \"file\" or " - "\"dynfile\" parameter must be given"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(pData->sigprovName != NULL) { - initSigprov(pData, lst); - } - - if(pData->cryprovName != NULL) { - CHKiRet(initCryprov(pData, lst)); - } - - tplToUse = ustrdup((pData->tplName == NULL) ? getDfltTpl() : pData->tplName); - CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_NO_RQD_TPL_OPTS)); - - if(pData->bDynamicName) { - /* "filename" is actually a template name, we need this as string 1. So let's add it - * to the pOMSR. -- rgerhards, 2007-07-27 - */ - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->fname), OMSR_NO_RQD_TPL_OPTS)); - // TODO: create unified code for this (legacy+v6 system) - /* we now allocate the cache table */ - CHKmalloc(pData->dynCache = (dynaFileCacheEntry**) - calloc(pData->iDynaFileCacheSize, sizeof(dynaFileCacheEntry*))); - pData->iCurrElt = -1; /* no current element */ - } -// TODO: add pData->iSizeLimit = 0; /* default value, use outchannels to configure! */ - setupInstStatsCtrs(pData); - -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - BEGINparseSelectorAct - uchar fname[MAXFNAME]; CODESTARTparseSelectorAct /* Note: the indicator sequence permits us to use '$' to signify * outchannel, what otherwise is not possible due to truely @@ -1242,6 +718,13 @@ */ if(!strncmp((char*) p, ":omfile:", sizeof(":omfile:") - 1)) { p += sizeof(":omfile:") - 1; + } else { + if(*p == '$') { + errmsg.LogError(0, RS_RET_OUTDATED_STMT, + "action '%s' treated as ':omfile:%s' - please " + "change syntax, '%s' will not be supported in " + "rsyslog v6 and above.", p, p, p); + } } if(!(*p == '$' || *p == '?' || *p == '/' || *p == '.' || *p == '-')) ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); @@ -1252,7 +735,7 @@ pData->bSyncFile = 0; p++; } else { - pData->bSyncFile = cs.bEnableSync; + pData->bSyncFile = bEnableSync; } pData->iSizeLimit = 0; /* default value, use outchannels to configure! */ @@ -1275,24 +758,39 @@ */ CODE_STD_STRING_REQUESTparseSelectorAct(2) ++p; /* eat '?' */ - CHKiRet(cflineParseFileName(p, fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, getDfltTpl())); - pData->fname = ustrdup(fname); - pData->bDynamicName = 1; - pData->iCurrElt = -1; /* no current element */ + CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName)); /* "filename" is actually a template name, we need this as string 1. So let's add it * to the pOMSR. -- rgerhards, 2007-07-27 */ - CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->fname), OMSR_NO_RQD_TPL_OPTS)); + CHKiRet(OMSRsetEntry(*ppOMSR, 1, ustrdup(pData->f_fname), OMSR_NO_RQD_TPL_OPTS)); + + pData->bDynamicName = 1; + pData->iCurrElt = -1; /* no current element */ /* we now allocate the cache table */ CHKmalloc(pData->dynCache = (dynaFileCacheEntry**) - calloc(cs.iDynaFileCacheSize, sizeof(dynaFileCacheEntry*))); + calloc(iDynaFileCacheSize, sizeof(dynaFileCacheEntry*))); break; + /* case '|': while pipe support has been removed, I leave the code in in case we + * need high-performance pipes at a later stage (unlikely). -- rgerhards, 2010-02-28 + */ case '/': case '.': CODE_STD_STRING_REQUESTparseSelectorAct(1) - CHKiRet(cflineParseFileName(p, fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, getDfltTpl())); - pData->fname = ustrdup(fname); + /* we now have *almost* the same semantics for files and pipes, but we still need + * to know we deal with a pipe, because we must do non-blocking opens in that case + * (to keep consistent with traditional semantics and prevent rsyslog from hanging). + */ + if(*p == '|') { + ++p; + pData->strmType = STREAMTYPE_NAMED_PIPE; + } else { + pData->strmType = STREAMTYPE_FILE_SINGLE; + } + + CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName)); pData->bDynamicName = 0; break; default: @@ -1300,22 +798,20 @@ } /* freeze current paremeters for this action */ - pData->iDynaFileCacheSize = cs.iDynaFileCacheSize; - pData->fCreateMode = cs.fCreateMode; - pData->fDirCreateMode = cs.fDirCreateMode; - pData->bCreateDirs = cs.bCreateDirs; - pData->bFailOnChown = cs.bFailOnChown; - pData->fileUID = cs.fileUID; - pData->fileGID = cs.fileGID; - pData->dirUID = cs.dirUID; - pData->dirGID = cs.dirGID; - pData->iZipLevel = cs.iZipLevel; - pData->bFlushOnTXEnd = cs.bFlushOnTXEnd; - pData->iIOBufSize = (int) cs.iIOBufSize; - pData->iFlushInterval = cs.iFlushInterval; - pData->bUseAsyncWriter = cs.bUseAsyncWriter; - pData->bVeryRobustZip = 0; /* cannot be specified via legacy conf */ - setupInstStatsCtrs(pData); + pData->iDynaFileCacheSize = iDynaFileCacheSize; + pData->fCreateMode = fCreateMode; + pData->fDirCreateMode = fDirCreateMode; + pData->bCreateDirs = bCreateDirs; + pData->bFailOnChown = bFailOnChown; + pData->fileUID = fileUID; + pData->fileGID = fileGID; + pData->dirUID = dirUID; + pData->dirGID = dirGID; + pData->iZipLevel = iZipLevel; + pData->bFlushOnTXEnd = bFlushOnTXEnd; + pData->iIOBufSize = (int) iIOBufSize; + pData->iFlushInterval = iFlushInterval; + pData->bUseAsyncWriter = bUseAsyncWriter; CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -1325,23 +821,26 @@ */ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { - cs.fileUID = -1; - cs.fileGID = -1; - cs.dirUID = -1; - cs.dirGID = -1; - cs.bFailOnChown = 1; - cs.iDynaFileCacheSize = 10; - cs.fCreateMode = 0644; - cs.fDirCreateMode = 0700; - cs.bCreateDirs = 1; - cs.bEnableSync = 0; - cs.iZipLevel = 0; - cs.bFlushOnTXEnd = FLUSHONTX_DFLT; - cs.iIOBufSize = IOBUF_DFLT_SIZE; - cs.iFlushInterval = FLUSH_INTRVL_DFLT; - cs.bUseAsyncWriter = USE_ASYNCWRITER_DFLT; - free(pszFileDfltTplName); - pszFileDfltTplName = NULL; + fileUID = -1; + fileGID = -1; + dirUID = -1; + dirGID = -1; + bFailOnChown = 1; + iDynaFileCacheSize = 10; + fCreateMode = 0644; + fDirCreateMode = 0700; + bCreateDirs = 1; + bEnableSync = 0; + iZipLevel = 0; + bFlushOnTXEnd = FLUSHONTX_DFLT; + iIOBufSize = IOBUF_DFLT_SIZE; + iFlushInterval = FLUSH_INTRVL_DFLT; + bUseAsyncWriter = USE_ASYNCWRITER_DFLT; + if(pszFileDfltTplName != NULL) { + free(pszFileDfltTplName); + pszFileDfltTplName = NULL; + } + return RS_RET_OK; } @@ -1352,7 +851,8 @@ dynaFileFreeCacheEntries(pData); } else { if(pData->pStrm != NULL) { - closeFile(pData); + strm.Destruct(&pData->pStrm); + pData->pStrm = NULL; } } ENDdoHUP @@ -1362,7 +862,7 @@ CODESTARTmodExit objRelease(errmsg, CORE_COMPONENT); objRelease(strm, CORE_COMPONENT); - objRelease(statsobj, CORE_COMPONENT); + free(pszFileDfltTplName); DESTROY_ATOMIC_HELPER_MUT(mutClock); ENDmodExit @@ -1370,9 +870,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES CODEqueryEtryPt_TXIF_OMOD_QUERIES /* we support the transactional interface! */ CODEqueryEtryPt_doHUP ENDqueryEtryPt @@ -1382,36 +879,30 @@ CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr -INITLegCnfVars CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(strm, CORE_COMPONENT)); - CHKiRet(objUse(statsobj, CORE_COMPONENT)); INIT_ATOMIC_HELPER_MUT(mutClock); INITChkCoreFeature(bCoreSupportsBatching, CORE_FEATURE_BATCHING); DBGPRINTF("omfile: %susing transactional output interface.\n", bCoreSupportsBatching ? "" : "not "); CHKiRet(omsdRegCFSLineHdlr((uchar *)"dynafilecachesize", 0, eCmdHdlrInt, (void*) setDynaFileCacheSize, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileziplevel", 0, eCmdHdlrInt, NULL, &cs.iZipLevel, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileflushinterval", 0, eCmdHdlrInt, NULL, &cs.iFlushInterval, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileasyncwriting", 0, eCmdHdlrBinary, NULL, &cs.bUseAsyncWriter, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileflushontxend", 0, eCmdHdlrBinary, NULL, &cs.bFlushOnTXEnd, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileiobuffersize", 0, eCmdHdlrSize, NULL, &cs.iIOBufSize, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"dirowner", 0, eCmdHdlrUID, NULL, &cs.dirUID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"dirownernum", 0, eCmdHdlrInt, NULL, &cs.dirUID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"dirgroup", 0, eCmdHdlrGID, NULL, &cs.dirGID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"dirgroupnum", 0, eCmdHdlrInt, NULL, &cs.dirGID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"fileowner", 0, eCmdHdlrUID, NULL, &cs.fileUID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"fileownernum", 0, eCmdHdlrInt, NULL, &cs.fileUID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"filegroup", 0, eCmdHdlrGID, NULL, &cs.fileGID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"filegroupnum", 0, eCmdHdlrInt, NULL, &cs.fileGID, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"dircreatemode", 0, eCmdHdlrFileCreateMode, NULL, &cs.fDirCreateMode, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"filecreatemode", 0, eCmdHdlrFileCreateMode, NULL, &cs.fCreateMode, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"createdirs", 0, eCmdHdlrBinary, NULL, &cs.bCreateDirs, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"failonchownfailure", 0, eCmdHdlrBinary, NULL, &cs.bFailOnChown, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileforcechown", 0, eCmdHdlrGoneAway, NULL, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionfileenablesync", 0, eCmdHdlrBinary, NULL, &cs.bEnableSync, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionfiledefaulttemplate", 0, eCmdHdlrGetWord, setLegacyDfltTpl, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileziplevel", 0, eCmdHdlrInt, NULL, &iZipLevel, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileflushinterval", 0, eCmdHdlrInt, NULL, &iFlushInterval, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileasyncwriting", 0, eCmdHdlrBinary, NULL, &bUseAsyncWriter, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileflushontxend", 0, eCmdHdlrBinary, NULL, &bFlushOnTXEnd, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileiobuffersize", 0, eCmdHdlrSize, NULL, &iIOBufSize, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"dirowner", 0, eCmdHdlrUID, NULL, &dirUID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"dirgroup", 0, eCmdHdlrGID, NULL, &dirGID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"fileowner", 0, eCmdHdlrUID, NULL, &fileUID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"filegroup", 0, eCmdHdlrGID, NULL, &fileGID, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"dircreatemode", 0, eCmdHdlrFileCreateMode, NULL, &fDirCreateMode, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"filecreatemode", 0, eCmdHdlrFileCreateMode, NULL, &fCreateMode, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"createdirs", 0, eCmdHdlrBinary, NULL, &bCreateDirs, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"failonchownfailure", 0, eCmdHdlrBinary, NULL, &bFailOnChown, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"omfileforcechown", 0, eCmdHdlrBinary, goneAway, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionfileenablesync", 0, eCmdHdlrBinary, NULL, &bEnableSync, STD_LOADABLE_MODULE_ID)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionfiledefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszFileDfltTplName, NULL)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* vi:set ai: diff -Nru rsyslog-7.6.0/tools/omfwd.c rsyslog-5.10.1/tools/omfwd.c --- rsyslog-7.6.0/tools/omfwd.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tools/omfwd.c 2012-10-17 14:41:20.000000000 +0000 @@ -4,7 +4,10 @@ * NOTE: read comments in module-template.h to understand how this file * works! * - * Copyright 2007-2013 Adiscon GmbH. + * File begun on 2007-07-20 by RGerhards (extracted from syslogd.c, which + * at the time of rsyslog fork from sysklogd was under BSD license) + * + * Copyright 2007-2012 Adiscon GmbH. * * This file is part of rsyslog. * @@ -36,7 +39,6 @@ #include #include #include -#include #ifdef USE_NETZIP #include #endif @@ -56,11 +58,9 @@ #include "module-template.h" #include "glbl.h" #include "errmsg.h" -#include "unicode-helper.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omfwd") /* internal structures */ @@ -72,156 +72,41 @@ DEFobjCurrIf(netstrm) DEFobjCurrIf(tcpclt) -/* some local constants (just) for better readybility */ -#define IS_FLUSH 1 -#define NO_FLUSH 0 - typedef struct _instanceData { - uchar *tplName; /* name of assigned template */ netstrms_t *pNS; /* netstream subsystem */ netstrm_t *pNetstrm; /* our output netstream */ uchar *pszStrmDrvr; uchar *pszStrmDrvrAuthMode; permittedPeers_t *pPermPeers; int iStrmDrvrMode; - char *target; + char *f_hname; int *pSockArray; /* sockets to use for UDP */ int bIsConnected; /* are we connected to remote host? 0 - no, 1 - yes, UDP means addr resolved */ struct addrinfo *f_addr; int compressionLevel; /* 0 - no compression, else level for zlib */ char *port; int protocol; - int iRebindInterval; /* rebind interval */ + int iUDPRebindInterval; /* rebind interval */ + int iTCPRebindInterval; /* rebind interval */ int nXmit; /* number of transmissions since last (re-)bind */ # define FORW_UDP 0 # define FORW_TCP 1 /* following fields for TCP-based delivery */ - TCPFRAMINGMODE tcp_framing; - int bResendLastOnRecon; /* should the last message be re-sent on a successful reconnect? */ tcpclt_t *pTCPClt; /* our tcpclt object */ -# define COMPRESS_NEVER 0 -# define COMPRESS_SINGLE_MSG 1 /* old, single-message compression */ - /* all other settings are for stream-compression */ -# define COMPRESS_STREAM_ALWAYS 2 - uint8_t compressionMode; - sbool strmCompFlushOnTxEnd; /* flush stream compression on transaction end? */ - sbool bzInitDone; /* did we do an init of zstrm already? */ - z_stream zstrm; /* zip stream to use for tcp compression */ - uchar sndBuf[16*1024]; /* this is intensionally fixed -- see no good reason to make configurable */ - unsigned offsSndBuf; /* next free spot in send buffer */ - int errsToReport; /* (remaining) number of errors to report */ } instanceData; /* config data */ -typedef struct configSettings_s { - uchar *pszTplName; /* name of the default template to use */ - uchar *pszStrmDrvr; /* name of the stream driver to use */ - int iStrmDrvrMode; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */ - int bResendLastOnRecon; /* should the last message be re-sent on a successful reconnect? */ - uchar *pszStrmDrvrAuthMode; /* authentication mode to use */ - int iTCPRebindInterval; /* support for automatic re-binding (load balancers!). 0 - no rebind */ - int iUDPRebindInterval; /* support for automatic re-binding (load balancers!). 0 - no rebind */ - permittedPeers_t *pPermPeers; -} configSettings_t; -static configSettings_t cs; - -/* tables for interfacing with the v6 config system */ -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "template", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "target", eCmdHdlrGetWord, 0 }, - { "port", eCmdHdlrGetWord, 0 }, - { "protocol", eCmdHdlrGetWord, 0 }, - { "tcp_framing", eCmdHdlrGetWord, 0 }, - { "ziplevel", eCmdHdlrInt, 0 }, - { "compression.mode", eCmdHdlrGetWord, 0 }, - { "compression.stream.flushontxend", eCmdHdlrBinary, 0 }, - { "maxerrormessages", eCmdHdlrInt, 0 }, - { "rebindinterval", eCmdHdlrInt, 0 }, - { "streamdriver", eCmdHdlrGetWord, 0 }, - { "streamdrivermode", eCmdHdlrInt, 0 }, - { "streamdriverauthmode", eCmdHdlrGetWord, 0 }, - { "streamdriverpermittedpeers", eCmdHdlrGetWord, 0 }, - { "resendlastmsgonreconnect", eCmdHdlrBinary, 0 }, - { "template", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - uchar *tplName; /* default template */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars - cs.pszTplName = NULL; /* name of the default template to use */ - cs.pszStrmDrvr = NULL; /* name of the stream driver to use */ - cs.iStrmDrvrMode = 0; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */ - cs.bResendLastOnRecon = 0; /* should the last message be re-sent on a successful reconnect? */ - cs.pszStrmDrvrAuthMode = NULL; /* authentication mode to use */ - cs.iUDPRebindInterval = 0; /* support for automatic re-binding (load balancers!). 0 - no rebind */ - cs.iTCPRebindInterval = 0; /* support for automatic re-binding (load balancers!). 0 - no rebind */ - cs.pPermPeers = NULL; -ENDinitConfVars +static uchar *pszTplName = NULL; /* name of the default template to use */ +static uchar *pszStrmDrvr = NULL; /* name of the stream driver to use */ +static int iStrmDrvrMode = 0; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */ +static int bResendLastOnRecon = 0; /* should the last message be re-sent on a successful reconnect? */ +static uchar *pszStrmDrvrAuthMode = NULL; /* authentication mode to use */ +static int iUDPRebindInterval = 0; /* support for automatic re-binding (load balancers!). 0 - no rebind */ +static int iTCPRebindInterval = 0; /* support for automatic re-binding (load balancers!). 0 - no rebind */ +static permittedPeers_t *pPermPeers = NULL; static rsRetVal doTryResume(instanceData *pData); -static rsRetVal doZipFinish(instanceData *pData); - -/* this function gets the default template. It coordinates action between - * old-style and new-style configuration parts. - */ -static inline uchar* -getDfltTpl(void) -{ - if(loadModConf != NULL && loadModConf->tplName != NULL) - return loadModConf->tplName; - else if(cs.pszTplName == NULL) - return (uchar*)"RSYSLOG_TraditionalForwardFormat"; - else - return cs.pszTplName; -} - - -/* set the default template to be used - * This is a module-global parameter, and as such needs special handling. It needs to - * be coordinated with values set via the v2 config system (rsyslog v6+). What we do - * is we do not permit this directive after the v2 config system has been used to set - * the parameter. - */ -static rsRetVal -setLegacyDfltTpl(void __attribute__((unused)) *pVal, uchar* newVal) -{ - DEFiRet; - - if(loadModConf != NULL && loadModConf->tplName != NULL) { - free(newVal); - errmsg.LogError(0, RS_RET_ERR, "omfwd default template already set via module " - "global parameter - can no longer be changed"); - ABORT_FINALIZE(RS_RET_ERR); - } - free(cs.pszTplName); - cs.pszTplName = newVal; -finalize_it: - RETiRet; -} /* Close the UDP sockets. * rgerhards, 2009-05-29 @@ -246,92 +131,19 @@ * This, for example, is needed after something went wrong. * This function is void because it "can not" fail. * rgerhards, 2008-06-04 - * Note that we DO NOT discard the current buffer contents - * (if any). This permits us to save data between sessions. In - * the wort case, some duplication occurs, but we do not - * loose data. */ static inline void DestructTCPInstanceData(instanceData *pData) { assert(pData != NULL); - doZipFinish(pData); if(pData->pNetstrm != NULL) netstrm.Destruct(&pData->pNetstrm); if(pData->pNS != NULL) netstrms.Destruct(&pData->pNS); } - -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->tplName = NULL; -ENDbeginCnfLoad - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for omfwd:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "template")) { - loadModConf->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - if(cs.pszTplName != NULL) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "omfwd: warning: default template " - "was already set via legacy directive - may lead to inconsistent " - "results."); - } - } else { - dbgprintf("omfwd: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(cs.pszTplName); - cs.pszTplName = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf - free(pModConf->tplName); -ENDfreeCnf - BEGINcreateInstance CODESTARTcreateInstance - pData->offsSndBuf = 0; - pData->errsToReport = 5; ENDcreateInstance @@ -353,7 +165,7 @@ } free(pData->port); - free(pData->target); + free(pData->f_hname); free(pData->pszStrmDrvr); free(pData->pszStrmDrvrAuthMode); net.DestructPermittedPeers(&pData->pPermPeers); @@ -362,7 +174,7 @@ BEGINdbgPrintInstInfo CODESTARTdbgPrintInstInfo - dbgprintf("%s", pData->target); + dbgprintf("%s", pData->f_hname); ENDdbgPrintInstInfo @@ -375,11 +187,9 @@ struct addrinfo *r; int i; unsigned lsent = 0; - sbool bSendSuccess; - int lasterrno; - char errStr[1024]; + int bSendSuccess; - if(pData->iRebindInterval && (pData->nXmit++ % pData->iRebindInterval == 0)) { + if(pData->iUDPRebindInterval && (pData->nXmit++ % pData->iUDPRebindInterval == 0)) { dbgprintf("omfwd dropping UDP 'connection' (as configured)\n"); pData->nXmit = 1; /* else we have an addtl wrap at 2^31-1 */ CHKiRet(closeUDPSockets(pData)); @@ -405,30 +215,18 @@ bSendSuccess = RSTRUE; break; } else { - lasterrno = errno; - DBGPRINTF("sendto() error: %d = %s.\n", - lasterrno, - rs_strerror_r(lasterrno, errStr, sizeof(errStr))); + int eno = errno; + char errStr[1024]; + dbgprintf("sendto() error: %d = %s.\n", + eno, rs_strerror_r(eno, errStr, sizeof(errStr))); } } if (lsent == len && !send_to_all) break; } /* finished looping */ - if(bSendSuccess == RSFALSE) { + if (bSendSuccess == RSFALSE) { dbgprintf("error forwarding via udp, suspending\n"); - if(pData->errsToReport > 0) { - rs_strerror_r(lasterrno, errStr, sizeof(errStr)); - errmsg.LogError(0, RS_RET_ERR_UDPSEND, "omfwd: error sending " - "via udp: %s", errStr); - if(pData->errsToReport == 1) { - errmsg.LogError(0, RS_RET_LAST_ERRREPORT, "omfwd: " - "max number of error message emitted " - "- further messages will be " - "suppressed"); - } - --pData->errsToReport; - } iRet = RS_RET_SUSPENDED; } } @@ -444,7 +242,7 @@ setPermittedPeer(void __attribute__((unused)) *pVal, uchar *pszID) { DEFiRet; - CHKiRet(net.AddPermittedPeer(&cs.pPermPeers, pszID)); + CHKiRet(net.AddPermittedPeer(&pPermPeers, pszID)); free(pszID); /* no longer needed, but we must free it as of interface def */ finalize_it: RETiRet; @@ -454,158 +252,30 @@ /* CODE FOR SENDING TCP MESSAGES */ -static rsRetVal -TCPSendBufUncompressed(instanceData *pData, uchar *buf, unsigned len) -{ - DEFiRet; - unsigned alreadySent; - ssize_t lenSend; - - alreadySent = 0; - CHKiRet(netstrm.CheckConnection(pData->pNetstrm)); /* hack for plain tcp syslog - see ptcp driver for details */ - - while(alreadySent != len) { - lenSend = len - alreadySent; - CHKiRet(netstrm.Send(pData->pNetstrm, buf+alreadySent, &lenSend)); - DBGPRINTF("omfwd: TCP sent %ld bytes, requested %u\n", (long) lenSend, len - alreadySent); - alreadySent += lenSend; - } - -finalize_it: - if(iRet != RS_RET_OK) { - /* error! */ - dbgprintf("TCPSendBuf error %d, destruct TCP Connection!\n", iRet); - DestructTCPInstanceData(pData); - iRet = RS_RET_SUSPENDED; - } - RETiRet; -} - -static rsRetVal -TCPSendBufCompressed(instanceData *pData, uchar *buf, unsigned len, sbool bIsFlush) -{ - int zRet; /* zlib return state */ - unsigned outavail; - uchar zipBuf[32*1024]; - int op; - DEFiRet; - - if(!pData->bzInitDone) { - /* allocate deflate state */ - pData->zstrm.zalloc = Z_NULL; - pData->zstrm.zfree = Z_NULL; - pData->zstrm.opaque = Z_NULL; - /* see note in file header for the params we use with deflateInit2() */ - zRet = deflateInit(&pData->zstrm, 9); - if(zRet != Z_OK) { - DBGPRINTF("error %d returned from zlib/deflateInit()\n", zRet); - ABORT_FINALIZE(RS_RET_ZLIB_ERR); - } - pData->bzInitDone = RSTRUE; - } - - /* now doing the compression */ - pData->zstrm.next_in = (Bytef*) buf; - pData->zstrm.avail_in = len; - if(pData->strmCompFlushOnTxEnd && bIsFlush) - op = Z_SYNC_FLUSH; - else - op = Z_NO_FLUSH; - /* run deflate() on buffer until everything has been compressed */ - do { - DBGPRINTF("omfwd: in deflate() loop, avail_in %d, total_in %ld, isFlush %d\n", pData->zstrm.avail_in, pData->zstrm.total_in, bIsFlush); - pData->zstrm.avail_out = sizeof(zipBuf); - pData->zstrm.next_out = zipBuf; - zRet = deflate(&pData->zstrm, op); /* no bad return value */ - DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet, pData->zstrm.avail_out); - outavail = sizeof(zipBuf) - pData->zstrm.avail_out; - if(outavail != 0) { - CHKiRet(TCPSendBufUncompressed(pData, zipBuf, outavail)); - } - } while (pData->zstrm.avail_out == 0); - -finalize_it: - RETiRet; -} - -static rsRetVal -TCPSendBuf(instanceData *pData, uchar *buf, unsigned len, sbool bIsFlush) -{ - DEFiRet; - if(pData->compressionMode >= COMPRESS_STREAM_ALWAYS) - iRet = TCPSendBufCompressed(pData, buf, len, bIsFlush); - else - iRet = TCPSendBufUncompressed(pData, buf, len); - RETiRet; -} - -/* finish zlib buffer, to be called before closing the ZIP file (if - * running in stream mode). - */ -static rsRetVal -doZipFinish(instanceData *pData) -{ - int zRet; /* zlib return state */ - DEFiRet; - unsigned outavail; - uchar zipBuf[32*1024]; - - if(!pData->bzInitDone) - goto done; - -// TODO: can we get this into a single common function? -dbgprintf("DDDD: in doZipFinish()\n"); - pData->zstrm.avail_in = 0; - /* run deflate() on buffer until everything has been compressed */ - do { - DBGPRINTF("in deflate() loop, avail_in %d, total_in %ld\n", pData->zstrm.avail_in, pData->zstrm.total_in); - pData->zstrm.avail_out = sizeof(zipBuf); - pData->zstrm.next_out = zipBuf; - zRet = deflate(&pData->zstrm, Z_FINISH); /* no bad return value */ - DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet, pData->zstrm.avail_out); - outavail = sizeof(zipBuf) - pData->zstrm.avail_out; - if(outavail != 0) { - CHKiRet(TCPSendBufUncompressed(pData, zipBuf, outavail)); - } - } while (pData->zstrm.avail_out == 0); - -finalize_it: - zRet = deflateEnd(&pData->zstrm); - if(zRet != Z_OK) { - DBGPRINTF("error %d returned from zlib/deflateEnd()\n", zRet); - } - - pData->bzInitDone = 0; -done: RETiRet; -} - -/* Add frame to send buffer (or send, if requried) +/* Send a frame via plain TCP protocol + * rgerhards, 2007-12-28 */ static rsRetVal TCPSendFrame(void *pvData, char *msg, size_t len) { DEFiRet; + ssize_t lenSend; instanceData *pData = (instanceData *) pvData; - DBGPRINTF("omfwd: add %u bytes to send buffer (curr offs %u)\n", - (unsigned) len, pData->offsSndBuf); - if(pData->offsSndBuf != 0 && pData->offsSndBuf + len >= sizeof(pData->sndBuf)) { - /* no buffer space left, need to commit previous records */ - CHKiRet(TCPSendBuf(pData, pData->sndBuf, pData->offsSndBuf, NO_FLUSH)); - pData->offsSndBuf = 0; - iRet = RS_RET_PREVIOUS_COMMITTED; - } - - /* check if the message is too large to fit into buffer */ - if(len > sizeof(pData->sndBuf)) { - CHKiRet(TCPSendBuf(pData, (uchar*)msg, len, NO_FLUSH)); - ABORT_FINALIZE(RS_RET_OK); /* committed everything so far */ - } - - /* we now know the buffer has enough free space */ - memcpy(pData->sndBuf + pData->offsSndBuf, msg, len); - pData->offsSndBuf += len; - iRet = RS_RET_DEFER_COMMIT; + lenSend = len; + netstrm.CheckConnection(pData->pNetstrm); /* hack for plain tcp syslog - see ptcp driver for details */ + CHKiRet(netstrm.Send(pData->pNetstrm, (uchar*)msg, &lenSend)); + dbgprintf("TCP sent %ld bytes, requested %ld\n", (long) lenSend, (long) len); + + if(lenSend != (ssize_t) len) { + /* no real error, could "just" not send everything... + * For the time being, we ignore this... + * rgerhards, 2005-10-25 + */ + dbgprintf("message not completely (tcp)send, ignoring %ld\n", (long) lenSend); + usleep(1000); /* experimental - might be benefitial in this situation */ + /* TODO: we need to revisit this code -- rgerhards, 2007-12-28 */ + } finalize_it: RETiRet; @@ -637,10 +307,9 @@ assert(pData != NULL); if(pData->pNetstrm == NULL) { - dbgprintf("TCPSendInit CREATE\n"); CHKiRet(netstrms.Construct(&pData->pNS)); /* the stream driver must be set before the object is finalized! */ - CHKiRet(netstrms.SetDrvrName(pData->pNS, pData->pszStrmDrvr)); + CHKiRet(netstrms.SetDrvrName(pData->pNS, pszStrmDrvr)); CHKiRet(netstrms.ConstructFinalize(pData->pNS)); /* now create the actual stream and connect to the server */ @@ -656,12 +325,11 @@ } /* params set, now connect */ CHKiRet(netstrm.Connect(pData->pNetstrm, glbl.GetDefPFFamily(), - (uchar*)pData->port, (uchar*)pData->target)); + (uchar*)pData->port, (uchar*)pData->f_hname)); } finalize_it: if(iRet != RS_RET_OK) { - dbgprintf("TCPSendInit FAILED with %d.\n", iRet); DestructTCPInstanceData(pData); } @@ -683,23 +351,23 @@ FINALIZE; /* The remote address is not yet known and needs to be obtained */ - dbgprintf(" %s\n", pData->target); + dbgprintf(" %s\n", pData->f_hname); if(pData->protocol == FORW_UDP) { memset(&hints, 0, sizeof(hints)); /* port must be numeric, because config file syntax requires this */ hints.ai_flags = AI_NUMERICSERV; hints.ai_family = glbl.GetDefPFFamily(); hints.ai_socktype = SOCK_DGRAM; - if((iErr = (getaddrinfo(pData->target, pData->port, &hints, &res))) != 0) { + if((iErr = (getaddrinfo(pData->f_hname, pData->port, &hints, &res))) != 0) { dbgprintf("could not get addrinfo for hostname '%s':'%s': %d%s\n", - pData->target, pData->port, iErr, gai_strerror(iErr)); + pData->f_hname, pData->port, iErr, gai_strerror(iErr)); ABORT_FINALIZE(RS_RET_SUSPENDED); } - dbgprintf("%s found, resuming.\n", pData->target); + dbgprintf("%s found, resuming.\n", pData->f_hname); pData->f_addr = res; pData->bIsConnected = 1; if(pData->pSockArray == NULL) { - pData->pSockArray = net.create_udp_socket((uchar*)pData->target, NULL, 0, 0); + pData->pSockArray = net.create_udp_socket((uchar*)pData->f_hname, NULL, 0); } } else { CHKiRet(TCPSendInit((void*)pData)); @@ -723,13 +391,6 @@ iRet = doTryResume(pData); ENDtryResume - -BEGINbeginTransaction -CODESTARTbeginTransaction -dbgprintf("omfwd: beginTransaction\n"); -ENDbeginTransaction - - BEGINdoAction char *psz; /* temporary buffering */ register unsigned l; @@ -742,7 +403,7 @@ iMaxLine = glbl.GetMaxLine(); - dbgprintf(" %s:%s/%s\n", pData->target, pData->port, + dbgprintf(" %s:%s/%s\n", pData->f_hname, pData->port, pData->protocol == FORW_UDP ? "udp" : "tcp"); psz = (char*) ppString[0]; @@ -759,10 +420,11 @@ * hard-coded but this may be changed to a config parameter. * rgerhards, 2006-11-30 */ - if(pData->compressionMode == COMPRESS_SINGLE_MSG && (l > CONF_MIN_SIZE_FOR_COMPRESS)) { + if(pData->compressionLevel && (l > CONF_MIN_SIZE_FOR_COMPRESS)) { uLongf destLen = iMaxLine + iMaxLine/100 +12; /* recommended value from zlib doc */ uLong srcLen = l; int ret; + /* TODO: optimize malloc sequence? -- rgerhards, 2008-09-02 */ CHKmalloc(out = (Bytef*) MALLOC(destLen)); out[0] = 'z'; out[1] = '\0'; @@ -794,16 +456,14 @@ CHKiRet(UDPSend(pData, psz, l)); } else { /* forward via TCP */ - iRet = tcpclt.Send(pData->pTCPClt, pData, psz, l); - if(iRet != RS_RET_OK && iRet != RS_RET_DEFER_COMMIT && iRet != RS_RET_PREVIOUS_COMMITTED) { + rsRetVal ret; + ret = tcpclt.Send(pData->pTCPClt, pData, psz, l); + if(ret != RS_RET_OK) { /* error! */ dbgprintf("error forwarding via tcp, suspending\n"); DestructTCPInstanceData(pData); iRet = RS_RET_SUSPENDED; } - if(pData->compressionMode >= COMPRESS_STREAM_ALWAYS && pData->strmCompFlushOnTxEnd) - /* mimic not committed, as we need the EndTx entry point to be called */ - iRet = RS_RET_DEFER_COMMIT; } finalize_it: # ifdef USE_NETZIP @@ -812,17 +472,6 @@ ENDdoAction -BEGINendTransaction -CODESTARTendTransaction -dbgprintf("omfwd: endTransaction, offsSndBuf %u\n", pData->offsSndBuf); - if(pData->offsSndBuf != 0) { - iRet = TCPSendBuf(pData, pData->sndBuf, pData->offsSndBuf, IS_FLUSH); - pData->offsSndBuf = 0; - } -ENDendTransaction - - - /* This function loads TCP support, if not already loaded. It will be called * during config processing. To server ressources, TCP support will only * be loaded if it actually is used. -- rgerhard, 2008-04-17 @@ -840,218 +489,6 @@ } -/* initialize TCP structures (if necessary) after the instance has been - * created. - */ -static rsRetVal -initTCP(instanceData *pData) -{ - DEFiRet; - if(pData->protocol == FORW_TCP) { - /* create our tcpclt */ - CHKiRet(tcpclt.Construct(&pData->pTCPClt)); - CHKiRet(tcpclt.SetResendLastOnRecon(pData->pTCPClt, pData->bResendLastOnRecon)); - /* and set callbacks */ - CHKiRet(tcpclt.SetSendInit(pData->pTCPClt, TCPSendInit)); - CHKiRet(tcpclt.SetSendFrame(pData->pTCPClt, TCPSendFrame)); - CHKiRet(tcpclt.SetSendPrepRetry(pData->pTCPClt, TCPSendPrepRetry)); - CHKiRet(tcpclt.SetFraming(pData->pTCPClt, pData->tcp_framing)); - CHKiRet(tcpclt.SetRebindInterval(pData->pTCPClt, pData->iRebindInterval)); - if(cs.pszStrmDrvr != NULL) - CHKmalloc(pData->pszStrmDrvr = (uchar*)strdup((char*)cs.pszStrmDrvr)); - if(cs.pszStrmDrvrAuthMode != NULL) - CHKmalloc(pData->pszStrmDrvrAuthMode = - (uchar*)strdup((char*)cs.pszStrmDrvrAuthMode)); - } -finalize_it: - RETiRet; -} - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->tplName = NULL; - pData->protocol = FORW_UDP; - pData->tcp_framing = TCP_FRAMING_OCTET_STUFFING; - pData->pszStrmDrvr = NULL; - pData->pszStrmDrvrAuthMode = NULL; - pData->iStrmDrvrMode = 0; - pData->iRebindInterval = 0; - pData->bResendLastOnRecon = 0; - pData->pPermPeers = NULL; - pData->compressionLevel = 9; - pData->strmCompFlushOnTxEnd = 1; - pData->compressionMode = COMPRESS_NEVER; - pData->errsToReport = 5; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - uchar *tplToUse; - char *cstr; - int i; - rsRetVal localRet; - int complevel = -1; -CODESTARTnewActInst - DBGPRINTF("newActInst (omfwd)\n"); - - pvals = nvlstGetParams(lst, &actpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "omfwd: either the \"file\" or " - "\"dynfile\" parameter must be given"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("action param blk in omfwd:\n"); - cnfparamsPrint(&actpblk, pvals); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "target")) { - pData->target = es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "port")) { - pData->port = es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "protocol")) { - if(!es_strcasebufcmp(pvals[i].val.d.estr, (uchar*)"udp", 3)) { - pData->protocol = FORW_UDP; - } else if(!es_strcasebufcmp(pvals[i].val.d.estr, (uchar*)"tcp", 3)) { - localRet = loadTCPSupport(); - if(localRet != RS_RET_OK) { - errmsg.LogError(0, localRet, "could not activate network stream modules for TCP " - "(internal error %d) - are modules missing?", localRet); - ABORT_FINALIZE(localRet); - } - pData->protocol = FORW_TCP; - } else { - uchar *str; - str = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_INVLD_PROTOCOL, - "omfwd: invalid protocol \"%s\"", str); - free(str); - ABORT_FINALIZE(RS_RET_INVLD_PROTOCOL); - } - } else if(!strcmp(actpblk.descr[i].name, "tcp_framing")) { - if(!es_strcasebufcmp(pvals[i].val.d.estr, (uchar*)"traditional", 11)) { - pData->tcp_framing = TCP_FRAMING_OCTET_STUFFING; - } else if(!es_strcasebufcmp(pvals[i].val.d.estr, (uchar*)"octet-counted", 13)) { - pData->tcp_framing = TCP_FRAMING_OCTET_COUNTING; - } else { - uchar *str; - str = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - errmsg.LogError(0, RS_RET_CNF_INVLD_FRAMING, - "omfwd: invalid framing \"%s\"", str); - free(str); - ABORT_FINALIZE(RS_RET_CNF_INVLD_FRAMING ); - } - } else if(!strcmp(actpblk.descr[i].name, "rebindinterval")) { - pData->iRebindInterval = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "streamdriver")) { - pData->pszStrmDrvr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "streamdrivermode")) { - pData->iStrmDrvrMode = pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "streamdriverauthmode")) { - pData->pszStrmDrvrAuthMode = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "streamdriverpermittedpeers")) { - uchar *start, *str; - uchar save; - uchar *p; - int lenStr; - str = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - start = str; - lenStr = ustrlen(start); /* we need length after '\0' has been dropped... */ - while(lenStr > 0) { - p = start; - while(*p && *p != ',' && lenStr--) - p++; - if(*p == ',') { - *p = '\0'; - } - save = *(p+1); /* we always have this, at least the \0 byte at EOS */ - *(p+1) = '\0'; - if(*start == '\0') { - DBGPRINTF("omfwd: ignoring empty permitted peer\n"); - } else { - dbgprintf("omfwd: adding permitted peer: '%s'\n", start); - CHKiRet(net.AddPermittedPeer(&(pData->pPermPeers), start)); - } - start = p+1; - if(lenStr) - --lenStr; - *(p+1) = save; - } - free(str); - } else if(!strcmp(actpblk.descr[i].name, "ziplevel")) { -# ifdef USE_NETZIP - complevel = pvals[i].val.d.n; - if(complevel >= 0 && complevel <= 10) { - pData->compressionLevel = complevel; - pData->compressionMode = COMPRESS_SINGLE_MSG; - } else { - errmsg.LogError(0, NO_ERRCODE, "Invalid ziplevel %d specified in " - "forwardig action - NOT turning on compression.", - complevel); - } -# else - errmsg.LogError(0, NO_ERRCODE, "Compression requested, but rsyslogd is not compiled " - "with compression support - request ignored."); -# endif /* #ifdef USE_NETZIP */ - } else if(!strcmp(actpblk.descr[i].name, "maxerrormessages")) { - pData->errsToReport = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "resendlastmsgonreconnect")) { - pData->bResendLastOnRecon = (int) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "compression.stream.flushontxend")) { - pData->strmCompFlushOnTxEnd = (sbool) pvals[i].val.d.n; - } else if(!strcmp(actpblk.descr[i].name, "compression.mode")) { - cstr = es_str2cstr(pvals[i].val.d.estr, NULL); - if(!strcasecmp(cstr, "stream:always")) { - pData->compressionMode = COMPRESS_STREAM_ALWAYS; - } else if(!strcasecmp(cstr, "none")) { - pData->compressionMode = COMPRESS_NEVER; - } else if(!strcasecmp(cstr, "single")) { - pData->compressionMode = COMPRESS_SINGLE_MSG; - } else { - errmsg.LogError(0, RS_RET_PARAM_ERROR, "omfwd: invalid value for 'compression.mode' " - "parameter (given is '%s')", cstr); - free(cstr); - ABORT_FINALIZE(RS_RET_PARAM_ERROR); - } - free(cstr); - } else { - DBGPRINTF("omfwd: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(complevel != -1) { - pData->compressionLevel = complevel; - if(pData->compressionMode == COMPRESS_NEVER) { - /* to keep compatible with pre-7.3.11, only setting the - * compresion level means old-style single-message mode. - */ - pData->compressionMode = COMPRESS_SINGLE_MSG; - } - } - - CODE_STD_STRING_REQUESTnewActInst(1) - - tplToUse = ustrdup((pData->tplName == NULL) ? getDfltTpl() : pData->tplName); - CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_NO_RQD_TPL_OPTS)); - - CHKiRet(initTCP(pData)); -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - BEGINparseSelectorAct uchar *q; int i; @@ -1108,7 +545,6 @@ iLevel = *p - '0'; ++p; /* eat */ pData->compressionLevel = iLevel; - pData->compressionMode = COMPRESS_SINGLE_MSG; } else { errmsg.LogError(0, NO_ERRCODE, "Invalid compression level '%c' specified in " "forwardig action - NOT turning on compression.", @@ -1158,7 +594,6 @@ /* JUST SKIP */; } - pData->tcp_framing = tcp_framing; pData->port = NULL; if(*p == ':') { /* process port */ uchar * tmp; @@ -1186,36 +621,46 @@ while(*p && *p != ';' && *p != '#' && !isspace((int) *p)) ++p; /*JUST SKIP*/ + /* TODO: make this if go away! */ if(*p == ';' || *p == '#' || isspace(*p)) { uchar cTmp = *p; *p = '\0'; /* trick to obtain hostname (later)! */ - CHKmalloc(pData->target = strdup((char*) q)); + CHKmalloc(pData->f_hname = strdup((char*) q)); *p = cTmp; } else { - CHKmalloc(pData->target = strdup((char*) q)); + CHKmalloc(pData->f_hname = strdup((char*) q)); } /* copy over config data as needed */ - pData->iRebindInterval = (pData->protocol == FORW_TCP) ? - cs.iTCPRebindInterval : cs.iUDPRebindInterval; + pData->iUDPRebindInterval = iUDPRebindInterval; + pData->iTCPRebindInterval = iTCPRebindInterval; /* process template */ - CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, getDfltTpl())); + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, + (pszTplName == NULL) ? (uchar*)"RSYSLOG_TraditionalForwardFormat" : pszTplName)); if(pData->protocol == FORW_TCP) { - pData->bResendLastOnRecon = cs.bResendLastOnRecon; - pData->iStrmDrvrMode = cs.iStrmDrvrMode; - if(cs.pszStrmDrvr != NULL) - CHKmalloc(pData->pszStrmDrvr = (uchar*)strdup((char*)cs.pszStrmDrvr)); - if(cs.pszStrmDrvrAuthMode != NULL) + /* create our tcpclt */ + CHKiRet(tcpclt.Construct(&pData->pTCPClt)); + CHKiRet(tcpclt.SetResendLastOnRecon(pData->pTCPClt, bResendLastOnRecon)); + /* and set callbacks */ + CHKiRet(tcpclt.SetSendInit(pData->pTCPClt, TCPSendInit)); + CHKiRet(tcpclt.SetSendFrame(pData->pTCPClt, TCPSendFrame)); + CHKiRet(tcpclt.SetSendPrepRetry(pData->pTCPClt, TCPSendPrepRetry)); + CHKiRet(tcpclt.SetFraming(pData->pTCPClt, tcp_framing)); + CHKiRet(tcpclt.SetRebindInterval(pData->pTCPClt, pData->iTCPRebindInterval)); + pData->iStrmDrvrMode = iStrmDrvrMode; + if(pszStrmDrvr != NULL) + CHKmalloc(pData->pszStrmDrvr = (uchar*)strdup((char*)pszStrmDrvr)); + if(pszStrmDrvrAuthMode != NULL) CHKmalloc(pData->pszStrmDrvrAuthMode = - (uchar*)strdup((char*)cs.pszStrmDrvrAuthMode)); - if(cs.pPermPeers != NULL) { - pData->pPermPeers = cs.pPermPeers; - cs.pPermPeers = NULL; + (uchar*)strdup((char*)pszStrmDrvrAuthMode)); + if(pPermPeers != NULL) { + pData->pPermPeers = pPermPeers; + pPermPeers = NULL; } } - CHKiRet(initTCP(pData)); + CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -1226,12 +671,21 @@ static void freeConfigVars(void) { - free(cs.pszStrmDrvr); - cs.pszStrmDrvr = NULL; - free(cs.pszStrmDrvrAuthMode); - cs.pszStrmDrvrAuthMode = NULL; - free(cs.pPermPeers); - cs.pPermPeers = NULL; /* TODO: fix in older builds! */ + if(pszTplName != NULL) { + free(pszTplName); + pszTplName = NULL; + } + if(pszStrmDrvr != NULL) { + free(pszStrmDrvr); + pszStrmDrvr = NULL; + } + if(pszStrmDrvrAuthMode != NULL) { + free(pszStrmDrvrAuthMode); + pszStrmDrvrAuthMode = NULL; + } + if(pPermPeers != NULL) { + free(pPermPeers); + } } @@ -1244,6 +698,7 @@ objRelease(netstrm, LM_NETSTRMS_FILENAME); objRelease(netstrms, LM_NETSTRMS_FILENAME); objRelease(tcpclt, LM_TCPCLT_FILENAME); + freeConfigVars(); ENDmodExit @@ -1251,10 +706,6 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES -CODEqueryEtryPt_TXIF_OMOD_QUERIES /* we support the transactional interface! */ ENDqueryEtryPt @@ -1266,10 +717,10 @@ freeConfigVars(); /* we now must reset all non-string values */ - cs.iStrmDrvrMode = 0; - cs.bResendLastOnRecon = 0; - cs.iUDPRebindInterval = 0; - cs.iTCPRebindInterval = 0; + iStrmDrvrMode = 0; + bResendLastOnRecon = 0; + iUDPRebindInterval = 0; + iTCPRebindInterval = 0; return RS_RET_OK; } @@ -1277,21 +728,20 @@ BEGINmodInit(Fwd) CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(glbl, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net,LM_NET_FILENAME)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionforwarddefaulttemplate", 0, eCmdHdlrGetWord, setLegacyDfltTpl, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionsendtcprebindinterval", 0, eCmdHdlrInt, NULL, &cs.iTCPRebindInterval, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionsendudprebindinterval", 0, eCmdHdlrInt, NULL, &cs.iUDPRebindInterval, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdriver", 0, eCmdHdlrGetWord, NULL, &cs.pszStrmDrvr, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdrivermode", 0, eCmdHdlrInt, NULL, &cs.iStrmDrvrMode, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdriverauthmode", 0, eCmdHdlrGetWord, NULL, &cs.pszStrmDrvrAuthMode, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionsendtcprebindinterval", 0, eCmdHdlrInt, NULL, &iTCPRebindInterval, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionsendudprebindinterval", 0, eCmdHdlrInt, NULL, &iUDPRebindInterval, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdriver", 0, eCmdHdlrGetWord, NULL, &pszStrmDrvr, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdrivermode", 0, eCmdHdlrInt, NULL, &iStrmDrvrMode, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdriverauthmode", 0, eCmdHdlrGetWord, NULL, &pszStrmDrvrAuthMode, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"actionsendstreamdriverpermittedpeer", 0, eCmdHdlrGetWord, setPermittedPeer, NULL, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"actionsendresendlastmsgonreconnect", 0, eCmdHdlrBinary, NULL, &cs.bResendLastOnRecon, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionsendresendlastmsgonreconnect", 0, eCmdHdlrBinary, NULL, &bResendLastOnRecon, NULL)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff -Nru rsyslog-7.6.0/tools/ompipe.c rsyslog-5.10.1/tools/ompipe.c --- rsyslog-7.6.0/tools/ompipe.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/tools/ompipe.c 2012-10-17 14:41:20.000000000 +0000 @@ -57,7 +57,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("ompipe") /* internal structures */ @@ -65,62 +64,15 @@ DEFobjCurrIf(errmsg) -typedef struct _instanceData { - uchar *pipe; /* pipe or template name (display only) */ - uchar *tplName; /* format template to use */ - short fd; /* pipe descriptor for (current) pipe */ - sbool bHadError; /* did we already have/report an error on this pipe? */ -} instanceData; - -typedef struct configSettings_s { - EMPTY_STRUCT -} configSettings_t; -static configSettings_t __attribute__((unused)) cs; - -/* tables for interfacing with the v6 config system */ -/* module-global parameters */ -static struct cnfparamdescr modpdescr[] = { - { "template", eCmdHdlrGetWord, 0 }, -}; -static struct cnfparamblk modpblk = - { CNFPARAMBLK_VERSION, - sizeof(modpdescr)/sizeof(struct cnfparamdescr), - modpdescr - }; - -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "pipe", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -struct modConfData_s { - rsconf_t *pConf; /* our overall config object */ - uchar *tplName; /* default template */ -}; - -static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */ -static modConfData_t *runModConf = NULL;/* modConf ptr to use for the current exec process */ - -/* this function gets the default template */ -static inline uchar* -getDfltTpl(void) -{ - if(loadModConf != NULL && loadModConf->tplName != NULL) - return loadModConf->tplName; - else - return (uchar*)"RSYSLOG_FileFormat"; -} +/* globals for default values */ +/* end globals for default values */ -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars -ENDinitConfVars +typedef struct _instanceData { + uchar f_fname[MAXFNAME];/* pipe or template name (display only) */ + short fd; /* pipe descriptor for (current) pipe */ + sbool bHadError; /* did we already have/report an error on this pipe? */ +} instanceData; BEGINisCompatibleWithFeature @@ -132,7 +84,7 @@ BEGINdbgPrintInstInfo CODESTARTdbgPrintInstInfo - dbgprintf("pipe %s", pData->pipe); + dbgprintf("pipe %s", pData->f_fname); if (pData->fd == -1) dbgprintf(" (unused)"); ENDdbgPrintInstInfo @@ -148,17 +100,17 @@ preparePipe(instanceData *pData) { DEFiRet; - pData->fd = open((char*) pData->pipe, O_RDWR|O_NONBLOCK|O_CLOEXEC); + pData->fd = open((char*) pData->f_fname, O_RDWR|O_NONBLOCK|O_CLOEXEC); if(pData->fd < 0 ) { pData->fd = -1; if(!pData->bHadError) { char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); errmsg.LogError(0, RS_RET_NO_FILE_ACCESS, "Could no open output pipe '%s': %s", - pData->pipe, errStr); + pData->f_fname, errStr); pData->bHadError = 1; } - DBGPRINTF("Error opening log pipe: %s\n", pData->pipe); + DBGPRINTF("Error opening log pipe: %s\n", pData->f_fname); } RETiRet; } @@ -198,7 +150,7 @@ pData->fd = -1; /* tell that fd is no longer open! */ iRet = RS_RET_SUSPENDED; errno = e; - errmsg.LogError(0, NO_ERRCODE, "%s", pData->pipe); + errmsg.LogError(0, NO_ERRCODE, "%s", pData->f_fname); } finalize_it: @@ -206,74 +158,8 @@ } -BEGINbeginCnfLoad -CODESTARTbeginCnfLoad - loadModConf = pModConf; - pModConf->pConf = pConf; - pModConf->tplName = NULL; -ENDbeginCnfLoad - -BEGINsetModCnf - struct cnfparamvals *pvals = NULL; - int i; -CODESTARTsetModCnf - pvals = nvlstGetParams(lst, &modpblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing module " - "config parameters [module(...)]"); - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - if(Debug) { - dbgprintf("module (global) param blk for ompipe:\n"); - cnfparamsPrint(&modpblk, pvals); - } - - for(i = 0 ; i < modpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(modpblk.descr[i].name, "template")) { - loadModConf->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - if(pszFileDfltTplName != NULL) { - errmsg.LogError(0, RS_RET_DUP_PARAM, "ompipe: warning: default template " - "was already set via legacy directive - may lead to inconsistent " - "results."); - } - } else { - dbgprintf("ompipe: program error, non-handled " - "param '%s' in beginCnfLoad\n", modpblk.descr[i].name); - } - } -finalize_it: - if(pvals != NULL) - cnfparamvalsDestruct(pvals, &modpblk); -ENDsetModCnf - -BEGINendCnfLoad -CODESTARTendCnfLoad - loadModConf = NULL; /* done loading */ - /* free legacy config vars */ - free(pszFileDfltTplName); - pszFileDfltTplName = NULL; -ENDendCnfLoad - -BEGINcheckCnf -CODESTARTcheckCnf -ENDcheckCnf - -BEGINactivateCnf -CODESTARTactivateCnf - runModConf = pModConf; -ENDactivateCnf - -BEGINfreeCnf -CODESTARTfreeCnf - free(pModConf->tplName); -ENDfreeCnf - BEGINcreateInstance CODESTARTcreateInstance - pData->pipe = NULL; pData->fd = -1; pData->bHadError = 0; ENDcreateInstance @@ -281,7 +167,6 @@ BEGINfreeInstance CODESTARTfreeInstance - free(pData->pipe); if(pData->fd != -1) close(pData->fd); ENDfreeInstance @@ -293,58 +178,11 @@ BEGINdoAction CODESTARTdoAction - DBGPRINTF(" (%s)\n", pData->pipe); + DBGPRINTF(" (%s)\n", pData->f_fname); iRet = writePipe(ppString, pData); ENDdoAction -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->tplName = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "pipe")) { - pData->pipe = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("ompipe: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ? - "RSYSLOG_ForwardFormat" : (char*)pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - /* Old flawed template code - if(pData->tplName == NULL) { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*) "RSYSLOG_FileFormat", - OMSR_NO_RQD_TPL_OPTS)); - } else { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, - (uchar*) strdup((char*) pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - }*/ -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - BEGINparseSelectorAct CODESTARTparseSelectorAct /* yes, the if below is redundant, but I need it now. Will go away as @@ -364,10 +202,19 @@ } CODE_STD_STRING_REQUESTparseSelectorAct(1) - CHKmalloc(pData->pipe = malloc(512)); ++p; - CHKiRet(cflineParseFileName(p, (uchar*) pData->pipe, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, - getDfltTpl())); + /* rgerhards 2004-11-17: from now, we need to have different + * processing, because after the first comma, the template name + * to use is specified. So we need to scan for the first coma first + * and then look at the rest of the line. + */ + CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, + (pszFileDfltTplName == NULL) ? (uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName)); + + /* at this stage, we ignore the return value of preparePipe, this is taken + * care of in later steps. -- rgerhards, 2009-03-19 + */ + preparePipe(pData); CODE_STD_FINALIZERparseSelectorAct ENDparseSelectorAct @@ -391,16 +238,11 @@ CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES CODEqueryEtryPt_doHUP -CODEqueryEtryPt_STD_CONF2_QUERIES -CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES -CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES ENDqueryEtryPt BEGINmodInit(Pipe) CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); diff -Nru rsyslog-7.6.0/tools/omshell.c rsyslog-5.10.1/tools/omshell.c --- rsyslog-7.6.0/tools/omshell.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/tools/omshell.c 2012-10-17 14:41:20.000000000 +0000 @@ -1,13 +1,6 @@ /* omshell.c * This is the implementation of the build-in shell output module. * - * ************* DO NOT EXTEND THIS MODULE ************** - * This is pure legacy, omprog has much better and more - * secure functionality than this module. It is NOT - * recommended to base new work on it! - * 2012-01-19 rgerhards - * ****************************************************** - * * NOTE: read comments in module-template.h to understand how this file * works! * @@ -63,6 +56,7 @@ uchar progName[MAXFNAME]; /* program to execute */ } instanceData; + BEGINcreateInstance CODESTARTcreateInstance ENDcreateInstance diff -Nru rsyslog-7.6.0/tools/omusrmsg.c rsyslog-5.10.1/tools/omusrmsg.c --- rsyslog-7.6.0/tools/omusrmsg.c 2014-02-10 14:48:44.000000000 +0000 +++ rsyslog-5.10.1/tools/omusrmsg.c 2012-10-17 14:41:20.000000000 +0000 @@ -10,6 +10,17 @@ * * Copyright 2007-2012 Adiscon GmbH. * + * rgerhards, 2008-07-04 (happy Independence Day!): rsyslog inherited the + * wall functionality from sysklogd. Sysklogd was single-threaded and could + * not afford to spent a lot of time inside a single action. Thus, it forked + * off a new process to do the wall. In rsyslog, however, this creates some + * grief with the threading model. Also, we do not really need to de-couple + * processing, because we have ample ways to do it in rsyslog. Plus, the + * default main message queue will care for a somewhat longer execution time. + * So in short, the real fix to the problem is an architecture change. From + * now on, we will not fork off a new process but rather do the notification + * within the current one. This also reduces system overhead. + * * This file is part of rsyslog. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,7 +45,6 @@ #include #include #include -#include #include #ifdef HAVE_UTMP_H # include @@ -74,7 +84,6 @@ MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP -MODULE_CNFNAME("omusrmsg") /* internal structures */ @@ -84,31 +93,8 @@ typedef struct _instanceData { int bIsWall; /* 1- is wall, 0 - individual users */ char uname[MAXUNAMES][UNAMESZ+1]; - uchar *tplName; } instanceData; -typedef struct configSettings_s { - EMPTY_STRUCT -} configSettings_t; -static configSettings_t __attribute__((unused)) cs; - - -/* tables for interfacing with the v6 config system */ -/* action (instance) parameters */ -static struct cnfparamdescr actpdescr[] = { - { "users", eCmdHdlrString, CNFPARAM_REQUIRED }, - { "template", eCmdHdlrGetWord, 0 } -}; -static struct cnfparamblk actpblk = - { CNFPARAMBLK_VERSION, - sizeof(actpdescr)/sizeof(struct cnfparamdescr), - actpdescr - }; - -BEGINinitConfVars /* (re)set config variables to default values */ -CODESTARTinitConfVars -ENDinitConfVars - BEGINcreateInstance CODESTARTcreateInstance @@ -124,7 +110,7 @@ BEGINfreeInstance CODESTARTfreeInstance - free(pData->tplName); + /* TODO: free the instance pointer (currently a leak, will go away) */ ENDfreeInstance @@ -280,118 +266,22 @@ ENDdoAction -static inline void -populateUsers(instanceData *pData, es_str_t *usrs) -{ - int i; - int iDst; - es_size_t iUsr; - es_size_t len; - uchar *c; - - len = es_strlen(usrs); - c = es_getBufAddr(usrs); - pData->bIsWall = 0; /* write to individual users */ - iUsr = 0; - for(i = 0 ; i < MAXUNAMES && iUsr < len ; ++i) { - for( iDst = 0 - ; iDst < UNAMESZ && iUsr < len && c[iUsr] != ',' - ; ++iDst, ++iUsr) { - pData->uname[i][iDst] = c[iUsr]; - } - pData->uname[i][iDst] = '\0'; - DBGPRINTF("omusrmsg: send to user '%s'\n", pData->uname[i]); - if(iUsr < len && c[iUsr] != ',') { - errmsg.LogError(0, RS_RET_ERR, "user name '%s...' too long - " - "ignored", pData->uname[i]); - --i; - ++iUsr; - while(iUsr < len && c[iUsr] != ',') - ++iUsr; /* skip to next name */ - } else if(iDst == 0) { - errmsg.LogError(0, RS_RET_ERR, "no user name given - " - "ignored"); - --i; - ++iUsr; - while(iUsr < len && c[iUsr] != ',') - ++iUsr; /* skip to next name */ - } - if(iUsr < len) { - ++iUsr; /* skip "," */ - while(iUsr < len && isspace(c[iUsr])) - ++iUsr; /* skip whitespace */ - } - } - if(i == MAXUNAMES && iUsr != len) { - errmsg.LogError(0, RS_RET_ERR, "omusrmsg supports only up to %d " - "user names in a single action - all others have been ignored", - MAXUNAMES); - } -} - - -static inline void -setInstParamDefaults(instanceData *pData) -{ - pData->bIsWall = 0; - pData->tplName = NULL; -} - -BEGINnewActInst - struct cnfparamvals *pvals; - int i; -CODESTARTnewActInst - if((pvals = nvlstGetParams(lst, &actpblk, NULL)) == NULL) { - ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); - } - - CHKiRet(createInstance(&pData)); - setInstParamDefaults(pData); - - CODE_STD_STRING_REQUESTnewActInst(1) - for(i = 0 ; i < actpblk.nParams ; ++i) { - if(!pvals[i].bUsed) - continue; - if(!strcmp(actpblk.descr[i].name, "users")) { - if(!es_strbufcmp(pvals[i].val.d.estr, (uchar*)"*", 1)) { - pData->bIsWall = 1; - } else { - populateUsers(pData, pvals[i].val.d.estr); - } - } else if(!strcmp(actpblk.descr[i].name, "template")) { - pData->tplName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL); - } else { - dbgprintf("omusrmsg: program error, non-handled " - "param '%s'\n", actpblk.descr[i].name); - } - } - - if(pData->tplName == NULL) { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, - (uchar*) strdup(pData->bIsWall ? " WallFmt" : " StdUsrMsgFmt"), - OMSR_NO_RQD_TPL_OPTS)); - } else { - CHKiRet(OMSRsetEntry(*ppOMSR, 0, - (uchar*) strdup((char*) pData->tplName), - OMSR_NO_RQD_TPL_OPTS)); - } -CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); -ENDnewActInst - - BEGINparseSelectorAct - es_str_t *usrs; - int bHadWarning; + uchar *q; + int i; + int bHadWarning = 0; CODESTARTparseSelectorAct CODE_STD_STRING_REQUESTparseSelectorAct(1) - bHadWarning = 0; + /* User names must begin with a gnu e-regex: + * [a-zA-Z0-9_.] + * plus '*' for wall + */ if(!strncmp((char*) p, ":omusrmsg:", sizeof(":omusrmsg:") - 1)) { p += sizeof(":omusrmsg:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ } else { if(!*p || !((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9') || *p == '_' || *p == '.' || *p == '*')) { - ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); + ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); } else { errmsg.LogError(0, RS_RET_OUTDATED_STMT, "action '%s' treated as ':omusrmsg:%s' - please " @@ -409,14 +299,26 @@ pData->bIsWall = 1; /* write to all users */ CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) " WallFmt")); } else { - /* everything else is currently treated as a user name */ - usrs = es_newStr(128); - while(*p && *p != ';') { - es_addChar(&usrs, *p); - ++p; + /* everything else beginning with the regex above + * is currently treated as a user name -- TODO: is this portable? + */ + dbgprintf("users: %s\n", p); /* ASP */ + pData->bIsWall = 0; /* write to individual users */ + for (i = 0; i < MAXUNAMES && *p && *p != ';'; i++) { + for (q = p; *q && *q != ',' && *q != ';'; ) + q++; + (void) strncpy((char*) pData->uname[i], (char*) p, UNAMESZ); + if ((q - p) > UNAMESZ) + pData->uname[i][UNAMESZ] = '\0'; + else + pData->uname[i][q - p] = '\0'; + while (*q == ',' || *q == ' ') + q++; + p = q; } - populateUsers(pData, usrs); - es_deleteStr(usrs); + /* done, on to the template + * TODO: we need to handle the case where i >= MAXUNAME! + */ if((iRet = cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*)" StdUsrMsgFmt")) != RS_RET_OK) goto finalize_it; @@ -435,13 +337,11 @@ BEGINqueryEtryPt CODESTARTqueryEtryPt CODEqueryEtryPt_STD_OMOD_QUERIES -CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES ENDqueryEtryPt BEGINmodInit(UsrMsg) CODESTARTmodInit -INITLegCnfVars *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(errmsg, CORE_COMPONENT)); diff -Nru rsyslog-7.6.0/tools/pidfile.c rsyslog-5.10.1/tools/pidfile.c --- rsyslog-7.6.0/tools/pidfile.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/pidfile.c 2012-10-17 14:41:20.000000000 +0000 @@ -55,8 +55,7 @@ if (!(f=fopen(pidfile,"r"))) return 0; - if(fscanf(f,"%d", &pid) != 1) - pid = 0; + fscanf(f,"%d", &pid); fclose(f); return pid; } @@ -114,8 +113,7 @@ #if HAVE_FLOCK if (flock(fd, LOCK_EX|LOCK_NB) == -1) { - if(fscanf(f, "%d", &pid) != 1) - pid = 0; + fscanf(f, "%d", &pid); fclose(f); printf("Can't lock, lock is held by pid %d.\n", pid); return 0; @@ -127,7 +125,7 @@ char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); printf("Can't write pid , %s.\n", errStr); - fclose(f); + close(fd); return 0; } fflush(f); @@ -137,11 +135,11 @@ char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); printf("Can't unlock pidfile %s, %s.\n", pidfile, errStr); - fclose(f); + close(fd); return 0; } #endif - fclose(f); + close(fd); return pid; } diff -Nru rsyslog-7.6.0/tools/pmrfc3164.c rsyslog-5.10.1/tools/pmrfc3164.c --- rsyslog-7.6.0/tools/pmrfc3164.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tools/pmrfc3164.c 2012-10-17 14:41:20.000000000 +0000 @@ -75,16 +75,17 @@ BEGINparse uchar *p2parse; int lenMsg; + int bTAGCharDetected; int i; /* general index for parsing */ uchar bufParseTAG[CONF_TAG_MAXSIZE]; uchar bufParseHOSTNAME[CONF_HOSTNAME_MAXSIZE]; CODESTARTparse - DBGPRINTF("Message will now be parsed by the legacy syslog parser (one size fits all... ;)).\n"); + dbgprintf("Message will now be parsed by the legacy syslog parser (one size fits all... ;)).\n"); assert(pMsg != NULL); assert(pMsg->pszRawMsg != NULL); lenMsg = pMsg->iLenRawMsg - pMsg->offAfterPRI; /* note: offAfterPRI is already the number of PRI chars (do not add one!) */ p2parse = pMsg->pszRawMsg + pMsg->offAfterPRI; /* point to start of text, after PRI */ - setProtocolVersion(pMsg, MSG_LEGACY_PROTOCOL); + setProtocolVersion(pMsg, 0); /* Check to see if msg contains a timestamp. We start by assuming * that the message timestamp is the time of reception (which we @@ -95,8 +96,6 @@ if(datetime.ParseTIMESTAMP3339(&(pMsg->tTIMESTAMP), &p2parse, &lenMsg) == RS_RET_OK) { /* we are done - parse pointer is moved by ParseTIMESTAMP3339 */; } else if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &p2parse, &lenMsg) == RS_RET_OK) { - if(pMsg->dfltTZ[0] != '\0') - applyDfltTZ(&pMsg->tTIMESTAMP, pMsg->dfltTZ); /* we are done - parse pointer is moved by ParseTIMESTAMP3164 */; } else if(*p2parse == ' ' && lenMsg > 1) { /* try to see if it is slighly malformed - HP procurve seems to do that sometimes */ ++p2parse; /* move over space */ @@ -138,9 +137,10 @@ * rgerhards, 2009-06-23: and I now have extended this logic to every character * that is not a valid hostname. */ + bTAGCharDetected = 0; if(lenMsg > 0 && pMsg->msgFlags & PARSE_HOSTNAME) { i = 0; - while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' + while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '.' || p2parse[i] == '_' || p2parse[i] == '-') && i < (CONF_HOSTNAME_MAXSIZE - 1)) { bufParseHOSTNAME[i] = p2parse[i]; ++i; @@ -231,7 +231,7 @@ CHKiRet(objUse(parser, CORE_COMPONENT)); CHKiRet(objUse(datetime, CORE_COMPONENT)); - DBGPRINTF("rfc3164 parser init called\n"); + dbgprintf("rfc3164 parser init called\n"); bParseHOSTNAMEandTAG = glbl.GetParseHOSTNAMEandTAG(); /* cache value, is set only during rsyslogd option processing */ diff -Nru rsyslog-7.6.0/tools/pmrfc5424.c rsyslog-5.10.1/tools/pmrfc5424.c --- rsyslog-7.6.0/tools/pmrfc5424.c 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tools/pmrfc5424.c 2012-10-17 14:41:20.000000000 +0000 @@ -106,7 +106,7 @@ /* set the new parse pointer */ *pp2parse = p2parse; - return iRet; + return 0; } @@ -191,7 +191,7 @@ /* set the new parse pointer */ *pp2parse = p2parse; *pLenStr = lenStr; - return iRet; + return 0; } /* parse a RFC5424-formatted syslog message. This function returns @@ -227,7 +227,7 @@ ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE); } DBGPRINTF("Message has RFC5424/syslog-protocol format.\n"); - setProtocolVersion(pMsg, MSG_RFC5424_PROTOCOL); + setProtocolVersion(pMsg, 1); p2parse += 2; lenMsg -= 2; diff -Nru rsyslog-7.6.0/tools/recover_qi.pl rsyslog-5.10.1/tools/recover_qi.pl --- rsyslog-7.6.0/tools/recover_qi.pl 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tools/recover_qi.pl 2012-09-26 09:31:30.000000000 +0000 @@ -1,207 +1,207 @@ -#!/usr/bin/perl -w -# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn). -# -# See: -# runtime/queue.c: qqueuePersist() -# runtime/queue.c: qqueueTryLoadPersistedInfo() -# -# kaiwang.chen@gmail.com 2012-03-14 -# -use strict; -use Getopt::Long; - -my %opt = (); -GetOptions(\%opt,"spool|w=s","basename|f=s","digits|d=i","help!"); -if ($opt{help}) { - print "Usage: -\t$0 -w WorkDirectory -f QueueFileName -d 8 > QueueFileName.qi -"; - exit; -} - -# runtime/queue.c: qConstructDisk() -my $iMaxFiles = 10000000; # 0+"1".( "0"x($opt{digits} - 1)); - -# get the list of queue files, spool directory excluded -my $re = qr/^\Q$opt{basename}\E\.\d{$opt{digits}}$/; -opendir(DIR, $opt{spool}) or die "can’t open spool: $!"; -my @qf = grep { /$re/ && -f "$opt{spool}/$_" } readdir(DIR); -closedir DIR; - -# ensure order and continuity -@qf = sort @qf; -my ($head) = ($qf[0] =~ /(\d+)$/); -my ($tail) = ($qf[-1] =~ /(\d+)$/); -$head += 0; -$tail += 0; -if ($tail-$head+1 != @qf || $tail > $iMaxFiles) { - die "broken queue: missing file(s) or wrong tail\n"; -} - -# collect some counters about the queue, assuming all are unprocessed entries. -my $sizeOnDisk = 0; -my $iQueueSize = 0; -chdir($opt{spool}) or die "can't chdir to spool: $!"; -print STDERR "traversing ". @qf ." files, please wait...\n"; -for (@qf) { - open FH, "<", $_ or die "can't read queue file $_\n"; - $sizeOnDisk += (stat FH)[7]; - while () { - $iQueueSize++ if /^new("qqueue",1); -$qqueue->property("iQueueSize", "INT", $iQueueSize); -$qqueue->property("tVars.disk.sizeOnDisk", "INT64", $sizeOnDisk); -$qqueue->property("tVars.disk.bytesRead", "INT64", 0); - -# runtime/stream.h: strmType_t -my $STREAMTYPE_FILE_CIRCULAR = 1; -# runtime/stream.h: strmMode_t -my $STREAMMODE_READ = 1; -my $STREAMMODE_WRITE_APPEND = 4; - -# runtime/stream.c: strmSerialize() -# write to end -my $strm_Write = Rsyslog::Obj->new("strm",1); -$strm_Write->property( "iCurrFNum", "INT", $tail); -$strm_Write->property( "pszFName", "PSZ", $opt{basename}); -$strm_Write->property( "iMaxFiles", "INT", $iMaxFiles); -$strm_Write->property( "bDeleteOnClose", "INT", 0); -$strm_Write->property( "sType", "INT", $STREAMTYPE_FILE_CIRCULAR); -$strm_Write->property("tOperationsMode", "INT", $STREAMMODE_WRITE_APPEND); -$strm_Write->property( "tOpenMode", "INT", 0600); -$strm_Write->property( "iCurrOffs","INT64", $iCurrOffs_Write); -# read from head -my $strm_ReadDel = Rsyslog::Obj->new("strm",1); -$strm_ReadDel->property( "iCurrFNum", "INT", $head); -$strm_ReadDel->property( "pszFName", "PSZ", $opt{basename}); -$strm_ReadDel->property( "iMaxFiles", "INT", $iMaxFiles); -$strm_ReadDel->property( "bDeleteOnClose", "INT", 1); -$strm_ReadDel->property( "sType", "INT", $STREAMTYPE_FILE_CIRCULAR); -$strm_ReadDel->property("tOperationsMode", "INT", $STREAMMODE_READ); -$strm_ReadDel->property( "tOpenMode", "INT", 0600); -$strm_ReadDel->property( "iCurrOffs","INT64", 0); - -# .qi -print $qqueue->serialize(); -print $strm_Write->serialize(); -print $strm_ReadDel->serialize(); - -exit; -#----------------------------------------------------------------------------- - -package Rsyslog::Serializable; -# runtime/obj.c -sub COOKIE_OBJLINE { '<' } -sub COOKIE_PROPLINE { '+' } -sub COOKIE_ENDLINE { '>' } -sub COOKIE_BLANKLINE { '.' } -# VARTYPE(short_ptype) -sub VARTYPE { - my ($t) = @_; - # runtime/obj-types.h: propType_t - my $ptype = "PROPTYPE_".$t; - # runtime/var.h: varType_t - my %vm = ( - VARTYPE_NONE => 0, - VARTYPE_STR => 1, - VARTYPE_NUMBER => 2, - VARTYPE_SYSLOGTIME => 3, - ); - # runtime/obj.c: SerializeProp() - my %p2v = ( - #PROPTYPE_NONE => "", - PROPTYPE_PSZ => "VARTYPE_STR", - PROPTYPE_SHORT => "VARTYPE_NUMBER", - PROPTYPE_INT => "VARTYPE_NUMBER", - PROPTYPE_LONG => "VARTYPE_NUMBER", - PROPTYPE_INT64 => "VARTYPE_NUMBER", - PROPTYPE_CSTR => "VARTYPE_STR", - #PROPTYPE_SYSLOGTIME => "VARTYPE_SYSLOGTIME", - ); - my $vtype = $p2v{$ptype}; - unless ($vtype) { - die "property type $t is not supported!\n"; - } - return $vm{$vtype}; -} -sub serialize { - my $self = shift; - # runtime/obj.c: objSerializeHeader() - my $x = COOKIE_OBJLINE(); - $x .= join(":", $self->type(), $self->cver(), $self->id(), $self->version()); - $x .= ":\n"; - for ( values %{$self->{props}} ) { - # runtime/obj.c: SerializeProp() - $x .= COOKIE_PROPLINE(); - $x .= join(":", - $_->{name}, - VARTYPE($_->{type}), - length($_->{value}), - $_->{value}); - $x .= ":\n"; - } - # runtime/obj.c: EndSerialize() - $x .= COOKIE_ENDLINE() . "End\n"; - $x .= COOKIE_BLANKLINE() . "\n"; -} -# constructor: new(id,version) -sub new { - my ($class, $id, $version) = @_; - $class = ref $class if ref $class; - bless { - id => $id, - version => $version, - props => {}, - }, $class; -} -sub id { - my $self = shift; - if (@_) { - my $x = $self->{id}; - $self->{id} = shift; - return $x; - } - return $self->{id}; -} -sub version { - my $self = shift; - if (@_) { - my $x = $self->{version}; - $self->{version} = shift; - return $x; - } - return $self->{version}; -} -# property(name, type, value) -sub property { - my $self = shift; - my $name = shift; - if (@_) { - my $x = $self->{props}{$name}; - $self->{props}{$name}{name} = $name; - $self->{props}{$name}{type} = shift; - $self->{props}{$name}{value} = shift; - return $x; - } - return $self->{props}{$name}; -} -1; -package Rsyslog::OPB; -use base qw(Rsyslog::Serializable); -sub type { 'OPB' } -sub cver { 1 } -sub new { shift->SUPER::new(@_) } -1; -package Rsyslog::Obj; -use base qw(Rsyslog::Serializable); -sub type { 'Obj' } -sub cver { 1 } -sub new { shift->SUPER::new(@_) } -1; +#!/usr/bin/perl -w +# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn). +# +# See: +# runtime/queue.c: qqueuePersist() +# runtime/queue.c: qqueueTryLoadPersistedInfo() +# +# kaiwang.chen@gmail.com 2012-03-14 +# +use strict; +use Getopt::Long; + +my %opt = (); +GetOptions(\%opt,"spool|w=s","basename|f=s","digits|d=i","help!"); +if ($opt{help}) { + print "Usage: +\t$0 -w WorkDirectory -f QueueFileName -d 8 > QueueFileName.qi +"; + exit; +} + +# runtime/queue.c: qConstructDisk() +my $iMaxFiles = 10000000; # 0+"1".( "0"x($opt{digits} - 1)); + +# get the list of queue files, spool directory excluded +my $re = qr/^\Q$opt{basename}\E\.\d{$opt{digits}}$/; +opendir(DIR, $opt{spool}) or die "can’t open spool: $!"; +my @qf = grep { /$re/ && -f "$opt{spool}/$_" } readdir(DIR); +closedir DIR; + +# ensure order and continuity +@qf = sort @qf; +my ($head) = ($qf[0] =~ /(\d+)$/); +my ($tail) = ($qf[-1] =~ /(\d+)$/); +$head += 0; +$tail += 0; +if ($tail-$head+1 != @qf || $tail > $iMaxFiles) { + die "broken queue: missing file(s) or wrong tail\n"; +} + +# collect some counters about the queue, assuming all are unprocessed entries. +my $sizeOnDisk = 0; +my $iQueueSize = 0; +chdir($opt{spool}) or die "can't chdir to spool: $!"; +print STDERR "traversing ". @qf ." files, please wait...\n"; +for (@qf) { + open FH, "<", $_ or die "can't read queue file $_\n"; + $sizeOnDisk += (stat FH)[7]; + while () { + $iQueueSize++ if /^new("qqueue",1); +$qqueue->property("iQueueSize", "INT", $iQueueSize); +$qqueue->property("tVars.disk.sizeOnDisk", "INT64", $sizeOnDisk); +$qqueue->property("tVars.disk.bytesRead", "INT64", 0); + +# runtime/stream.h: strmType_t +my $STREAMTYPE_FILE_CIRCULAR = 1; +# runtime/stream.h: strmMode_t +my $STREAMMODE_READ = 1; +my $STREAMMODE_WRITE_APPEND = 4; + +# runtime/stream.c: strmSerialize() +# write to end +my $strm_Write = Rsyslog::Obj->new("strm",1); +$strm_Write->property( "iCurrFNum", "INT", $tail); +$strm_Write->property( "pszFName", "PSZ", $opt{basename}); +$strm_Write->property( "iMaxFiles", "INT", $iMaxFiles); +$strm_Write->property( "bDeleteOnClose", "INT", 0); +$strm_Write->property( "sType", "INT", $STREAMTYPE_FILE_CIRCULAR); +$strm_Write->property("tOperationsMode", "INT", $STREAMMODE_WRITE_APPEND); +$strm_Write->property( "tOpenMode", "INT", 0600); +$strm_Write->property( "iCurrOffs","INT64", $iCurrOffs_Write); +# read from head +my $strm_ReadDel = Rsyslog::Obj->new("strm",1); +$strm_ReadDel->property( "iCurrFNum", "INT", $head); +$strm_ReadDel->property( "pszFName", "PSZ", $opt{basename}); +$strm_ReadDel->property( "iMaxFiles", "INT", $iMaxFiles); +$strm_ReadDel->property( "bDeleteOnClose", "INT", 1); +$strm_ReadDel->property( "sType", "INT", $STREAMTYPE_FILE_CIRCULAR); +$strm_ReadDel->property("tOperationsMode", "INT", $STREAMMODE_READ); +$strm_ReadDel->property( "tOpenMode", "INT", 0600); +$strm_ReadDel->property( "iCurrOffs","INT64", 0); + +# .qi +print $qqueue->serialize(); +print $strm_Write->serialize(); +print $strm_ReadDel->serialize(); + +exit; +#----------------------------------------------------------------------------- + +package Rsyslog::Serializable; +# runtime/obj.c +sub COOKIE_OBJLINE { '<' } +sub COOKIE_PROPLINE { '+' } +sub COOKIE_ENDLINE { '>' } +sub COOKIE_BLANKLINE { '.' } +# VARTYPE(short_ptype) +sub VARTYPE { + my ($t) = @_; + # runtime/obj-types.h: propType_t + my $ptype = "PROPTYPE_".$t; + # runtime/var.h: varType_t + my %vm = ( + VARTYPE_NONE => 0, + VARTYPE_STR => 1, + VARTYPE_NUMBER => 2, + VARTYPE_SYSLOGTIME => 3, + ); + # runtime/obj.c: SerializeProp() + my %p2v = ( + #PROPTYPE_NONE => "", + PROPTYPE_PSZ => "VARTYPE_STR", + PROPTYPE_SHORT => "VARTYPE_NUMBER", + PROPTYPE_INT => "VARTYPE_NUMBER", + PROPTYPE_LONG => "VARTYPE_NUMBER", + PROPTYPE_INT64 => "VARTYPE_NUMBER", + PROPTYPE_CSTR => "VARTYPE_STR", + #PROPTYPE_SYSLOGTIME => "VARTYPE_SYSLOGTIME", + ); + my $vtype = $p2v{$ptype}; + unless ($vtype) { + die "property type $t is not supported!\n"; + } + return $vm{$vtype}; +} +sub serialize { + my $self = shift; + # runtime/obj.c: objSerializeHeader() + my $x = COOKIE_OBJLINE(); + $x .= join(":", $self->type(), $self->cver(), $self->id(), $self->version()); + $x .= ":\n"; + for ( values %{$self->{props}} ) { + # runtime/obj.c: SerializeProp() + $x .= COOKIE_PROPLINE(); + $x .= join(":", + $_->{name}, + VARTYPE($_->{type}), + length($_->{value}), + $_->{value}); + $x .= ":\n"; + } + # runtime/obj.c: EndSerialize() + $x .= COOKIE_ENDLINE() . "End\n"; + $x .= COOKIE_BLANKLINE() . "\n"; +} +# constructor: new(id,version) +sub new { + my ($class, $id, $version) = @_; + $class = ref $class if ref $class; + bless { + id => $id, + version => $version, + props => {}, + }, $class; +} +sub id { + my $self = shift; + if (@_) { + my $x = $self->{id}; + $self->{id} = shift; + return $x; + } + return $self->{id}; +} +sub version { + my $self = shift; + if (@_) { + my $x = $self->{version}; + $self->{version} = shift; + return $x; + } + return $self->{version}; +} +# property(name, type, value) +sub property { + my $self = shift; + my $name = shift; + if (@_) { + my $x = $self->{props}{$name}; + $self->{props}{$name}{name} = $name; + $self->{props}{$name}{type} = shift; + $self->{props}{$name}{value} = shift; + return $x; + } + return $self->{props}{$name}; +} +1; +package Rsyslog::OPB; +use base qw(Rsyslog::Serializable); +sub type { 'OPB' } +sub cver { 1 } +sub new { shift->SUPER::new(@_) } +1; +package Rsyslog::Obj; +use base qw(Rsyslog::Serializable); +sub type { 'Obj' } +sub cver { 1 } +sub new { shift->SUPER::new(@_) } +1; diff -Nru rsyslog-7.6.0/tools/rscryutil.1 rsyslog-5.10.1/tools/rscryutil.1 --- rsyslog-7.6.0/tools/rscryutil.1 2013-10-29 15:31:21.000000000 +0000 +++ rsyslog-5.10.1/tools/rscryutil.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -.\" Man page generated from reStructeredText. -. -.TH RSCRYUTIL 1 "2013-04-15" "" "" -.SH NAME -rscryutil \- Manage Encrypted Log Files -. -.nr rst2man-indent-level 0 -. -.de1 rstReportMargin -\\$1 \\n[an-margin] -level \\n[rst2man-indent-level] -level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] -- -\\n[rst2man-indent0] -\\n[rst2man-indent1] -\\n[rst2man-indent2] -.. -.de1 INDENT -.\" .rstReportMargin pre: -. RS \\$1 -. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] -. nr rst2man-indent-level +1 -.\" .rstReportMargin post: -.. -.de UNINDENT -. RE -.\" indent \\n[an-margin] -.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] -.nr rst2man-indent-level -1 -.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] -.in \\n[rst2man-indent\\n[rst2man-indent-level]]u -.. -.SH SYNOPSIS -.sp -.nf -.ft C -rscryutil [OPTIONS] [FILE] ... -.ft P -.fi -.SH DESCRIPTION -.sp -This tool performs various operations on encrypted log files. -Most importantly, it provides the ability to decrypt them. -.SH OPTIONS -.INDENT 0.0 -.TP -.B \-d, \-\-decrypt -Select decryption mode. This is the default mode. -.TP -.BI \-W, \-\-write\-keyfile \ -Utility function to write a key to a keyfile. The key can be obtained -via any method. -.TP -.B \-v, \-\-verbose -Select verbose mode. -.TP -.B \-f, \-\-force -Forces operations that otherwise would fail. -.TP -.BI \-k, \-\-keyfile \ -Reads the key from . File _must_ contain the key, only, no headers -or other meta information. Keyfiles can be generated via the -\fI\-\-write\-keyfile\fP option. -.TP -.BI \-p, \-\-key\-program \ -In this mode, the key is provided by a so\-called "key program". This program -is executed and must return the key to (as well as some meta information) -via stdout. The core idea of key programs is that using this interface the -user can implement as complex (and secure) method to obtain keys as -desired, all without the need to make modifications to rsyslog. -.TP -.BI \-K, \-\-key \ -TESTING AID, NOT FOR PRODUCTION USE. This uses the KEY specified -on the command line. This is the actual key, and as such this mode -is highly insecure. However, it can be useful for intial testing -steps. This option may be removed in the future. -.TP -.BI \-a, \-\-algo \ -Sets the encryption algorightm (cipher) to be used. See below -for supported algorithms. The default is "AES128". -.TP -.BI \-m, \-\-mode \ -Sets the ciphermode to be used. See below for supported modes. -The default is "CBC". -.TP -.BI \-r, \-\-generate\-random\-key \ -Generates a random key of length . This option is -meant to be used together with \fI\-\-write\-keyfile\fP (and it is hard -to envision any other valid use for it). -.UNINDENT -.SH OPERATION MODES -.sp -The operation mode specifies what exactly the tool does with the provided -files. The default operation mode is "dump", but this may change in the future. -Thus, it is recommended to always set the operations mode explicitely. If -multiple operations mode are set on the command line, results are -unpredictable. -.SS decrypt -.sp -The provided log files are decrypted. Note that the \fI.encinfo\fP side files -must exist and be accessible in order for decryption to to work. -.SS write\-keyfile -.sp -In this mode no log files are processed; thus it is an error to specify -any on the command line. The specified keyfile is written. The key itself -is obtained via the usual key commands. If \fI\-\-keyfile\fP is used, that -file is effectively copied. -.sp -For security reasons, existing key files are _not_ overwritten. To permit -this, specify the \fI\-\-force\fP option. When doing so, keep in mind that lost -keys cannot be recovered and data encrypted with them may also be considered -lost. -.sp -Keyfiles are always created with 0400 permission, that is read access for only -the user. An exception is when an existing file is overwritten via the -\fI\-\-force\fP option, in which case the former permissions still apply. -.SH EXIT CODES -.sp -The command returns an exit code of 0 if everything went fine, and some -other code in case of failures. -.SH SUPPORTED ALGORITHMS -.sp -We basically support what libgcrypt supports. This is: -.INDENT 0.0 -.INDENT 3.5 -3DES -CAST5 -BLOWFISH -AES128 -AES192 -AES256 -TWOFISH -TWOFISH128 -ARCFOUR -DES -SERPENT128 -SERPENT192 -SERPENT256 -RFC2268_40 -SEED -CAMELLIA128 -CAMELLIA192 -CAMELLIA256 -.UNINDENT -.UNINDENT -.SH SUPPORTED CIPHER MODES -.sp -We basically support what libgcrypt supports. This is: -.INDENT 0.0 -.INDENT 3.5 -ECB -CFB -CBC -STREAM -OFB -CTR -AESWRAP -.UNINDENT -.UNINDENT -.SH EXAMPLES -.sp -\fBrscryutil logfile\fP -.sp -Decrypts "logfile" and sends data to stdout. -.sp -\fBrscryutil \-\-generate\-random\-key 16 \-\-keyfile /some/secured/path/keyfile\fP -.sp -Generates random key and stores it in the specified keyfile. -.SH LOG SIGNATURES -.sp -Encrypted log files can be used together with signing. To verify such a file, -it must be decrypted first, and the verification tool \fBrsgtutil(1)\fP must be -run on the decrypted file. -.SH SECURITY CONSIDERATIONS -.sp -Specifying keys directly on the command line (\fI\-\-key\fP option) is very -insecure and should -not be done, except for testing purposes with test keys. Even then it is -recommended to use keyfiles, which are also easy to handle during testing. -Keep in mind that command history is usally be kept by bash and can also -easily be monitored. -.sp -Local keyfiles are also a security risk. At a minimum, they should be -used with very restrictive file permissions. For this reason, -the \fIrscryutil\fP tool creates them with read permissions for the user, -only, no matter what umask is set to. -.sp -When selecting cipher algorithms and modes, care needs to be taken. The -defaults should be reasonable safe to use, but this tends to change over -time. Keep up with the most current crypto recommendations. -.SH SEE ALSO -.sp -\fBrsgtutil(1)\fP, \fBrsyslogd(8)\fP -.SH COPYRIGHT -.sp -This page is part of the \fIrsyslog\fP project, and is available under -LGPLv2. -.SH AUTHOR -Rainer Gerhards -.\" Generated by docutils manpage writer. -.\" -. diff -Nru rsyslog-7.6.0/tools/rscryutil.c rsyslog-5.10.1/tools/rscryutil.c --- rsyslog-7.6.0/tools/rscryutil.c 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/rscryutil.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,512 +0,0 @@ -/* This is a tool for processing rsyslog encrypted log files. - * - * Copyright 2013 Adiscon GmbH - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either exprs or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rsyslog.h" -#include "libgcry.h" - - -static enum { MD_DECRYPT, MD_WRITE_KEYFILE -} mode = MD_DECRYPT; -static int verbose = 0; -static gcry_cipher_hd_t gcry_chd; -static size_t blkLength; - -static char *keyfile = NULL; -static char *keyprog = NULL; -static int randomKeyLen = -1; -static char *cry_key = NULL; -static unsigned cry_keylen = 0; -static int cry_algo = GCRY_CIPHER_AES128; -static int cry_mode = GCRY_CIPHER_MODE_CBC; -static int optionForce = 0; - -/* rectype/value must be EIF_MAX_*_LEN+1 long! - * returns 0 on success or something else on error/EOF - */ -static int -eiGetRecord(FILE *eifp, char *rectype, char *value) -{ - int r; - unsigned short i, j; - char buf[EIF_MAX_RECTYPE_LEN+EIF_MAX_VALUE_LEN+128]; - /* large enough for any valid record */ - - if(fgets(buf, sizeof(buf), eifp) == NULL) { - r = 1; goto done; - } - - for(i = 0 ; i < EIF_MAX_RECTYPE_LEN && buf[i] != ':' ; ++i) - if(buf[i] == '\0') { - r = 2; goto done; - } else - rectype[i] = buf[i]; - rectype[i] = '\0'; - j = 0; - for(++i ; i < EIF_MAX_VALUE_LEN && buf[i] != '\n' ; ++i, ++j) - if(buf[i] == '\0') { - r = 3; goto done; - } else - value[j] = buf[i]; - value[j] = '\0'; - r = 0; -done: return r; -} - -static int -eiCheckFiletype(FILE *eifp) -{ - char rectype[EIF_MAX_RECTYPE_LEN+1]; - char value[EIF_MAX_VALUE_LEN+1]; - int r; - - if((r = eiGetRecord(eifp, rectype, value)) != 0) goto done; - if(strcmp(rectype, "FILETYPE") || strcmp(value, RSGCRY_FILETYPE_NAME)) { - fprintf(stderr, "invalid filetype \"cookie\" in encryption " - "info file\n"); - fprintf(stderr, "\trectype: '%s', value: '%s'\n", rectype, value); - r = 1; goto done; - } - r = 0; -done: return r; -} - -static int -eiGetIV(FILE *eifp, char *iv, size_t leniv) -{ - char rectype[EIF_MAX_RECTYPE_LEN+1]; - char value[EIF_MAX_VALUE_LEN+1]; - size_t valueLen; - unsigned short i, j; - int r; - unsigned char nibble; - - if((r = eiGetRecord(eifp, rectype, value)) != 0) goto done; - if(strcmp(rectype, "IV")) { - fprintf(stderr, "no IV record found when expected, record type " - "seen is '%s'\n", rectype); - r = 1; goto done; - } - valueLen = strlen(value); - if(valueLen/2 != leniv) { - fprintf(stderr, "length of IV is %d, expected %d\n", - valueLen/2, leniv); - r = 1; goto done; - } - - for(i = j = 0 ; i < valueLen ; ++i) { - if(value[i] >= '0' && value[i] <= '9') - nibble = value[i] - '0'; - else if(value[i] >= 'a' && value[i] <= 'f') - nibble = value[i] - 'a' + 10; - else { - fprintf(stderr, "invalid IV '%s'\n", value); - r = 1; goto done; - } - if(i % 2 == 0) - iv[j] = nibble << 4; - else - iv[j++] |= nibble; - } - r = 0; -done: return r; -} - -static int -eiGetEND(FILE *eifp, off64_t *offs) -{ - char rectype[EIF_MAX_RECTYPE_LEN+1]; - char value[EIF_MAX_VALUE_LEN+1]; - int r; - - if((r = eiGetRecord(eifp, rectype, value)) != 0) goto done; - if(strcmp(rectype, "END")) { - fprintf(stderr, "no END record found when expected, record type " - "seen is '%s'\n", rectype); - r = 1; goto done; - } - *offs = atoll(value); - r = 0; -done: return r; -} - -static int -initCrypt(FILE *eifp) -{ - int r = 0; - gcry_error_t gcryError; - char iv[4096]; - - blkLength = gcry_cipher_get_algo_blklen(cry_algo); - if(blkLength > sizeof(iv)) { - fprintf(stderr, "internal error[%s:%d]: block length %d too large for " - "iv buffer\n", __FILE__, __LINE__, blkLength); - r = 1; goto done; - } - if((r = eiGetIV(eifp, iv, blkLength)) != 0) goto done; - - size_t keyLength = gcry_cipher_get_algo_keylen(cry_algo); - if(strlen(cry_key) != keyLength) { - fprintf(stderr, "invalid key length; key is %u characters, but " - "exactly %u characters are required\n", cry_keylen, - keyLength); - r = 1; goto done; - } - - gcryError = gcry_cipher_open(&gcry_chd, cry_algo, cry_mode, 0); - if (gcryError) { - printf("gcry_cipher_open failed: %s/%s\n", - gcry_strsource(gcryError), - gcry_strerror(gcryError)); - r = 1; goto done; - } - - gcryError = gcry_cipher_setkey(gcry_chd, cry_key, keyLength); - if (gcryError) { - printf("gcry_cipher_setkey failed: %s/%s\n", - gcry_strsource(gcryError), - gcry_strerror(gcryError)); - r = 1; goto done; - } - - gcryError = gcry_cipher_setiv(gcry_chd, iv, blkLength); - if (gcryError) { - printf("gcry_cipher_setiv failed: %s/%s\n", - gcry_strsource(gcryError), - gcry_strerror(gcryError)); - r = 1; goto done; - } -done: return r; -} - -static inline void -removePadding(char *buf, size_t *plen) -{ - unsigned len = (unsigned) *plen; - unsigned iSrc, iDst; - char *frstNUL; - - frstNUL = memchr(buf, 0x00, *plen); - if(frstNUL == NULL) - goto done; - iDst = iSrc = frstNUL - buf; - - while(iSrc < len) { - if(buf[iSrc] != 0x00) - buf[iDst++] = buf[iSrc]; - ++iSrc; - } - - *plen = iDst; -done: return; -} - -static void -decryptBlock(FILE *fpin, FILE *fpout, off64_t blkEnd, off64_t *pCurrOffs) -{ - gcry_error_t gcryError; - size_t nRead, nWritten; - size_t toRead; - size_t leftTillBlkEnd; - char buf[64*1024]; - - leftTillBlkEnd = blkEnd - *pCurrOffs; - while(1) { - toRead = sizeof(buf) <= leftTillBlkEnd ? sizeof(buf) : leftTillBlkEnd; - toRead = toRead - toRead % blkLength; - nRead = fread(buf, 1, toRead, fpin); - if(nRead == 0) - break; - leftTillBlkEnd -= nRead, *pCurrOffs += nRead; - gcryError = gcry_cipher_decrypt( - gcry_chd, // gcry_cipher_hd_t - buf, // void * - nRead, // size_t - NULL, // const void * - 0); // size_t - if (gcryError) { - fprintf(stderr, "gcry_cipher_decrypt failed: %s/%s\n", - gcry_strsource(gcryError), - gcry_strerror(gcryError)); - return; - } - removePadding(buf, &nRead); - nWritten = fwrite(buf, 1, nRead, fpout); - if(nWritten != nRead) { - perror("fpout"); - return; - } - } -} - - -static int -doDecrypt(FILE *logfp, FILE *eifp, FILE *outfp) -{ - off64_t blkEnd; - off64_t currOffs = 0; - int r; - - while(1) { - /* process block */ - if(initCrypt(eifp) != 0) - goto done; - if((r = eiGetEND(eifp, &blkEnd)) != 0) goto done; - decryptBlock(logfp, outfp, blkEnd, &currOffs); - gcry_cipher_close(gcry_chd); - } - r = 0; -done: return r; -} - -static void -decrypt(char *name) -{ - FILE *logfp = NULL, *eifp = NULL; - int r = 0; - char eifname[4096]; - - if(!strcmp(name, "-")) { - fprintf(stderr, "decrypt mode cannot work on stdin\n"); - goto err; - } else { - if((logfp = fopen(name, "r")) == NULL) { - perror(name); - goto err; - } - snprintf(eifname, sizeof(eifname), "%s%s", name, ENCINFO_SUFFIX); - eifname[sizeof(eifname)-1] = '\0'; - if((eifp = fopen(eifname, "r")) == NULL) { - perror(eifname); - goto err; - } - if(eiCheckFiletype(eifp) != 0) - goto err; - } - - doDecrypt(logfp, eifp, stdout); - - fclose(logfp); logfp = NULL; - fclose(eifp); eifp = NULL; - return; - -err: - fprintf(stderr, "error %d processing file %s\n", r, name); - if(logfp != NULL) - fclose(logfp); -} - -static void -write_keyfile(char *fn) -{ - int fd; - int r; - mode_t fmode; - - fmode = O_WRONLY|O_CREAT; - if(!optionForce) - fmode |= O_EXCL; - if((fd = open(fn, fmode, S_IRUSR)) == -1) { - fprintf(stderr, "error opening keyfile "); - perror(fn); - exit(1); - } - if((r = write(fd, cry_key, cry_keylen)) != (ssize_t)cry_keylen) { - fprintf(stderr, "error writing keyfile (ret=%d) ", r); - perror(fn); - exit(1); - } - close(fd); -} - -static void -getKeyFromFile(char *fn) -{ - int r; - r = gcryGetKeyFromFile(fn, &cry_key, &cry_keylen); - if(r != 0) { - fprintf(stderr, "Error %d reading key from file '%s'\n", r, fn); - exit(1); - } -} - -static void -getRandomKey(void) -{ - int fd; - cry_keylen = randomKeyLen; - cry_key = malloc(randomKeyLen); /* do NOT zero-out! */ - /* if we cannot obtain data from /dev/urandom, we use whatever - * is present at the current memory location as random data. Of - * course, this is very weak and we should consider a different - * option, especially when not running under Linux (for Linux, - * unavailability of /dev/urandom is just a theoretic thing, it - * will always work...). -- TODO -- rgerhards, 2013-03-06 - */ - if((fd = open("/dev/urandom", O_RDONLY)) > 0) { - if(read(fd, cry_key, randomKeyLen)) {}; /* keep compiler happy */ - close(fd); - } -} - - -static void -setKey() -{ - if(randomKeyLen != -1) - getRandomKey(); - else if(keyfile != NULL) - getKeyFromFile(keyfile); - else if(keyprog != NULL) - gcryGetKeyFromProg(keyprog, &cry_key, &cry_keylen); - if(cry_key == NULL) { - fprintf(stderr, "ERROR: key must be set via some method\n"); - exit(1); - } -} - -static struct option long_options[] = -{ - {"verbose", no_argument, NULL, 'v'}, - {"version", no_argument, NULL, 'V'}, - {"decrypt", no_argument, NULL, 'd'}, - {"force", no_argument, NULL, 'f'}, - {"write-keyfile", required_argument, NULL, 'W'}, - {"key", required_argument, NULL, 'K'}, - {"generate-random-key", required_argument, NULL, 'r'}, - {"keyfile", required_argument, NULL, 'k'}, - {"key-program", required_argument, NULL, 'p'}, - {"algo", required_argument, NULL, 'a'}, - {"mode", required_argument, NULL, 'm'}, - {NULL, 0, NULL, 0} -}; - -int -main(int argc, char *argv[]) -{ - int i; - int opt; - int temp; - char *newKeyFile = NULL; - - while(1) { - opt = getopt_long(argc, argv, "a:dfk:K:m:p:r:vVW:", long_options, NULL); - if(opt == -1) - break; - switch(opt) { - case 'd': - mode = MD_DECRYPT; - break; - case 'W': - mode = MD_WRITE_KEYFILE; - newKeyFile = optarg; - break; - case 'k': - keyfile = optarg; - break; - case 'p': - keyprog = optarg; - break; - case 'f': - optionForce = 1; - break; - case 'r': - randomKeyLen = atoi(optarg); - if(randomKeyLen > 64*1024) { - fprintf(stderr, "ERROR: keys larger than 64KiB are " - "not supported\n"); - exit(1); - } - break; - case 'K': - fprintf(stderr, "WARNING: specifying the actual key " - "via the command line is highly insecure\n" - "Do NOT use this for PRODUCTION use.\n"); - cry_key = optarg; - cry_keylen = strlen(cry_key); - break; - case 'a': - temp = rsgcryAlgoname2Algo(optarg); - if(temp == GCRY_CIPHER_NONE) { - fprintf(stderr, "ERROR: algorithm \"%s\" is not " - "kown/supported\n", optarg); - exit(1); - } - cry_algo = temp; - break; - case 'm': - temp = rsgcryModename2Mode(optarg); - if(temp == GCRY_CIPHER_MODE_NONE) { - fprintf(stderr, "ERROR: cipher mode \"%s\" is not " - "kown/supported\n", optarg); - exit(1); - } - cry_mode = temp; - break; - case 'v': - verbose = 1; - break; - case 'V': - fprintf(stderr, "rsgtutil " VERSION "\n"); - exit(0); - break; - case '?': - break; - default:fprintf(stderr, "getopt_long() returns unknown value %d\n", opt); - return 1; - } - } - - setKey(); - - if(mode == MD_WRITE_KEYFILE) { - if(optind != argc) { - fprintf(stderr, "ERROR: no file parameters permitted in " - "--write-keyfile mode\n"); - exit(1); - } - write_keyfile(newKeyFile); - } else { - if(optind == argc) - decrypt("-"); - else { - for(i = optind ; i < argc ; ++i) - decrypt(argv[i]); - } - } - - memset(cry_key, 0, cry_keylen); /* zero-out key store */ - cry_keylen = 0; - return 0; -} diff -Nru rsyslog-7.6.0/tools/rscryutil.rst rsyslog-5.10.1/tools/rscryutil.rst --- rsyslog-7.6.0/tools/rscryutil.rst 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/rscryutil.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -========= -rscryutil -========= - --------------------------- -Manage Encrypted Log Files --------------------------- - -:Author: Rainer Gerhards -:Date: 2013-04-15 -:Manual section: 1 - -SYNOPSIS -======== - -:: - - rscryutil [OPTIONS] [FILE] ... - - -DESCRIPTION -=========== - -This tool performs various operations on encrypted log files. -Most importantly, it provides the ability to decrypt them. - - -OPTIONS -======= - --d, --decrypt - Select decryption mode. This is the default mode. - --W, --write-keyfile - Utility function to write a key to a keyfile. The key can be obtained - via any method. - --v, --verbose - Select verbose mode. - --f, --force - Forces operations that otherwise would fail. - --k, --keyfile - Reads the key from . File _must_ contain the key, only, no headers - or other meta information. Keyfiles can be generated via the - *--write-keyfile* option. - --p, --key-program - In this mode, the key is provided by a so-called "key program". This program - is executed and must return the key to (as well as some meta information) - via stdout. The core idea of key programs is that using this interface the - user can implement as complex (and secure) method to obtain keys as - desired, all without the need to make modifications to rsyslog. - --K, --key - TESTING AID, NOT FOR PRODUCTION USE. This uses the KEY specified - on the command line. This is the actual key, and as such this mode - is highly insecure. However, it can be useful for intial testing - steps. This option may be removed in the future. - --a, --algo - Sets the encryption algorightm (cipher) to be used. See below - for supported algorithms. The default is "AES128". - --m, --mode - Sets the ciphermode to be used. See below for supported modes. - The default is "CBC". - --r, --generate-random-key - Generates a random key of length . This option is - meant to be used together with *--write-keyfile* (and it is hard - to envision any other valid use for it). - -OPERATION MODES -=============== - -The operation mode specifies what exactly the tool does with the provided -files. The default operation mode is "dump", but this may change in the future. -Thus, it is recommended to always set the operations mode explicitely. If -multiple operations mode are set on the command line, results are -unpredictable. - -decrypt -------- - -The provided log files are decrypted. Note that the *.encinfo* side files -must exist and be accessible in order for decryption to to work. - -write-keyfile -------------- - -In this mode no log files are processed; thus it is an error to specify -any on the command line. The specified keyfile is written. The key itself -is obtained via the usual key commands. If *--keyfile* is used, that -file is effectively copied. - -For security reasons, existing key files are _not_ overwritten. To permit -this, specify the *--force* option. When doing so, keep in mind that lost -keys cannot be recovered and data encrypted with them may also be considered -lost. - -Keyfiles are always created with 0400 permission, that is read access for only -the user. An exception is when an existing file is overwritten via the -*--force* option, in which case the former permissions still apply. - -EXIT CODES -========== - -The command returns an exit code of 0 if everything went fine, and some -other code in case of failures. - - -SUPPORTED ALGORITHMS -==================== - -We basically support what libgcrypt supports. This is: - - 3DES - CAST5 - BLOWFISH - AES128 - AES192 - AES256 - TWOFISH - TWOFISH128 - ARCFOUR - DES - SERPENT128 - SERPENT192 - SERPENT256 - RFC2268_40 - SEED - CAMELLIA128 - CAMELLIA192 - CAMELLIA256 - - -SUPPORTED CIPHER MODES -====================== - -We basically support what libgcrypt supports. This is: - - ECB - CFB - CBC - STREAM - OFB - CTR - AESWRAP - -EXAMPLES -======== - -**rscryutil logfile** - -Decrypts "logfile" and sends data to stdout. - - -**rscryutil --generate-random-key 16 --keyfile /some/secured/path/keyfile** - -Generates random key and stores it in the specified keyfile. - -LOG SIGNATURES -============== - -Encrypted log files can be used together with signing. To verify such a file, -it must be decrypted first, and the verification tool **rsgtutil(1)** must be -run on the decrypted file. - -SECURITY CONSIDERATIONS -======================= - -Specifying keys directly on the command line (*--key* option) is very -insecure and should -not be done, except for testing purposes with test keys. Even then it is -recommended to use keyfiles, which are also easy to handle during testing. -Keep in mind that command history is usally be kept by bash and can also -easily be monitored. - -Local keyfiles are also a security risk. At a minimum, they should be -used with very restrictive file permissions. For this reason, -the *rscryutil* tool creates them with read permissions for the user, -only, no matter what umask is set to. - -When selecting cipher algorithms and modes, care needs to be taken. The -defaults should be reasonable safe to use, but this tends to change over -time. Keep up with the most current crypto recommendations. - - -SEE ALSO -======== -**rsgtutil(1)**, **rsyslogd(8)** - -COPYRIGHT -========= - -This page is part of the *rsyslog* project, and is available under -LGPLv2. diff -Nru rsyslog-7.6.0/tools/rsgtutil.1 rsyslog-5.10.1/tools/rsgtutil.1 --- rsyslog-7.6.0/tools/rsgtutil.1 2013-05-14 23:01:48.000000000 +0000 +++ rsyslog-5.10.1/tools/rsgtutil.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -.\" Man page generated from reStructeredText. -. -.TH RSGTUTIL 1 "2013-03-25" "" "" -.SH NAME -rsgtutil \- Manage (GuardTime) Signed Log Files -. -.nr rst2man-indent-level 0 -. -.de1 rstReportMargin -\\$1 \\n[an-margin] -level \\n[rst2man-indent-level] -level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] -- -\\n[rst2man-indent0] -\\n[rst2man-indent1] -\\n[rst2man-indent2] -.. -.de1 INDENT -.\" .rstReportMargin pre: -. RS \\$1 -. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] -. nr rst2man-indent-level +1 -.\" .rstReportMargin post: -.. -.de UNINDENT -. RE -.\" indent \\n[an-margin] -.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] -.nr rst2man-indent-level -1 -.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] -.in \\n[rst2man-indent\\n[rst2man-indent-level]]u -.. -.SH SYNOPSIS -.sp -.nf -.ft C -rsgtutil [OPTIONS] [FILE] ... -.ft P -.fi -.SH DESCRIPTION -.sp -This tool performs various maintenance operations on signed log files. -It specifically supports the GuardTime signature provider. -.sp -The \fIrsgtutil\fP tool is the primary tool to verify log file signatures, -dump signature file contents and carry out other maintenance operations. -The tool offers different operation modes, which are selected via -command line options. -.sp -The processing of multiple files is permitted. Depending on operation -mode, either the signature file or the base log file must be specified. -Within a single call, only a single operations mode is permitted. To -use different modes on different files, multiple calles, one for each -mode, must be made. -.sp -If no file is specified on the command line, stdin is used instead. Note -that not all operation modes support stdin. -.SH OPTIONS -.INDENT 0.0 -.TP -.B \-D, \-\-dump -Select "dump" operations mode. -.TP -.B \-t, \-\-verify -Select "verify" operations mode. -.TP -.B \-T, \-\-detect\-file\-type -Select "detect\-file\-type" operations mode. -.TP -.B \-B, \-\-show\-sigblock\-params -Select "show\-sigblock\-params" operations mode. -.TP -.B \-s, \-\-show\-verified -Prints out information about correctly verified blocks (by default, only -errors are printed). -.TP -.B \-v, \-\-verbose -Select verbose mode. Most importantly, hashes and signatures are printed -in full length (can be \fBvery\fP lengthy) rather than the usual abbreviation. -.TP -.B \-e, \-\-extend -Select extend mode. This extends the RFC3161 signatures. Note that this -mode also implies a full verification. If there are verify errors, extending -will also fail. -.TP -.BI \-P \ , \ \-\-publications\-server \ -Sets the publications server. If not set but required by the operation a -default server is used. The default server is not necessarily optimal -in regard to performance and reliability. -.UNINDENT -.SH OPERATION MODES -.sp -The operation mode specifies what exactly the tool does with the provided -files. The default operation mode is "dump", but this may change in the future. -Thus, it is recommended to always set the operations mode explicitely. If -multiple operations mode are set on the command line, results are -unpredictable. -.SS dump -.sp -The provided \fIsignature\fP files are dumped. For each top\-level record, the*u -type code is printed as well as q short description. If there is additional -information available, it will be printed in tab\-indented lines below the -main record dump. The actual \fIlog\fP files need not to be present. -.SS verify -.sp -This mode does not work with stdin. On the command line, the \fIlog\fP file names -are specified. The corresponding \fIsignature\fP files (ending on ".gtsig") must also -be preset at the same location as the log file. In verify mode, both the log -and signature file is read and the validity of the log file checked. If verification -errors are detected these are printed and processing of the file aborted. By default, -each file is verified individually, without taking cross\-file hash chains into -account (so the order of files on the command line does not matter). -.sp -Note that the actual amount of what can be verified depends on the parameters with -which the signature file was written. If record and tree hashes are present, they -will be verified and thus fine\-granular error reporting is possible. If they are -not present, only the block signature itself is verified. -.sp -By default, only errors are printed. To also print successful verifications, use the -\fB\-\-show\-verified\fP option. -.SS extend -.sp -This extends the RFC3161 signatures. This includes a full verification -of the file. If there are verification errors, extending will also fail. -Note that a signature can only be extended when the required hash has been -published. Currently, these hashes are created at the 15th of each month at -0:00hrs UTC. It takes another few days to get them finally published. As such, -it can be assumed that extending is only possible after this happend (which -means it may take slightly above a month). -.sp -To prevent data corruption, a copy of the signature file is created during -extension. So there must be enough disk space available for both files, -otherwise the operation will fail. If the log file is named logfile, the -signature file is logfile.gtsig and the temporary work file is named -logfile.gtsig.new. When extending finished successfully, the original -signature file (logfile.gtsig in our example) is renamed with the .old -postfix (logfile.gtsig.old) and the temporary file written under the -original name. The .old file can be deleted. It is just kept as a -precaution to prevent signature loss. Note that any already existing -.old or .new files are overwritten by these operations. -.SS detect\-file\-type -.sp -This mode is used to detect the type of some well\-know files used inside the -signature system. The detection is based on the file header. This mode is -primarily a debug aid. -.SS show\-sigblock\-params -.sp -This mode is used to print signature block parameters. It is similar to \fIdump\fP -mode, but will ignore everything except signature blocks. Also, some additional -meta information is printed. This mode is primarily a debug aid. -.SH EXIT CODES -.sp -The command returns an exit code of 0 if everything went fine, and some -other code in case of failures. -.SH EXAMPLES -.sp -\fBrsgtutil \-\-verify logfile\fP -.sp -This verifies the file "logfile" via its associated signature file -"logfile.gtsig". If errors are detected, these are reported to stderr. -Otherwise, rsgtutil terminates without messages. -.sp -\fBrsgtutil \-\-dump logfile.gtsig\fP -.sp -This dumps the content of the signature file "logfile.gtsig". The -actual log file is not being processed and does not even need to be -present. -.SH SEE ALSO -.sp -\fBrsyslogd(8)\fP -.SH COPYRIGHT -.sp -This page is part of the \fIrsyslog\fP project, and is available under -LGPLv2. -.SH AUTHOR -Rainer Gerhards -.\" Generated by docutils manpage writer. -.\" -. diff -Nru rsyslog-7.6.0/tools/rsgtutil.c rsyslog-5.10.1/tools/rsgtutil.c --- rsyslog-7.6.0/tools/rsgtutil.c 2014-02-04 12:09:50.000000000 +0000 +++ rsyslog-5.10.1/tools/rsgtutil.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,440 +0,0 @@ -/* This is a tool for dumpoing the content of GuardTime TLV - * files in a (somewhat) human-readable manner. - * - * Copyright 2013 Adiscon GmbH - * - * This file is part of rsyslog. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * -or- - * see COPYING.ASL20 in the source distribution - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either exprs or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#include "librsgt.h" - -typedef unsigned char uchar; - -static enum { MD_DUMP, MD_DETECT_FILE_TYPE, MD_SHOW_SIGBLK_PARAMS, - MD_VERIFY, MD_EXTEND -} mode = MD_DUMP; -static int verbose = 0; - -static void -dumpFile(char *name) -{ - FILE *fp; - uchar hdr[9]; - void *obj; - tlvrecord_t rec; - int r = -1; - - if(!strcmp(name, "-")) - fp = stdin; - else { - printf("Processing file %s:\n", name); - if((fp = fopen(name, "r")) == NULL) { - perror(name); - goto err; - } - } - if((r = rsgt_tlvrdHeader(fp, hdr)) != 0) goto err; - printf("File Header: '%s'\n", hdr); - while(1) { /* we will err out on EOF */ - if((r = rsgt_tlvrd(fp, &rec, &obj)) != 0) { - if(feof(fp)) - break; - else - goto err; - } - rsgt_tlvprint(stdout, rec.tlvtype, obj, verbose); - rsgt_objfree(rec.tlvtype, obj); - } - - if(fp != stdin) - fclose(fp); - return; -err: fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name); -} - -static void -showSigblkParams(char *name) -{ - FILE *fp; - block_sig_t *bs; - uint8_t bHasRecHashes, bHasIntermedHashes; - uint64_t blkCnt = 0; - int r = -1; - - if(!strcmp(name, "-")) - fp = stdin; - else { - if((fp = fopen(name, "r")) == NULL) { - perror(name); - goto err; - } - } - if((r = rsgt_chkFileHdr(fp, "LOGSIG10")) != 0) goto err; - - while(1) { /* we will err out on EOF */ - if((r = rsgt_getBlockParams(fp, 0, &bs, &bHasRecHashes, - &bHasIntermedHashes)) != 0) - goto err; - ++blkCnt; - rsgt_printBLOCK_SIG(stdout, bs, verbose); - printf("\t***META INFORMATION:\n"); - printf("\tBlock Nbr in File...: %llu\n", blkCnt); - printf("\tHas Record Hashes...: %d\n", bHasRecHashes); - printf("\tHas Tree Hashes.....: %d\n", bHasIntermedHashes); - } - - if(fp != stdin) - fclose(fp); - return; -err: - if(r != RSGTE_EOF) - fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name); -} - -static void -detectFileType(char *name) -{ - FILE *fp; - char *typeName; - char hdr[9]; - int r = -1; - - if(!strcmp(name, "-")) - fp = stdin; - else { - if((fp = fopen(name, "r")) == NULL) { - perror(name); - goto err; - } - } - if((r = rsgt_tlvrdHeader(fp, (uchar*)hdr)) != 0) goto err; - if(!strcmp(hdr, "LOGSIG10")) - typeName = "Log Signature File, Version 10"; - else if(!strcmp(hdr, "GTSTAT10")) - typeName = "rsyslog GuardTime Signature State File, Version 10"; - else - typeName = "unknown"; - - printf("%s: %s [%s]\n", name, hdr, typeName); - - if(fp != stdin) - fclose(fp); - return; -err: fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name); -} - -static inline int -doVerifyRec(FILE *logfp, FILE *sigfp, FILE *nsigfp, - block_sig_t *bs, gtfile gf, gterrctx_t *ectx, uint8_t bInBlock) -{ - int r; - size_t lenRec; - char line[128*1024]; - - if(fgets(line, sizeof(line), logfp) == NULL) { - if(feof(logfp)) { - r = RSGTE_EOF; - } else { - perror("log file input"); - r = RSGTE_IO; - } - goto done; - } - lenRec = strlen(line); - if(line[lenRec-1] == '\n') { - line[lenRec-1] = '\0'; - --lenRec; - rsgt_errctxSetErrRec(ectx, line); - } - - /* we need to preserve the first line (record) of each block for - * error-reporting purposes (bInBlock==0 meanst start of block) - */ - if(bInBlock == 0) - rsgt_errctxFrstRecInBlk(ectx, line); - - r = rsgt_vrfy_nextRec(bs, gf, sigfp, nsigfp, (unsigned char*)line, lenRec, ectx); -done: - return r; -} - -/* We handle both verify and extend with the same function as they - * are very similiar. - * - * note: here we need to have the LOG file name, not signature! - */ -static void -verify(char *name) -{ - FILE *logfp = NULL, *sigfp = NULL, *nsigfp = NULL; - block_sig_t *bs = NULL; - gtfile gf; - uint8_t bHasRecHashes, bHasIntermedHashes; - uint8_t bInBlock; - int r = 0; - char sigfname[4096]; - char oldsigfname[4096]; - char nsigfname[4096]; - gterrctx_t ectx; - - if(!strcmp(name, "-")) { - fprintf(stderr, "%s mode cannot work on stdin\n", - mode == MD_VERIFY ? "verify" : "extend"); - goto err; - } else { - snprintf(sigfname, sizeof(sigfname), "%s.gtsig", name); - sigfname[sizeof(sigfname)-1] = '\0'; - if((logfp = fopen(name, "r")) == NULL) { - perror(name); - goto err; - } - if((sigfp = fopen(sigfname, "r")) == NULL) { - perror(sigfname); - goto err; - } - if(mode == MD_EXTEND) { - snprintf(nsigfname, sizeof(nsigfname), "%s.gtsig.new", name); - nsigfname[sizeof(nsigfname)-1] = '\0'; - if((nsigfp = fopen(nsigfname, "w")) == NULL) { - perror(nsigfname); - goto err; - } - snprintf(oldsigfname, sizeof(oldsigfname), - "%s.gtsig.old", name); - oldsigfname[sizeof(oldsigfname)-1] = '\0'; - } - } - - rsgtInit("rsyslog rsgtutil " VERSION); - rsgt_errctxInit(&ectx); - ectx.verbose = verbose; - ectx.fp = stderr; - ectx.filename = strdup(sigfname); - - if((r = rsgt_chkFileHdr(sigfp, "LOGSIG10")) != 0) goto done; - if(mode == MD_EXTEND) { - if(fwrite("LOGSIG10", 8, 1, nsigfp) != 1) { - perror(nsigfname); - r = RSGTE_IO; - goto done; - } - } - gf = rsgt_vrfyConstruct_gf(); - if(gf == NULL) { - fprintf(stderr, "error initializing signature file structure\n"); - goto done; - } - - bInBlock = 0; - ectx.blkNum = 0; - ectx.recNumInFile = 0; - - while(!feof(logfp)) { - if(bInBlock == 0) { - if(bs != NULL) - rsgt_objfree(0x0902, bs); - if((r = rsgt_getBlockParams(sigfp, 1, &bs, &bHasRecHashes, - &bHasIntermedHashes)) != 0) { - if(ectx.blkNum == 0) { - fprintf(stderr, "EOF before finding any signature block - " - "is the file still open and being written to?\n"); - } else { - if(verbose) - fprintf(stderr, "EOF after signature block %lld\n", - ectx.blkNum); - } - goto done; - } - rsgt_vrfyBlkInit(gf, bs, bHasRecHashes, bHasIntermedHashes); - ectx.recNum = 0; - ++ectx.blkNum; - } - ++ectx.recNum, ++ectx.recNumInFile; - if((r = doVerifyRec(logfp, sigfp, nsigfp, bs, gf, &ectx, bInBlock)) != 0) - goto done; - if(ectx.recNum == bs->recCount) { - if((r = verifyBLOCK_SIG(bs, gf, sigfp, nsigfp, - (mode == MD_EXTEND) ? 1 : 0, &ectx)) != 0) - goto done; - bInBlock = 0; - } else bInBlock = 1; - } - -done: - if(r != RSGTE_EOF) - goto err; - - fclose(logfp); logfp = NULL; - fclose(sigfp); sigfp = NULL; - if(nsigfp != NULL) { - fclose(nsigfp); nsigfp = NULL; - } - - /* everything went fine, so we rename files if we updated them */ - if(mode == MD_EXTEND) { - if(unlink(oldsigfname) != 0) { - if(errno != ENOENT) { - perror("unlink oldsig"); - r = RSGTE_IO; - goto err; - } - } - if(link(sigfname, oldsigfname) != 0) { - perror("link oldsig"); - r = RSGTE_IO; - goto err; - } - if(unlink(sigfname) != 0) { - perror("unlink cursig"); - r = RSGTE_IO; - goto err; - } - if(link(nsigfname, sigfname) != 0) { - perror("link newsig"); - fprintf(stderr, "WARNING: current sig file has been " - "renamed to %s - you need to manually recover " - "it.\n", oldsigfname); - r = RSGTE_IO; - goto err; - } - if(unlink(nsigfname) != 0) { - perror("unlink newsig"); - fprintf(stderr, "WARNING: current sig file has been " - "renamed to %s - you need to manually recover " - "it.\n", oldsigfname); - r = RSGTE_IO; - goto err; - } - } - rsgtExit(); - rsgt_errctxExit(&ectx); - return; - -err: - fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name); - if(logfp != NULL) - fclose(logfp); - if(sigfp != NULL) - fclose(sigfp); - if(nsigfp != NULL) { - fclose(nsigfp); - unlink(nsigfname); - } - rsgtExit(); - rsgt_errctxExit(&ectx); -} - -static void -processFile(char *name) -{ - switch(mode) { - case MD_DETECT_FILE_TYPE: - detectFileType(name); - break; - case MD_DUMP: - dumpFile(name); - break; - case MD_SHOW_SIGBLK_PARAMS: - showSigblkParams(name); - break; - case MD_VERIFY: - case MD_EXTEND: - verify(name); - break; - } -} - - -static struct option long_options[] = -{ - {"dump", no_argument, NULL, 'D'}, - {"verbose", no_argument, NULL, 'v'}, - {"version", no_argument, NULL, 'V'}, - {"detect-file-type", no_argument, NULL, 'T'}, - {"show-sigblock-params", no_argument, NULL, 'B'}, - {"verify", no_argument, NULL, 't'}, /* 't' as in "test signatures" */ - {"extend", no_argument, NULL, 'e'}, - {"publications-server", optional_argument, NULL, 'P'}, - {"show-verified", no_argument, NULL, 's'}, - {NULL, 0, NULL, 0} -}; - -int -main(int argc, char *argv[]) -{ - int i; - int opt; - - while(1) { - opt = getopt_long(argc, argv, "DvVTBtPs", long_options, NULL); - if(opt == -1) - break; - switch(opt) { - case 'v': - verbose = 1; - break; - case 's': - rsgt_read_showVerified = 1; - break; - case 'V': - fprintf(stderr, "rsgtutil " VERSION "\n"); - exit(0); - case 'D': - mode = MD_DUMP; - break; - case 'B': - mode = MD_SHOW_SIGBLK_PARAMS; - break; - case 'P': - rsgt_read_puburl = optarg; - break; - case 'T': - mode = MD_DETECT_FILE_TYPE; - break; - case 't': - mode = MD_VERIFY; - break; - case 'e': - mode = MD_EXTEND; - break; - case '?': - break; - default:fprintf(stderr, "getopt_long() returns unknown value %d\n", opt); - return 1; - } - } - - if(optind == argc) - processFile("-"); - else { - for(i = optind ; i < argc ; ++i) - processFile(argv[i]); - } - - return 0; -} diff -Nru rsyslog-7.6.0/tools/rsgtutil.rst rsyslog-5.10.1/tools/rsgtutil.rst --- rsyslog-7.6.0/tools/rsgtutil.rst 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/rsgtutil.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -======== -rsgtutil -======== - ------------------------------------ -Manage (GuardTime) Signed Log Files ------------------------------------ - -:Author: Rainer Gerhards -:Date: 2013-03-25 -:Manual section: 1 - -SYNOPSIS -======== - -:: - - rsgtutil [OPTIONS] [FILE] ... - - -DESCRIPTION -=========== - -This tool performs various maintenance operations on signed log files. -It specifically supports the GuardTime signature provider. - -The *rsgtutil* tool is the primary tool to verify log file signatures, -dump signature file contents and carry out other maintenance operations. -The tool offers different operation modes, which are selected via -command line options. - -The processing of multiple files is permitted. Depending on operation -mode, either the signature file or the base log file must be specified. -Within a single call, only a single operations mode is permitted. To -use different modes on different files, multiple calles, one for each -mode, must be made. - -If no file is specified on the command line, stdin is used instead. Note -that not all operation modes support stdin. - -OPTIONS -======= - --D, --dump - Select "dump" operations mode. - --t, --verify - Select "verify" operations mode. - --T, --detect-file-type - Select "detect-file-type" operations mode. - --B, --show-sigblock-params - Select "show-sigblock-params" operations mode. - --s, --show-verified - Prints out information about correctly verified blocks (by default, only - errors are printed). - --v, --verbose - Select verbose mode. Most importantly, hashes and signatures are printed - in full length (can be **very** lengthy) rather than the usual abbreviation. - --e, --extend - Select extend mode. This extends the RFC3161 signatures. Note that this - mode also implies a full verification. If there are verify errors, extending - will also fail. - --P , --publications-server - Sets the publications server. If not set but required by the operation a - default server is used. The default server is not necessarily optimal - in regard to performance and reliability. - - -OPERATION MODES -=============== - -The operation mode specifies what exactly the tool does with the provided -files. The default operation mode is "dump", but this may change in the future. -Thus, it is recommended to always set the operations mode explicitely. If -multiple operations mode are set on the command line, results are -unpredictable. - -dump ----- - -The provided *signature* files are dumped. For each top-level record, the*u -type code is printed as well as q short description. If there is additional -information available, it will be printed in tab-indented lines below the -main record dump. The actual *log* files need not to be present. - -verify ------- - -This mode does not work with stdin. On the command line, the *log* file names -are specified. The corresponding *signature* files (ending on ".gtsig") must also -be preset at the same location as the log file. In verify mode, both the log -and signature file is read and the validity of the log file checked. If verification -errors are detected these are printed and processing of the file aborted. By default, -each file is verified individually, without taking cross-file hash chains into -account (so the order of files on the command line does not matter). - -Note that the actual amount of what can be verified depends on the parameters with -which the signature file was written. If record and tree hashes are present, they -will be verified and thus fine-granular error reporting is possible. If they are -not present, only the block signature itself is verified. - -By default, only errors are printed. To also print successful verifications, use the -**--show-verified** option. - - -extend ------- -This extends the RFC3161 signatures. This includes a full verification -of the file. If there are verification errors, extending will also fail. -Note that a signature can only be extended when the required hash has been -published. Currently, these hashes are created at the 15th of each month at -0:00hrs UTC. It takes another few days to get them finally published. As such, -it can be assumed that extending is only possible after this happend (which -means it may take slightly above a month). - -To prevent data corruption, a copy of the signature file is created during -extension. So there must be enough disk space available for both files, -otherwise the operation will fail. If the log file is named logfile, the -signature file is logfile.gtsig and the temporary work file is named -logfile.gtsig.new. When extending finished successfully, the original -signature file (logfile.gtsig in our example) is renamed with the .old -postfix (logfile.gtsig.old) and the temporary file written under the -original name. The .old file can be deleted. It is just kept as a -precaution to prevent signature loss. Note that any already existing -.old or .new files are overwritten by these operations. - - -detect-file-type ----------------- -This mode is used to detect the type of some well-know files used inside the -signature system. The detection is based on the file header. This mode is -primarily a debug aid. - - -show-sigblock-params --------------------- -This mode is used to print signature block parameters. It is similar to *dump* -mode, but will ignore everything except signature blocks. Also, some additional -meta information is printed. This mode is primarily a debug aid. - -EXIT CODES -========== - -The command returns an exit code of 0 if everything went fine, and some -other code in case of failures. - - -EXAMPLES -======== - -**rsgtutil --verify logfile** - -This verifies the file "logfile" via its associated signature file -"logfile.gtsig". If errors are detected, these are reported to stderr. -Otherwise, rsgtutil terminates without messages. - -**rsgtutil --dump logfile.gtsig** - -This dumps the content of the signature file "logfile.gtsig". The -actual log file is not being processed and does not even need to be -present. - -SEE ALSO -======== -**rsyslogd(8)** - -COPYRIGHT -========= - -This page is part of the *rsyslog* project, and is available under -LGPLv2. diff -Nru rsyslog-7.6.0/tools/rsyslog.conf.5 rsyslog-5.10.1/tools/rsyslog.conf.5 --- rsyslog-7.6.0/tools/rsyslog.conf.5 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/rsyslog.conf.5 2012-09-23 10:29:49.000000000 +0000 @@ -17,7 +17,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. .\" -.TH RSYSLOG.CONF 5 "22 October 2012" "Version 7.2.0" "Linux System Administration" +.TH RSYSLOG.CONF 5 "11 July 2008" "Version 3.18.0" "Linux System Administration" .SH NAME rsyslog.conf \- rsyslogd(8) configuration file .SH DESCRIPTION @@ -218,7 +218,7 @@ .B Example: .RS -*.* /var/log/traditionalfile.log;RSYSLOG_TraditionalFileFormat # log to a file in the traditional format +*.* /var/log/traditionalfile.log;RSYSLOG_TraditionalFormat # log to a file in the traditional format .RE Note: if you would like to use high-precision timestamps in your log files, @@ -335,6 +335,13 @@ * expression-based filters .RE +.SS Blocks +Rsyslogd supports BSD-style blocks inside rsyslog.conf. Each block of lines is separated from +the previous block by a program or hostname specification. A block will only log messages +corresponding to the most recent program and hostname specifications given. Thus, a block which +selects "ppp" as the program, directly followed by a block that selects messages from the +hostname "dialhost", then the second block will only log messages from the ppp program on dialhost. + .SS Selectors .B Selectors are the traditional way of filtering syslog messages. They have been kept in rsyslog with their original syntax, because it is well-known, highly @@ -415,7 +422,7 @@ .sp 0 \\ = \\\\ --> '\\' is used to escape (as in C) .sp 0 -$template TraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg%\\n" +$template TraditionalFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg%\n" Properties can be accessed by the property replacer (see there for details). @@ -487,7 +494,7 @@ .RS $template TraditionalFormat,"%timegenerated% %HOSTNAME% .sp 0 -%syslogtag%%msg:::drop-last-lf%\\n" +%syslogtag%%msg:::drop-last-lf%\n" .RE A template that tells you a little more about the message: @@ -495,7 +502,7 @@ .RS $template precise,"%syslogpriority%,%syslogfacility%,%timegenerated%,%HOSTNAME%, .sp 0 -%syslogtag%,%msg%\\n" +%syslogtag%,%msg%\n" .RE A template for RFC 3164 format: @@ -507,7 +514,7 @@ A template for the format traditionally used for user messages: .sp .RS -$template usermsg," XXXX%syslogtag%%msg%\\n\\r" +$template usermsg," XXXX%syslogtag%%msg%\n\r" .RE And a template with the traditional wall-message format: diff -Nru rsyslog-7.6.0/tools/rsyslogd.8 rsyslog-5.10.1/tools/rsyslogd.8 --- rsyslog-7.6.0/tools/rsyslogd.8 2014-02-12 11:58:53.000000000 +0000 +++ rsyslog-5.10.1/tools/rsyslogd.8 2012-10-17 14:41:20.000000000 +0000 @@ -1,7 +1,7 @@ .\" Copyright 2004-2008 Rainer Gerhards and Adiscon for the rsyslog modifications .\" May be distributed under the GNU General Public License .\" -.TH RSYSLOGD 8 "16 October 2012" "Version 6.4.3" "Linux System Administration" +.TH RSYSLOGD 8 "29 July 2008" "Version 3.21.1" "Linux System Administration" .SH NAME rsyslogd \- reliable and extended syslogd .SH SYNOPSIS @@ -10,7 +10,6 @@ .RB [ " \-6 " ] .RB [ " \-A " ] .RB [ " \-d " ] -.RB [ " \-D " ] .RB [ " \-f " .I config file ] @@ -94,6 +93,9 @@ .LP .SH OPTIONS +.B Note that in version 3 of rsyslog a number of command line options +.B have been deprecated and replaced with config file directives. The +.B -c option controls the backward compatibility mode in use. .TP .BI "\-A" When sending UDP messages, there are potentially multiple paths to @@ -121,14 +123,26 @@ listens to all configured addresses of the system. .TP .BI "\-c " "version" -This option has been obsoleted and has no function any longer. It is still -accepted in order not to break existing scripts. However, future versions -may not support it. -.TP -.B "\-D" -Runs the Bison config parser in debug mode. This may help when hard to find -syntax errors are reported. Please note that the output generated is deeply -technical and orignally targeted towards developers. +Selects the desired backward compatibility mode. It must always be the +first option on the command line, as it influences processing of the +other options. To use the rsyslog v3 native interface, specify -c3. To +use compatibility mode , either do not use -c at all or use +-c where +.IR version +is the rsyslog version that it shall be +compatible with. Using -c0 tells rsyslog to be command-line compatible +to sysklogd, which is the default if -c is not given. +.B Please note that rsyslogd issues warning messages if the -c3 +.B command line option is not given. +This is to alert you that your are running in compatibility +mode. Compatibility mode interferes with your rsyslog.conf commands and +may cause some undesired side-effects. It is meant to be used with a +plain old rsyslog.conf - if you use new features, things become +messy. So the best advice is to work through this document, convert +your options and config file and then use rsyslog in native mode. In +order to aid you in this process, rsyslog logs every +compatibility-mode config file directive it has generated. So you can +simply copy them from your logfile and paste them to the config. .TP .B "\-d" Turns on debug mode. Using this the daemon will not proceed a @@ -191,10 +205,6 @@ no domain would be cut, you will have to specify two domains like: .BR "\-s north.de:infodrom.north.de" . .TP -.BI "\-S ip_address" "local client source IP" -rsyslogd uses ip_address as local client address while connecting -to remote logserver. Currently used by omrelp only and only with tcp. -.TP .BI "\-u " "userlevel" This is a "catch all" option for some very seldomly-used user settings. The "userlevel" variable selects multiple things. Add the specific values diff -Nru rsyslog-7.6.0/tools/syslogd.c rsyslog-5.10.1/tools/syslogd.c --- rsyslog-7.6.0/tools/syslogd.c 2014-02-12 11:59:00.000000000 +0000 +++ rsyslog-5.10.1/tools/syslogd.c 2012-10-17 14:41:20.000000000 +0000 @@ -21,7 +21,7 @@ * For further information, please see http://www.rsyslog.com * * rsyslog - An Enhanced syslogd Replacement. - * Copyright 2003-2014 Rainer Gerhards and Adiscon GmbH. + * Copyright 2003-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -44,6 +44,7 @@ #include "rsyslog.h" #define DEFUPRI (LOG_USER|LOG_NOTICE) +#define TIMERINTVL 30 /* interval for checking flush, mark */ #include #include @@ -51,6 +52,7 @@ #include #include #include +#define GNU_SOURCE #include #include #include @@ -82,7 +84,6 @@ #endif #include -#include #if HAVE_PATHS_H #include @@ -92,8 +93,6 @@ #include #endif -extern int yydebug; /* interface to flex */ - #include #include "pidfile.h" @@ -109,6 +108,18 @@ #include "action.h" #include "iminternal.h" #include "cfsysline.h" +#include "omshell.h" +#include "omusrmsg.h" +#include "omfwd.h" +#include "omfile.h" +#include "ompipe.h" +#include "omdiscard.h" +#include "pmrfc5424.h" +#include "pmrfc3164.h" +#include "smfile.h" +#include "smtradfile.h" +#include "smfwd.h" +#include "smtradfwd.h" #include "threads.h" #include "wti.h" #include "queue.h" @@ -120,25 +131,24 @@ #include "batch.h" #include "unicode-helper.h" #include "ruleset.h" +#include "rule.h" #include "net.h" +#include "vm.h" #include "prop.h" -#include "rsconf.h" -#include "dnscache.h" #include "sd-daemon.h" -#include "rainerscript.h" -#include "ratelimit.h" /* definitions for objects we access */ DEFobjCurrIf(obj) DEFobjCurrIf(glbl) DEFobjCurrIf(datetime) /* TODO: make go away! */ DEFobjCurrIf(conf) +DEFobjCurrIf(expr) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) +DEFobjCurrIf(rule) DEFobjCurrIf(ruleset) DEFobjCurrIf(prop) DEFobjCurrIf(parser) -DEFobjCurrIf(rsconf) DEFobjCurrIf(net) /* TODO: make go away! */ @@ -189,12 +199,11 @@ # define _PATH_TTY "/dev/tty" #endif -rsconf_t *ourConf; /* our config object */ - static prop_t *pInternalInputName = NULL; /* there is only one global inputName for all internally-generated messages */ static uchar *ConfFile = (uchar*) _PATH_LOGCONF; /* read-only after startup */ static char *PidFile = _PATH_LOGPID; /* read-only after startup */ +static pid_t myPid; /* our pid for use in self-generated messages, e.g. on startup */ /* mypid is read-only after the initial fork() */ static int bHadHUP = 0; /* did we have a HUP? */ @@ -202,32 +211,140 @@ * is either 0 or the number of the signal that requested the * termination. */ -int iConfigVerify = 0; /* is this just a config verify run? */ +static int iConfigVerify = 0; /* is this just a config verify run? */ + +/* Intervals at which we flush out "message repeated" messages, + * in seconds after previous message is logged. After each flush, + * we move to the next interval until we reach the largest. + * TODO: this shall go into action object! -- rgerhards, 2008-01-29 + */ +int repeatinterval[2] = { 30, 60 }; /* # of secs before flush */ #define LIST_DELIMITER ':' /* delimiter between two hosts */ static pid_t ppid; /* This is a quick and dirty hack used for spliting main/startup thread */ +typedef struct legacyOptsLL_s { + uchar *line; + struct legacyOptsLL_s *next; +} legacyOptsLL_t; +legacyOptsLL_t *pLegacyOptsLL = NULL; + struct queuefilenames_s { struct queuefilenames_s *next; uchar *name; } *queuefilenames = NULL; +/* global variables for config file state */ +int iCompatibilityMode = 0; /* version we should be compatible with; 0 means sysklogd. It is + the default, so if no -c option is given, we make ourselvs + as compatible to sysklogd as possible. */ +#define DFLT_bLogStatusMsgs 1 +static int bLogStatusMsgs = DFLT_bLogStatusMsgs; /* log rsyslog start/stop/HUP messages? */ +static int bDebugPrintTemplateList = 1;/* output template list in debug mode? */ +static int bDebugPrintCfSysLineHandlerList = 1;/* output cfsyslinehandler list in debug mode? */ +static int bDebugPrintModuleList = 1;/* output module list in debug mode? */ +static int bErrMsgToStderr = 1; /* print error messages to stderr (in addition to everything else)? */ +int bReduceRepeatMsgs; /* reduce repeated message - 0 - no, 1 - yes */ +int bAbortOnUncleanConfig = 0; /* abort run (rather than starting with partial config) if there was any issue in conf */ +int bActExecWhenPrevSusp; /* execute action only when previous one was suspended? */ +/* end global config file state variables */ -static ratelimit_t *dflt_ratelimiter = NULL; /* ratelimiter for submits without explicit one */ -static ratelimit_t *internalMsg_ratelimiter = NULL; /* ratelimiter for rsyslog-own messages */ int MarkInterval = 20 * 60; /* interval between marks in seconds - read-only after startup */ int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ -static int doFork = 1; /* fork - run in daemon mode - read-only after startup */ -int bHaveMainQueue = 0;/* set to 1 if the main queue - in queueing mode - is available +static int NoFork = 0; /* don't fork - don't run in daemon mode - read-only after startup */ +static int bHaveMainQueue = 0;/* set to 1 if the main queue - in queueing mode - is available * If the main queue is either not yet ready or not running in * queueing mode (mode DIRECT!), then this is set to 0. */ +static int uidDropPriv = 0; /* user-id to which priveleges should be dropped to (AFTER init()!) */ +static int gidDropPriv = 0; /* group-id to which priveleges should be dropped to (AFTER init()!) */ extern int errno; +static uchar *pszConfDAGFile = NULL; /* name of config DAG file, non-NULL means generate one */ /* main message queue and its configuration parameters */ qqueue_t *pMsgQueue = NULL; /* the main message queue */ +static int iMainMsgQueueSize = 10000; /* size of the main message queue above */ +static int iMainMsgQHighWtrMark = 8000; /* high water mark for disk-assisted queues */ +static int iMainMsgQLightDlyMark = -1; /* light delay mark for disk-assisted queues */ +static int iMainMsgQLowWtrMark = 2000; /* low water mark for disk-assisted queues */ +static int iMainMsgQDiscardMark = 9800; /* begin to discard messages */ +static int iMainMsgQDiscardSeverity = 8; /* by default, discard nothing to prevent unintentional loss */ +static int iMainMsgQueueNumWorkers = 1; /* number of worker threads for the mm queue above */ +static queueType_t MainMsgQueType = QUEUETYPE_FIXED_ARRAY; /* type of the main message queue above */ +static uchar *pszMainMsgQFName = NULL; /* prefix for the main message queue file */ +static int64 iMainMsgQueMaxFileSize = 1024*1024; +static int iMainMsgQPersistUpdCnt = 0; /* persist queue info every n updates */ +static int bMainMsgQSyncQeueFiles = 0; /* sync queue files on every write? */ +static int iMainMsgQtoQShutdown = 1500; /* queue shutdown (ms) */ +static int iMainMsgQtoActShutdown = 1000; /* action shutdown (in phase 2) */ +static int iMainMsgQtoEnq = 2000; /* timeout for queue enque */ +static int iMainMsgQtoWrkShutdown = 60000; /* timeout for worker thread shutdown */ +static int iMainMsgQWrkMinMsgs = 100; /* minimum messages per worker needed to start a new one */ +static int iMainMsgQDeqSlowdown = 0; /* dequeue slowdown (simple rate limiting) */ +static int64 iMainMsgQueMaxDiskSpace = 0; /* max disk space allocated 0 ==> unlimited */ +static int64 iMainMsgQueDeqBatchSize = 32; /* dequeue batch size */ +static int bMainMsgQSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */ +static int iMainMsgQueueDeqtWinFromHr = 0; /* hour begin of time frame when queue is to be dequeued */ +static int iMainMsgQueueDeqtWinToHr = 25; /* hour begin of time frame when queue is to be dequeued */ + + +/* Reset config variables to default values. + * rgerhards, 2007-07-17 + */ +static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +{ + bLogStatusMsgs = DFLT_bLogStatusMsgs; + bActExecWhenPrevSusp = 0; + bDebugPrintTemplateList = 1; + bDebugPrintCfSysLineHandlerList = 1; + bDebugPrintModuleList = 1; + bReduceRepeatMsgs = 0; + bAbortOnUncleanConfig = 0; + free(pszMainMsgQFName); + pszMainMsgQFName = NULL; + iMainMsgQueueSize = 10000; + iMainMsgQHighWtrMark = 8000; + iMainMsgQLightDlyMark = -1; + iMainMsgQLowWtrMark = 2000; + iMainMsgQDiscardMark = 9800; + iMainMsgQDiscardSeverity = 8; + iMainMsgQueMaxFileSize = 1024 * 1024; + iMainMsgQueueNumWorkers = 1; + iMainMsgQPersistUpdCnt = 0; + bMainMsgQSyncQeueFiles = 0; + iMainMsgQtoQShutdown = 1500; + iMainMsgQtoActShutdown = 1000; + iMainMsgQtoEnq = 2000; + iMainMsgQtoWrkShutdown = 60000; + iMainMsgQWrkMinMsgs = 100; + iMainMsgQDeqSlowdown = 0; + bMainMsgQSaveOnShutdown = 1; + MainMsgQueType = QUEUETYPE_FIXED_ARRAY; + iMainMsgQueMaxDiskSpace = 0; + iMainMsgQueDeqBatchSize = 32; + glbliActionResumeRetryCount = 0; + + return RS_RET_OK; +} + + +/* hardcoded standard templates (used for defaults) */ +static uchar template_DebugFormat[] = "\"Debug line with all properties:\nFROMHOST: '%FROMHOST%', fromhost-ip: '%fromhost-ip%', HOSTNAME: '%HOSTNAME%', PRI: %PRI%,\nsyslogtag '%syslogtag%', programname: '%programname%', APP-NAME: '%APP-NAME%', PROCID: '%PROCID%', MSGID: '%MSGID%',\nTIMESTAMP: '%TIMESTAMP%', STRUCTURED-DATA: '%STRUCTURED-DATA%',\nmsg: '%msg%'\nescaped msg: '%msg:::drop-cc%'\ninputname: %inputname% rawmsg: '%rawmsg%'\n\n\""; +static uchar template_SyslogProtocol23Format[] = "\"<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n\""; +static uchar template_TraditionalFileFormat[] = "=RSYSLOG_TraditionalFileFormat"; +static uchar template_FileFormat[] = "=RSYSLOG_FileFormat"; +static uchar template_ForwardFormat[] = "=RSYSLOG_ForwardFormat"; +static uchar template_TraditionalForwardFormat[] = "=RSYSLOG_TraditionalForwardFormat"; +static uchar template_WallFmt[] = "\"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r\""; +static uchar template_StdUsrMsgFmt[] = "\" %syslogtag%%msg%\n\r\""; +static uchar template_StdDBFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')\",SQL"; +static uchar template_StdPgSQLFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-pgsql%', '%timegenerated:::date-pgsql%', %iut%, '%syslogtag%')\",STDSQL"; +static uchar template_SysklogdFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n\""; +static uchar template_StdJSONFmt[] = "\"{\\\"message\\\":\\\"%msg%\\\",\\\"fromhost\\\":\\\"%HOSTNAME%\\\",\\\"facility\\\":\\\"%syslogfacility-text%\\\",\\\"priority\\\":\\\"%syslogpriority-text%\\\",\\\"timereported\\\":\\\"%timereported:::date-rfc3339%\\\",\\\"timegenerated\\\":\\\"%timegenerated:::date-rfc3339%\\\"}\",JSON"; +static uchar template_spoofadr[] = "\"%fromhost-ip%\""; +/* end templates */ /* up to the next comment, prototypes that should be removed by reordering */ @@ -240,9 +357,10 @@ static int usage(void) { - fprintf(stderr, "usage: rsyslogd [-46AdnqQvwx] [-l] [-s]\n" + fprintf(stderr, "usage: rsyslogd [-c] [-46AdnqQvwx] [-l] [-s]\n" " [-f] [-i] [-N] [-M]\n" " [-u]\n" + "To run rsyslogd in native mode, use \"rsyslogd -c5 \"\n\n" "For further information see http://www.rsyslog.com/doc\n"); exit(1); /* "good" exit - done to terminate usage() */ } @@ -384,7 +502,7 @@ */ rsRetVal parseAndSubmitMessage(uchar *hname, uchar *hnameIP, uchar *msg, int len, int flags, flowControl_t flowCtlType, - prop_t *pInputName, struct syslogTime *stTime, time_t ttGenTime, ruleset_t *pRuleset) + prop_t *pInputName, struct syslogTime *stTime, time_t ttGenTime) { prop_t *pProp = NULL; msg_t *pMsg; @@ -400,14 +518,13 @@ MsgSetInputName(pMsg, pInputName); MsgSetRawMsg(pMsg, (char*)msg, len); MsgSetFlowControlType(pMsg, flowCtlType); - MsgSetRuleset(pMsg, pRuleset); pMsg->msgFlags = flags | NEEDS_PARSING; MsgSetRcvFromStr(pMsg, hname, ustrlen(hname), &pProp); CHKiRet(prop.Destruct(&pProp)); CHKiRet(MsgSetRcvFromIPStr(pMsg, hnameIP, ustrlen(hnameIP), &pProp)); CHKiRet(prop.Destruct(&pProp)); - CHKiRet(submitMsg2(pMsg)); + CHKiRet(submitMsg(pMsg)); finalize_it: RETiRet; @@ -418,26 +535,20 @@ * function is also passed to the runtime library as the generic error * message handler. -- rgerhards, 2008-04-17 */ -void -submitErrMsg(const int severity, const int iErr, const uchar *msg) +rsRetVal +submitErrMsg(int iErr, uchar *msg) { - logmsgInternal(iErr, LOG_SYSLOG|(severity & 0x07), msg, 0); + DEFiRet; + iRet = logmsgInternal(iErr, LOG_SYSLOG|LOG_ERR, msg, 0); + RETiRet; } -static inline rsRetVal -submitMsgWithDfltRatelimiter(msg_t *pMsg) -{ - return ratelimitAddMsg(dflt_ratelimiter, NULL, pMsg); -} - -/* This function logs a message to rsyslog itself, using its own - * internal structures. This means external programs (like the - * system journal) will never see this message. +/* rgerhards 2004-11-09: the following is a function that can be used + * to log a message orginating from the syslogd itself. */ -static rsRetVal -logmsgInternalSelf(const int iErr, const int pri, const size_t lenMsg, - const char *__restrict__ const msg, int flags) +rsRetVal +logmsgInternal(int iErr, int pri, uchar *msg, int flags) { uchar pszTag[33]; msg_t *pMsg; @@ -445,9 +556,10 @@ CHKiRet(msgConstruct(&pMsg)); MsgSetInputName(pMsg, pInternalInputName); - MsgSetRawMsg(pMsg, (char*)msg, lenMsg); + MsgSetRawMsgWOSize(pMsg, (char*)msg); MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); +dbgprintf("ZZZZ: pLocalHostIPIF used!\n"); MsgSetRcvFromIP(pMsg, glbl.GetLocalHostIP()); MsgSetMSGoffs(pMsg, 0); /* check if we have an error code associated and, if so, @@ -465,70 +577,68 @@ flags |= INTERNAL_MSG; pMsg->msgFlags = flags; + /* we now check if we should print internal messages out to stderr. This was + * suggested by HKS as a way to help people troubleshoot rsyslog configuration + * (by running it interactively. This makes an awful lot of sense, so I add + * it here. -- rgerhards, 2008-07-28 + * Note that error messages can not be disable during a config verify. This + * permits us to process unmodified config files which otherwise contain a + * supressor statement. + */ + if(((Debug == DEBUG_FULL || NoFork) && bErrMsgToStderr) || iConfigVerify) { + if(LOG_PRI(pri) == LOG_ERR) + fprintf(stderr, "rsyslogd: %s\n", msg); + } + if(bHaveMainQueue == 0) { /* not yet in queued mode */ iminternalAddMsg(pMsg); } else { /* we have the queue, so we can simply provide the * message to the queue engine. */ - ratelimitAddMsg(internalMsg_ratelimiter, NULL, pMsg); + submitMsg(pMsg); } finalize_it: RETiRet; } - -/* rgerhards 2004-11-09: the following is a function that can be used - * to log a message orginating from the syslogd itself. +/* check message against ACL set + * rgerhards, 2009-11-16 */ -rsRetVal -logmsgInternal(int iErr, int pri, const uchar *const msg, int flags) -{ - size_t lenMsg; - unsigned i; - char *bufModMsg = NULL; /* buffer for modified message, should we need to modify */ - DEFiRet; - - /* we first do a path the remove control characters that may have accidently - * introduced (program error!). This costs performance, but we do not expect - * to be called very frequently in any case ;) -- rgerhards, 2013-12-19. - */ - lenMsg = ustrlen(msg); - for(i = 0 ; i < lenMsg ; ++i) { - if(msg[i] < 0x20 || msg[i] == 0x7f) { - if(bufModMsg == NULL) { - CHKmalloc(bufModMsg = strdup((char*) msg)); +#if 0 +static inline rsRetVal +chkMsgAgainstACL() { + /* if we reach this point, we had a good receive and can process the packet received */ + /* check if we have a different sender than before, if so, we need to query some new values */ + if(net.CmpHost(&frominet, frominetPrev, socklen) != 0) { + CHKiRet(net.cvthname(&frominet, fromHost, fromHostFQDN, fromHostIP)); + memcpy(frominetPrev, &frominet, socklen); /* update cache indicator */ + /* Here we check if a host is permitted to send us + * syslog messages. If it isn't, we do not further + * process the message but log a warning (if we are + * configured to do this). + * rgerhards, 2005-09-26 + */ + *pbIsPermitted = net.isAllowedSender((uchar*)"UDP", + (struct sockaddr *)&frominet, (char*)fromHostFQDN); + + if(!*pbIsPermitted) { + DBGPRINTF("%s is not an allowed sender\n", (char*)fromHostFQDN); + if(glbl.GetOption_DisallowWarning) { + time_t tt; + + datetime.GetTime(&tt); + if(tt > ttLastDiscard + 60) { + ttLastDiscard = tt; + errmsg.LogError(0, NO_ERRCODE, + "UDP message from disallowed sender %s discarded", + (char*)fromHost); + } } - bufModMsg[i] = ' '; } } - - if(bProcessInternalMessages) { - CHKiRet(logmsgInternalSelf(iErr, pri, lenMsg, - (bufModMsg == NULL) ? (char*)msg : bufModMsg, - flags)); - } else { - stdlog_log(NULL, LOG_PRI(pri), "%s", - (bufModMsg == NULL) ? (char*)msg : bufModMsg); - } - - /* we now check if we should print internal messages out to stderr. This was - * suggested by HKS as a way to help people troubleshoot rsyslog configuration - * (by running it interactively. This makes an awful lot of sense, so I add - * it here. -- rgerhards, 2008-07-28 - * Note that error messages can not be disabled during a config verify. This - * permits us to process unmodified config files which otherwise contain a - * supressor statement. - */ - if(((Debug == DEBUG_FULL || !doFork) && ourConf->globals.bErrMsgToStderr) || iConfigVerify) { - if(LOG_PRI(pri) == LOG_ERR) - fprintf(stderr, "rsyslogd: %s\n", (bufModMsg == NULL) ? (char*)msg : bufModMsg); - } - -finalize_it: - free(bufModMsg); - RETiRet; } +#endif /* preprocess a batch of messages, that is ready them for actual processing. This is done @@ -538,9 +648,9 @@ */ static inline rsRetVal preprocessBatch(batch_t *pBatch) { - prop_t *ip; - prop_t *fqdn; - prop_t *localName; + uchar fromHost[NI_MAXHOST]; + uchar fromHostIP[NI_MAXHOST]; + uchar fromHostFQDN[NI_MAXHOST]; prop_t *propFromHost = NULL; prop_t *propFromHostIP = NULL; int bSingleRuleset; @@ -552,31 +662,31 @@ DEFiRet; bSingleRuleset = 1; - batchRuleset = (pBatch->nElem > 0) ? pBatch->pElem[0].pMsg->pRuleset : NULL; + batchRuleset = (pBatch->nElem > 0) ? ((msg_t*) pBatch->pElem[0].pUsrp)->pRuleset : NULL; for(i = 0 ; i < pBatch->nElem && !*(pBatch->pbShutdownImmediate) ; i++) { - pMsg = pBatch->pElem[i].pMsg; + pMsg = (msg_t*) pBatch->pElem[i].pUsrp; if((pMsg->msgFlags & NEEDS_ACLCHK_U) != 0) { DBGPRINTF("msgConsumer: UDP ACL must be checked for message (hostname-based)\n"); - if(net.cvthname(pMsg->rcvFrom.pfrominet, &localName, &fqdn, &ip) != RS_RET_OK) + if(net.cvthname(pMsg->rcvFrom.pfrominet, fromHost, fromHostFQDN, fromHostIP) != RS_RET_OK) continue; bIsPermitted = net.isAllowedSender2((uchar*)"UDP", - (struct sockaddr *)pMsg->rcvFrom.pfrominet, (char*)propGetSzStr(fqdn), 1); + (struct sockaddr *)pMsg->rcvFrom.pfrominet, (char*)fromHostFQDN, 1); if(!bIsPermitted) { DBGPRINTF("Message from '%s' discarded, not a permitted sender host\n", - propGetSzStr(fqdn)); - pBatch->eltState[i] = BATCH_STATE_DISC; + fromHostFQDN); + pBatch->pElem[i].state = BATCH_STATE_DISC; } else { /* save some of the info we obtained */ - MsgSetRcvFrom(pMsg, localName); - CHKiRet(MsgSetRcvFromIP(pMsg, ip)); + MsgSetRcvFromStr(pMsg, fromHost, ustrlen(fromHost), &propFromHost); + CHKiRet(MsgSetRcvFromIPStr(pMsg, fromHostIP, ustrlen(fromHostIP), &propFromHostIP)); pMsg->msgFlags &= ~NEEDS_ACLCHK_U; } } if((pMsg->msgFlags & NEEDS_PARSING) != 0) { if((localRet = parser.ParseMsg(pMsg)) != RS_RET_OK) { DBGPRINTF("Message discarded, parsing error %d\n", localRet); - pBatch->eltState[i] = BATCH_STATE_DISC; + pBatch->pElem[i].state = BATCH_STATE_DISC; } } if(pMsg->pRuleset != batchRuleset) @@ -611,7 +721,7 @@ //do not have this yet and so we emulate -- 2010-06-10 int i; for(i = 0 ; i < pBatch->nElem && !*pbShutdownImmediate ; i++) { - pBatch->eltState[i] = BATCH_STATE_COMM; + pBatch->pElem[i].state = BATCH_STATE_COMM; } RETiRet; } @@ -622,7 +732,7 @@ * rgerhards, 2008-02-13 */ rsRetVal -submitMsg2(msg_t *pMsg) +submitMsg(msg_t *pMsg) { qqueue_t *pQueue; ruleset_t *pRuleset; @@ -635,31 +745,27 @@ /* if a plugin logs a message during shutdown, the queue may no longer exist */ if(pQueue == NULL) { - DBGPRINTF("submitMsg2() could not submit message - " + DBGPRINTF("submitMsg() could not submit message - " "queue does (no longer?) exist - ignored\n"); FINALIZE; } - qqueueEnqMsg(pQueue, pMsg->flowCtlType, pMsg); + MsgPrepareEnqueue(pMsg); + qqueueEnqObj(pQueue, pMsg->flowCtlType, (void*) pMsg); finalize_it: RETiRet; } -rsRetVal -submitMsg(msg_t *pMsg) -{ - return submitMsgWithDfltRatelimiter(pMsg); -} - /* submit multiple messages at once, very similar to submitMsg, just * for multi_submit_t. All messages need to go into the SAME queue! * rgerhards, 2009-06-16 */ rsRetVal -multiSubmitMsg2(multi_submit_t *pMultiSub) +multiSubmitMsg(multi_submit_t *pMultiSub) { + int i; qqueue_t *pQueue; ruleset_t *pRuleset; DEFiRet; @@ -678,29 +784,18 @@ FINALIZE; } + for(i = 0 ; i < pMultiSub->nElem ; ++i) { + MsgPrepareEnqueue(pMultiSub->ppMsgs[i]); + } + iRet = pQueue->MultiEnq(pQueue, pMultiSub); pMultiSub->nElem = 0; finalize_it: RETiRet; } -rsRetVal -multiSubmitMsg(multi_submit_t *pMultiSub) /* backward compat. level */ -{ - return multiSubmitMsg2(pMultiSub); -} -/* flush multiSubmit, e.g. at end of read records */ -rsRetVal -multiSubmitFlush(multi_submit_t *pMultiSub) -{ - DEFiRet; - if(pMultiSub->nElem > 0) { - iRet = multiSubmitMsg2(pMultiSub); - } - RETiRet; -} static void @@ -719,6 +814,43 @@ } +/* helper to doFlushRptdMsgs() to flush the individual action links via llExecFunc + * rgerhards, 2007-08-02 + */ +DEFFUNC_llExecFunc(flushRptdMsgsActions) +{ + action_t *pAction = (action_t*) pData; + assert(pAction != NULL); + + BEGINfunc + LockObj(pAction); + /* TODO: time() performance: the call below could be moved to + * the beginn of the llExec(). This makes it slightly less correct, but + * in an acceptable way. -- rgerhards, 2008-09-16 + */ + if (pAction->f_prevcount && datetime.GetTime(NULL) >= REPEATTIME(pAction)) { + DBGPRINTF("flush %s: repeated %d times, %d sec.\n", + module.GetStateName(pAction->pMod), pAction->f_prevcount, + repeatinterval[pAction->f_repeatcount]); + actionWriteToAction(pAction); + BACKOFF(pAction); + } + UnlockObj(pAction); + + ENDfunc + return RS_RET_OK; /* we ignore errors, we can not do anything either way */ +} + + +/* This method flushes repeat messages. + */ +static void +doFlushRptdMsgs(void) +{ + ruleset.IterateAllActions(flushRptdMsgsActions, NULL); +} + + static void debug_switch() { time_t tTime; @@ -752,6 +884,132 @@ } +void legacyOptsEnq(uchar *line) +{ + legacyOptsLL_t *pNew; + + pNew = MALLOC(sizeof(legacyOptsLL_t)); + if(line == NULL) + pNew->line = NULL; + else + pNew->line = (uchar *) strdup((char *) line); + pNew->next = NULL; + + if(pLegacyOptsLL == NULL) + pLegacyOptsLL = pNew; + else { + legacyOptsLL_t *pThis = pLegacyOptsLL; + + while(pThis->next != NULL) + pThis = pThis->next; + pThis->next = pNew; + } +} + + +void legacyOptsFree(void) +{ + legacyOptsLL_t *pThis = pLegacyOptsLL, *pNext; + + while(pThis != NULL) { + if(pThis->line != NULL) + free(pThis->line); + pNext = pThis->next; + free(pThis); + pThis = pNext; + } +} + + +void legacyOptsHook(void) +{ + legacyOptsLL_t *pThis = pLegacyOptsLL; + + while(pThis != NULL) { + if(pThis->line != NULL) { + errno = 0; + errmsg.LogError(0, NO_ERRCODE, "Warning: backward compatibility layer added to following " + "directive to rsyslog.conf: %s", pThis->line); + conf.cfsysline(pThis->line); + } + pThis = pThis->next; + } +} + + +void legacyOptsParseTCP(char ch, char *arg) +{ + register int i; + register char *pArg = arg; + static char conflict = '\0'; + + if((conflict == 'g' && ch == 't') || (conflict == 't' && ch == 'g')) { + fprintf(stderr, "rsyslogd: If you want to use both -g and -t, use directives instead, -%c ignored.\n", ch); + return; + } else + conflict = ch; + + /* extract port */ + i = 0; + while(isdigit((int) *pArg)) + i = i * 10 + *pArg++ - '0'; + + /* number of sessions */ + if(*pArg == '\0' || *pArg == ',') { + if(ch == 't') + legacyOptsEnq((uchar *) "ModLoad imtcp"); + else if(ch == 'g') + legacyOptsEnq((uchar *) "ModLoad imgssapi"); + + if(i >= 0 && i <= 65535) { + uchar line[30]; + + if(ch == 't') { + snprintf((char *) line, sizeof(line), "InputTCPServerRun %d", i); + } else if(ch == 'g') { + snprintf((char *) line, sizeof(line), "InputGSSServerRun %d", i); + } + legacyOptsEnq(line); + } else { + if(ch == 't') { + fprintf(stderr, "rsyslogd: Invalid TCP listen port %d - changed to 514.\n", i); + legacyOptsEnq((uchar *) "InputTCPServerRun 514"); + } else if(ch == 'g') { + fprintf(stderr, "rsyslogd: Invalid GSS listen port %d - changed to 514.\n", i); + legacyOptsEnq((uchar *) "InputGSSServerRun 514"); + } + } + + if(*pArg == ',') { + ++pArg; + while(isspace((int) *pArg)) + ++pArg; + i = 0; + while(isdigit((int) *pArg)) { + i = i * 10 + *pArg++ - '0'; + } + if(i > 0) { + uchar line[30]; + + snprintf((char *) line, sizeof(line), "InputTCPMaxSessions %d", i); + legacyOptsEnq(line); + } else { + if(ch == 't') { + fprintf(stderr, "rsyslogd: TCP session max configured " + "to %d [-t %s] - changing to 1.\n", i, arg); + legacyOptsEnq((uchar *) "InputTCPMaxSessions 1"); + } else if (ch == 'g') { + fprintf(stderr, "rsyslogd: GSS session max configured " + "to %d [-g %s] - changing to 1.\n", i, arg); + legacyOptsEnq((uchar *) "InputTCPMaxSessions 1"); + } + } + } + } else + fprintf(stderr, "rsyslogd: Invalid -t %s command line option.\n", arg); +} + + /* doDie() is a signal handler. If called, it sets the bFinished variable * to indicate the program should terminate. However, it does not terminate * it itself, because that causes issues with multi-threading. The actual @@ -759,11 +1017,8 @@ * a minimal delay, but it is much cleaner than the approach of doing everything * inside the signal handler. * rgerhards, 2005-10-26 - * Note: - * - we do not call DBGPRINTF() as this may cause us to block in case something - * with the threading is wrong. - * - we do not really care about the return state of write(), but we need this - * strange check we do to silence compiler warnings (thanks, Ubuntu!) + * Note: we do not call DBGPRINTF() as this may cause us to block in case something + * with the threading is wrong. */ static void doDie(int sig) { @@ -771,34 +1026,47 @@ # define MSG2 "DoDie called 5 times - unconditional exit\n" static int iRetries = 0; /* debug aid */ dbgprintf(MSG1); - if(Debug == DEBUG_FULL) { - if(write(1, MSG1, sizeof(MSG1) - 1)) {} - } + if(Debug == DEBUG_FULL) + write(1, MSG1, sizeof(MSG1) - 1); if(iRetries++ == 4) { - if(Debug == DEBUG_FULL) { - if(write(1, MSG2, sizeof(MSG2) - 1)) {} - } + if(Debug == DEBUG_FULL) + write(1, MSG2, sizeof(MSG2) - 1); abort(); } bFinished = sig; - if(glblDebugOnShutdown) { - /* kind of hackish - set to 0, so that debug_swith will enable - * and AND emit the "start debug log" message. - */ - debugging_on = 0; - debug_switch(); - } # undef MSG1 # undef MSG2 } +/* This function frees all dynamically allocated memory for program termination. + * It must be called only immediately before exit(). It is primarily an aid + * for memory debuggers, which prevents cluttered outupt. + * rgerhards, 2008-03-20 + */ +static void +freeAllDynMemForTermination(void) +{ + struct queuefilenames_s *qfn, *qfnDel; + + for(qfn = queuefilenames ; qfn != NULL ; ) { + qfnDel = qfn; + qfn = qfn->next; + free(qfnDel->name); + free(qfnDel); + } + free(pszMainMsgQFName); + free(pModDir); + free(pszConfDAGFile); +} + + /* Finalize and destruct all actions. */ static inline void destructAllActions(void) { - ruleset.DestructAllActions(runConf); + ruleset.DestructAllActions(); bHaveMainQueue = 0; // flag that internal messages need to be temporarily stored } @@ -836,11 +1104,11 @@ thrdTerminateAll(); /* and THEN send the termination log message (see long comment above) */ - if(sig && runConf->globals.bLogStatusMsgs) { + if(sig && bLogStatusMsgs) { (void) snprintf(buf, sizeof(buf) / sizeof(char), " [origin software=\"rsyslogd\" " "swVersion=\"" VERSION \ "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"]" " exiting on signal %d.", - (int) glblGetOurPid(), sig); + (int) myPid, sig); errno = 0; logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)buf, 0); } @@ -862,16 +1130,14 @@ destructAllActions(); DBGPRINTF("all primary multi-thread sources have been terminated - now doing aux cleanup...\n"); - - DBGPRINTF("destructing current config...\n"); - rsconf.Destruct(&runConf); - /* rger 2005-02-22 * now clean up the in-memory structures. OK, the OS * would also take care of that, but if we do it * ourselfs, this makes finding memory leaks a lot * easier. */ + tplDeleteAll(); + /* de-init some modules */ modExitIminternal(); @@ -882,6 +1148,8 @@ */ unregCfSysLineHdlrs(); + legacyOptsFree(); + /* destruct our global properties */ if(pInternalInputName != NULL) prop.Destruct(&pInternalInputName); @@ -895,8 +1163,15 @@ /* dbgClassExit MUST be the last one, because it de-inits the debug system */ dbgClassExit(); - /* NO CODE HERE - dbgClassExit() must be the last thing before exit()! */ + /* free all remaining memory blocks - this is not absolutely necessary, but helps + * us keep memory debugger logs clean and this is in aid in developing. It doesn't + * cost much time, so we do it always. -- rgerhards, 2008-03-20 + */ + freeAllDynMemForTermination(); + /* NO CODE HERE - feeelAllDynMemForTermination() must be the last thing before exit()! */ + remove_pid(PidFile); + exit(0); /* "good" exit, this is the terminator function for rsyslog [die()] */ } @@ -910,7 +1185,110 @@ exit(0); /* "good" exit, only during child-creation */ } -#if 0 /* TODO: re-enable, currently not used */ + +/* set the maximum message size */ +static rsRetVal setMaxMsgSize(void __attribute__((unused)) *pVal, long iNewVal) +{ + return glbl.SetMaxLine(iNewVal); +} + + +/* set the action resume interval */ +static rsRetVal setActionResumeInterval(void __attribute__((unused)) *pVal, int iNewVal) +{ + return actionSetGlobalResumeInterval(iNewVal); +} + + +/* set the processes max number ob files (upon configuration request) + * 2009-04-14 rgerhards + */ +static rsRetVal setMaxFiles(void __attribute__((unused)) *pVal, int iFiles) +{ + struct rlimit maxFiles; + char errStr[1024]; + DEFiRet; + + maxFiles.rlim_cur = iFiles; + maxFiles.rlim_max = iFiles; + + if(setrlimit(RLIMIT_NOFILE, &maxFiles) < 0) { + /* NOTE: under valgrind, we seem to be unable to extend the size! */ + rs_strerror_r(errno, errStr, sizeof(errStr)); + errmsg.LogError(0, RS_RET_ERR_RLIM_NOFILE, "could not set process file limit to %d: %s [kernel max %ld]", + iFiles, errStr, (long) maxFiles.rlim_max); + ABORT_FINALIZE(RS_RET_ERR_RLIM_NOFILE); + } +#ifdef USE_UNLIMITED_SELECT + glbl.SetFdSetSize(howmany(iFiles, __NFDBITS) * sizeof (fd_mask)); +#endif + DBGPRINTF("Max number of files set to %d [kernel max %ld].\n", iFiles, (long) maxFiles.rlim_max); + +finalize_it: + RETiRet; +} + + +/* set the processes umask (upon configuration request) */ +static rsRetVal setUmask(void __attribute__((unused)) *pVal, int iUmask) +{ + umask(iUmask); + DBGPRINTF("umask set to 0%3.3o.\n", iUmask); + + return RS_RET_OK; +} + + +/* drop to specified group + * if something goes wrong, the function never returns + * Note that such an abort can cause damage to on-disk structures, so we should + * re-design the "interface" in the long term. -- rgerhards, 2008-11-26 + */ +static void doDropPrivGid(int iGid) +{ + int res; + uchar szBuf[1024]; + + res = setgroups(0, NULL); /* remove all supplementary group IDs */ + if(res) { + perror("could not remove supplemental group IDs"); + exit(1); + } + DBGPRINTF("setgroups(0, NULL): %d\n", res); + res = setgid(iGid); + if(res) { + /* if we can not set the userid, this is fatal, so let's unconditionally abort */ + perror("could not set requested group id"); + exit(1); + } + DBGPRINTF("setgid(%d): %d\n", iGid, res); + snprintf((char*)szBuf, sizeof(szBuf)/sizeof(uchar), "rsyslogd's groupid changed to %d", iGid); + logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, szBuf, 0); +} + + +/* drop to specified user + * if something goes wrong, the function never returns + * Note that such an abort can cause damage to on-disk structures, so we should + * re-design the "interface" in the long term. -- rgerhards, 2008-11-19 + */ +static void doDropPrivUid(int iUid) +{ + int res; + uchar szBuf[1024]; + + res = setuid(iUid); + if(res) { + /* if we can not set the userid, this is fatal, so let's unconditionally abort */ + perror("could not set requested userid"); + exit(1); + } + DBGPRINTF("setuid(%d): %d\n", iUid, res); + snprintf((char*)szBuf, sizeof(szBuf)/sizeof(uchar), "rsyslogd's userid changed to %d", iUid); + logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, szBuf, 0); +} + + /* helper to generateConfigDAG, to print out all actions via * the llExecFunc() facility. * rgerhards, 2007-08-02 @@ -1095,7 +1473,105 @@ finalize_it: RETiRet; } -#endif + + +/* print debug information as part of init(). This pretty much + * outputs the whole config of rsyslogd. I've moved this code + * out of init() to clean it somewhat up. + * rgerhards, 2007-07-31 + */ +static void dbgPrintInitInfo(void) +{ + ruleset.DebugPrintAll(); + DBGPRINTF("\n"); + if(bDebugPrintTemplateList) + tplPrintList(); + if(bDebugPrintModuleList) + module.PrintList(); + ochPrintList(); + + if(bDebugPrintCfSysLineHandlerList) + dbgPrintCfSysLineHandlers(); + + DBGPRINTF("Messages with malicious PTR DNS Records are %sdropped.\n", + glbl.GetDropMalPTRMsgs() ? "" : "not "); + + DBGPRINTF("Main queue size %d messages.\n", iMainMsgQueueSize); + DBGPRINTF("Main queue worker threads: %d, wThread shutdown: %d, Perists every %d updates.\n", + iMainMsgQueueNumWorkers, iMainMsgQtoWrkShutdown, iMainMsgQPersistUpdCnt); + DBGPRINTF("Main queue timeouts: shutdown: %d, action completion shutdown: %d, enq: %d\n", + iMainMsgQtoQShutdown, iMainMsgQtoActShutdown, iMainMsgQtoEnq); + DBGPRINTF("Main queue watermarks: high: %d, low: %d, discard: %d, discard-severity: %d, light-delay %d\n", + iMainMsgQHighWtrMark, iMainMsgQLowWtrMark, iMainMsgQDiscardMark, iMainMsgQDiscardSeverity, iMainMsgQLightDlyMark); + DBGPRINTF("Main queue save on shutdown %d, max disk space allowed %lld\n", + bMainMsgQSaveOnShutdown, iMainMsgQueMaxDiskSpace); + /* TODO: add + iActionRetryCount = 0; + iActionRetryInterval = 30000; + static int iMainMsgQtoWrkMinMsgs = 100; + static int iMainMsgQbSaveOnShutdown = 1; + iMainMsgQueMaxDiskSpace = 0; + setQPROP(qqueueSetiMinMsgsPerWrkr, "$MainMsgQueueWorkerThreadMinimumMessages", 100); + setQPROP(qqueueSetbSaveOnShutdown, "$MainMsgQueueSaveOnShutdown", 1); + */ + DBGPRINTF("Work Directory: '%s'.\n", glbl.GetWorkDir()); +} + + +/* Actually run the input modules. This happens after privileges are dropped, + * if that is requested. + */ +static rsRetVal +runInputModules(void) +{ + modInfo_t *pMod; + int bNeedsCancel; + + BEGINfunc + /* loop through all modules and activate them (brr...) */ + pMod = module.GetNxtType(NULL, eMOD_IN); + while(pMod != NULL) { + if(pMod->mod.im.bCanRun) { + DBGPRINTF("trying to start input module '%s'\n", pMod->pszName); + /* activate here */ + bNeedsCancel = (pMod->isCompatibleWithFeature(sFEATURENonCancelInputTermination) == RS_RET_OK) ? + 0 : 1; + thrdCreate(pMod->mod.im.runInput, pMod->mod.im.afterRun, bNeedsCancel); + } + pMod = module.GetNxtType(pMod, eMOD_IN); + } + + ENDfunc + return RS_RET_OK; /* intentional: we do not care about module errors */ +} + + +/* Start the input modules. This function will probably undergo big changes + * while we implement the input module interface. For now, it does the most + * important thing to get at least my poor initial input modules up and + * running. Almost no config option is taken. + * rgerhards, 2007-12-14 + */ +static rsRetVal +startInputModules(void) +{ + DEFiRet; + modInfo_t *pMod; + + /* loop through all modules and activate them (brr...) */ + pMod = module.GetNxtType(NULL, eMOD_IN); + while(pMod != NULL) { + iRet = pMod->mod.im.willRun(); + pMod->mod.im.bCanRun = (iRet == RS_RET_OK); + if(!pMod->mod.im.bCanRun) { + DBGPRINTF("module %lx will not run, iRet %d\n", (unsigned long) pMod, iRet); + } + pMod = module.GetNxtType(pMod, eMOD_IN); + } + + ENDfunc + return RS_RET_OK; /* intentional: we do not care about module errors */ +} /* create a main message queue, now also used for ruleset queues. This function @@ -1103,7 +1579,7 @@ * the time being (remember that we want to restructure config processing at large!). * rgerhards, 2009-10-27 */ -rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName, struct nvlst *lst) +rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName) { struct queuefilenames_s *qfn; uchar *qfname = NULL; @@ -1111,73 +1587,76 @@ uchar qfrenamebuf[1024]; DEFiRet; + /* switch the message object to threaded operation, if necessary */ + if(MainMsgQueType == QUEUETYPE_DIRECT || iMainMsgQueueNumWorkers > 1) { + MsgEnableThreadSafety(); + } + /* create message queue */ - CHKiRet_Hdlr(qqueueConstruct(ppQueue, ourConf->globals.mainQ.MainMsgQueType, ourConf->globals.mainQ.iMainMsgQueueNumWorkers, ourConf->globals.mainQ.iMainMsgQueueSize, msgConsumer)) { + CHKiRet_Hdlr(qqueueConstruct(ppQueue, MainMsgQueType, iMainMsgQueueNumWorkers, iMainMsgQueueSize, msgConsumer)) { /* no queue is fatal, we need to give up in that case... */ errmsg.LogError(0, iRet, "could not create (ruleset) main message queue"); \ } /* name our main queue object (it's not fatal if it fails...) */ obj.SetName((obj_t*) (*ppQueue), pszQueueName); - if(lst == NULL) { /* use legacy parameters? */ - /* ... set some properties ... */ - # define setQPROP(func, directive, data) \ - CHKiRet_Hdlr(func(*ppQueue, data)) { \ - errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \ - } - # define setQPROPstr(func, directive, data) \ - CHKiRet_Hdlr(func(*ppQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \ - errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \ - } - - if(ourConf->globals.mainQ.pszMainMsgQFName != NULL) { - /* check if the queue file name is unique, else emit an error */ - for(qfn = queuefilenames ; qfn != NULL ; qfn = qfn->next) { - dbgprintf("check queue file name '%s' vs '%s'\n", qfn->name, ourConf->globals.mainQ.pszMainMsgQFName ); - if(!ustrcmp(qfn->name, ourConf->globals.mainQ.pszMainMsgQFName)) { - snprintf((char*)qfrenamebuf, sizeof(qfrenamebuf), "%d-%s-%s", - ++qfn_renamenum, ourConf->globals.mainQ.pszMainMsgQFName, - (pszQueueName == NULL) ? "NONAME" : (char*)pszQueueName); - qfname = ustrdup(qfrenamebuf); - errmsg.LogError(0, NO_ERRCODE, "Error: queue file name '%s' already in use " - " - using '%s' instead", ourConf->globals.mainQ.pszMainMsgQFName, qfname); - break; - } + /* ... set some properties ... */ +# define setQPROP(func, directive, data) \ + CHKiRet_Hdlr(func(*ppQueue, data)) { \ + errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \ + } +# define setQPROPstr(func, directive, data) \ + CHKiRet_Hdlr(func(*ppQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \ + errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", error %d. Ignored, running with default setting", iRet); \ + } + + if(pszMainMsgQFName != NULL) { + /* check if the queue file name is unique, else emit an error */ + for(qfn = queuefilenames ; qfn != NULL ; qfn = qfn->next) { + dbgprintf("check queue file name '%s' vs '%s'\n", qfn->name, pszMainMsgQFName); + if(!ustrcmp(qfn->name, pszMainMsgQFName)) { + snprintf((char*)qfrenamebuf, sizeof(qfrenamebuf), "%d-%s-%s", + ++qfn_renamenum, pszMainMsgQFName, + (pszQueueName == NULL) ? "NONAME" : (char*)pszQueueName); + qfname = ustrdup(qfrenamebuf); + errmsg.LogError(0, NO_ERRCODE, "Error: queue file name '%s' already in use " + " - using '%s' instead", pszMainMsgQFName, qfname); + break; } - if(qfname == NULL) - qfname = ustrdup(ourConf->globals.mainQ.pszMainMsgQFName); - qfn = malloc(sizeof(struct queuefilenames_s)); - qfn->name = qfname; - qfn->next = queuefilenames; - queuefilenames = qfn; - } - - setQPROP(qqueueSetMaxFileSize, "$MainMsgQueueFileSize", ourConf->globals.mainQ.iMainMsgQueMaxFileSize); - setQPROP(qqueueSetsizeOnDiskMax, "$MainMsgQueueMaxDiskSpace", ourConf->globals.mainQ.iMainMsgQueMaxDiskSpace); - setQPROP(qqueueSetiDeqBatchSize, "$MainMsgQueueDequeueBatchSize", ourConf->globals.mainQ.iMainMsgQueDeqBatchSize); - setQPROPstr(qqueueSetFilePrefix, "$MainMsgQueueFileName", qfname); - setQPROP(qqueueSetiPersistUpdCnt, "$MainMsgQueueCheckpointInterval", ourConf->globals.mainQ.iMainMsgQPersistUpdCnt); - setQPROP(qqueueSetbSyncQueueFiles, "$MainMsgQueueSyncQueueFiles", ourConf->globals.mainQ.bMainMsgQSyncQeueFiles); - setQPROP(qqueueSettoQShutdown, "$MainMsgQueueTimeoutShutdown", ourConf->globals.mainQ.iMainMsgQtoQShutdown ); - setQPROP(qqueueSettoActShutdown, "$MainMsgQueueTimeoutActionCompletion", ourConf->globals.mainQ.iMainMsgQtoActShutdown); - setQPROP(qqueueSettoWrkShutdown, "$MainMsgQueueWorkerTimeoutThreadShutdown", ourConf->globals.mainQ.iMainMsgQtoWrkShutdown); - setQPROP(qqueueSettoEnq, "$MainMsgQueueTimeoutEnqueue", ourConf->globals.mainQ.iMainMsgQtoEnq); - setQPROP(qqueueSetiHighWtrMrk, "$MainMsgQueueHighWaterMark", ourConf->globals.mainQ.iMainMsgQHighWtrMark); - setQPROP(qqueueSetiLowWtrMrk, "$MainMsgQueueLowWaterMark", ourConf->globals.mainQ.iMainMsgQLowWtrMark); - setQPROP(qqueueSetiDiscardMrk, "$MainMsgQueueDiscardMark", ourConf->globals.mainQ.iMainMsgQDiscardMark); - setQPROP(qqueueSetiDiscardSeverity, "$MainMsgQueueDiscardSeverity", ourConf->globals.mainQ.iMainMsgQDiscardSeverity); - setQPROP(qqueueSetiMinMsgsPerWrkr, "$MainMsgQueueWorkerThreadMinimumMessages", ourConf->globals.mainQ.iMainMsgQWrkMinMsgs); - setQPROP(qqueueSetbSaveOnShutdown, "$MainMsgQueueSaveOnShutdown", ourConf->globals.mainQ.bMainMsgQSaveOnShutdown); - setQPROP(qqueueSetiDeqSlowdown, "$MainMsgQueueDequeueSlowdown", ourConf->globals.mainQ.iMainMsgQDeqSlowdown); - setQPROP(qqueueSetiDeqtWinFromHr, "$MainMsgQueueDequeueTimeBegin", ourConf->globals.mainQ.iMainMsgQueueDeqtWinFromHr); - setQPROP(qqueueSetiDeqtWinToHr, "$MainMsgQueueDequeueTimeEnd", ourConf->globals.mainQ.iMainMsgQueueDeqtWinToHr); - - # undef setQPROP - # undef setQPROPstr - } else { /* use new style config! */ - qqueueSetDefaultsRulesetQueue(*ppQueue); - qqueueApplyCnfParam(*ppQueue, lst); - } + } + if(qfname == NULL) + qfname = ustrdup(pszMainMsgQFName); + qfn = malloc(sizeof(struct queuefilenames_s)); + qfn->name = qfname; + qfn->next = queuefilenames; + queuefilenames = qfn; + } + + setQPROP(qqueueSetMaxFileSize, "$MainMsgQueueFileSize", iMainMsgQueMaxFileSize); + setQPROP(qqueueSetsizeOnDiskMax, "$MainMsgQueueMaxDiskSpace", iMainMsgQueMaxDiskSpace); + setQPROP(qqueueSetiDeqBatchSize, "$MainMsgQueueDequeueBatchSize", iMainMsgQueDeqBatchSize); + setQPROPstr(qqueueSetFilePrefix, "$MainMsgQueueFileName", qfname); + setQPROP(qqueueSetiPersistUpdCnt, "$MainMsgQueueCheckpointInterval", iMainMsgQPersistUpdCnt); + setQPROP(qqueueSetbSyncQueueFiles, "$MainMsgQueueSyncQueueFiles", bMainMsgQSyncQeueFiles); + setQPROP(qqueueSettoQShutdown, "$MainMsgQueueTimeoutShutdown", iMainMsgQtoQShutdown ); + setQPROP(qqueueSettoActShutdown, "$MainMsgQueueTimeoutActionCompletion", iMainMsgQtoActShutdown); + setQPROP(qqueueSettoWrkShutdown, "$MainMsgQueueWorkerTimeoutThreadShutdown", iMainMsgQtoWrkShutdown); + setQPROP(qqueueSettoEnq, "$MainMsgQueueTimeoutEnqueue", iMainMsgQtoEnq); + setQPROP(qqueueSetiHighWtrMrk, "$MainMsgQueueHighWaterMark", iMainMsgQHighWtrMark); + setQPROP(qqueueSetiLowWtrMrk, "$MainMsgQueueLowWaterMark", iMainMsgQLowWtrMark); + setQPROP(qqueueSetiDiscardMrk, "$MainMsgQueueDiscardMark", iMainMsgQDiscardMark); + if(iMainMsgQLightDlyMark > 0) { + setQPROP(qqueueSetiLightDlyMrk, "$MainMsgQueueLightDelayMark", iMainMsgQLightDlyMark); + } + setQPROP(qqueueSetiDiscardSeverity, "$MainMsgQueueDiscardSeverity", iMainMsgQDiscardSeverity); + setQPROP(qqueueSetiMinMsgsPerWrkr, "$MainMsgQueueWorkerThreadMinimumMessages", iMainMsgQWrkMinMsgs); + setQPROP(qqueueSetbSaveOnShutdown, "$MainMsgQueueSaveOnShutdown", bMainMsgQSaveOnShutdown); + setQPROP(qqueueSetiDeqSlowdown, "$MainMsgQueueDequeueSlowdown", iMainMsgQDeqSlowdown); + setQPROP(qqueueSetiDeqtWinFromHr, "$MainMsgQueueDequeueTimeBegin", iMainMsgQueueDeqtWinFromHr); + setQPROP(qqueueSetiDeqtWinToHr, "$MainMsgQueueDequeueTimeEnd", iMainMsgQueueDeqtWinToHr); + +# undef setQPROP +# undef setQPROPstr /* ... and finally start the queue! */ CHKiRet_Hdlr(qqueueStart(*ppQueue)) { @@ -1195,26 +1674,146 @@ static rsRetVal init(void) { + rsRetVal localRet; + int iNbrActions; + int bHadConfigErr = 0; + ruleset_t *pRuleset; + char cbuf[BUFSIZ]; char bufStartUpMsg[512]; struct sigaction sigAct; DEFiRet; + DBGPRINTF("rsyslog %s - called init()\n", VERSION); + + /* construct the default ruleset */ + ruleset.Construct(&pRuleset); + ruleset.SetName(pRuleset, UCHAR_CONSTANT("RSYSLOG_DefaultRuleset")); + ruleset.ConstructFinalize(pRuleset); + + /* open the configuration file */ + localRet = conf.processConfFile(ConfFile); + CHKiRet(conf.GetNbrActActions(&iNbrActions)); + + if(localRet != RS_RET_OK) { + errmsg.LogError(0, localRet, "CONFIG ERROR: could not interpret master config file '%s'.", ConfFile); + bHadConfigErr = 1; + } else if(iNbrActions == 0) { + errmsg.LogError(0, RS_RET_NO_ACTIONS, "CONFIG ERROR: there are no active actions configured. Inputs will " + "run, but no output whatsoever is created."); + bHadConfigErr = 1; + } + + if((localRet != RS_RET_OK && localRet != RS_RET_NONFATAL_CONFIG_ERR) || iNbrActions == 0) { + /* rgerhards: this code is executed to set defaults when the + * config file could not be opened. We might think about + * abandoning the run in this case - but this, too, is not + * very clever... So we stick with what we have. + * We ignore any errors while doing this - we would be lost anyhow... + */ + errmsg.LogError(0, NO_ERRCODE, "EMERGENCY CONFIGURATION ACTIVATED - fix rsyslog config file!"); + + /* note: we previously used _POSIY_TTY_NAME_MAX+1, but this turned out to be + * too low on linux... :-S -- rgerhards, 2008-07-28 + */ + char szTTYNameBuf[128]; + rule_t *pRule = NULL; /* initialization to NULL is *vitally* important! */ + conf.cfline(UCHAR_CONSTANT("*.ERR\t" _PATH_CONSOLE), &pRule); + conf.cfline(UCHAR_CONSTANT("syslog.*\t" _PATH_CONSOLE), &pRule); + conf.cfline(UCHAR_CONSTANT("*.PANIC\t*"), &pRule); + conf.cfline(UCHAR_CONSTANT("syslog.*\troot"), &pRule); + if(ttyname_r(0, szTTYNameBuf, sizeof(szTTYNameBuf)) == 0) { + snprintf(cbuf,sizeof(cbuf), "*.*\t%s", szTTYNameBuf); + conf.cfline((uchar*)cbuf, &pRule); + } else { + DBGPRINTF("error %d obtaining controlling terminal, not using that emergency rule\n", errno); + } + ruleset.AddRule(ruleset.GetCurrent(), &pRule); + } + + legacyOptsHook(); + + /* some checks */ + if(iMainMsgQueueNumWorkers < 1) { + errmsg.LogError(0, NO_ERRCODE, "$MainMsgQueueNumWorkers must be at least 1! Set to 1.\n"); + iMainMsgQueueNumWorkers = 1; + } + + if(MainMsgQueType == QUEUETYPE_DISK) { + errno = 0; /* for logerror! */ + if(glbl.GetWorkDir() == NULL) { + errmsg.LogError(0, NO_ERRCODE, "No $WorkDirectory specified - can not run main message queue in 'disk' mode. " + "Using 'FixedArray' instead.\n"); + MainMsgQueType = QUEUETYPE_FIXED_ARRAY; + } + if(pszMainMsgQFName == NULL) { + errmsg.LogError(0, NO_ERRCODE, "No $MainMsgQueueFileName specified - can not run main message queue in " + "'disk' mode. Using 'FixedArray' instead.\n"); + MainMsgQueType = QUEUETYPE_FIXED_ARRAY; + } + } + + /* check if we need to generate a config DAG and, if so, do that */ + if(pszConfDAGFile != NULL) + generateConfigDAG(pszConfDAGFile); + + /* we are done checking the config - now validate if we should actually run or not. + * If not, terminate. -- rgerhards, 2008-07-25 + */ + if(iConfigVerify) { + if(bHadConfigErr) { + /* a bit dirty, but useful... */ + exit(1); + } + ABORT_FINALIZE(RS_RET_VALIDATION_RUN); + } + + if(bAbortOnUncleanConfig && bHadConfigErr) { + fprintf(stderr, "rsyslogd: $AbortOnUncleanConfig is set, and config is not clean.\n" + "Check error log for details, fix errors and restart. As a last\n" + "resort, you may want to remove $AbortOnUncleanConfig to permit a\n" + "startup with a dirty config.\n"); + exit(2); + } + + /* create message queue */ + CHKiRet_Hdlr(createMainQueue(&pMsgQueue, UCHAR_CONSTANT("main Q"))) { + /* no queue is fatal, we need to give up in that case... */ + fprintf(stderr, "fatal error %d: could not create message queue - rsyslogd can not run!\n", iRet); + exit(1); + } + + bHaveMainQueue = (MainMsgQueType == QUEUETYPE_DIRECT) ? 0 : 1; + DBGPRINTF("Main processing queue is initialized and running\n"); + + /* the output part and the queue is now ready to run. So it is a good time + * to initialize the inputs. Please note that the net code above should be + * shuffled to down here once we have everything in input modules. + * rgerhards, 2007-12-14 + * NOTE: as of 2009-06-29, the input modules are initialized, but not yet run. + * Keep in mind. though, that the outputs already run if the queue was + * persisted to disk. -- rgerhards + */ + startInputModules(); + + if(Debug) { + dbgPrintInitInfo(); + } + memset(&sigAct, 0, sizeof (sigAct)); sigemptyset(&sigAct.sa_mask); sigAct.sa_handler = sighup_handler; sigaction(SIGHUP, &sigAct, NULL); - CHKiRet(rsconf.Activate(ourConf)); DBGPRINTF(" started.\n"); /* we now generate the startup message. It now includes everything to * identify this instance. -- rgerhards, 2005-08-17 */ - if(ourConf->globals.bLogStatusMsgs) { + if(bLogStatusMsgs) { snprintf(bufStartUpMsg, sizeof(bufStartUpMsg)/sizeof(char), " [origin software=\"rsyslogd\" " "swVersion=\"" VERSION \ "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"] start", - (int) glblGetOurPid()); + (int) myPid); logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)bufStartUpMsg, 0); } @@ -1223,6 +1822,100 @@ } +/* Switch the default ruleset (that, what servcies bind to if nothing specific + * is specified). + * rgerhards, 2009-06-12 + */ +static rsRetVal +setDefaultRuleset(void __attribute__((unused)) *pVal, uchar *pszName) +{ + DEFiRet; + + CHKiRet(ruleset.SetDefaultRuleset(pszName)); + +finalize_it: + free(pszName); /* no longer needed */ + RETiRet; +} + + + +/* Put the rsyslog main thread to sleep for n seconds. This was introduced as + * a quick and dirty workaround for a privilege drop race in regard to listener + * startup, which itself was a result of the not-yet-done proper coding of + * privilege drop code (quite some effort). It may be useful for other occasions, too. + * is specified). + * rgerhards, 2009-06-12 + */ +static rsRetVal +putToSleep(void __attribute__((unused)) *pVal, int iNewVal) +{ + DEFiRet; + DBGPRINTF("rsyslog main thread put to sleep via $sleep %d directive...\n", iNewVal); + srSleep(iNewVal, 0); + DBGPRINTF("rsyslog main thread continues after $sleep %d\n", iNewVal); + RETiRet; +} + + +/* Switch to either an already existing rule set or start a new one. The + * named rule set becomes the new "current" rule set (what means that new + * actions are added to it). + * rgerhards, 2009-06-12 + */ +static rsRetVal +setCurrRuleset(void __attribute__((unused)) *pVal, uchar *pszName) +{ + ruleset_t *pRuleset; + rsRetVal localRet; + DEFiRet; + + localRet = ruleset.SetCurrRuleset(pszName); + + if(localRet == RS_RET_NOT_FOUND) { + DBGPRINTF("begin new current rule set '%s'\n", pszName); + CHKiRet(ruleset.Construct(&pRuleset)); + CHKiRet(ruleset.SetName(pRuleset, pszName)); + CHKiRet(ruleset.ConstructFinalize(pRuleset)); + } else { + ABORT_FINALIZE(localRet); + } + +finalize_it: + free(pszName); /* no longer needed */ + RETiRet; +} + + +/* set the main message queue mode + * rgerhards, 2008-01-03 + */ +static rsRetVal setMainMsgQueType(void __attribute__((unused)) *pVal, uchar *pszType) +{ + DEFiRet; + + if (!strcasecmp((char *) pszType, "fixedarray")) { + MainMsgQueType = QUEUETYPE_FIXED_ARRAY; + DBGPRINTF("main message queue type set to FIXED_ARRAY\n"); + } else if (!strcasecmp((char *) pszType, "linkedlist")) { + MainMsgQueType = QUEUETYPE_LINKEDLIST; + DBGPRINTF("main message queue type set to LINKEDLIST\n"); + } else if (!strcasecmp((char *) pszType, "disk")) { + MainMsgQueType = QUEUETYPE_DISK; + DBGPRINTF("main message queue type set to DISK\n"); + } else if (!strcasecmp((char *) pszType, "direct")) { + MainMsgQueType = QUEUETYPE_DIRECT; + DBGPRINTF("main message queue type set to DIRECT (no queueing at all)\n"); + } else { + errmsg.LogError(0, RS_RET_INVALID_PARAMS, "unknown mainmessagequeuetype parameter: %s", (char *) pszType); + iRet = RS_RET_INVALID_PARAMS; + } + free(pszType); /* no longer needed */ + + RETiRet; +} + + /* * The following function is resposible for handling a SIGHUP signal. Since * we are now doing mallocs/free as part of init we had better not being @@ -1256,7 +1949,7 @@ msg_t *pMsg; while(iminternalRemoveMsg(&pMsg) == RS_RET_OK) { - submitMsgWithDfltRatelimiter(pMsg); + submitMsg(pMsg); } } @@ -1289,18 +1982,17 @@ { char buf[512]; - if(ourConf->globals.bLogStatusMsgs) { + if(bLogStatusMsgs) { snprintf(buf, sizeof(buf) / sizeof(char), " [origin software=\"rsyslogd\" " "swVersion=\"" VERSION "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"] rsyslogd was HUPed", - (int) glblGetOurPid()); + (int) myPid); errno = 0; logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)buf, 0); } queryLocalHostname(); /* re-read our name */ - ruleset.IterateAllActions(ourConf, doHUPActions, NULL); - lookupDoHUP(); + ruleset.IterateAllActions(doHUPActions, NULL); } @@ -1324,26 +2016,169 @@ while(!bFinished){ /* this is now just a wait - please note that we do use a near-"eternal" - * timeout of 1 day. This enables us to help safe the environment + * timeout of 1 day if we do not have repeated message reduction turned on + * (which it is not by default). This enables us to help safe the environment * by not unnecessarily awaking rsyslog on a regular tick (just think * powertop, for example). In that case, we primarily wait for a signal, * but a once-a-day wakeup should be quite acceptable. -- rgerhards, 2008-06-09 */ - tvSelectTimeout.tv_sec = 86400 /*1 day*/; + tvSelectTimeout.tv_sec = (bReduceRepeatMsgs == 1) ? TIMERINTVL : 86400 /*1 day*/; + //tvSelectTimeout.tv_sec = TIMERINTVL; /* TODO: change this back to the above code when we have a better solution for apc */ tvSelectTimeout.tv_usec = 0; select(1, NULL, NULL, NULL, &tvSelectTimeout); if(bFinished) - break; /* exit as quickly as possible */ + break; /* exit as quickly as possible - see long comment below */ + + /* If we received a HUP signal, we call doFlushRptdMsgs() a bit early. This + * doesn't matter, because doFlushRptdMsgs() checks timestamps. What may happen, + * however, is that the too-early call may lead to a bit too-late output + * of "last message repeated n times" messages. But that is quite acceptable. + * rgerhards, 2007-12-21 + * ... and just to explain, we flush here because that is exactly what the mainloop + * shall do - provide a periodic interval in which not-yet-flushed messages will + * be flushed. Be careful, there is a potential race condition: doFlushRptdMsgs() + * needs to aquire a lock on the action objects. If, however, long-running consumers + * cause the main queue worker threads to lock them for a long time, we may receive + * a starvation condition, resulting in the mainloop being held on lock for an extended + * period of time. That, in turn, could lead to unresponsiveness to termination + * requests. It is especially important that the bFinished flag is checked before + * doFlushRptdMsgs() is called (I know because I ran into that situation). I am + * not yet sure if the remaining probability window of a termination-related + * problem is large enough to justify changing the code - I would consider it + * extremely unlikely that the problem ever occurs in practice. Fixing it would + * require not only a lot of effort but would cost considerable performance. So + * for the time being, I think the remaining risk can be accepted. + * rgerhards, 2008-01-10 + */ + if(bReduceRepeatMsgs == 1) + doFlushRptdMsgs(); if(bHadHUP) { doHUP(); bHadHUP = 0; continue; } + // TODO: remove execScheduled(); /* handle Apc calls (if any) */ } ENDfunc } + +/* load build-in modules + * very first version begun on 2007-07-23 by rgerhards + */ +static rsRetVal loadBuildInModules(void) +{ + DEFiRet; + + if((iRet = module.doModInit(modInitFile, UCHAR_CONSTANT("builtin-file"), NULL)) != RS_RET_OK) { + RETiRet; + } + if((iRet = module.doModInit(modInitPipe, UCHAR_CONSTANT("builtin-pipe"), NULL)) != RS_RET_OK) { + RETiRet; + } +#ifdef SYSLOG_INET + if((iRet = module.doModInit(modInitFwd, UCHAR_CONSTANT("builtin-fwd"), NULL)) != RS_RET_OK) { + RETiRet; + } +#endif + if((iRet = module.doModInit(modInitShell, UCHAR_CONSTANT("builtin-shell"), NULL)) != RS_RET_OK) { + RETiRet; + } + if((iRet = module.doModInit(modInitDiscard, UCHAR_CONSTANT("builtin-discard"), NULL)) != RS_RET_OK) { + RETiRet; + } + + /* dirty, but this must be for the time being: the usrmsg module must always be + * loaded as last module. This is because it processes any type of action selector. + * If we load it before other modules, these others will never have a chance of + * working with the config file. We may change that implementation so that a user name + * must start with an alnum, that would definitely help (but would it break backwards + * compatibility?). * rgerhards, 2007-07-23 + * User names now must begin with: + * [a-zA-Z0-9_.] + */ + CHKiRet(module.doModInit(modInitUsrMsg, (uchar*) "builtin-usrmsg", NULL)); + + /* load build-in parser modules */ + CHKiRet(module.doModInit(modInitpmrfc5424, UCHAR_CONSTANT("builtin-pmrfc5424"), NULL)); + CHKiRet(module.doModInit(modInitpmrfc3164, UCHAR_CONSTANT("builtin-pmrfc3164"), NULL)); + + /* and set default parser modules (order is *very* important, legacy (3164) parse needs to go last! */ + CHKiRet(parser.AddDfltParser(UCHAR_CONSTANT("rsyslog.rfc5424"))); + CHKiRet(parser.AddDfltParser(UCHAR_CONSTANT("rsyslog.rfc3164"))); + + /* load build-in strgen modules */ + CHKiRet(module.doModInit(modInitsmfile, UCHAR_CONSTANT("builtin-smfile"), NULL)); + CHKiRet(module.doModInit(modInitsmtradfile, UCHAR_CONSTANT("builtin-smtradfile"), NULL)); + CHKiRet(module.doModInit(modInitsmfwd, UCHAR_CONSTANT("builtin-smfwd"), NULL)); + CHKiRet(module.doModInit(modInitsmtradfwd, UCHAR_CONSTANT("builtin-smtradfwd"), NULL)); + + /* ok, initialization of the command handler probably does not 100% belong right in + * this space here. However, with the current design, this is actually quite a good + * place to put it. We might decide to shuffle it around later, but for the time + * being, the code has found its home here. A not-just-sideeffect of this decision + * is that rsyslog will terminate if we can not register our built-in config commands. + * This, I think, is the right thing to do. -- rgerhards, 2007-07-31 + */ + CHKiRet(regCfSysLineHdlr((uchar *)"logrsyslogstatusmessages", 0, eCmdHdlrBinary, NULL, &bLogStatusMsgs, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionresumeretrycount", 0, eCmdHdlrInt, NULL, &glbliActionResumeRetryCount, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"defaultruleset", 0, eCmdHdlrGetWord, setDefaultRuleset, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"ruleset", 0, eCmdHdlrGetWord, setCurrRuleset, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"sleep", 0, eCmdHdlrInt, putToSleep, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuefilename", 0, eCmdHdlrGetWord, NULL, &pszMainMsgQFName, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesize", 0, eCmdHdlrInt, NULL, &iMainMsgQueueSize, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuehighwatermark", 0, eCmdHdlrInt, NULL, &iMainMsgQHighWtrMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuelowwatermark", 0, eCmdHdlrInt, NULL, &iMainMsgQLowWtrMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuediscardmark", 0, eCmdHdlrInt, NULL, &iMainMsgQDiscardMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuelightdelaymark", 0, eCmdHdlrInt, NULL, &iMainMsgQLightDlyMark, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuediscardseverity", 0, eCmdHdlrSeverity, NULL, &iMainMsgQDiscardSeverity, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuecheckpointinterval", 0, eCmdHdlrInt, NULL, &iMainMsgQPersistUpdCnt, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesyncqueuefiles", 0, eCmdHdlrBinary, NULL, &bMainMsgQSyncQeueFiles, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetype", 0, eCmdHdlrGetWord, setMainMsgQueType, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkerthreads", 0, eCmdHdlrInt, NULL, &iMainMsgQueueNumWorkers, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetimeoutshutdown", 0, eCmdHdlrInt, NULL, &iMainMsgQtoQShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetimeoutactioncompletion", 0, eCmdHdlrInt, NULL, &iMainMsgQtoActShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetimeoutenqueue", 0, eCmdHdlrInt, NULL, &iMainMsgQtoEnq, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkertimeoutthreadshutdown", 0, eCmdHdlrInt, NULL, &iMainMsgQtoWrkShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeueslowdown", 0, eCmdHdlrInt, NULL, &iMainMsgQDeqSlowdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkerthreadminimummessages", 0, eCmdHdlrInt, NULL, &iMainMsgQWrkMinMsgs, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuemaxfilesize", 0, eCmdHdlrSize, NULL, &iMainMsgQueMaxFileSize, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeuebatchsize", 0, eCmdHdlrSize, NULL, &iMainMsgQueDeqBatchSize, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuemaxdiskspace", 0, eCmdHdlrSize, NULL, &iMainMsgQueMaxDiskSpace, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesaveonshutdown", 0, eCmdHdlrBinary, NULL, &bMainMsgQSaveOnShutdown, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeuetimebegin", 0, eCmdHdlrInt, NULL, &iMainMsgQueueDeqtWinFromHr, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuedequeuetimeend", 0, eCmdHdlrInt, NULL, &iMainMsgQueueDeqtWinToHr, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"abortonuncleanconfig", 0, eCmdHdlrBinary, NULL, &bAbortOnUncleanConfig, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"repeatedmsgreduction", 0, eCmdHdlrBinary, NULL, &bReduceRepeatMsgs, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionexeconlywhenpreviousissuspended", 0, eCmdHdlrBinary, NULL, &bActExecWhenPrevSusp, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"actionresumeinterval", 0, eCmdHdlrInt, setActionResumeInterval, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"template", 0, eCmdHdlrCustomHandler, conf.doNameLine, (void*)DIR_TEMPLATE, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"outchannel", 0, eCmdHdlrCustomHandler, conf.doNameLine, (void*)DIR_OUTCHANNEL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"allowedsender", 0, eCmdHdlrCustomHandler, conf.doNameLine, (void*)DIR_ALLOWEDSENDER, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"modload", 0, eCmdHdlrCustomHandler, conf.doModLoad, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"includeconfig", 0, eCmdHdlrCustomHandler, conf.doIncludeLine, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"umask", 0, eCmdHdlrFileCreateMode, setUmask, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"maxopenfiles", 0, eCmdHdlrInt, setMaxFiles, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"debugprinttemplatelist", 0, eCmdHdlrBinary, NULL, &bDebugPrintTemplateList, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"debugprintmodulelist", 0, eCmdHdlrBinary, NULL, &bDebugPrintModuleList, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"debugprintcfsyslinehandlerlist", 0, eCmdHdlrBinary, + NULL, &bDebugPrintCfSysLineHandlerList, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"moddir", 0, eCmdHdlrGetWord, NULL, &pModDir, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"generateconfiggraph", 0, eCmdHdlrGetWord, NULL, &pszConfDAGFile, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"errormessagestostderr", 0, eCmdHdlrBinary, NULL, &bErrMsgToStderr, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"maxmessagesize", 0, eCmdHdlrSize, setMaxMsgSize, NULL, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"privdroptouser", 0, eCmdHdlrUID, NULL, &uidDropPriv, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"privdroptouserid", 0, eCmdHdlrInt, NULL, &uidDropPriv, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"privdroptogroup", 0, eCmdHdlrGID, NULL, &gidDropPriv, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"privdroptogroupid", 0, eCmdHdlrGID, NULL, &gidDropPriv, NULL)); + +finalize_it: + RETiRet; +} + + /* print version and compile-time setting information. */ static void printVersion(void) @@ -1385,20 +2220,102 @@ #else printf("\tRuntime Instrumentation (slow code):\tNo\n"); #endif -#ifdef USE_LIBUUID - printf("\tuuid support:\t\t\t\tYes\n"); -#else - printf("\tuuid support:\t\t\t\tNo\n"); -#endif -#ifdef HAVE_JSON_OBJECT_NEW_INT64 - printf("\tNumber of Bits in RainerScript integers: 64\n"); -#else - printf("\tNumber of Bits in RainerScript integers: 32 (due to too-old json-c lib)\n"); -#endif printf("\nSee http://www.rsyslog.com for more information.\n"); } +/* This function is called after initial initalization. It is used to + * move code out of the too-long main() function. + * rgerhards, 2007-10-17 + */ +static rsRetVal mainThread() +{ + DEFiRet; + uchar *pTmp; + + /* initialize the build-in templates */ + pTmp = template_DebugFormat; + tplAddLine("RSYSLOG_DebugFormat", &pTmp); + pTmp = template_SyslogProtocol23Format; + tplAddLine("RSYSLOG_SyslogProtocol23Format", &pTmp); + pTmp = template_FileFormat; /* new format for files with high-precision stamp */ + tplAddLine("RSYSLOG_FileFormat", &pTmp); + pTmp = template_TraditionalFileFormat; + tplAddLine("RSYSLOG_TraditionalFileFormat", &pTmp); + pTmp = template_WallFmt; + tplAddLine(" WallFmt", &pTmp); + pTmp = template_ForwardFormat; + tplAddLine("RSYSLOG_ForwardFormat", &pTmp); + pTmp = template_TraditionalForwardFormat; + tplAddLine("RSYSLOG_TraditionalForwardFormat", &pTmp); + pTmp = template_StdUsrMsgFmt; + tplAddLine(" StdUsrMsgFmt", &pTmp); + pTmp = template_StdDBFmt; + tplAddLine(" StdDBFmt", &pTmp); + pTmp = template_SysklogdFileFormat; + tplAddLine("RSYSLOG_SysklogdFileFormat", &pTmp); + pTmp = template_StdPgSQLFmt; + tplAddLine(" StdPgSQLFmt", &pTmp); + pTmp = template_StdJSONFmt; + tplAddLine(" StdJSONFmt", &pTmp); + pTmp = template_spoofadr; + tplLastStaticInit(tplAddLine("RSYSLOG_omudpspoofDfltSourceTpl", &pTmp)); + + CHKiRet(init()); + + if(Debug && debugging_on) { + DBGPRINTF("Debugging enabled, SIGUSR1 to turn off debugging.\n"); + } + + /* Send a signal to the parent so it can terminate. + */ + if(myPid != ppid) + kill(ppid, SIGTERM); + + glbl.GenerateLocalHostNameProperty(); /* regenerate, FQDN setting may have changed */ + + /* If instructed to do so, we now drop privileges. Note that this is not 100% secure, + * because outputs are already running at this time. However, we can implement + * dropping of privileges rather quickly and it will work in many cases. While it is not + * the ultimate solution, the current one is still much better than not being able to + * drop privileges at all. Doing it correctly, requires a change in architecture, which + * we should do over time. TODO -- rgerhards, 2008-11-19 + */ + if(gidDropPriv != 0) { + doDropPrivGid(gidDropPriv); + } + + if(uidDropPriv != 0) { + doDropPrivUid(uidDropPriv); + } + + /* finally let the inputs run... */ + runInputModules(); + + /* END OF INTIALIZATION + */ + DBGPRINTF("initialization completed, transitioning to regular run mode\n"); + + /* close stderr and stdout if they are kept open during a fork. Note that this + * may introduce subtle security issues: if we are in a jail, one may break out of + * it via these descriptors. But if I close them earlier, error messages will (once + * again) not be emitted to the user that starts the daemon. As root jail support + * is still in its infancy (and not really done), we currently accept this issue. + * rgerhards, 2009-06-29 + */ + if(!(Debug == DEBUG_FULL || NoFork)) { + close(1); + close(2); + bErrMsgToStderr = 0; + } + + mainloop(); + +finalize_it: + RETiRet; +} + + /* Method to initialize all global classes and use the objects that we need. * rgerhards, 2008-01-04 * rgerhards, 2008-04-16: the actual initialization is now carried out by the runtime @@ -1412,7 +2329,7 @@ /* Intialize the runtime system */ pErrObj = "rsyslog runtime"; /* set in case the runtime errors before setting an object */ CHKiRet(rsrtInit(&pErrObj, &obj)); - rsrtSetErrLogger(submitErrMsg); + CHKiRet(rsrtSetErrLogger(submitErrMsg)); /* set out error handler */ /* Now tell the system which classes we need ourselfs */ pErrObj = "glbl"; @@ -1423,6 +2340,10 @@ CHKiRet(objUse(module, CORE_COMPONENT)); pErrObj = "datetime"; CHKiRet(objUse(datetime, CORE_COMPONENT)); + pErrObj = "expr"; + CHKiRet(objUse(expr, CORE_COMPONENT)); + pErrObj = "rule"; + CHKiRet(objUse(rule, CORE_COMPONENT)); pErrObj = "ruleset"; CHKiRet(objUse(ruleset, CORE_COMPONENT)); pErrObj = "conf"; @@ -1431,8 +2352,6 @@ CHKiRet(objUse(prop, CORE_COMPONENT)); pErrObj = "parser"; CHKiRet(objUse(parser, CORE_COMPONENT)); - pErrObj = "rsconf"; - CHKiRet(objUse(rsconf, CORE_COMPONENT)); /* intialize some dummy classes that are not part of the runtime */ pErrObj = "action"; @@ -1443,9 +2362,6 @@ /* TODO: the dependency on net shall go away! -- rgerhards, 2008-03-07 */ pErrObj = "net"; CHKiRet(objUse(net, LM_NET_FILENAME)); - dnscacheInit(); - initRainerscript(); - ratelimitModInit(); finalize_it: if(iRet != RS_RET_OK) { @@ -1477,14 +2393,15 @@ objRelease(prop, CORE_COMPONENT); objRelease(conf, CORE_COMPONENT); objRelease(ruleset, CORE_COMPONENT); + objRelease(rule, CORE_COMPONENT); + objRelease(expr, CORE_COMPONENT); + vmClassExit(); /* this is hack, currently core_modules do not get this automatically called */ parserClassExit(); /* this is hack, currently core_modules do not get this automatically called */ - rsconfClassExit(); /* this is hack, currently core_modules do not get this automatically called */ objRelease(datetime, CORE_COMPONENT); /* TODO: implement the rest of the deinit */ /* dummy "classes */ strExit(); - ratelimitModExit(); #if 0 CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */ @@ -1492,7 +2409,6 @@ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); #endif - dnscacheDeinit(); rsrtExit(); /* *THIS* *MUST/SHOULD?* always be the first class initilizer being called (except debug)! */ RETiRet; @@ -1580,13 +2496,6 @@ */ glbl.SetLocalHostName(LocalHostName); glbl.SetLocalDomain(LocalDomain); - - if ( strlen((char*)LocalDomain) ) { - CHKmalloc(LocalFQDNName = (uchar*)malloc(strlen((char*)LocalDomain)+strlen((char*)LocalHostName)+2));/* one for dot, one for NUL! */ - if ( sprintf((char*)LocalFQDNName,"%s.%s",(char*)LocalHostName,(char*)LocalDomain) ) - glbl.SetLocalFQDNName(LocalFQDNName); - } - glbl.GenerateLocalHostNameProperty(); /* must be redone after conf processing, FQDN setting may have changed */ finalize_it: RETiRet; @@ -1673,7 +2582,8 @@ thrdInit(); - if(doFork) { + if( !(Debug == DEBUG_FULL || NoFork) ) + { DBGPRINTF("Checking pidfile '%s'.\n", PidFile); if (!check_pid(PidFile)) { @@ -1685,23 +2595,16 @@ /* stop writing debug messages to stdout (if debugging is on) */ stddbg = -1; - dbgprintf("ready for forking\n"); if (fork()) { /* Parent process */ - dbgprintf("parent process going to sleep for 60 secs\n"); - sleep(60); - /* Not reached unless something major went wrong. 1 - * minute should be a fair amount of time to wait. - * The parent should not exit before rsyslogd is - * properly initilized (at least almost) or the init - * system may get a wrong impression of our readyness. - * Note that we exit before being completely initialized, - * but at this point it is very, very unlikely that something - * bad can happen. We do this here, because otherwise we would - * need to have much more code to handle priv drop (which we - * don't consider worth for the init system, especially as it - * is going away on the majority of distros). + sleep(300); + /* Not reached unless something major went wrong. 5 + * minutes should be a fair amount of time to wait. + * Please note that this procedure is important since + * the father must not exit before syslogd isn't + * initialized or the klogd won't be able to flush its + * logs. -Joey */ exit(1); /* "good" exit - after forking, not diasabling anything */ } @@ -1710,7 +2613,6 @@ close(0); /* we keep stdout and stderr open in case we have to emit something */ i = 3; - dbgprintf("in child, finalizing initialization\n"); /* if (sd_booted()) */ { const char *e; @@ -1744,8 +2646,7 @@ i = SD_LISTEN_FDS_START + sd_fds; } for ( ; i < num_fds; i++) - if(i != dbgGetDbglogFd()) - close(i); + (void) close(i); untty(); } else { @@ -1770,7 +2671,7 @@ fputs("Pidfile (and pid) already exist.\n", stderr); exit(1); /* exit during startup - questionable */ } - glblSetOurPid(getpid()); + myPid = getpid(); /* save our pid for further testing (also used for messages) */ memset(&sigAct, 0, sizeof (sigAct)); sigemptyset(&sigAct.sa_mask); @@ -1803,16 +2704,18 @@ */ int realMain(int argc, char **argv) { - rsRetVal localRet; + DEFiRet; + int ch; extern int optind; extern char *optarg; int bEOptionWasGiven = 0; + int bImUxSockLoaded = 0; /* already generated a $ModLoad imuxsock? */ int iHelperUOpt; int bChDirRoot = 1; /* change the current working directory to "/"? */ char *arg; /* for command line option processing */ + uchar legacyConfLine[80]; char cwdbuf[128]; /* buffer to obtain/display current working directory */ - DEFiRet; /* first, parse the command line options. We do not carry out any actual work, just * see what we should do. This relieves us from certain anomalies and we can process @@ -1822,10 +2725,13 @@ * split of functionality, this is no longer a problem. Thanks to varmofekoj for * suggesting this algo. * Note: where we just need to set some flags and can do so without knowledge - * of other options, we do this during the inital option processing. + * of other options, we do this during the inital option processing. With later + * versions (if a dependency on -c option is introduced), we must move that code + * to other places, but I think it is quite appropriate and saves code to do this + * only when actually neeeded. * rgerhards, 2008-04-04 */ - while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:S:t:T:u:vwx")) != EOF) { + while((ch = getopt(argc, argv, "46a:Ac:def:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) { switch((char)ch) { case '4': case '6': @@ -1843,37 +2749,51 @@ case 'q': /* add hostname if DNS resolving has failed */ case 'Q': /* dont resolve hostnames in ACL to IPs */ case 's': - case 'S': /* Source IP for local client to be used on multihomed host */ case 'T': /* chroot on startup (primarily for testing) */ case 'u': /* misc user settings */ case 'w': /* disable disallowed host warnings */ case 'x': /* disable dns for remote messages */ - case 'g': /* enable tcp gssapi logging */ - case 'r': /* accept remote messages */ - case 't': /* enable tcp logging */ CHKiRet(bufOptAdd(ch, optarg)); break; case 'c': /* compatibility mode */ - fprintf(stderr, "rsyslogd: error: option -c is no longer supported - ignored\n"); + iCompatibilityMode = atoi(optarg); break; case 'd': /* debug - must be handled now, so that debug is active during init! */ debugging_on = 1; Debug = 1; - yydebug = 1; - break; - case 'D': /* BISON debug */ - yydebug = 1; break; case 'e': /* log every message (no repeat message supression) */ + fprintf(stderr, "note: -e option is no longer supported, every message is now logged by default\n"); bEOptionWasGiven = 1; break; + case 'g': /* enable tcp gssapi logging */ +#if defined(SYSLOG_INET) && defined(USE_GSSAPI) + CHKiRet(bufOptAdd('g', optarg)); +#else + fprintf(stderr, "rsyslogd: -g not valid - not compiled with gssapi support"); +#endif + break; case 'M': /* default module load path -- this MUST be carried out immediately! */ glblModPath = (uchar*) optarg; break; + case 'r': /* accept remote messages */ +#ifdef SYSLOG_INET + CHKiRet(bufOptAdd(ch, optarg)); +#else + fprintf(stderr, "rsyslogd: -r not valid - not compiled with network support\n"); +#endif + break; + case 't': /* enable tcp logging */ +#ifdef SYSLOG_INET + CHKiRet(bufOptAdd(ch, optarg)); +#else + fprintf(stderr, "rsyslogd: -t not valid - not compiled with network support\n"); +#endif + break; case 'v': /* MUST be carried out immediately! */ printVersion(); exit(0); /* exit for -v option - so this is a "good one" */ - case '?': + case '?': default: usage(); } @@ -1882,8 +2802,8 @@ if(argc - optind) usage(); - DBGPRINTF("rsyslogd %s startup, module path '%s', cwd:%s\n", - VERSION, glblModPath == NULL ? "" : (char*)glblModPath, + DBGPRINTF("rsyslogd %s startup, compatibility mode %d, module path '%s', cwd:%s\n", + VERSION, iCompatibilityMode, glblModPath == NULL ? "" : (char*)glblModPath, getcwd(cwdbuf, sizeof(cwdbuf))); /* we are done with the initial option parsing and processing. Now we init the system. */ @@ -1917,6 +2837,11 @@ exit(1); /* "good" exit, leaving at init for fatal error */ } + if((iRet = loadBuildInModules()) != RS_RET_OK) { + fprintf(stderr, "fatal error: could not activate built-in modules. Error code %d.\n", + iRet); + exit(1); /* "good" exit, leaving at init for fatal error */ + } /* END core initializations - we now come back to carrying out command line options*/ @@ -1933,22 +2858,32 @@ send_to_all++; break; case 'a': - fprintf(stderr, "rsyslogd: error -a is no longer supported, use module imuxsock instead"); - break; - case 'S': /* Source IP for local client to be used on multihomed host */ - if(glbl.GetSourceIPofLocalClient() != NULL) { - fprintf (stderr, "rsyslogd: Only one -S argument allowed, the first one is taken.\n"); + if(iCompatibilityMode < 3) { + if(!bImUxSockLoaded) { + legacyOptsEnq((uchar *) "ModLoad imuxsock"); + bImUxSockLoaded = 1; + } + snprintf((char *) legacyConfLine, sizeof(legacyConfLine), "addunixlistensocket %s", arg); + legacyOptsEnq(legacyConfLine); } else { - glbl.SetSourceIPofLocalClient((uchar*)arg); + fprintf(stderr, "error -a is no longer supported, use module imuxsock instead"); } - break; + break; case 'f': /* configuration file */ ConfFile = (uchar*) arg; break; case 'g': /* enable tcp gssapi logging */ - fprintf(stderr, "rsyslogd: -g option no longer supported - ignored\n"); + if(iCompatibilityMode < 3) { + legacyOptsParseTCP(ch, arg); + } else + fprintf(stderr, "-g option only supported in compatibility modes 0 to 2 - ignored\n"); + break; case 'h': - fprintf(stderr, "rsyslogd: error -h is no longer supported - ignored"); + if(iCompatibilityMode < 3) { + errmsg.LogError(0, NO_ERRCODE, "WARNING: -h option is no longer supported - ignored"); + } else { + usage(); /* for v3 and above, it simply is an error */ + } break; case 'i': /* pid file name */ PidFile = arg; @@ -1961,19 +2896,40 @@ } break; case 'm': /* mark interval */ - fprintf(stderr, "rsyslogd: error -m is no longer supported - use immark instead"); + if(iCompatibilityMode < 3) { + MarkInterval = atoi(arg) * 60; + } else + fprintf(stderr, + "-m option only supported in compatibility modes 0 to 2 - ignored\n"); break; case 'n': /* don't fork */ - doFork = 0; + NoFork = 1; break; case 'N': /* enable config verify mode */ iConfigVerify = atoi(arg); break; case 'o': - fprintf(stderr, "error -o is no longer supported, use module imuxsock instead"); + if(iCompatibilityMode < 3) { + if(!bImUxSockLoaded) { + legacyOptsEnq((uchar *) "ModLoad imuxsock"); + bImUxSockLoaded = 1; + } + legacyOptsEnq((uchar *) "OmitLocalLogging"); + } else { + fprintf(stderr, "error -o is no longer supported, use module imuxsock instead"); + } break; case 'p': - fprintf(stderr, "error -p is no longer supported, use module imuxsock instead"); + if(iCompatibilityMode < 3) { + if(!bImUxSockLoaded) { + legacyOptsEnq((uchar *) "ModLoad imuxsock"); + bImUxSockLoaded = 1; + } + snprintf((char *) legacyConfLine, sizeof(legacyConfLine), "SystemLogSocketName %s", arg); + legacyOptsEnq(legacyConfLine); + } else { + fprintf(stderr, "error -p is no longer supported, use module imuxsock instead"); + } break; case 'q': /* add hostname if DNS resolving has failed */ *(net.pACLAddHostnameOnFail) = 1; @@ -1982,7 +2938,12 @@ *(net.pACLDontResolve) = 1; break; case 'r': /* accept remote messages */ - fprintf(stderr, "rsyslogd: error option -r is no longer supported - ignored"); + if(iCompatibilityMode < 3) { + legacyOptsEnq((uchar *) "ModLoad imudp"); + snprintf((char *) legacyConfLine, sizeof(legacyConfLine), "UDPServerRun %s", arg); + legacyOptsEnq(legacyConfLine); + } else + fprintf(stderr, "-r option only supported in compatibility modes 0 to 2 - ignored\n"); break; case 's': if(glbl.GetStripDomains() != NULL) { @@ -1992,7 +2953,10 @@ } break; case 't': /* enable tcp logging */ - fprintf(stderr, "rsyslogd: error option -t is no longer supported - ignored"); + if(iCompatibilityMode < 3) { + legacyOptsParseTCP(ch, arg); + } else + fprintf(stderr, "-t option only supported in compatibility modes 0 to 2 - ignored\n"); break; case 'T':/* chroot() immediately at program startup, but only for testing, NOT security yet */ if(chroot(arg) != 0) { @@ -2027,38 +2991,32 @@ VERSION, iConfigVerify, ConfFile); } - localRet = rsconf.Load(&ourConf, ConfFile); - queryLocalHostname(); /* need to re-query to pick up a changed hostname due to config */ - - if(localRet == RS_RET_NONFATAL_CONFIG_ERR) { - if(loadConf->globals.bAbortOnUncleanConfig) { - fprintf(stderr, "rsyslogd: $AbortOnUncleanConfig is set, and config is not clean.\n" - "Check error log for details, fix errors and restart. As a last\n" - "resort, you may want to remove $AbortOnUncleanConfig to permit a\n" - "startup with a dirty config.\n"); - exit(2); - } - if(iConfigVerify) { - /* a bit dirty, but useful... */ - exit(1); - } - localRet = RS_RET_OK; - } - CHKiRet(localRet); - - CHKiRet(ratelimitNew(&dflt_ratelimiter, "rsyslogd", "dflt")); - /* TODO: add linux-type limiting capability */ - CHKiRet(ratelimitNew(&internalMsg_ratelimiter, "rsyslogd", "internal_messages")); - ratelimitSetLinuxLike(internalMsg_ratelimiter, 5, 500); - /* TODO: make internalMsg ratelimit settings configurable */ - if(bChDirRoot) { if(chdir("/") != 0) fprintf(stderr, "Can not do 'cd /' - still trying to run\n"); } + /* process compatibility mode settings */ - if(bEOptionWasGiven) { + if(iCompatibilityMode < 4) { + errmsg.LogError(0, NO_ERRCODE, "WARNING: rsyslogd is running in compatibility mode. Automatically " + "generated config directives may interfer with your rsyslog.conf settings. " + "We suggest upgrading your config and adding -c5 as the first " + "rsyslogd option."); + } + + if(iCompatibilityMode < 3) { + if(MarkInterval > 0) { + legacyOptsEnq((uchar *) "ModLoad immark"); + snprintf((char *) legacyConfLine, sizeof(legacyConfLine), "MarkMessagePeriod %d", MarkInterval); + legacyOptsEnq(legacyConfLine); + } + if(!bImUxSockLoaded) { + legacyOptsEnq((uchar *) "ModLoad imuxsock"); + } + } + + if(bEOptionWasGiven && iCompatibilityMode < 3) { errmsg.LogError(0, NO_ERRCODE, "WARNING: \"message repeated n times\" feature MUST be turned on in " "rsyslog.conf - CURRENTLY EVERY MESSAGE WILL BE LOGGED. Visit " "http://www.rsyslog.com/rptdmsgreduction to learn " @@ -2068,35 +3026,7 @@ if(!iConfigVerify) CHKiRet(doGlblProcessInit()); - /* Send a signal to the parent so it can terminate. */ - if(glblGetOurPid() != ppid) - kill(ppid, SIGTERM); - - CHKiRet(init()); - - if(Debug && debugging_on) { - dbgprintf("Debugging enabled, SIGUSR1 to turn off debugging.\n"); - } - - /* END OF INTIALIZATION */ - DBGPRINTF("initialization completed, transitioning to regular run mode\n"); - - /* close stderr and stdout if they are kept open during a fork. Note that this - * may introduce subtle security issues: if we are in a jail, one may break out of - * it via these descriptors. But if I close them earlier, error messages will (once - * again) not be emitted to the user that starts the daemon. As root jail support - * is still in its infancy (and not really done), we currently accept this issue. - * rgerhards, 2009-06-29 - */ - if(doFork) { - close(1); - close(2); - ourConf->globals.bErrMsgToStderr = 0; - } - - sd_notify(0, "READY=1"); - - mainloop(); + CHKiRet(mainThread()); /* do any de-init's that need to be done AFTER this comment */ @@ -2108,9 +3038,8 @@ if(iRet == RS_RET_VALIDATION_RUN) { fprintf(stderr, "rsyslogd: End of config validation run. Bye.\n"); } else if(iRet != RS_RET_OK) { - fprintf(stderr, "rsyslogd: run failed with error %d (see rsyslog.h " + fprintf(stderr, "rsyslogd run failed with error %d (see rsyslog.h " "or try http://www.rsyslog.com/e/%d to learn what that number means)\n", iRet, iRet*-1); - exit(1); } ENDfunc diff -Nru rsyslog-7.6.0/tools/syslogd.h rsyslog-5.10.1/tools/syslogd.h --- rsyslog-7.6.0/tools/syslogd.h 2014-02-04 12:06:57.000000000 +0000 +++ rsyslog-5.10.1/tools/syslogd.h 2012-10-17 14:41:20.000000000 +0000 @@ -26,6 +26,7 @@ #include "template.h" #include "action.h" #include "linkedlist.h" +#include "expr.h" /* the following prototypes should go away once we have an input * module interface -- rgerhards, 2007-12-12 diff -Nru rsyslog-7.6.0/ylwrap rsyslog-5.10.1/ylwrap --- rsyslog-7.6.0/ylwrap 2014-02-12 12:06:31.000000000 +0000 +++ rsyslog-5.10.1/ylwrap 2012-10-16 13:39:52.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2011-08-25.18; # UTC +scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, -# 2007, 2009, 2010, 2011 Free Software Foundation, Inc. +# 2007, 2009 Free Software Foundation, Inc. # # Written by Tom Tromey . # @@ -99,11 +99,7 @@ # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ -do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' -trap "ret=129; $do_exit" 1 -trap "ret=130; $do_exit" 2 -trap "ret=141; $do_exit" 13 -trap "ret=143; $do_exit" 15 +trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname @@ -137,19 +133,19 @@ # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then - from="y_tab.c" + from="y_tab.c" else - if test $from = "y.tab.h"; then - from="y_tab.h" - fi + if test $from = "y.tab.h"; then + from="y_tab.h" + fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in - [\\/]* | ?:[\\/]*) target="$2";; - *) target="../$2";; + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't @@ -159,8 +155,8 @@ # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then - realtarget="$target" - target="tmp-`echo $target | sed s/.*[\\/]//g`" + realtarget="$target" + target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # @@ -184,10 +180,10 @@ # Check whether header files must be updated. if test $first = no; then - if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then - echo "$2" is unchanged - rm -f "$target" - else + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else echo updating "$2" mv -f "$target" "$realtarget" fi