agent: don't enforce user session

Agent registration should not be blocked by absence of a user session
tracked using logind or consolekit. Access control based on UID is
sufficient.

This patch ensures that the user can always register a secret agent,
even if he doesn't have a session tracked by logind or consolekit and
even when NetworkManager is not built with logind or consolekit support.

Please note checking for presence or absence of a user session tracked
by logind has no value in this context.

Acked-By: Thomas Haller <thaller@redhat.com>
Acked-By: Dan Williams <dcbw@redhat.com>
This commit is contained in:
Pavel Šimerda 2014-12-27 19:55:25 +01:00
parent 511a7395bf
commit 75221bbc1b

View file

@ -285,14 +285,6 @@ impl_agent_manager_register_with_capabilities (NMAgentManager *self,
}
sender_uid = nm_auth_subject_get_unix_process_uid (subject);
if ( 0 != sender_uid
&& !nm_session_monitor_session_exists (sender_uid, FALSE)) {
error = g_error_new_literal (NM_AGENT_MANAGER_ERROR,
NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED,
"Session not found");
goto done;
}
/* Validate the identifier */
if (!validate_identifier (identifier, &error))
goto done;