From markk@knigma.org  Tue Dec 21 13:52:08 2004
Return-Path: <markk@knigma.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6DAC316A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Dec 2004 13:52:08 +0000 (GMT)
Received: from shrewd.pub.knigma.org (shrewd.pub.knigma.org [81.2.102.154])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8CEE443D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Dec 2004 13:52:07 +0000 (GMT)
	(envelope-from markk@knigma.org)
Received: from shrewd.pub.knigma.org (localhost [127.0.0.1])
	by shrewd.pub.knigma.org (8.13.1/8.13.1) with ESMTP id iBLDq5mh009932
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 21 Dec 2004 13:52:06 GMT
	(envelope-from mkn@shrewd.pub.knigma.org)
Received: (from mkn@localhost)
	by shrewd.pub.knigma.org (8.13.1/8.13.1/Submit) id iBLDq5sM009931;
	Tue, 21 Dec 2004 13:52:05 GMT
	(envelope-from mkn)
Message-Id: <200412211352.iBLDq5sM009931@shrewd.pub.knigma.org>
Date: Tue, 21 Dec 2004 13:52:05 GMT
From: Mark Knight <markk@knigma.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: amd logs to /dev/console when it shouldn't
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75356
>Category:       bin
>Synopsis:       amd logs to /dev/console when it shouldn't
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 21 14:00:50 GMT 2004
>Closed-Date:    Mon Dec 27 09:52:13 GMT 2004
>Last-Modified:  Mon Dec 27 09:52:13 GMT 2004
>Originator:     Mark Knight
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD shrewd.pub.knigma.org 5.3-STABLE FreeBSD 5.3-STABLE #0: Sat Dec 18 20:47:21 GMT 2004 root@shrewd.pub.knigma.org:/slave/usr/obj/usr/src/sys/SHREWD i386
>Description:
I've just updated to a more recent snapshot of RELENG_5 (last updated
early November).  Now, every hour this appears in my console:

  amd[473]: reload of map /etc/amd.map is not needed (in sync)

Hardly serious, but annoying.

The only line that mentions amd in rc.conf is amd_enable="YES".  I have 
no amd.conf file.  

ps shows:

  /usr/sbin/amd -p -a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map

so it looks like the -l syslog isn't working properly.  I've now
seen this on two machines.
>How-To-Repeat:
Put amd_enable="YES" in rc.conf and reboot.

>Fix:
>Release-Note:
>Audit-Trail:

From: Mark Knight <markk@knigma.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/75356: amd logs to /dev/console when it shouldn't
Date: Wed, 22 Dec 2004 12:09:17 +0000

 The problem looks related to recent changes to syslogd and libc, to log
 via /var/run/logpriv for privileged processes.
 
 The program below works running as a mortal, but logs to the console if
 run as root.
 
 #include <syslog.h>
 #include <stdarg.h>
 
 int main(int argc, char *argv[])
 {
   openlog("test", LOG_CONS, LOG_LOCAL0);
 
   syslog(LOG_INFO, "%s", "test");
 
   closelog();
 }
 -- 
 Mark A. R. Knight                               finger: markk@knigma.org
 Tel: +44 7973 410732                            http://www.knigma.org/

From: Mark Knight <markk@knigma.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/75356: amd logs to /dev/console when it shouldn't
Date: Fri, 24 Dec 2004 00:11:22 +0000

 Here's the fix:
 
 Index: syslog.c
 ===================================================================
 RCS file: /home/ncvs/src/lib/libc/gen/syslog.c,v
 retrieving revision 1.30.2.1
 diff -u -r1.30.2.1 syslog.c
 --- syslog.c    5 Dec 2004 18:26:07 -0000       1.30.2.1
 +++ syslog.c    23 Dec 2004 23:56:15 -0000
 @@ -277,6 +277,8 @@
                         if (status == CONNPRIV)
                                 break;
                 } while (errno == ENOBUFS);
 +       } else {
 +               return;
         }
 
         /*
 
 -- 
 Mark A. R. Knight                               finger: markk@knigma.org
 Tel: +44 7973 410732                            http://www.knigma.org/
Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: brian 
Responsible-Changed-When: Fri Dec 24 01:00:02 GMT 2004 
Responsible-Changed-Why:  
The patch looks sane to me - assigning to Gleb (the author) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75356 
State-Changed-From-To: open->patched 
State-Changed-By: glebius 
State-Changed-When: Fri Dec 24 09:09:54 GMT 2004 
State-Changed-Why:  
Commited, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75356 
State-Changed-From-To: patched->closed 
State-Changed-By: glebius 
State-Changed-When: Mon Dec 27 09:51:48 GMT 2004 
State-Changed-Why:  
Fix MFCed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75356 
>Unformatted:
