bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] Patch For Issue and Another Related Bug


From: Anthony Awtrey
Subject: [bug-inetutils] Patch For Issue and Another Related Bug
Date: Mon, 26 Jul 2004 15:45:35 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.1) Gecko/20040715 Debian/1.7.1-1

Found the bug!

The state of the NoForward variable is unset unless forwarding is explicitly disabled via command line parameter when it is set to 1. The test of that variable on line 1303 of syslogd.c is logically reversed. The debug message indicates that it should evaluate true if forwarding is disabled and in fact evaluates the opposite. Here is the patch.

File is here: inetutils-1.4.2+20040207/syslogd/syslogd.c

### Patch Starts Here ###
--- syslogd.c.orig      2004-07-26 14:33:25.000000000 -0400
+++ syslogd.c   2004-07-26 14:49:24.000000000 -0400
@@ -1300,7 +1300,7 @@
     dbg_printf (" %s\n", f->f_un.f_forw.f_hname);
     if (strcasecmp (from, LocalHostName) && NoHops)
       dbg_printf ("Not forwarding remote message.\n");
-    else if (!NoForward)
+    else if (NoForward)
       dbg_printf ("Not forwarding because forwarding is disabled.\n");
     else if (finet < 0)
       dbg_printf ("Not forwarding because of invalid inet fd.\n");
### Patch Ends Here ###

This will correct the bug and allow remote logging as normal. There is another issue that I noted that I haven't spent the time to truly investigate. The init() function called on line 561 of syslogd.c runs a logmsg() to log the syslogd starting, but finet (the inet socket file descriptor) has not been initialized at this point in the code, so that initial message fails to be sent to the remote log server.

I assume moving the init() function until after the finet socket file descriptor has been created would correct this, but I have not taken this step due to the Law of Unforeseen Consequences. Frankly, I can live with the syslogd start-up message being dropped if all the rest of them get logged on our log server. Maybe someone can look at the issue and roll a fix into the official version.

Hope this helps.

T
--
Anthony L. Awtrey
Vice President
[T]  407.999.9870 x13
[F]  407.999.9850

I.D.E.A.L. Technology Corporation
http://www.idealcorp.com

"The Leader in Linux and Open Source Solutions"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]