~ubuntu-branches/debian/sid/rsyslog/sid

« back to all changes in this revision

Viewing changes to plugins/imuxsock/imuxsock.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Michael Biebl, Daniel Pocock
  • Date: 2014-03-11 19:52:49 UTC
  • mfrom: (1.1.37)
  • Revision ID: package-import@ubuntu.com-20140311195249-phbsh9be8lebawti
Tags: 7.4.8-1
[ Michael Biebl ]
* New upstream release.
* Update Build-Depends:
  - Bump libestr-dev to (>= 0.1.9).
  - Tighten liblognorm-dev to (<< 1.0.0).
  - Replace libjson0-dev with libjson-c-dev, we no longer need the
    transitional package.
* Bump Standards-Version to 3.9.5. No further changes.

[ Daniel Pocock ]
* Make template parameter not mandatory in mongodb output plugin. Patch
  cherry-picked from upstream Git. (Closes: #740869, #721277)
* Ensure JSON templates are NUL terminated. Patch cherry-picked from
  upstream Git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
static int nfd = 1; /* number of Unix sockets open / read-only after startup */
160
160
static int sd_fds = 0;                  /* number of systemd activated sockets */
161
161
 
162
 
/* config vars for legacy config system */
163
162
#define DFLT_bCreatePath 0
164
163
#define DFLT_ratelimitInterval 0
165
164
#define DFLT_ratelimitBurst 200
166
165
#define DFLT_ratelimitSeverity 1                        /* do not rate-limit emergency messages */
 
166
/* config vars for the legacy config system */
167
167
static struct configSettings_s {
168
168
        int bOmitLocalLogging;
169
169
        uchar *pLogSockName;
188
188
        int bParseTrusted;              /* parse trusted properties */
189
189
} cs;
190
190
 
 
191
/* config vars for the v2 config system (rsyslog v6+) */
191
192
struct instanceConf_s {
192
193
        uchar *sockName;
193
194
        uchar *pLogHostName;            /* host name to use with this socket */
401
402
                listeners[nfd].flags = inst->bIgnoreTimestamp ? IGNDATE : NOFLAG;
402
403
                listeners[nfd].bCreatePath = inst->bCreatePath;
403
404
                listeners[nfd].sockName = ustrdup(inst->sockName);
404
 
                listeners[nfd].bUseCreds = (inst->bDiscardOwnMsgs || inst->bWritePid || inst->ratelimitInterval || inst->bAnnotate) ? 1 : 0;
 
405
                listeners[nfd].bUseCreds = (inst->bDiscardOwnMsgs || inst->bWritePid || inst->ratelimitInterval || inst->bAnnotate || inst->bUseSysTimeStamp) ? 1 : 0;
405
406
                listeners[nfd].bAnnotate = inst->bAnnotate;
406
407
                listeners[nfd].bParseTrusted = inst->bParseTrusted;
407
408
                listeners[nfd].bDiscardOwnMsgs = inst->bDiscardOwnMsgs;
992
993
        if(iRcvd > 0) {
993
994
                cred = NULL;
994
995
                ts = NULL;
995
 
                if(pLstn->bUseCreds || pLstn->bUseSysTimeStamp) {
 
996
                if(pLstn->bUseCreds) {
996
997
                        for(cm = CMSG_FIRSTHDR(&msgh); cm; cm = CMSG_NXTHDR(&msgh, cm)) {
997
998
#                               if HAVE_SCM_CREDENTIALS
998
999
                                if(   pLstn->bUseCreds
1062
1063
        listeners[0].ratelimitInterval = runModConf->ratelimitIntervalSysSock;
1063
1064
        listeners[0].ratelimitBurst = runModConf->ratelimitBurstSysSock;
1064
1065
        listeners[0].ratelimitSev = runModConf->ratelimitSeveritySysSock;
1065
 
        listeners[0].bUseCreds = (runModConf->bWritePidSysSock || runModConf->ratelimitIntervalSysSock || runModConf->bAnnotateSysSock || runModConf->bDiscardOwnMsgs) ? 1 : 0;
 
1066
        listeners[0].bUseCreds = (runModConf->bWritePidSysSock || runModConf->ratelimitIntervalSysSock || runModConf->bAnnotateSysSock || runModConf->bDiscardOwnMsgs || runModConf->bUseSysTimeStamp) ? 1 : 0;
1066
1067
        listeners[0].bWritePid = runModConf->bWritePidSysSock;
1067
1068
        listeners[0].bAnnotate = runModConf->bAnnotateSysSock;
1068
1069
        listeners[0].bParseTrusted = runModConf->bParseTrusted;
1256
1257
CODESTARTendCnfLoad
1257
1258
        if(!loadModConf->configSetViaV2Method) {
1258
1259
                /* persist module-specific settings from legacy config system */
 
1260
                /* these are used to initialize the system log socket (listeners[0]) */
1259
1261
                loadModConf->bOmitLocalLogging = cs.bOmitLocalLogging;
1260
1262
                loadModConf->pLogSockName = cs.pLogSockName;
1261
1263
                loadModConf->bIgnoreTimestamp = cs.bIgnoreTimestampSysSock;
 
1264
                loadModConf->bUseSysTimeStamp = cs.bUseSysTimeStampSysSock;
1262
1265
                loadModConf->bUseFlowCtl = cs.bUseFlowCtlSysSock;
1263
1266
                loadModConf->bAnnotateSysSock = cs.bAnnotateSysSock;
 
1267
                loadModConf->bWritePidSysSock = cs.bWritePidSysSock;
1264
1268
                loadModConf->bParseTrusted = cs.bParseTrusted;
1265
1269
                loadModConf->ratelimitIntervalSysSock = cs.ratelimitIntervalSysSock;
1266
1270
                loadModConf->ratelimitBurstSysSock = cs.ratelimitBurstSysSock;