[1600] in linux-security and linux-alert archive

home help back first fref pref prev next nref lref last post

[linux-security] Sysklogd's -r option

daemon@ATHENA.MIT.EDU (Andi Kleen)
Thu Sep 4 03:59:05 1997

To: bugs@redhat.com
cc: linux-security@redhat.com
Date: Wed, 03 Sep 1997 21:15:08 +0200
From: Andi Kleen <andi@zero.aec.at>
Resent-From: linux-security@redhat.com
Reply-To: linux-security@redhat.com


sysklogd in RH4.2 always opens a UDP listen socket, even when -r
is not specified on the command line. It doesn't check the file descriptor
when -r is off though, but the behaviour still irritates the
system administrator greatly (see also the recent bugtraq messages
about this).

Here is a patch to fix this:

--- sysklogd-1.3/syslogd.c-o	Wed Sep  3 22:19:26 1997
+++ sysklogd-1.3/syslogd.c	Wed Sep  3 22:19:39 1997
@@ -791,7 +791,7 @@
 					(char *) &on, sizeof(on)) < 0 ) {
 				logerror("setsockopt, suspending inet");
 			}
-			else {
+			else if (AcceptRemote) {
 				if (bind(finet, (struct sockaddr *) &sin, \
 					 sizeof(sin)) < 0) {
 					logerror("bind, suspending inet");
@@ -1834,7 +1834,7 @@
 
 	/* Close the sockets. */
         close(funix);
-	close(inetm);
+	if (InetInuse) close(inetm);
 
 	/* Clean-up files. */
 	(void) unlink(LogName);

-Andi


home help back first fref pref prev next nref lref last post