From timesink.spk.wa.us!kew@tau-ceti.isc-br.com  Thu Dec  1 12:11:07 1994
Received: from tau-ceti.isc-br.com (tau-ceti.isc-br.com [129.189.2.133]) by freefall.cdrom.com (8.6.8/8.6.6) with SMTP id MAA00287 for <FreeBSD-gnats-submit@freebsd.org>; Thu, 1 Dec 1994 12:06:02 -0800
Received: by tau-ceti.isc-br.com (Smail3.1.28.1 #4)
	id m0rDGXe-0000tpC; Thu, 1 Dec 94 10:47 PST
Received: (from kew@localhost) by timesink.spk.wa.us (8.6.9/8.6.6) id JAA03366; Thu, 1 Dec 1994 09:11:45 -0800
Message-Id: <199412011711.JAA03366@timesink.spk.wa.us>
Date: Thu, 1 Dec 1994 09:11:45 -0800
From: kew@timesink.spk.wa.us
Reply-To: kew@timesink.spk.wa.us
To: FreeBSD-gnats-submit@freebsd.org
Subject: MAKEDEV deletes wrong files when creating cua/tty files.
X-Send-Pr-Version: 3.2

>Number:         36
>Category:       misc
>Synopsis:       MAKEDEV tty01 deletes cua01 and vice-versa
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    core (FreeBSD core team)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec  1 13:00:01 1994
>Closed-Date:    Fri Dec  2 13:01:18 PST 1994
>Last-Modified:
>Originator:     Keith Walker
>Release:        FreeBSD 2.0-RELEASE i386
>Organization:
>Environment:

	FreeBSD 2.0-Release

>Description:

	When running 'MAKEDEV tty0?' the corresponding cua files are
	deleted. When doing a 'MAKEDEV cua0?' command, the corresponding
	tty files are deleted.

	The permissions for the tw0 device are wrong. Ownership is
	root.wheel -- the xtend program runs as setuid-bin.

>How-To-Repeat:

	cd /dev
	sh MAKEDEV tty01	# see the cua*01 files disappear!

	sh MAKEDEV tw0		# ownership is root.wheel

>Fix:
	
--- MAKEDEV.orig	Wed Nov 30 10:21:54 1994
+++ MAKEDEV	Wed Nov 30 10:25:25 1994
@@ -422,7 +422,7 @@
 	unit=`expr $i : 'tw\(.*\)'`
 	rm -f tw$unit
 	mknod tw$unit c 19 $unit
-	chown root.wheel tw$unit
+	chown bin.bin tw$unit
 	;;
 
 # hv 22-apr-93 use this to create the necessary video device for
@@ -466,7 +466,7 @@
 
 cua0?|cua?|ttyd?)
 	unit=`expr $i : '...[d0]*\(.\)$'`
-	rm -f tty*0$unit cua*0$unit tty*d$unit
+	rm -f cua*0$unit tty*d$unit
 	case $unit in
 	[0-9]) m=$unit;;
 	a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
@@ -487,7 +487,7 @@
 
 tty0?|tty?)
 	unit=`expr $i : 'tty0*\(.\)$'`
-	rm -f tty*0$unit cua*0$unit tty*d$unit
+	rm -f tty*0$unit
 	case $unit in
 	[0-9]) m=$unit;;
 	a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;




>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Fri Dec  2 13:01:18 PST 1994
State-Changed-Why:  
Fix adopted.
>Unformatted:




