From nobody@FreeBSD.ORG Sun May  2 19:20:58 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 86BA414DDA; Sun,  2 May 1999 19:20:58 -0700 (PDT)
Message-Id: <19990503022058.86BA414DDA@hub.freebsd.org>
Date: Sun,  2 May 1999 19:20:58 -0700 (PDT)
From: cliff@steam.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: syslogd does not open UDP socket
X-Send-Pr-Version: www-1.0

>Number:         11458
>Category:       bin
>Synopsis:       syslogd does not open UDP socket
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May  2 19:30:00 PDT 1999
>Closed-Date:    Tue May 4 11:06:37 PDT 1999
>Last-Modified:  Tue May  4 11:07:12 PDT 1999
>Originator:     cliff skolnick
>Release:        3.1-stable
>Organization:
steam.com
>Environment:
FreeBSD lazlo.internal.steam.com 3.1-STABLE FreeBSD 3.1-STABLE #0: Sun May  2 17
:06:47 PDT 1999     cliff@lazlo.internal.steam.com:/usr/src/sys/compile/lazlo  i
386
>Description:
There is a bug in syslogd which makes it not listen on UDP port 514
unless two "-s" options are given on the command line, which is very
contrary to the man page.  It appears a logic error in syslog.c:397 is
to blame.  The program works as stated if changed to:

        if (SecureMode < 2)

Guess this explains why remote logging stopped on my system, but it is
now working after this change.  Fascist mode is cool, but you better
give people a way out!  More importantly the "-s -s" does the opposite
of the man page :/

Cliff
>How-To-Repeat:

run syslog, check netstat -af inet for something listening on
UDP 514.
>Fix:
*** syslogd.c-orig      Sat May  1 11:49:17 1999
--- syslogd.c   Sun May  2 18:45:51 1999
***************
*** 394,400 ****
                                die(0);
                }
        }
!       if (SecureMode > 1)
                finet = socket(AF_INET, SOCK_DGRAM, 0);
        if (finet >= 0) {
                struct servent *sp;
--- 394,400 ----
                                die(0);
                }
        }
!       if (SecureMode < 2)
                finet = socket(AF_INET, SOCK_DGRAM, 0);
        if (finet >= 0) {
                struct servent *sp;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: dt 
Responsible-Changed-When: Tue May 4 06:30:35 PDT 1999 
Responsible-Changed-Why:  
DES' bug. 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Tue May 4 11:06:37 PDT 1999 
State-Changed-Why:  
Fixed, thanks. 
>Unformatted:
