diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-06 10:30:10 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-06 10:30:10 +0200 |
commit | 759904862dab6e580c6b890fd9ed75e1f29271f1 (patch) | |
tree | b804f701bca837c63827d40bdf40ba5602fd3416 | |
parent | ff2bb192f2c566f189a9d104d83d7a70c7888774 (diff) | |
download | rsyslog-759904862dab6e580c6b890fd9ed75e1f29271f1.tar.gz rsyslog-759904862dab6e580c6b890fd9ed75e1f29271f1.tar.xz rsyslog-759904862dab6e580c6b890fd9ed75e1f29271f1.zip |
step: imtcp did not properly handle privilege drop
-rw-r--r-- | plugins/imtcp/imtcp.c | 6 | ||||
-rw-r--r-- | runtime/nsd_ptcp.c | 6 | ||||
-rw-r--r-- | runtime/rsconf.c | 2 | ||||
-rw-r--r-- | tcpsrv.c | 1 |
4 files changed, 5 insertions, 10 deletions
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index 3978ff5d..976fbf1f 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -339,6 +339,7 @@ CODESTARTactivateCnfPrePrivDrop } if(pOurTcpsrv == NULL) ABORT_FINALIZE(RS_RET_NO_RUN); + CHKiRet(tcpsrv.ConstructFinalize(pOurTcpsrv)); finalize_it: ENDactivateCnfPrePrivDrop @@ -357,12 +358,7 @@ ENDfreeCnf */ 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 diff --git a/runtime/nsd_ptcp.c b/runtime/nsd_ptcp.c index c8915231..dd6764fa 100644 --- a/runtime/nsd_ptcp.c +++ b/runtime/nsd_ptcp.c @@ -486,7 +486,7 @@ LstnInit(netstrms_t *pNS, void *pUsr, rsRetVal(*fAddLstn)(void*,netstrm_t*), #endif ) { /* TODO: check if *we* bound the socket - else we *have* an error! */ - dbgprintf("error %d while binding tcp socket", errno); + dbgprintf("error %d while binding tcp socket\n", errno); close(sock); sock = -1; continue; @@ -498,7 +498,7 @@ LstnInit(netstrms_t *pNS, void *pUsr, rsRetVal(*fAddLstn)(void*,netstrm_t*), * 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.", + dbgprintf("listen with a backlog of %d failed - retrying with default of 32.\n", iSessMax / 10 + 5); if(listen(sock, 32) < 0) { dbgprintf("tcp listen error %d, suspending\n", errno); @@ -531,7 +531,7 @@ LstnInit(netstrms_t *pNS, void *pUsr, rsRetVal(*fAddLstn)(void*,netstrm_t*), "- this may or may not be an error indication.\n", numSocks, maxs); if(numSocks == 0) { - dbgprintf("No TCP listen sockets could successfully be initialized"); + dbgprintf("No TCP listen sockets could successfully be initialized\n"); ABORT_FINALIZE(RS_RET_COULD_NOT_BIND); } diff --git a/runtime/rsconf.c b/runtime/rsconf.c index 94190d76..0f944539 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -357,7 +357,7 @@ tellModulesActivateConfigPrePrivDrop(void) if( node->pMod->beginCnfLoad != NULL && node->pMod->activateCnfPrePrivDrop != NULL && node->canActivate) { - DBGPRINTF("activating config %p for module %s\n", + 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) { @@ -897,7 +897,6 @@ tcpsrvConstructFinalize(tcpsrv_t *pThis) /* set up listeners */ CHKmalloc(pThis->ppLstn = calloc(pThis->iLstnMax, sizeof(netstrm_t*))); CHKmalloc(pThis->ppLstnPort = calloc(pThis->iLstnMax, sizeof(tcpLstnPortList_t*))); -dbgprintf("XXXX: open sockets (tcpsrv)\n"); iRet = pThis->OpenLstnSocks(pThis); finalize_it: |