CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]  2026/11/07 02:59:53

Modified files:
        distrib/sets/lists/comp: mi 
        distrib/sets/lists/etc: mi 
        distrib/sets/lists/man: mi 
        etc            : Makefile changelist 
        etc/etc.alpha  : MAKEDEV 
        etc/etc.amd64  : MAKEDEV 
        etc/etc.arm64  : MAKEDEV 
        etc/etc.armv7  : MAKEDEV 
        etc/etc.hppa   : MAKEDEV 
        etc/etc.i386   : MAKEDEV 
        etc/etc.landisk: MAKEDEV 
        etc/etc.luna88k: MAKEDEV 
        etc/etc.macppc : MAKEDEV 
        etc/etc.octeon : MAKEDEV 
        etc/etc.powerpc64: MAKEDEV 
        etc/etc.riscv64: MAKEDEV 
        etc/etc.sparc64: MAKEDEV 
        etc/mtree      : special 
        include        : login_cap.h 
        lib/libc/gen   : login_cap.c 
        lib/libutil    : Makefile Symbols.map shlib_version util.h 
        libexec/getty  : main.c 
        sbin/init      : init.8 init.c 
        share/man/man5 : Makefile 
        share/man/man8 : afterboot.8 
        usr.bin/login  : login.1 login.c 
Added files:
        lib/libutil    : login_wscons.c 
Removed files:
        etc            : fbtab.head fbtab.tail 
        etc/etc.alpha  : fbtab 
        etc/etc.amd64  : fbtab 
        etc/etc.arm64  : fbtab 
        etc/etc.armv7  : fbtab 
        etc/etc.hppa   : fbtab 
        etc/etc.i386   : fbtab 
        etc/etc.landisk: fbtab 
        etc/etc.luna88k: fbtab 
        etc/etc.macppc : fbtab 
        etc/etc.octeon : fbtab 
        etc/etc.powerpc64: fbtab 
        etc/etc.riscv64: fbtab 
        etc/etc.sparc64: fbtab 
        lib/libutil    : login_fbtab.3 login_fbtab.c 
        share/man/man5 : fbtab.5 

Log message:
replace login_fbtab with the wscons group if the users is on the glass console

Historically login_fbtab(3) was called on user login to change permission
of devices for the user logging in on the console or xdm and this mechanism
had its quirks.

In in effort to make this better, introduce the LOGIN_SETWSCONSGROUP flag for
setusercontext(3), which will append the special wscons group to a user context
if the user is logging in on the "glass" console.

Callers of setusercontex(3) can also use the new login_wscons(const char *tty)
libutil function to determine if the tty is appropriate for setting the group.

The last part of this commit also changes the device node entries so that the
wscons group has write access to a specific list of devices that were previously
handled by fbtab, e.g. for amd64 (for other arches it might differ):

/dev/console
/dev/wskbd
/dev/wskbd0
/dev/wsmouse
/dev/wsmouse0
/dev/ttyCcfg
/dev/ttyC4
/dev/dri/card0
/dev/dri/renderD128

Additinally access to /dev/video is also granted (protected by a sysctl anyway).

This is a major crank for libutil due to the removal of login_fbtab.

tested by and ok aja@, landry@, matthieu@
let's do it by deraadt@, kettenis@

Reply via email to