From 4fa5bb88de05a7af4acd4a96f0185a2b55264844 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 30 Aug 2021 15:38:28 +0000 Subject: Generate all the config scripts to avoid hard-coding /usr/X11R6. This was already done partially. --- config/GiveConsole | 23 ----------------------- config/GiveConsole.in | 26 ++++++++++++++++++++++++++ config/TakeConsole | 20 -------------------- config/TakeConsole.in | 23 +++++++++++++++++++++++ config/Xsetup_0 | 16 ---------------- config/Xsetup_0.in | 19 +++++++++++++++++++ 6 files changed, 68 insertions(+), 59 deletions(-) delete mode 100644 config/GiveConsole create mode 100644 config/GiveConsole.in delete mode 100644 config/TakeConsole create mode 100644 config/TakeConsole.in delete mode 100644 config/Xsetup_0 create mode 100644 config/Xsetup_0.in (limited to 'config') diff --git a/config/GiveConsole b/config/GiveConsole deleted file mode 100644 index 60e568b..0000000 --- a/config/GiveConsole +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Assign ownership of the console to the invoking user -# $OpenBSD: GiveConsole,v 1.4 2021/02/12 10:33:34 jsg Exp $ -# -# By convention, both xconsole and xterm -C check that the -# console is owned by the invoking user and is readable before attaching -# the console output. This way a random user can invoke xterm -C without -# causing serious grief. -# -chown $USER /dev/console -if [ -c /dev/drm0 ]; then - chown $USER /dev/drm0 -fi -if [ -c /dev/drmR128 ]; then - chown $USER /dev/drmR128 -fi -if [ -c /dev/dri/card0 ]; then - chown $USER /dev/dri/card0 -fi -if [ -c /dev/dri/renderD128 ]; then - chown $USER /dev/dri/renderD128 -fi -/usr/X11R6/bin/sessreg -a -l $DISPLAY -u none $USER diff --git a/config/GiveConsole.in b/config/GiveConsole.in new file mode 100644 index 0000000..c282997 --- /dev/null +++ b/config/GiveConsole.in @@ -0,0 +1,26 @@ +#!/bin/sh +# Assign ownership of the console to the invoking user +# $OpenBSD: GiveConsole.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $ +# +# By convention, both xconsole and xterm -C check that the +# console is owned by the invoking user and is readable before attaching +# the console output. This way a random user can invoke xterm -C without +# causing serious grief. +# +prefix="@prefix@" +exec_prefix="@exec_prefix@" + +chown $USER /dev/console +if [ -c /dev/drm0 ]; then + chown $USER /dev/drm0 +fi +if [ -c /dev/drmR128 ]; then + chown $USER /dev/drmR128 +fi +if [ -c /dev/dri/card0 ]; then + chown $USER /dev/dri/card0 +fi +if [ -c /dev/dri/renderD128 ]; then + chown $USER /dev/dri/renderD128 +fi +@bindir@/sessreg -a -l $DISPLAY -u none $USER diff --git a/config/TakeConsole b/config/TakeConsole deleted file mode 100644 index cf649f9..0000000 --- a/config/TakeConsole +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# Reassign ownership of the console to root, this should disallow -# assignment of console output to any random users's xterm -# $OpenBSD: TakeConsole,v 1.5 2021/02/12 10:33:34 jsg Exp $ -# -chown root /dev/console -chmod 622 /dev/console -if [ -c /dev/drm0 ]; then - chown root /dev/drm0 -fi -if [ -c /dev/drmR128 ]; then - chown root /dev/drmR128 -fi -if [ -c /dev/dri/card0 ]; then - chown root /dev/dri/card0 -fi -if [ -c /dev/dri/renderD128 ]; then - chown root /dev/dri/renderD128 -fi -/usr/X11R6/bin/sessreg -d -l $DISPLAY -u none $USER diff --git a/config/TakeConsole.in b/config/TakeConsole.in new file mode 100644 index 0000000..d5448d5 --- /dev/null +++ b/config/TakeConsole.in @@ -0,0 +1,23 @@ +#!/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.1 2021/08/30 15:38:27 matthieu Exp $ +# +prefix="@prefix@" +exec_prefix="@exec_prefix@" + +chown root /dev/console +chmod 622 /dev/console +if [ -c /dev/drm0 ]; then + chown root /dev/drm0 +fi +if [ -c /dev/drmR128 ]; then + chown root /dev/drmR128 +fi +if [ -c /dev/dri/card0 ]; then + chown root /dev/dri/card0 +fi +if [ -c /dev/dri/renderD128 ]; then + chown root /dev/dri/renderD128 +fi +@bindir@/sessreg -d -l $DISPLAY -u none $USER diff --git a/config/Xsetup_0 b/config/Xsetup_0 deleted file mode 100644 index dfb3e4e..0000000 --- a/config/Xsetup_0 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# $OpenBSD: Xsetup_0,v 1.8 2020/07/04 13:32:50 matthieu Exp $ - -xsetroot -fg \#6f6f6f -bg \#bfbfbf -bitmap /usr/X11R6/include/X11/bitmaps/root_weave - -xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail - -# install package openbsd-backgrounds -# then uncomment: -# -# if test -x /usr/local/bin/openbsd-wallpaper -# then -# /usr/local/bin/openbsd-wallpaper -# fi - -# sxpm OpenBSD.xpm & diff --git a/config/Xsetup_0.in b/config/Xsetup_0.in new file mode 100644 index 0000000..8e77edf --- /dev/null +++ b/config/Xsetup_0.in @@ -0,0 +1,19 @@ +#!/bin/sh +# $OpenBSD: Xsetup_0.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $ + +prefix="@prefix@" +exec_prefix="@exec_prefix@" + +@bindir@/xsetroot -fg \#6f6f6f -bg \#bfbfbf -bitmap @includedir@/X11/bitmaps/root_weave + +@bindir@/xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail + +# install package openbsd-backgrounds +# then uncomment: +# +# if test -x /usr/local/bin/openbsd-wallpaper +# then +# /usr/local/bin/openbsd-wallpaper +# fi + +# sxpm OpenBSD.xpm & -- cgit v1.2.3