Commit c4946a6d authored by Dan Williams's avatar Dan Williams

core: fix some problems with the user auth rework

parent 3b6917f7
......@@ -2468,8 +2468,8 @@ is_user_request_authorized (NMManager *manager,
g_set_error (error, NM_MANAGER_ERROR,
NM_MANAGER_ERROR_PERMISSION_DENIED,
"%s", "Could not determine user settings service name");
}
goto out;
}
service_owner = nm_dbus_manager_get_name_owner (priv->dbus_mgr, service_name, NULL);
if (!service_owner) {
......@@ -2479,6 +2479,15 @@ is_user_request_authorized (NMManager *manager,
goto out;
}
connection = nm_dbus_manager_get_dbus_connection (priv->dbus_mgr);
if (!connection) {
g_set_error_literal (error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_PERMISSION_DENIED,
"Could not get the D-Bus system bus");
goto out;
}
dbus_error_init (&dbus_error);
/* FIXME: do this async */
service_uid = dbus_bus_get_unix_user (connection, service_owner, &dbus_error);
......@@ -2495,10 +2504,8 @@ is_user_request_authorized (NMManager *manager,
g_set_error (error, NM_MANAGER_ERROR,
NM_MANAGER_ERROR_PERMISSION_DENIED,
"%s", "Requestor UID does not match the UID of the user settings service");
goto out;
}
success = TRUE;
} else
success = TRUE;
out:
g_free (service_owner);
......
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