GNOME Bugzilla – Bug 635694
gdbus aborting due to unauthorized socket in DBUS_SESSION_BUS_ADDRESS
Last modified: 2011-04-13 19:40:06 UTC
Created attachment 175165 [details]
minimal example to trigger the bug
When DBUS_SESSION_BUS_ADDRESS is set to the valid socket of another user glib will abort due to an assertion failure when more than one connection attempt via gdbus is made. In practice this often happens when users try to execute GTK applications which use GConf through su/sudo without properly clearing the environment. glib should handle invalid environment variables gracefully rather than crashing.
A minimal example which triggers the problem is attached (note that in order to reproduce DBUS_SESSION_BUS_ADDRESS must be set to a valid socket of another user, bogus values will be handled correctly by returning an error)
Starting program: /home/gber/gdbus-test
[New Thread 0xb7b3bb70 (LWP 24927)]
Program received signal SIGABRT, Aborted.
0xffffe430 in __kernel_vsyscall ()
Inferior 1 [process 24924] will be killed.
Quit anyway? (y or n)
See also on for openSUSE on Novell's bugzilla:
Bug 655751 - gdbus aborting due to unauthorized socket in DBUS_SESSION_BUS_ADDRESS
with the duplicates:
Bug 648558 - yast sw module crashes from root console
Bug 672793 - GLib-GIO:ERROR:gdbusconnection.c:2279:initable_init: assertion failed: (connection->initialization_error == NULL)
Bug 671355 - OpenSuse 11.4 RC1 - zypper dup - GLib-GIO:ERROR:gdbusconnection.c:2279:initable_init: assertion failed:
Bug 671996 - Zypper display the GIO:ERROR warning
Bug 677911 - It is not possible to start yast2 from the command line
Compare also on the openSUSE forums:
Thread: After zypper dup to 11.4 , most of the (graphical) YaST modules do not start via YaST
(repasting comments lost in outage)
--- Comment #2 from Colin Walters <firstname.lastname@example.org> 2011-03-24 14:58:43 UTC ---
David, did you fix this one? I thought I saw it go by, but I'm not seeing a
commit for it.
--- Comment #3 from David Zeuthen <email@example.com> 2011-03-24 15:40:06 UTC ---
(In reply to comment #2)
> David, did you fix this one? I thought I saw it go by, but I'm not seeing a
> commit for it.
No, haven't fixed it yet. I agree it would be nice to have a bug-fix (and
test-case as well) for this... I'll look at it soon.
Created attachment 185897 [details] [review]
gdbusconnection: Avoid tripping assertion if we fail to authenticate twice
If g_bus_get_sync() fails in authentication (because e.g. the process
uid, doesn't match the expected in EXTERNAL), a secondary call to
g_bus_get_sync() would notice we aren't initialized, and try
The assertion here is just wrong; we now explicitly and clearly handle
both cases where we already have an error, or we already succeeded.
(In reply to comment #2)
> No, haven't fixed it yet. I agree it would be nice to have a bug-fix (and
> test-case as well)
A test case turns out to be a pain to write because we need to simulate an authentication error; I just punted on this. The new code is pretty clearly right IMO.
Patch looks right to me (was looking at this very same bug yesterday...)
Attachment 185897 [details] pushed as 68b16de - gdbusconnection: Avoid tripping assertion if we fail to authenticate twice
Looks good to me. Thanks for fixing this. Agree we can punt on the test case for now...