[Pkg-kbd-devel] Bug#522453: fgconsole doesn't work as user

Jakub Wilk jwilk at jwilk.net
Mon Sep 5 07:06:58 BST 2022


* Michael Schutte <michi at uiae.at>, 2009-04-05 10:41:
>This is true.  It doesn’t only affect fgconsole, but also chvt, openvt 
>and any other kbd utility which tries to get a console file descriptor. 
>These programs do their job by trying to open/ioctl these files (in 
>this order):
>
>	/proc/self/fd/0		(is a pseudo tty in your case)
>	/dev/tty		(also PTY)
>	/dev/tty0		(only accessible to root)
>	/dev/vc/0		(doesn’t exist nowadays)
>	/dev/console		(root)
>	std{in,out,err}		(PTY)
>
>As none of these is able to respond to a VT_GETSTATE ioctl, fgconsole 
>and friends fail.  I’m afraid this situation won’t change.

These days there's world-readable /sys/class/tty/tty0/active, so 
fgconsole could be patched to use that.

-- 
Jakub Wilk



More information about the Pkg-kbd-devel mailing list