tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: graphics drivers needing X root privileges?



I tinkered with it, so victory screenshot (look at my great
wallpaper): https://i.imgur.com/shWGlv2.jpg

so, permissions of /dev/ttyE* and /dev/dri/card* begin to matter a lot
more once X is not run as root. I had to manually chown things to get
things working(!), I am not sure what's the correct thing to get it to
automagically do the right thing with certainty.

This was the diff I used (thx mrg) :)

Index: sysutils/libpciaccess/patches/patch-src_netbsd__pci.c
===================================================================
RCS file: sysutils/libpciaccess/patches/patch-src_netbsd__pci.c
diff -N sysutils/libpciaccess/patches/patch-src_netbsd__pci.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysutils/libpciaccess/patches/patch-src_netbsd__pci.c	26 Oct 2018 01:09:21 -0000
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Don't require root access.
+
+--- src/netbsd_pci.c.orig	2017-10-23 15:48:29.000000000 +0000
++++ src/netbsd_pci.c
+@@ -909,7 +911,7 @@ pci_system_netbsd_create(void)
+ 	ndevs = 0;
+ 	nbuses = 0;
+ 	snprintf(netbsd_devname, 32, "/dev/pci%d", nbuses);
+-	pcifd = open(netbsd_devname, O_RDWR | O_CLOEXEC);
++	pcifd = open(netbsd_devname, O_RDONLY | O_CLOEXEC);
+ 	while (pcifd > 0) {
+ 		ioctl(pcifd, PCI_IOC_BUSINFO, &businfo);
+ 		buses[nbuses].fd = pcifd;
+@@ -931,7 +933,7 @@ pci_system_netbsd_create(void)
+ 			}
+ 		}
+ 		snprintf(netbsd_devname, 32, "/dev/pci%d", nbuses);
+-		pcifd = open(netbsd_devname, O_RDWR);
++		pcifd = open(netbsd_devname, O_RDONLY);
+ 	}
+ 
+ 	pci_sys->num_devices = ndevs;
Index: x11/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c
===================================================================
RCS file: x11/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c
diff -N x11/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ x11/modular-xorg-server/patches/patch-hw_xfree86_os-support_bsd_bsd__init.c	26 Oct 2018 01:09:21 -0000
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- hw/xfree86/os-support/bsd/bsd_init.c.orig	2018-10-25 14:13:21.000000000 +0000
++++ hw/xfree86/os-support/bsd/bsd_init.c
+@@ -165,10 +165,12 @@ xf86OpenConsole()
+ #endif
+ 
+     if (serverGeneration == 1) {
++#ifndef __NetBSD__
+         /* check if we are run with euid==0 */
+         if (geteuid() != 0) {
+             FatalError("xf86OpenConsole: Server must be suid root");
+         }
++#endif
+ 
+         if (!KeepTty) {
+             /*



Home | Main Index | Thread Index | Old Index