Blame SOURCES/admin-Prevent-access-if-any-authentication-agent-isn.patch

ebf376
From d8d0c8c40049cfd824b2b90d0cd47914052b9811 Mon Sep 17 00:00:00 2001
ebf376
From: Ondrej Holy <oholy@redhat.com>
ebf376
Date: Wed, 2 Jan 2019 17:13:27 +0100
ebf376
Subject: [PATCH] admin: Prevent access if any authentication agent isn't
ebf376
 available
ebf376
ebf376
The backend currently allows to access and modify files without prompting
ebf376
for password if any polkit authentication agent isn't available. This seems
ebf376
isn't usually problem, because polkit agents are integral parts of
ebf376
graphical environments / linux distributions. The agents can't be simply
ebf376
disabled without root permissions and are automatically respawned. However,
ebf376
this might be a problem in some non-standard cases.
ebf376
ebf376
This affects only users which belong to wheel group (i.e. those who are
ebf376
already allowed to use sudo). It doesn't allow privilege escalation for
ebf376
users, who don't belong to that group.
ebf376
ebf376
Let's return permission denied error also when the subject can't be
ebf376
authorized by any polkit agent to prevent this behavior.
ebf376
ebf376
Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/355
ebf376
---
ebf376
 daemon/gvfsbackendadmin.c | 3 +--
ebf376
 1 file changed, 1 insertion(+), 2 deletions(-)
ebf376
ebf376
diff --git a/daemon/gvfsbackendadmin.c b/daemon/gvfsbackendadmin.c
ebf376
index ec0f2392..0f849008 100644
ebf376
--- a/daemon/gvfsbackendadmin.c
ebf376
+++ b/daemon/gvfsbackendadmin.c
ebf376
@@ -130,8 +130,7 @@ check_permission (GVfsBackendAdmin *self,
ebf376
       return FALSE;
ebf376
     }
ebf376
 
ebf376
-  is_authorized = polkit_authorization_result_get_is_authorized (result) ||
ebf376
-    polkit_authorization_result_get_is_challenge (result);
ebf376
+  is_authorized = polkit_authorization_result_get_is_authorized (result);
ebf376
 
ebf376
   g_object_unref (result);
ebf376
 
ebf376
-- 
ebf376
2.20.1
ebf376