Subject: bin/355: write(1) should only print a warning if no reply possible
To: None <gnats-admin>
From: Mark Weaver <mhw@cs.brown.edu>
List: netbsd-bugs
Date: 07/20/1994 22:20:07
>Number: 355
>Category: bin
>Synopsis: write(1) should only print a warning if no reply possible
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gnats-admin (Utility Bug People)
>State: open
>Class: change-request
>Submitter-Id: mhw
>Arrival-Date: Wed Jul 20 22:20:04 1994
>Originator: Mark Weaver
>Organization:
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu | Brown University
PGP Key: finger mhw@cs.brown.edu | Dept of Computer Science
>Release: NetBSD 1.0-ALPHA 20-July-1994
>Environment:
System: NetBSD cis-ts3-slip4.cis.brown.edu 1.0-ALPHA NetBSD 1.0-ALPHA (EXCELSIOR) #4: Sun Jul 17 23:46:04 EDT 1994 mhw@cis-ts3-slip4.cis.brown.edu:/usr/src/sys/arch/i386/compile/EXCELSIOR i386
>Description:
Currently, write(1) won't work if the tty you're on is set to
'mesg n'. I propose to change this to a warning message instead.
When I run X, I have many overlapping xterms, and messages
often go to a hidden window where I can't see them. To solve
this, I turn off messages to all but one tiny window up at the
top. The problem is, I can't use write(1) anywhere except that
tiny window.
Incidentally, Solaris 2.3 prints a warning, but still allows
you to do the write. Not that NetBSD == Solaris, (I hope not! :)
but I still think a warning is quite sufficient and preferable.
I have been running with this patch for several months
with no problems.
>How-To-Repeat:
>Fix:
*** src/usr.bin/write/write.c.mhw1 Fri Dec 17 02:22:31 1993
--- src/usr.bin/write/write.c Thu Jul 21 01:00:50 1994
***************
*** 90,97 ****
exit(1);
if (!msgsok) {
(void)fprintf(stderr,
! "write: you have write permission turned off.\n");
! exit(1);
}
myuid = getuid();
--- 90,97 ----
exit(1);
if (!msgsok) {
(void)fprintf(stderr,
! "warning: you have write permission turned off; "
! "no reply possible\n");
}
myuid = getuid();
>Audit-Trail:
>Unformatted:
------------------------------------------------------------------------------