daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
84b277
From 02d57e30f6e8f0a1f0828d4ee0e1d3b87b54d8f6 Mon Sep 17 00:00:00 2001
84b277
From: David Herrmann <dh.herrmann@gmail.com>
84b277
Date: Wed, 2 Apr 2014 16:20:13 +0200
84b277
Subject: [PATCH] logind: don't print error if devices vanish during ACL-init
84b277
84b277
If a device is unplugged while we initialize it, we will get ENOENT for
84b277
ACL-init (and related stuff). We currently print errors then, which is
84b277
misleading. Print a debug-message early and continue.
84b277
84b277
Conflicts:
84b277
	src/login/logind-acl.c
84b277
84b277
(cherry-picked from 8016b904849a2d2bd8b0171ed8493db5524b5ff7)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/login/logind-acl.c | 8 +++++++-
84b277
 1 file changed, 7 insertions(+), 1 deletion(-)
84b277
84b277
diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c
84b277
index 25abcbc..6582b8c 100644
84b277
--- a/src/login/logind-acl.c
84b277
+++ b/src/login/logind-acl.c
84b277
@@ -283,8 +283,14 @@ int devnode_acl_all(struct udev *udev,
84b277
         }
84b277
 
84b277
         SET_FOREACH(n, nodes, i) {
84b277
+                int k;
84b277
+
84b277
                 log_debug("Fixing up ACLs at %s for seat %s", n, seat);
84b277
-                r = devnode_acl(n, flush, del, old_uid, add, new_uid);
84b277
+                k = devnode_acl(n, flush, del, old_uid, add, new_uid);
84b277
+                if (k == -ENOENT)
84b277
+                        log_debug("Device %s disappeared while setting ACLs", n);
84b277
+                else if (k < 0)
84b277
+                        r = k;
84b277
         }
84b277
 
84b277
 finish: