From c0f5872b5a6573e968698649aeb983e072c89972 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 17 Nov 2010 17:54:04 -0600 Subject: [PATCH] settings: don't accept possible auth as success for saving hostname Since user interaction is allowed when the permission for SaveHostname is requested, if the user didn't authorize completely when polkit returns, we don't want to proceed with the request. Otherwise we might get into a situation where it's possible for the user to authorize, but they didn't, and previously the code would allow the request. --- src/settings/nm-settings.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 970c2b6f94..d3ceba05b6 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -884,8 +884,7 @@ pk_hostname_cb (NMAuthChain *chain, result = nm_auth_chain_get_result (chain, NM_AUTH_PERMISSION_SETTINGS_HOSTNAME_MODIFY); /* Caller didn't successfully authenticate */ - if ( result != NM_AUTH_CALL_RESULT_YES - && result != NM_AUTH_CALL_RESULT_AUTH) { + if (result != NM_AUTH_CALL_RESULT_YES) { error = g_error_new_literal (NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_NOT_PRIVILEGED, "Insufficient privileges.");