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(+)
|
|
|
|
|
|
|
|
diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c
|
|
|
|
index cb045a9..51093f2 100644
|
|
|
|
--- a/src/login/logind-acl.c
|
|
|
|
+++ b/src/login/logind-acl.c
|
2013-06-05 13:16:22 +02:00
|
|
|
@@ -24,6 +24,7 @@
|
|
|
|
#include <acl/libacl.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
|
|
|
+#include <strv.h>
|
|
|
|
|
|
|
|
#include "logind-acl.h"
|
|
|
|
#include "util.h"
|
|
|
|
@@ -240,6 +241,22 @@ int devnode_acl_all(struct udev *udev,
|
2013-04-23 11:39:56 +02:00
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2013-06-05 13:16:22 +02:00
|
|
|
+ /* only search for nvidia* if /dev/nvidiactl exists */
|
|
|
|
+ if (!devnode_acl("/dev/nvidiactl", flush, del, old_uid, add, new_uid)) {
|
|
|
|
+ char** directory;
|
|
|
|
+ char **f, *resolved;
|
|
|
|
+
|
|
|
|
+ if (get_files_in_directory ("/dev", &directory)) {
|
|
|
|
+ STRV_FOREACH(f,directory)
|
|
|
|
+ if (startswith(*f,"nvidia")) {
|
|
|
|
+ resolved = strjoin("/dev/", *f, NULL);
|
|
|
|
+ devnode_acl(resolved, flush, del, old_uid, add, new_uid);
|
|
|
|
+ free(resolved);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ strv_free(directory);
|
|
|
|
+ }
|
2013-04-23 11:39:56 +02:00
|
|
|
+
|
|
|
|
finish:
|
|
|
|
if (e)
|
|
|
|
udev_enumerate_unref(e);
|