2013-04-23 11:39:56 +02:00
|
|
|
From: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
|
|
Date: Mon, 8 Apr 2013 14:51:47 +0200
|
|
|
|
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(+)
|
|
|
|
|
2013-06-05 13:16:22 +02:00
|
|
|
|
2013-12-19 12:51:56 +01:00
|
|
|
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,
|
2013-08-02 07:26:48 +02:00
|
|
|
r = devnode_acl(n, flush, del, old_uid, add, new_uid);
|
2013-04-23 11:39:56 +02:00
|
|
|
}
|
|
|
|
|
2013-12-19 12:51:56 +01:00
|
|
|
+ /* only apply ACL on nvidia* if /dev/nvidiactl exists */
|
|
|
|
+ if (devnode_acl("/dev/nvidiactl", flush, del, old_uid, add, new_uid) >= 0) {
|
|
|
|
+ int i;
|
|
|
|
+ char *devname;
|
2013-06-05 13:16:22 +02:00
|
|
|
+
|
2013-12-19 12:51:56 +01:00
|
|
|
+ for (i = 0; i <= 256 ; i++) {
|
|
|
|
+ if (asprintf(&devname, "/dev/nvidia%d", i) < 0)
|
|
|
|
+ break;
|
|
|
|
+ if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0) {
|
|
|
|
+ free(devname);
|
|
|
|
+ break;
|
2013-06-05 13:16:22 +02:00
|
|
|
+ }
|
2013-12-19 12:51:56 +01:00
|
|
|
+ free(devname);
|
2013-06-05 13:16:22 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2013-04-23 11:39:56 +02:00
|
|
|
+
|
|
|
|
finish:
|
2013-08-02 07:26:48 +02:00
|
|
|
udev_enumerate_unref(e);
|
|
|
|
set_free_free(nodes);
|