mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-10 03:04:05 +02:00
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 to initialize. The assertion here is just wrong; we now explicitly and clearly handle both cases where we already have an error, or we already succeeded. https://bugzilla.gnome.org/show_bug.cgi?id=635694
This commit is contained in:
@@ -2264,15 +2264,20 @@ initable_init (GInitable *initable,
|
|||||||
|
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
|
||||||
|
/* First, handle the case where the connection already has an
|
||||||
|
* initialization error set.
|
||||||
|
*/
|
||||||
|
if (connection->initialization_error != NULL)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
/* Also make this a no-op if we're already initialized fine */
|
||||||
if (connection->is_initialized)
|
if (connection->is_initialized)
|
||||||
{
|
{
|
||||||
if (connection->stream != NULL)
|
ret = TRUE;
|
||||||
ret = TRUE;
|
|
||||||
else
|
|
||||||
g_assert (connection->initialization_error != NULL);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
g_assert (connection->initialization_error == NULL);
|
|
||||||
|
g_assert (connection->initialization_error == NULL && !connection->is_initialized);
|
||||||
|
|
||||||
/* The user can pass multiple (but mutally exclusive) construct
|
/* The user can pass multiple (but mutally exclusive) construct
|
||||||
* properties:
|
* properties:
|
||||||
|
Reference in New Issue
Block a user