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

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