From nnd@wint.itfs.nsk.su  Mon Mar  5 03:29:53 2001
Return-Path: <nnd@wint.itfs.nsk.su>
Received: from wint.itfs.nsk.su (wint.itfs.nsk.su [212.20.32.43])
	by hub.freebsd.org (Postfix) with ESMTP id 24D2D37B719
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Mar 2001 03:29:52 -0800 (PST)
	(envelope-from nnd@wint.itfs.nsk.su)
Received: (from nnd@localhost)
	by wint.itfs.nsk.su (8.11.3/8.11.1) id f25BTnd00793;
	Mon, 5 Mar 2001 17:29:49 +0600 (NOVT)
	(envelope-from nnd)
Message-Id: <200103051129.f25BTnd00793@wint.itfs.nsk.su>
Date: Mon, 5 Mar 2001 17:29:49 +0600 (NOVT)
From: nnd@mail.nsk.ru
Reply-To: nnd@mail.nsk.ru
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Bug in the -CURRENT 'wall' command 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         25541
>Category:       bin
>Synopsis:       Bug in the -CURRENT 'wall' command
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 05 03:30:00 PST 2001
>Closed-Date:    Mon Mar 5 06:11:35 PST 2001
>Last-Modified:  Mon Mar 05 06:12:09 PST 2001
>Originator:     Nickolay Dudorov
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
STE Infoteka
>Environment:
System: FreeBSD wint.itfs.nsk.su 5.0-CURRENT FreeBSD 5.0-CURRENT #16: Mon Mar 5 13:44:50 NOVT 2001 nnd@wint.itfs.nsk.su:/usr/obj/usr/src/sys/WINTS i386


>Description:
	
	Version 1.7 of the 'src/usr.bin/wall/ttymsg.c' makes 
the device's names of the types : /dev/ttyp0, /dev/ttyp0ttyp1,
/dev/ttyp0ttyp1ttyp2 and thus  'wall' (despite the name - Write to ALL)
write the message only to the first one of them.

>How-To-Repeat:
	
	Use the 'wall' command on the system with more than one line
in use.

>Fix:

	Apply the next patch (or other one with the same effect ;-)


Index: src/usr.bin/wall/ttymsg.c
===================================================================
RCS file: /scratch/CVS/src/usr.bin/wall/ttymsg.c,v
retrieving revision 1.7
diff -b -u -r1.7 ttymsg.c
--- src/usr.bin/wall/ttymsg.c	2001/03/01 05:43:12	1.7
+++ src/usr.bin/wall/ttymsg.c	2001/03/05 11:11:56
@@ -71,7 +71,7 @@
 	if (iovcnt > sizeof(localiov) / sizeof(localiov[0]))
 		return ("too many iov's (change code in wall/ttymsg.c)");
 
-	strlcat(device, line, sizeof(device));
+	strlcpy(device + sizeof(_PATH_DEV) - 1, line, sizeof(device));
 	if (strchr(device + sizeof(_PATH_DEV) - 1, '/')) {
 		/* A slash is an attempt to break security... */
 		(void) snprintf(errbuf, sizeof(errbuf),
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ache 
State-Changed-When: Mon Mar 5 06:11:35 PST 2001 
State-Changed-Why:  
Commited. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25541 
>Unformatted:
