Subject: kern/21304: removal of the UCONSOLE option broke xconsole
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin Husemann <martin@aprisoft.de>
List: netbsd-bugs
Date: 04/24/2003 12:48:40
>Number:         21304
>Category:       kern
>Synopsis:       removal of the UCONSOLE option broke xconsole
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 24 10:49:03 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Martin Husemann
>Release:        NetBSD 1.6R
>Organization:
>Environment:

System: NetBSD beasty.aprisoft.de 1.6R NetBSD 1.6R (BEASTY) #0: Wed Apr 23 11:35:41 CEST 2003 martin@beasty.aprisoft.de:/usr/src/sys/arch/i386/compile/BEASTY i386
Architecture: i386
Machine: i386
>Description:

This change removed the UCONSOLE option:

RCS file: /cvsroot/src/sys/kern/tty.c,v
revision 1.151
date: 2003/04/10 22:05:57;  author: christos;  state: Exp;  lines: +15 -9
PR/732: Matt Green: TIOCCONS should work if the user owns /dev/console.

Unfortunately now xconsole does not work any more, if you do not log in
on ttyE0 (on i386) and use startx.

>How-To-Repeat:

Configure gdm or xdm and the X server on (say) vt5.
Log in, start xconsole and watch it fail:

 22262 xconsole RET   open 5
 22262 xconsole CALL  ioctl(0x5,TIOCCONS,0xbfbff910)
 22262 xconsole NAMI  "/dev/console"
 22262 xconsole RET   ioctl -1 errno 13 Permission denied

The new code seems to check for read permission on /dev/console, which in
the default setup a user only has if he logs in on ttyE0.

>Fix:
n/a
>Release-Note:
>Audit-Trail:
>Unformatted: