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).
---
 logind-acl.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

Index: systemd-210/src/login/logind-acl.c
===================================================================
--- systemd-210.orig/src/login/logind-acl.c
+++ systemd-210/src/login/logind-acl.c
@@ -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) {
+                int j;
+                for (j = 0; j <= 256 ; j++) {
+                        _cleanup_free_ char *devname = NULL;
+                        if (asprintf(&devname, "/dev/nvidia%d", j) < 0)
+                                break;
+                        if (devnode_acl(devname, flush, del, old_uid, add, new_uid) < 0)
+                                break;
+                }
+        }
+
         return r;
 }
