NetBSD Problem Report #47449

From dholland@netbsd.org  Tue Jan 15 05:20:34 2013
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 595DE63E893
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 15 Jan 2013 05:20:34 +0000 (UTC)
Message-Id: <20130115052034.11B9414A4B0@mail.netbsd.org>
Date: Tue, 15 Jan 2013 05:20:34 +0000 (UTC)
From: dholland@netbsd.org
Reply-To: dholland@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: syslogd doesn't honor mesg n
X-Send-Pr-Version: 3.95

>Number:         47449
>Category:       bin
>Synopsis:       syslogd doesn't honor mesg n
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 15 05:25:00 +0000 2013
>Closed-Date:    Mon Feb 25 07:49:58 +0000 2013
>Last-Modified:  Mon Feb 25 07:49:58 +0000 2013
>Originator:     David A. Holland
>Release:        NetBSD 6.99.16 (20120115)
>Organization:
>Environment:
System: NetBSD macaran 6.99.11 NetBSD 6.99.11 (MACARAN) #15: Mon Oct 15 21:24:31 EDT 2012  dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

syslogd does not honor mesg n (g+w permission) on the ttys of users it
sends logs to.

This is a nuisance sometimes.

>How-To-Repeat:

Create a test user, add it as a destination in syslog.conf (e.g.
cron.*	testuser), log in, set mesg n, and watch the messages roll in
regardless.

>Fix:

As syslogd runs as root it needs to explicitly check for g+w
permission, instead of just using the same tty message code as other
things and assuming it'll get EACCES when mesg n is set.

Probably it should also override mesg n for LOG_EMERG messages, which
are traditionally walled to everyone.

>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: bin/47449: syslogd doesn't honor mesg n
Date: Tue, 15 Jan 2013 11:53:29 -0500

 On Jan 15,  5:25am, dholland@netbsd.org (dholland@netbsd.org) wrote:
 -- Subject: bin/47449: syslogd doesn't honor mesg n

 | syslogd does not honor mesg n (g+w permission) on the ttys of users it
 | sends logs to.
 | 
 | This is a nuisance sometimes.
 | 
 | >How-To-Repeat:
 | 
 | Create a test user, add it as a destination in syslog.conf (e.g.
 | cron.*	testuser), log in, set mesg n, and watch the messages roll in
 | regardless.
 | 
 | >Fix:
 | 
 | As syslogd runs as root it needs to explicitly check for g+w
 | permission, instead of just using the same tty message code as other
 | things and assuming it'll get EACCES when mesg n is set.
 | 
 | Probably it should also override mesg n for LOG_EMERG messages, which
 | are traditionally walled to everyone.

 Do you have an example syslogd implementation in mind that honors that?
 What about messages explicitly sent to that user?

 christos

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/47449: syslogd doesn't honor mesg n
Date: Tue, 15 Jan 2013 17:53:25 +0000

 On Tue, Jan 15, 2013 at 04:55:05PM +0000, Christos Zoulas wrote:
  >  Do you have an example syslogd implementation in mind that honors that?
  >  What about messages explicitly sent to that user?

 What do you mean?

 I routinely put

    stuff			dholland

 in syslog.conf on server-type machines, but it's useful to be able to
 silence that in some ttys when working on them.

 -- 
 David A. Holland
 dholland@netbsd.org

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	dholland@netbsd.org
Cc: 
Subject: Re: bin/47449: syslogd doesn't honor mesg n
Date: Tue, 15 Jan 2013 13:07:46 -0500

 On Jan 15,  5:55pm, dholland-bugs@netbsd.org (David Holland) wrote:
 -- Subject: Re: bin/47449: syslogd doesn't honor mesg n

 |  On Tue, Jan 15, 2013 at 04:55:05PM +0000, Christos Zoulas wrote:
 |   >  Do you have an example syslogd implementation in mind that honors that?
 |   >  What about messages explicitly sent to that user?
 |  
 |  What do you mean?
 |  
 |  I routinely put
 |  
 |     stuff			dholland
 |  
 |  in syslog.conf on server-type machines, but it's useful to be able to
 |  silence that in some ttys when working on them.

 That is exactly what I mean. I wanted your opinion on what to do for messages
 explicitly sent to the user. This leaves only one question unanswered :-)
 I want to know because I'd like to look at their implementation, not just
 from curiosity.

 christos

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	dholland@netbsd.org
Cc: 
Subject: Re: bin/47449: syslogd doesn't honor mesg n
Date: Tue, 15 Jan 2013 13:09:30 -0500

 On Jan 15,  1:07pm, christos@zoulas.com (Christos Zoulas) wrote:
 -- Subject: Re: bin/47449: syslogd doesn't honor mesg n

 What about wall messages?

 christos

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/47449 CVS commit: src/usr.sbin/syslogd
Date: Tue, 15 Jan 2013 17:37:04 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Tue Jan 15 22:37:04 UTC 2013

 Modified Files:
 	src/usr.sbin/syslogd: syslogd.c

 Log Message:
 PR/47449: David Holland: Don't log to terminals with mesg n, unless it is a
 wall message.


 To generate a diff of this commit:
 cvs rdiff -u -r1.112 -r1.113 src/usr.sbin/syslogd/syslogd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 25 Feb 2013 07:49:58 +0000
State-Changed-Why:
fixed, thanks


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.