]> git.proxmox.com Git - fwupd.git/commitdiff
trivial: Do not ask for polkit auth if the device is emulated
authorRichard Hughes <richard@hughsie.com>
Fri, 27 Jan 2023 15:21:11 +0000 (15:21 +0000)
committerRichard Hughes <richard@hughsie.com>
Fri, 27 Jan 2023 15:47:44 +0000 (15:47 +0000)
src/fu-daemon.c

index 19423decc3b002ba5b5b1d2499aaed8d2cd26bb5..c9ff21bdb0b4e3fd712aba922153d54d6a6c27ff 100644 (file)
@@ -787,7 +787,6 @@ fu_daemon_install_with_helper_device(FuMainAuthHelper *helper,
                                     GError **error)
 {
        FuDaemon *self = helper->self;
-       const gchar *action_id;
        g_autoptr(FuRelease) release = fu_release_new();
        g_autoptr(GError) error_local = NULL;
        g_autoptr(GPtrArray) releases = NULL;
@@ -885,9 +884,11 @@ fu_daemon_install_with_helper_device(FuMainAuthHelper *helper,
                }
 
                /* get the action IDs for the valid device */
-               action_id = fu_release_get_action_id(release_tmp);
-               if (!g_ptr_array_find(helper->action_ids, action_id, NULL))
-                       g_ptr_array_add(helper->action_ids, g_strdup(action_id));
+               if (!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_EMULATED)) {
+                       const gchar *action_id = fu_release_get_action_id(release_tmp);
+                       if (!g_ptr_array_find(helper->action_ids, action_id, NULL))
+                               g_ptr_array_add(helper->action_ids, g_strdup(action_id));
+               }
                g_ptr_array_add(helper->releases, g_object_ref(release_tmp));
        }