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

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