Blame SOURCES/0003-build-sys-bump-polkit-requirement-to-0.101.patch

84be6c
From f036039b2ab3945940159342fb3880064f2611c9 Mon Sep 17 00:00:00 2001
84be6c
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
84be6c
Date: Thu, 9 Apr 2020 01:05:00 +0200
84be6c
Subject: [PATCH 3/9] build-sys: bump polkit requirement to 0.101
84be6c
MIME-Version: 1.0
84be6c
Content-Type: text/plain; charset=UTF-8
84be6c
Content-Transfer-Encoding: 8bit
84be6c
84be6c
It was released on 2011-03-03, and is available in old debian stable
84be6c
and all distros we care about.
84be6c
84be6c
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
84be6c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
84be6c
(cherry picked from commit 94a3375beff5df8c8add33cf2f1b74350185dce2)
84be6c
---
84be6c
 meson.build                            |  7 +-----
84be6c
 src/spice-client-glib-usb-acl-helper.c | 34 --------------------------
84be6c
 2 files changed, 1 insertion(+), 40 deletions(-)
84be6c
84be6c
diff --git a/meson.build b/meson.build
84be6c
index 8098989..c442a0d 100644
84be6c
--- a/meson.build
84be6c
+++ b/meson.build
84be6c
@@ -204,14 +204,9 @@ endif
84be6c
 
84be6c
 # polkit
84be6c
 spice_gtk_has_polkit = false
84be6c
-d = dependency('polkit-gobject-1', version : '>= 0.96', required : get_option('polkit'))
84be6c
+d = dependency('polkit-gobject-1', version : '>= 0.101', required : get_option('polkit'))
84be6c
 if d.found()
84be6c
   spice_gtk_policy_dir = d.get_pkgconfig_variable('policydir')
84be6c
-  foreach func : ['polkit_authority_get_sync', 'polkit_authorization_result_get_dismissed']
84be6c
-    if compiler.has_function(func, dependencies : d)
84be6c
-      spice_gtk_config_data.set('HAVE_@0@'.format(func.to_upper()), '1')
84be6c
-    endif
84be6c
-  endforeach
84be6c
 
84be6c
   # TODO:  With 'auto', we should just disable polkit support if this is missing.
84be6c
   if not compiler.has_function('acl_get_file')
84be6c
diff --git a/src/spice-client-glib-usb-acl-helper.c b/src/spice-client-glib-usb-acl-helper.c
84be6c
index f75e0fc..de9e605 100644
84be6c
--- a/src/spice-client-glib-usb-acl-helper.c
84be6c
+++ b/src/spice-client-glib-usb-acl-helper.c
84be6c
@@ -156,25 +156,6 @@ static void cleanup(void)
84be6c
         g_main_loop_quit(loop);
84be6c
 }
84be6c
 
84be6c
-/* Not available in polkit < 0.101 */
84be6c
-#ifndef HAVE_POLKIT_AUTHORIZATION_RESULT_GET_DISMISSED
84be6c
-static gboolean
84be6c
-polkit_authorization_result_get_dismissed(PolkitAuthorizationResult *result)
84be6c
-{
84be6c
-    gboolean ret;
84be6c
-    PolkitDetails *details;
84be6c
-
84be6c
-    g_return_val_if_fail(POLKIT_IS_AUTHORIZATION_RESULT(result), FALSE);
84be6c
-
84be6c
-    ret = FALSE;
84be6c
-    details = polkit_authorization_result_get_details(result);
84be6c
-    if (details != NULL && polkit_details_lookup(details, "polkit.dismissed"))
84be6c
-        ret = TRUE;
84be6c
-
84be6c
-    return ret;
84be6c
-}
84be6c
-#endif
84be6c
-
84be6c
 static void check_authorization_cb(PolkitAuthority *authority,
84be6c
                                    GAsyncResult *res, gpointer data)
84be6c
 {
84be6c
@@ -291,21 +272,6 @@ static void stdin_read_complete(GObject *src, GAsyncResult *res, gpointer data)
84be6c
     g_free(s);
84be6c
 }
84be6c
 
84be6c
-/* Fix for polkit 0.97 and later */
84be6c
-#ifndef HAVE_POLKIT_AUTHORITY_GET_SYNC
84be6c
-static PolkitAuthority *
84be6c
-polkit_authority_get_sync (GCancellable *cancellable, GError **error)
84be6c
-{
84be6c
-    PolkitAuthority *authority;
84be6c
-
84be6c
-    authority = polkit_authority_get ();
84be6c
-    if (!authority)
84be6c
-        g_set_error (error, 0, 0, "failed to get the PolicyKit authority");
84be6c
-
84be6c
-    return authority;
84be6c
-}
84be6c
-#endif
84be6c
-
84be6c
 #ifndef HAVE_CLEARENV
84be6c
 extern char **environ;
84be6c
 
84be6c
-- 
84be6c
2.26.2
84be6c