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 d2ae55fafa
commit 85c1ec0827

View File

@ -1534,7 +1534,7 @@ on_authorize_authenticated_peer (GDBusAuthObserver *observer,
GCredentials *credentials, GCredentials *credentials,
gpointer user_data) gpointer user_data)
{ {
gboolean authorized = TRUE; gboolean authorized = FALSE;
if (credentials != NULL) if (credentials != NULL)
{ {
@ -1544,6 +1544,14 @@ on_authorize_authenticated_peer (GDBusAuthObserver *observer,
authorized = g_credentials_is_same_user (credentials, own_credentials, NULL); authorized = g_credentials_is_same_user (credentials, own_credentials, NULL);
g_object_unref (own_credentials); 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; return authorized;
} }