Commit 68b16deb authored by Colin Walters's avatar Colin Walters
Browse files

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.
parent 4d15ba90
......@@ -2264,15 +2264,20 @@ initable_init (GInitable *initable,
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->stream != NULL)
ret = TRUE;
g_assert (connection->initialization_error != NULL);
ret = TRUE;
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
* properties:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment