Bug 196742 - new feature for syslogd - obey mesg flag
Summary: new feature for syslogd - obey mesg flag
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-01-15 01:10 UTC by Jef Poskanzer
Modified: 2018-02-20 19:33 UTC (History)
1 user (show)

See Also:


Attachments
context diff for 10.0-R /usr/src/usr.sbin/syslogd/syslogd.c (1.71 KB, text/plain)
2015-01-15 01:10 UTC, Jef Poskanzer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jef Poskanzer 2015-01-15 01:10:30 UTC
Created attachment 151651 [details]
context diff for 10.0-R /usr/src/usr.sbin/syslogd/syslogd.c

Currently, when syslogd sends a message to a named user, all of that user's logged-in sessions receive the message. This can be annoying. It would be preferable to be able to designate one particular session to receive such messages.

This patch changes syslogd so that when sending a message to a named user, it obeys each session's mesg y/n setting. Sessions with mesg y get the message, sessions with mesg n do not. The patch does not affect messages to everyone ("*"), those still go through regardless of mesg settings.

Please find attached a context diff against the 10.0-RELEASE version of /usr/src/usr.sbin/syslogd/syslogd.c - it adds a wrapper routine that checks the mesg flag, and calls it in the appropriate place.

I have been using this patch since FreeBSD 4 in 2004, and it seems like time to try and get it into the release.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-11-25 20:01:16 UTC
A commit references this bug:

Author: lidl
Date: Wed Nov 25 20:01:12 UTC 2015
New revision: 291328
URL: https://svnweb.freebsd.org/changeset/base/291328

Log:
  Have syslogd honor 'mesg' status when logging to users.

  PR:		bin/196742
  Submitted by:	jef at mail acme com
  Approved by:	rpaulo (mentor)
  Differential Revision:	https://reviews.freebsd.org/D4270

Changes:
  head/usr.sbin/syslogd/syslogd.c