0001-admin-Prevent-access-if-any-authentication-agent-isn-t-available.patch 1.7 KB

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