gentleknife / rpms / dbus

Forked from rpms/dbus 4 years ago
Clone

Blame SOURCES/dbus-1.6.12-auth-process-ok-message-dispatch-test-fix.patch

275029
From b17615cda8a7ec80692d84e544b71e8183461aa5 Mon Sep 17 00:00:00 2001
275029
From: Roy Li <rongqing.li@windriver.com>
275029
Date: Wed, 21 Jan 2015 09:28:53 +0000
275029
Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd failed
275029
275029
Once send_negotiate_unix_fd failed, this failure will happen, since
275029
auth->guid_from_server has been set to some value before
275029
send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to this
275029
auth be handled by process_ok again, but this auth->guid_from_server is
275029
not zero.
275029
275029
So we should clear auth->guid_from_server if send_negotiate_unix_fd
275029
failed.
275029
275029
http://lists.freedesktop.org/archives/dbus/2014-February/016122.html
275029
https://bugs.freedesktop.org/show_bug.cgi?id=75589
275029
https://bugzilla.redhat.com/show_bug.cgi?id=1183755
275029
275029
Signed-off-by: Roy Li <rongqing.li@windriver.com>
275029
---
275029
 dbus/dbus-auth.c | 10 +++++++++-
275029
 1 file changed, 9 insertions(+), 1 deletion(-)
275029
275029
diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
275029
index d2c37a7..dd6e61d 100644
275029
--- a/dbus/dbus-auth.c
275029
+++ b/dbus/dbus-auth.c
275029
@@ -1572,7 +1572,15 @@ process_ok(DBusAuth *auth,
275029
                  _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
275029
 
275029
   if (auth->unix_fd_possible)
275029
-    return send_negotiate_unix_fd(auth);
275029
+    {
275029
+      if (!send_negotiate_unix_fd (auth))
275029
+        {
275029
+          _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
275029
+          return FALSE;
275029
+        }
275029
+
275029
+      return TRUE;
275029
+    }
275029
 
275029
   _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
275029
   return send_begin (auth);
275029
-- 
275029
2.2.1
275029