summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2023-11-10 18:49:22 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2023-11-10 18:49:22 +0000
commitf94c8b00738e4837446c6b2f70213915b9d8d10c (patch)
tree5272d2a579b2fe3454d018baa59dcb4028404802 /app
parentee52993c44af63caaa2f544a9e4020ba4eb37d39 (diff)
Add group handling to match fbtab(5). Suggested by and ok aja@
Diffstat (limited to 'app')
-rw-r--r--app/xenodm/config/GiveConsole.in10
-rw-r--r--app/xenodm/config/TakeConsole.in8
2 files changed, 10 insertions, 8 deletions
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