After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673943 - Add test-case checking interoperability with the libdbus-1.so implementation of DBUS_COOKIE_SHA1
Add test-case checking interoperability with the libdbus-1.so implementation ...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-04-11 19:09 UTC by David Zeuthen (not reading bugmail)
Modified: 2012-04-14 16:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a way to pick authentication mechanism (9.72 KB, patch)
2012-04-12 03:39 UTC, David Zeuthen (not reading bugmail)
none Details | Review
Check interop with libdbus-1 (8.13 KB, patch)
2012-04-12 03:42 UTC, David Zeuthen (not reading bugmail)
none Details | Review
Interop v2 (8.80 KB, patch)
2012-04-12 15:23 UTC, David Zeuthen (not reading bugmail)
none Details | Review

Description David Zeuthen (not reading bugmail) 2012-04-11 19:09:00 UTC
Just gotten reports that this may not currently work. Since the DBUS_COOKIE_SHA1 authentication method is rarely used, it's likely it will just bit-rot without a proper test. Should guard the tests behind HAVE_DBUS1.
Comment 1 David Zeuthen (not reading bugmail) 2012-04-12 03:12:55 UTC
This actually turned out to be a libdbus-1 bug, see

 https://bugs.freedesktop.org/show_bug.cgi?id=48580

I still have a couple of nice test cases for this, though, will attach it in a bit. Won't be able to enable these tests until there's a release of libdbus-1 we can depend on though.
Comment 2 David Zeuthen (not reading bugmail) 2012-04-12 03:39:38 UTC
Created attachment 211895 [details] [review]
Add a way to pick authentication mechanism

First we need to have a way to pick what authentication mechanisms to use. This is new API so mark is as 2.34.

Need to wait for 2.32 to branch before committing this to master, obviously.
Comment 3 David Zeuthen (not reading bugmail) 2012-04-12 03:42:20 UTC
Created attachment 211896 [details] [review]
Check interop with libdbus-1

Once we have a way to pick auth mechanisms, it's fairly straightforward to check that we interoperate with libdbus-1. Note that there are two cases

 1. GDBus being a client and libdbus-1 being a server; and
 2. libdbus-1 being a client and GDBus being a server

and that we need to test both (and only the second one currently fail).
Comment 4 David Zeuthen (not reading bugmail) 2012-04-12 03:47:07 UTC
Btw, here's the routput when running the new tests using a patched libdbus-1 and with G_DBUS_DEBUG=authentication

$ G_DBUS_DEBUG=authentication LD_LIBRARY_PATH=/home/davidz/Hacking/dbus/dbus/.libs ./gdbus-dbus-cookie-sha1-interop 
/gdbus/dbus-cookie-sha1-interop/gdbus-client: GDBus-debug:Auth: CLIENT: initiating
GDBus-debug:Auth: CLIENT: sent credentials `GCredentials:linux-ucred:pid=20697,uid=500,gid=500'
GDBus-debug:Auth: CLIENT: writing `AUTH\r\n'
GDBus-debug:Auth: CLIENT: WaitingForReject
GDBus-debug:Auth: CLIENT: WaitingForReject, read 'REJECTED EXTERNAL DBUS_COOKIE_SHA1 ANONYMOUS'
GDBus-debug:Auth: CLIENT: Trying to choose mechanism
GDBus-debug:Auth: CLIENT: Trying mechanism `DBUS_COOKIE_SHA1'
GDBus-debug:Auth: CLIENT: writing `AUTH DBUS_COOKIE_SHA1 353030\r\n'
GDBus-debug:Auth: CLIENT: WaitingForData
GDBus-debug:Auth: CLIENT: WaitingForData, read=`DATA 6f72675f667265656465736b746f705f67656e6572616c2031303534363634313330203532663934383235376133633063303664646562646366393663616464353261'
GDBus-debug:Auth: CLIENT: writing `DATA 47326d5831663435795968434b41594f2034363731376534313766633063623837396130663034306366643636666331653263663234633433\r\n'
GDBus-debug:Auth: CLIENT: WaitingForOK
GDBus-debug:Auth: CLIENT: WaitingForOK, read `OK 436d711a81c83b0a385b707c00014918'
GDBus-debug:Auth: CLIENT: writing `NEGOTIATE_UNIX_FD\r\n'
GDBus-debug:Auth: CLIENT: WaitingForAgreeUnixFD
GDBus-debug:Auth: CLIENT: WaitingForAgreeUnixFD, read=`AGREE_UNIX_FD'
GDBus-debug:Auth: CLIENT: writing `BEGIN\r\n'
GDBus-debug:Auth: CLIENT: Done, authenticated=1
OK
/gdbus/dbus-cookie-sha1-interop/gdbus-server: GDBus-debug:Auth: SERVER: initiating
GDBus-debug:Auth: SERVER: received credentials `GCredentials:linux-ucred:pid=0'
GDBus-debug:Auth: SERVER: WaitingForAuth
GDBus-debug:Auth: SERVER: WaitingForAuth, read `AUTH EXTERNAL 353030'
GDBus-debug:Auth: SERVER: writing `REJECTED DBUS_COOKIE_SHA1\r\n'
GDBus-debug:Auth: SERVER: WaitingForAuth
GDBus-debug:Auth: SERVER: WaitingForAuth, read `AUTH DBUS_COOKIE_SHA1 353030'
GDBus-debug:Auth: SERVER: writing `DATA 6f72675f67746b5f67646275735f67656e6572616c203120444234766e683279324d4d3850367633\r\n'
GDBus-debug:Auth: SERVER: WaitingForData
GDBus-debug:Auth: SERVER: WaitingForData, read `DATA 30643634323562353031396164666335616638383038653863356230633165612066303437393961313537373366346433396663346163636633646133363438373662613132636637'
GDBus-debug:Auth: SERVER: writing `OK 4ba30ef6b908575cb91bd28a4f864fe0\r\n'
GDBus-debug:Auth: SERVER: WaitingForBegin
GDBus-debug:Auth: SERVER: WaitingForBegin, read `NEGOTIATE_UNIX_FD'
GDBus-debug:Auth: SERVER: writing `AGREE_UNIX_FD\r\n'
GDBus-debug:Auth: SERVER: WaitingForBegin
GDBus-debug:Auth: SERVER: WaitingForBegin, read `BEGIN'
GDBus-debug:Auth: SERVER: Done, authenticated=1
Comment 5 David Zeuthen (not reading bugmail) 2012-04-12 15:23:04 UTC
Created attachment 211942 [details] [review]
Interop v2

The D-Bus bug-fix has been committed, see https://bugs.freedesktop.org/show_bug.cgi?id=48580#c7

so update this patch to run the test only if using these versions or newer.
Comment 6 Matthias Clasen 2012-04-13 23:59:07 UTC
I've branched 2.32 now, so I think this can go in
Comment 7 David Zeuthen (not reading bugmail) 2012-04-14 16:43:42 UTC
OK, I made the tests a bit more general so they also check that EXTERNAL works. I also had to remove a g_warning() from gio/gsocketcontrolmessage.c which was fallout from alexl's recent socket credentials commit.