summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net.c8
-rw-r--r--plugins/imtcp/imtcp.c16
-rw-r--r--plugins/imudp/imudp.c1
-rw-r--r--syslogd.c31
4 files changed, 27 insertions, 29 deletions
diff --git a/net.c b/net.c
index fdeb71da..8a1f7231 100644
--- a/net.c
+++ b/net.c
@@ -340,7 +340,7 @@ void PrintAllowedSenders(int iListToPrint)
#endif
);
- printf("\nAllowed %s Senders:\n",
+ dbgprintf("Allowed %s Senders:\n",
(iListToPrint == 1) ? "UDP" :
#ifdef USE_GSSAPI
(iListToPrint == 3) ? "GSS" :
@@ -353,16 +353,16 @@ void PrintAllowedSenders(int iListToPrint)
#endif
pAllowedSenders_TCP;
if(pSender == NULL) {
- printf("\tNo restrictions set.\n");
+ dbgprintf("\tNo restrictions set.\n");
} else {
while(pSender != NULL) {
if (F_ISSET(pSender->allowedSender.flags, ADDR_NAME))
- printf ("\t%s\n", pSender->allowedSender.addr.HostWildcard);
+ dbgprintf ("\t%s\n", pSender->allowedSender.addr.HostWildcard);
else {
if(getnameinfo (pSender->allowedSender.addr.NetAddr,
SALEN(pSender->allowedSender.addr.NetAddr),
(char*)szIP, 64, NULL, 0, NI_NUMERICHOST) == 0) {
- printf ("\t%s/%u\n", szIP, pSender->SignificantBits);
+ dbgprintf ("\t%s/%u\n", szIP, pSender->SignificantBits);
} else {
/* getnameinfo() failed - but as this is only a
* debug function, we simply spit out an error and do
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index 8639baf3..1efd5316 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -198,6 +198,10 @@ BEGINwillRun
CODESTARTwillRun
/* first apply some config settings */
dbgprintf("imtcp: bEnableTCP %d\n", bEnableTCP);
+ PrintAllowedSenders(2); /* TCP */
+#ifdef USE_GSSAPI
+ PrintAllowedSenders(3); /* GSS */
+#endif
if (bEnableTCP) {
if(sockTCPLstn == NULL) {
/* even when doing a re-init, we do not shut down and
@@ -226,6 +230,18 @@ ENDwillRun
BEGINafterRun
CODESTARTafterRun
/* do cleanup here */
+dbgprintf("call clearAllowedSenders(0x%lx)\n", (unsigned long) pAllowedSenders_TCP);
+ if (pAllowedSenders_TCP != NULL) {
+ clearAllowedSenders (pAllowedSenders_TCP);
+ pAllowedSenders_TCP = NULL;
+ }
+#ifdef USE_GSSAPI
+dbgprintf("call clearAllowedSenders(0x%lx)\n", (unsigned long) pAllowedSenders_GSS);
+ if (pAllowedSenders_GSS != NULL) {
+ clearAllowedSenders (pAllowedSenders_GSS);
+ pAllowedSenders_GSS = NULL;
+ }
+#endif
ENDafterRun
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 5aebc9b5..f3a2b72a 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -152,6 +152,7 @@ ENDrunInput
/* initialize and return if will run or not */
BEGINwillRun
CODESTARTwillRun
+ PrintAllowedSenders(1); /* UDP */
if((udpLstnSocks = create_udp_socket(NULL, (uchar*)LogPort, 1)) != NULL)
dbgprintf("Opened %d syslog UDP port(s).\n", *udpLstnSocks);
diff --git a/syslogd.c b/syslogd.c
index e1179720..15d88cd4 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -3276,16 +3276,6 @@ static void dbgPrintInitInfo(void)
if(bDebugPrintCfSysLineHandlerList)
dbgPrintCfSysLineHandlers();
-#ifdef SYSLOG_INET
- /* now the allowedSender lists: */
- PrintAllowedSenders(1); /* UDP */
- PrintAllowedSenders(2); /* TCP */
-#ifdef USE_GSSAPI
- PrintAllowedSenders(3); /* GSS */
-#endif
- printf("\n");
-#endif /* #ifdef SYSLOG_INET */
-
printf("Messages with malicious PTR DNS Records are %sdropped.\n",
bDropMalPTRMsgs ? "" : "not ");
@@ -3453,21 +3443,6 @@ init(void)
eDfltHostnameCmpMode = HN_NO_COMP;
Forwarding = 0;
-#ifdef SYSLOG_INET
- if (restart) {
- if (pAllowedSenders_TCP != NULL) {
- clearAllowedSenders (pAllowedSenders_TCP);
- pAllowedSenders_TCP = NULL;
- }
-#ifdef USE_GSSAPI
- if (pAllowedSenders_GSS != NULL) {
- clearAllowedSenders (pAllowedSenders_GSS);
- pAllowedSenders_GSS = NULL;
- }
-#endif
- }
-#endif
-
/* I was told by an IPv6 expert that calling getservbyname() seems to be
* still valid, at least for the use case we have. So I re-enabled that
* code. rgerhards, 2007-07-02
@@ -4597,6 +4572,11 @@ mainloop(void)
*/
static void checkPermissions()
{
+#if 0
+ /* TODO: this function must either be redone or removed - now with the input modules,
+ * there is no such simple check we can do. What we can check, however, is if there is
+ * any input module active and terminate, if not. -- rgerhards, 2007-12-26
+ */
/* we are not root */
if (geteuid() != 0)
{
@@ -4621,6 +4601,7 @@ static void checkPermissions()
}
#endif
}
+#endif
}