diff options
author | Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> | 2012-09-12 12:44:51 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-12 12:44:51 +0200 |
commit | d1de4cbd92a55c6b930fd84ee9fa5bbfee16aed6 (patch) | |
tree | 615a8b91f331f04360418bdde29888599c8e6d14 | |
parent | a53c2bca49ba0bb49719ebe570854d06ea7e1ca2 (diff) | |
download | rsyslog-d1de4cbd92a55c6b930fd84ee9fa5bbfee16aed6.tar.gz rsyslog-d1de4cbd92a55c6b930fd84ee9fa5bbfee16aed6.tar.bz2 rsyslog-d1de4cbd92a55c6b930fd84ee9fa5bbfee16aed6.zip |
imuxsock: remove incorrect socket option call
SCM_CREDENTIALS is not a socket option; its value is usually
0x2 which on most archs corresponds to socket option
SO_REUSEADDR, but on mips-arch there is no socket option
with value 0x2 and SO_REUSEADDR = 0x4, so the call will fail
with ENOPROTOOPT 'Protocol not available'; skip it.
There does not seem any other special setsockopt call is
needed anyway, besides the above.
In addition Jonny Törnbom commented:
SCM_CREDENTIALS is a control message type, not a socket option, so using
setsockopt(...SCM_CREDENTIALS...) is potentially dangerous and wrong and
should be deleted from the code. (SCM_CREDENTIALS is used in conjuction
with SO_PASSCRED which is the socket option to use.)
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index d8922888..b0247d6e 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -427,10 +427,6 @@ openLogSocket(lstn_t *pLstn) errmsg.LogError(errno, NO_ERRCODE, "set SO_PASSCRED failed on '%s'", pLstn->sockName); pLstn->bUseCreds = 0; } - if(setsockopt(pLstn->fd, SOL_SOCKET, SCM_CREDENTIALS, &one, sizeof(one)) != 0) { - errmsg.LogError(errno, NO_ERRCODE, "set SCM_CREDENTIALS failed on '%s'", pLstn->sockName); - pLstn->bUseCreds = 0; - } // TODO: move to its own #if if(setsockopt(pLstn->fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one)) != 0) { errmsg.LogError(errno, NO_ERRCODE, "set SO_TIMESTAMP failed on '%s'", pLstn->sockName); |