Do the proper chown(1) $USER, root or _gdm dance according to the situation.

prodded by kettenis@
This commit is contained in:
ajacoutot 2013-12-26 15:38:29 +00:00
parent 37141c7f19
commit 1157cfa912
5 changed files with 49 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.180 2013/12/01 17:54:13 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.181 2013/12/26 15:38:29 ajacoutot Exp $
# XXX configuring GDM from gnome-cc does not work
@ -8,7 +8,7 @@ COMMENT= GNOME display manager
GNOME_PROJECT= gdm
GNOME_VERSION= 3.10.0.1
REVISION= 4
REVISION= 5
SHARED_LIBS += gdm 0.0 # 1.0

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-data_Init_in,v 1.3 2013/12/26 15:38:29 ajacoutot Exp $
--- data/Init.in.orig Thu Dec 26 16:07:13 2013
+++ data/Init.in Thu Dec 26 16:09:40 2013
@@ -86,4 +86,9 @@ if [ "x$SETXKBMAP" != "x" ] ; then
fi
fi
+# /etc/X11/xdm/GiveConsole, fbtab(5)
+if [ -c /dev/drm0 ]; then
+ /sbin/chown _gdm /dev/drm0
+fi
+
exit 0

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-data_PostSession_in,v 1.1 2013/12/26 15:38:29 ajacoutot Exp $
--- data/PostSession.in.orig Thu Dec 26 16:30:16 2013
+++ data/PostSession.in Thu Dec 26 16:31:15 2013
@@ -1,3 +1,8 @@
#!/bin/sh
+# /etc/X11/xdm/TakeConsole, fbtab(5)
+if [ -c /dev/drm0 ]; then
+ /sbin/chown root /dev/drm0
+fi
+
exit 0

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-data_PreSession_in,v 1.3 2013/12/26 15:38:29 ajacoutot Exp $
--- data/PreSession.in.orig Thu Dec 26 16:04:18 2013
+++ data/PreSession.in Thu Dec 26 16:09:50 2013
@@ -7,3 +7,8 @@
# Note that output goes into the .xsession-errors file for easy debugging
#
PATH="@X_PATH@:$PATH"
+
+# /etc/X11/xdm/GiveConsole, fbtab(5)
+if [ -c /dev/drm0 ]; then
+ /sbin/chown $USER /dev/drm0
+fi

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: gdm.rc,v 1.24 2013/12/01 17:54:13 ajacoutot Exp $
# $OpenBSD: gdm.rc,v 1.25 2013/12/26 15:38:29 ajacoutot Exp $
daemon="${TRUEPREFIX}/sbin/gdm"
@ -21,7 +21,15 @@ rc_start() {
rc_stop() {
pkill -f "^${pexp}"
pkill -u _gdm
# _gdm owned processed may already be gone... or not
pkill -u _gdm || return 0
}
# /etc/X11/xdm/TakeConsole, fbtab(5)
rc_post() {
if [ -c /dev/drm0 ]; then
chown root /dev/drm0
fi
}
rc_cmd $1