From a4256940da049f91bbbea5e53e469a59ea9c10f7 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 25 Oct 2013 21:20:58 +0200 Subject: Imported Upstream version 0.9.8.8 --- src/settings/nm-agent-manager.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/settings/nm-agent-manager.c') diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c index d9199f51..531fabc5 100644 --- a/src/settings/nm-agent-manager.c +++ b/src/settings/nm-agent-manager.c @@ -262,10 +262,11 @@ impl_agent_manager_register (NMAgentManager *self, goto done; } - if (!nm_session_monitor_uid_has_session (priv->session_monitor, - sender_uid, - NULL, - &local)) { + if ( 0 != sender_uid + && !nm_session_monitor_uid_has_session (priv->session_monitor, + sender_uid, + NULL, + &local)) { error = g_error_new_literal (NM_AGENT_MANAGER_ERROR, NM_AGENT_MANAGER_ERROR_SESSION_NOT_FOUND, local && local->message ? local->message : "Session not found"); @@ -552,15 +553,12 @@ request_add_agent (Request *req, * or that the permissions is empty (ie, visible by everyone). */ agent_uid = nm_secret_agent_get_owner_uid (agent); - if (0 != agent_uid) { - if (!nm_auth_uid_in_acl (req->connection, session_monitor, agent_uid, NULL)) { - nm_log_dbg (LOGD_AGENTS, "(%s) agent ignored for secrets request %p/%s (not in ACL)", - nm_secret_agent_get_description (agent), - req, req->setting_name); - /* Connection not visible to this agent's user */ - return; - } - /* Caller is allowed to manipulate this connection */ + if (!nm_auth_uid_in_acl (req->connection, session_monitor, agent_uid, NULL)) { + nm_log_dbg (LOGD_AGENTS, "(%s) agent ignored for secrets request %p/%s (not in ACL)", + nm_secret_agent_get_description (agent), + req, req->setting_name); + /* Connection not visible to this agent's user */ + return; } /* If the request should filter agents by UID, do that now */ -- cgit 1.3.0-6-gf8a5