diff options
author | Miloslav Trmač <mitr@redhat.com> | 2012-07-23 13:51:59 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-07-31 08:52:35 +0200 |
commit | 127e2cf09596c86d106d521c9977434bc128a763 (patch) | |
tree | b709ec3270c063944339820e07e583aadaa0a608 | |
parent | 6e1774a3515893038914ab91eb2024dbb1ad3112 (diff) | |
download | rsyslog-127e2cf09596c86d106d521c9977434bc128a763.tar.gz rsyslog-127e2cf09596c86d106d521c9977434bc128a763.tar.xz rsyslog-127e2cf09596c86d106d521c9977434bc128a763.zip |
Fix $SystemLogSocketAnnotate
* Copy bAnnotateSysSock value from old config data into the new structure
* Set bUseCreds on the system log socket if bAnnotateSysSock is set
* Process all CMSG records, not only the first one
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 389a465c..b4289345 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -946,14 +946,12 @@ static rsRetVal readSocket(lstn_t *pLstn) 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); - break; } # endif /* HAVE_SO_TIMESTAMP */ } @@ -1012,7 +1010,7 @@ activateListeners() listeners[0].ratelimitInterval = runModConf->ratelimitIntervalSysSock; listeners[0].ratelimitBurst = runModConf->ratelimitBurstSysSock; listeners[0].ratelimitSev = runModConf->ratelimitSeveritySysSock; - listeners[0].bUseCreds = (runModConf->bWritePidSysSock || runModConf->ratelimitIntervalSysSock) ? 1 : 0; + listeners[0].bUseCreds = (runModConf->bWritePidSysSock || runModConf->ratelimitIntervalSysSock || runModConf->bAnnotateSysSock) ? 1 : 0; listeners[0].bWritePid = runModConf->bWritePidSysSock; listeners[0].bAnnotate = runModConf->bAnnotateSysSock; listeners[0].bUseSysTimeStamp = runModConf->bUseSysTimeStamp; @@ -1130,6 +1128,7 @@ CODESTARTendCnfLoad loadModConf->pLogSockName = cs.pLogSockName; loadModConf->bIgnoreTimestamp = cs.bIgnoreTimestampSysSock; loadModConf->bUseFlowCtl = cs.bUseFlowCtlSysSock; + loadModConf->bAnnotateSysSock = cs.bAnnotateSysSock; } loadModConf = NULL; /* done loading */ |