SHA256
1
0
forked from pool/systemd
Dr. Werner Fink 2014-02-28 17:31:08 +00:00 committed by Git OBS Bridge
parent 0bd7739d9b
commit 89574e1c2d
3 changed files with 15 additions and 20 deletions

View File

@ -4,34 +4,26 @@ Subject: apply ACL for nvidia device nodes
set ACL on nvidia devices (bnc#808319).
---
src/login/logind-acl.c | 3 +++
1 file changed, 3 insertions(+)
logind-acl.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Index: systemd-208/src/login/logind-acl.c
===================================================================
--- systemd-208.orig/src/login/logind-acl.c
+++ systemd-208/src/login/logind-acl.c
@@ -287,6 +287,22 @@ int devnode_acl_all(struct udev *udev,
r = devnode_acl(n, flush, del, old_uid, add, new_uid);
--- systemd-209/src/login/logind-acl.c
+++ systemd-209/src/login/logind-acl.c 2014-02-28 17:27:51.806239118 +0000
@@ -283,5 +283,17 @@ int devnode_acl_all(struct udev *udev,
r = k;
}
+ /* only apply ACL on nvidia* if /dev/nvidiactl exists */
+ if (devnode_acl("/dev/nvidiactl", flush, del, old_uid, add, new_uid) >= 0) {
+ if (devnode_acl("/dev/nvidiactl", flush, del, old_uid, add, new_uid) >= 0) {
+ int i;
+ char *devname;
+
+ for (i = 0; i <= 256 ; i++) {
+ _cleanup_free_ char *devname = NULL;
+ if (asprintf(&devname, "/dev/nvidia%d", i) < 0)
+ break;
+ if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0) {
+ free(devname);
+ if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0)
+ break;
+ }
+ free(devname);
+ }
+ }
+
finish:
udev_enumerate_unref(e);
set_free_free(nodes);
return r;
}

View File

@ -4,6 +4,9 @@ Fri Feb 28 17:15:38 UTC 2014 - werner@suse.de
- Make patch
0001-make-209-working-on-older-dist.patch
more smart that is make configure script les restrictive
- Make patch
apply-ACL-for-nvidia-device-nodes.patch
apply to v209
-------------------------------------------------------------------
Fri Feb 28 16:59:25 UTC 2014 - werner@suse.de

View File

@ -484,7 +484,7 @@ cp %{SOURCE7} m4/
%patch25 -p1
# check if this is still needed, or can be derived from fbdev uaccess rule
# http://lists.freedesktop.org/archives/systemd-devel/2012-November/007561.html
# %patch27 -p1
%patch27 -p1
%patch37 -p1
%ifarch %arm
%patch38 -p1