Date: Wed, 27 Sep 1995 21:01:39 +0100 From: hohmuth@inf.tu-dresden.de To: FreeBSD-gnats-submit@freebsd.org Subject: bin/746: `talk' forbids talking from write-protected terminal for no good reason Message-ID: <199509272001.VAA01103@irs201.inf.tu-dresden.de> Resent-Message-ID: <199509272010.NAA12901@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 746
>Category: bin
>Synopsis: `talk' forbids talking from write-protected terminal for no good reason
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 27 13:10:03 PDT 1995
>Last-Modified:
>Originator: Michael Hohmuth
>Organization:
Dept. of Computer Science, TU Dresden, Germany
>Release: FreeBSD 2.0.5-RELEASE i386
>Environment:
"uname -a" yields:
FreeBSD olymp.inf.tu-dresden.de 2.0.5-RELEASE FreeBSD 2.0.5-RELEASE #0: Wed Jul 5 12:39:10 1995 root@olymp.inf.tu-dresden.de:/usr/src/sys/compile/OLYMP i386
>Description:
The `talk' program has a misfeature in that it cannot be used except
from a terminal with messages on ("mesg y"). When used from a
write-protected terminal (messages off, "mesg n"), it complains that
``The callee cannot write to this terminal, use "mesg y"''. While
this is indisputable, there is no good reason to forbid usage of the
`talk' program in this case: It is very well possible to establish a
`talk' session from a write-protected terminal; this can easily be
demonstrated after removing this misfeature.
(One might even argue _for_ write-protecting one's terminal before
initiating a `talk' session that this prevents other talk requests
from arriving in this very terminal.)
>How-To-Repeat:
olymp:~> mesg n
Exit 1
olymp:~> talk hohmuth@irs
talk: The callee cannot write to this terminal, use "mesg y".
Exit 1
>Fix:
diff -u /usr/src/usr.bin/talk/init_disp.c ./init_disp.c
--- /usr/src/usr.bin/talk/init_disp.c Tue May 30 08:34:33 1995
+++ ./init_disp.c Wed Sep 27 20:38:23 1995
@@ -51,22 +51,6 @@
#include "talk.h"
/*
- * Make sure the callee can write to the screen
- */
-void check_writeable()
-{
- char *tty;
- struct stat sb;
-
- if ((tty = ttyname(STDERR_FILENO)) == NULL)
- err(1, "ttyname");
- if (stat(tty, &sb) < 0)
- err(1, "%s", tty);
- if (!(sb.st_mode & S_IWGRP))
- errx(1, "The callee cannot write to this terminal, use \"mesg y\".");
-}
-
-/*
* Set up curses, catch the appropriate signals,
* and build the various windows.
*/
diff -u /usr/src/usr.bin/talk/talk.c ./talk.c
--- /usr/src/usr.bin/talk/talk.c Tue May 30 08:34:41 1995
+++ ./talk.c Wed Sep 27 20:38:56 1995
@@ -63,7 +63,6 @@
char *argv[];
{
get_names(argc, argv);
- check_writeable();
init_display();
open_ctl();
open_sockt();
>Audit-Trail:
>Unformatted:
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509272001.VAA01103>
