mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-21 15:34:59 +00:00
Enforce allowing providers to take away flash abilities
The flags for ALLOW_OFFLINE and ALLOW_ONLINE aren't currently used to block a provider from flashing a file by hand.
This commit is contained in:
parent
3321d7ea09
commit
ff94ccde59
@ -561,6 +561,17 @@ fu_main_provider_update_authenticated (FuMainAuthHelper *helper, GError **error)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* The provider might have taken away update abilities */
|
||||
if (!fu_device_has_flag (item->device, FU_DEVICE_FLAG_ALLOW_OFFLINE) &&
|
||||
!fu_device_has_flag (item->device, FU_DEVICE_FLAG_ALLOW_ONLINE)) {
|
||||
g_set_error(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INTERNAL,
|
||||
"Device %s does not currently allow updates",
|
||||
fu_device_get_id (helper->device));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* can we only do this on AC power */
|
||||
if (fu_device_has_flag (item->device, FU_DEVICE_FLAG_REQUIRE_AC)) {
|
||||
if (fu_main_on_battery (helper->priv)) {
|
||||
|
Loading…
Reference in New Issue
Block a user