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.
This commit is contained in:
Dan Williams 2010-11-17 17:54:04 -06:00
parent 1bbc624477
commit c0f5872b5a

View file

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