core: fix some problems with the user auth rework

This commit is contained in:
Dan Williams 2010-05-31 16:47:38 -07:00
parent 3b6917f74b
commit c4946a6dfe

View file

@ -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);