gdbusdaemon: Only authorize anonymous users on Windows, not Unix

On Unix, we expect EXTERNAL authentication to work.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2019-06-05 15:00:29 +01:00 committed by Philip Withnall
parent a5923d4e49
commit 11233f572d

View File

@ -1539,7 +1539,7 @@ on_authorize_authenticated_peer (GDBusAuthObserver *observer,
GCredentials *credentials,
gpointer user_data)
{
gboolean authorized = TRUE;
gboolean authorized = FALSE;
if (credentials != NULL)
{
@ -1549,6 +1549,14 @@ on_authorize_authenticated_peer (GDBusAuthObserver *observer,
authorized = g_credentials_is_same_user (credentials, own_credentials, NULL);
g_object_unref (own_credentials);
}
#ifdef G_OS_WIN32
else
{
/* We allow ANONYMOUS authentication on Windows for now, in
* combination with the nonce-tcp transport. */
authorized = TRUE;
}
#endif
return authorized;
}