Do not allow devices that have no vendor ID to be UPDATABLE

This commit is contained in:
Richard Hughes 2020-02-19 15:04:49 +00:00
parent dbcc8e1137
commit d8ea8da902

View File

@ -4356,6 +4356,13 @@ fu_engine_add_device (FuEngine *self, FuDevice *device)
fu_device_set_update_error (device, "VersionFormat is ambiguous for this device");
}
/* no vendor-id, and so no way to lock it down! */
if (fu_device_has_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE) &&
fu_device_get_vendor_id (device) == NULL) {
fu_device_remove_flag (device, FWUPD_DEVICE_FLAG_UPDATABLE);
fu_device_set_update_error (device, "No vendor ID set");
}
/* notify all plugins about this new device */
if (!fu_device_has_flag (device, FWUPD_DEVICE_FLAG_REGISTERED))
fu_engine_plugin_device_register (self, device);