From owner-freebsd-bugs Wed Sep 27 13:10:13 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA12907 for bugs-outgoing; Wed, 27 Sep 1995 13:10:13 -0700 Received: (from gnats@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA12901 ; Wed, 27 Sep 1995 13:10:07 -0700 Resent-Date: Wed, 27 Sep 1995 13:10:07 -0700 Resent-Message-Id: <199509272010.NAA12901@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, hohmuth@inf.tu-dresden.de Received: from irs201.inf.tu-dresden.de ([141.76.16.201]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA12688 for ; Wed, 27 Sep 1995 13:02:09 -0700 Received: (from hohmuth@localhost) by irs201.inf.tu-dresden.de (8.6.11/8.6.9) id VAA01103; Wed, 27 Sep 1995 21:01:39 +0100 Message-Id: <199509272001.VAA01103@irs201.inf.tu-dresden.de> Date: Wed, 27 Sep 1995 21:01:39 +0100 From: hohmuth@inf.tu-dresden.de Reply-To: hohmuth@inf.tu-dresden.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/746: `talk' forbids talking from write-protected terminal for no good reason Sender: owner-bugs@freebsd.org Precedence: bulk >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: