2013-04-13 13:09:53 +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).
|
|
|
|
---
|
2014-02-28 18:31:08 +01:00
|
|
|
logind-acl.c | 12 ++++++++++++
|
|
|
|
1 file changed, 12 insertions(+)
|
2013-04-13 13:09:53 +02:00
|
|
|
|
2014-02-28 18:31:08 +01:00
|
|
|
--- 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;
|
2013-04-13 13:09:53 +02:00
|
|
|
}
|
|
|
|
|
2013-12-16 17:54:19 +01:00
|
|
|
+ /* only apply ACL on nvidia* if /dev/nvidiactl exists */
|
2014-02-28 18:31:08 +01:00
|
|
|
+ if (devnode_acl("/dev/nvidiactl", flush, del, old_uid, add, new_uid) >= 0) {
|
2013-12-16 17:54:19 +01:00
|
|
|
+ int i;
|
|
|
|
+ for (i = 0; i <= 256 ; i++) {
|
2014-02-28 18:31:08 +01:00
|
|
|
+ _cleanup_free_ char *devname = NULL;
|
2013-12-16 17:54:19 +01:00
|
|
|
+ if (asprintf(&devname, "/dev/nvidia%d", i) < 0)
|
|
|
|
+ break;
|
2014-02-28 18:31:08 +01:00
|
|
|
+ if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0)
|
2013-12-16 17:54:19 +01:00
|
|
|
+ break;
|
2013-05-29 17:26:40 +02:00
|
|
|
+ }
|
|
|
|
+ }
|
2013-04-13 13:09:53 +02:00
|
|
|
+
|
2014-02-28 18:31:08 +01:00
|
|
|
return r;
|
|
|
|
}
|