From f94c8b00738e4837446c6b2f70213915b9d8d10c Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Fri, 10 Nov 2023 18:49:22 +0000 Subject: Add group handling to match fbtab(5). Suggested by and ok aja@ --- app/xenodm/config/GiveConsole.in | 10 ++++++---- app/xenodm/config/TakeConsole.in | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/xenodm/config/GiveConsole.in b/app/xenodm/config/GiveConsole.in index 2ae911247..2d26408d4 100644 --- a/app/xenodm/config/GiveConsole.in +++ b/app/xenodm/config/GiveConsole.in @@ -1,6 +1,6 @@ #!/bin/sh # Assign ownership of the console to the invoking user -# $OpenBSD: GiveConsole.in,v 1.2 2022/01/06 23:35:41 jsg Exp $ +# $OpenBSD: GiveConsole.in,v 1.3 2023/11/10 18:49:21 matthieu Exp $ # # By convention, both xconsole and xterm -C check that the # console is owned by the invoking user and is readable before attaching @@ -10,11 +10,13 @@ prefix="@prefix@" exec_prefix="@exec_prefix@" -chown $USER /dev/console +GROUP=`id -g $USER` + +chown $USER:$GROUP /dev/console if [ -c /dev/dri/card0 ]; then - chown $USER /dev/dri/card0 + chown $USER:$GROUP /dev/dri/card0 fi if [ -c /dev/dri/renderD128 ]; then - chown $USER /dev/dri/renderD128 + chown $USER:$GROUP /dev/dri/renderD128 fi @bindir@/sessreg -a -l $DISPLAY -u none $USER diff --git a/app/xenodm/config/TakeConsole.in b/app/xenodm/config/TakeConsole.in index 46fde4ea8..35300d734 100644 --- a/app/xenodm/config/TakeConsole.in +++ b/app/xenodm/config/TakeConsole.in @@ -1,17 +1,17 @@ #!/bin/sh # Reassign ownership of the console to root, this should disallow # assignment of console output to any random users's xterm -# $OpenBSD: TakeConsole.in,v 1.2 2022/01/06 23:35:41 jsg Exp $ +# $OpenBSD: TakeConsole.in,v 1.3 2023/11/10 18:49:21 matthieu Exp $ # prefix="@prefix@" exec_prefix="@exec_prefix@" -chown root /dev/console +chown root:wheel /dev/console chmod 622 /dev/console if [ -c /dev/dri/card0 ]; then - chown root /dev/dri/card0 + chown root:wheel /dev/dri/card0 fi if [ -c /dev/dri/renderD128 ]; then - chown root /dev/dri/renderD128 + chown root:wheel /dev/dri/renderD128 fi @bindir@/sessreg -d -l $DISPLAY -u none $USER -- cgit v1.2.3