xterm -C and TIOCCONS vs. PRIV_TTY_CONSOLE

Gary Jennejohn gljennjohn at googlemail.com
Fri Jan 7 10:58:16 UTC 2011


On Thu, 06 Jan 2011 19:15:35 -0800
Craig Leres <leres at ee.lbl.gov> wrote:

> I recently upgraded my desktop from 7.2-RELEASE to 8.1-RELEASE and
> noticed that I no longer get biff messages in my "console" xterm window.
> I traced this to:
> 
>     xterm: cannot open console: Operation not permitted
> 
> and see that the TIOCCONS code in tty_generic_ioctl() is checking for
> PRIV_TTY_CONSOLE. So far so good. But I don't *any* code that ever
> grants PRIV_TTY_CONSOLE! As far as I can tell it's now totally
> impossible to ever set a terminal as a console TTY (even for root). This
> ioctl has been effectively disabled.
> 
> Shouldn't PRIV_TTY_CONSOLE be granted when a user logs onto /dev/ttyvX?
> 

See the reply I just posted to current.

If your xterm is setuid root it does work, because the privilege checking
code doesn't look at the credential passed in.

It's still a bug, but you can work around it.

-- 
Gary Jennejohn


More information about the freebsd-hackers mailing list