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