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

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