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

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