Commit Graph

2202 Commits

Author SHA1 Message Date
Gaël PORTAY
128caa5388 Fix memory leak
This fixes the memory leak below:

	$ sudo valgrind -v --leak-check=full fwupdtool get-devices
	(...)
	==3244345== 133 (64 direct, 69 indirect) bytes in 2 blocks are definitely lost in loss record 2,488 of 2,681
	==3244345==    at 0x4845899: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
	==3244345==    by 0x4C04D59: g_malloc (in /usr/lib/libglib-2.0.so.0.7000.4)
	==3244345==    by 0x4C1C816: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.7000.4)
	==3244345==    by 0x4C1CE9E: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.7000.4)
	==3244345==    by 0x4B84684: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4B6BB65: ??? (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4B6CAF4: g_object_new_with_properties (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4B6D659: g_object_new (in /usr/lib/libgobject-2.0.so.0.7000.4)
	==3244345==    by 0x4AA8969: ??? (in /usr/lib/libgio-2.0.so.0.7000.4)
	==3244345==    by 0x153967: fu_engine_load_local_metadata_watches (fu-engine.c:7050)
	==3244345==    by 0x1540FC: fu_engine_load (fu-engine.c:7230)
	==3244345==    by 0x124D29: fu_util_start_engine (fu-tool.c:262)
	(...)
	==3244345== LEAK SUMMARY:
	==3244345==    definitely lost: 64 bytes in 2 blocks
	==3244345==    indirectly lost: 69 bytes in 2 blocks
	==3244345==      possibly lost: 1,936 bytes in 8 blocks
	==3244345==    still reachable: 234,668 bytes in 3,072 blocks
	==3244345==         suppressed: 0 bytes in 0 blocks
	==3244345== Reachable blocks (those to which a pointer was found) are not shown.
	==3244345== To see them, rerun with: --leak-check=full --show-leak-kinds=all
	==3244345==
	==3244345== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 0 from 0)
2022-03-23 19:05:20 +00:00
Richard Hughes
b99297046f Check the update protocol exists when checking requirements 2022-03-23 16:34:09 +00:00
Richard Hughes
8624f454d6 trivial: Remove one instance of -Wunused-variable 2022-03-18 13:35:57 +00:00
Richard Hughes
84a13af360 Show the user a wiki page about the FDE warning
Fixes https://github.com/fwupd/fwupd/issues/4400
2022-03-18 12:11:40 +00:00
Richard Hughes
b9774c644d Fix the 'Device has been removed' warning incorrectly seen on devices
Uninhibit the returning device if no firmware update has been performed.
2022-03-17 10:06:37 +00:00
Richard Hughes
92515d193a Add coSWID and uSWID parsers to libfwupdplugin
These parse the structures as defined in:

 * https://datatracker.ietf.org/doc/draft-ietf-sacm-coswid/
 * https://github.com/hughsie/python-uswid
2022-03-15 14:37:02 +00:00
Richard Hughes
6b5d933e99 Do not show unconnected or unreachable devices in the client tools
Fixes https://github.com/fwupd/fwupd/issues/4378
2022-03-15 14:08:17 +00:00
Crag Wang
a2b46e15cf Add daemon configuration 'OnlyTrusted' to D-Bus properties 2022-03-10 09:46:54 +00:00
Richard Hughes
91512925a0 Check for os-release on FWUPD_SYSCONFDIR
Change-Id: I391eabfb1ef6eadbad100273445794172b2cb1fd

Fixes https://github.com/fwupd/fwupd/issues/4366

Based on a patch by Daniel Campello <campello@chromium.org>, many thanks.
2022-03-09 08:10:18 -07:00
Richard Hughes
d86b8bc794 Show devices that are updatable and payload signing is still unknown
But, ignore devices like UEFI, NVMe and Redfish as this is specified in
the firmware metadata.
2022-03-02 15:33:42 +00:00
Mario Limonciello
661990ed98 Convert build system to use meson tristate features
tristate features will automatically disable if dependencies marked
as required are missing.

Packagers can manually override using `auto_features`.

Link: https://mesonbuild.com/Build-options.html#features
2022-02-28 08:34:48 -06:00
Daniel Campello
6eb1cef881 Use multiple checksums when no <artifacts>
Current behavior is that only first checksum is used from metadata if no
<artifacts> section is present. Change this to process all checksums
available.

Change-Id: I03771971bee0fb7960460094bf0790d29bf11e0a
2022-02-25 10:31:03 +00:00
Richard Hughes
46848d3bef trivial: Fix a thinko when not using --json 2022-02-23 10:50:31 +00:00
Richard Hughes
46cf7e4f30 trivial: Fix thinko when there exists LVFS DeviceIntegrity metadata 2022-02-23 10:44:38 +00:00
Richard Hughes
6ec0646380 trivial: Do not output selected device when using --as-json 2022-02-22 21:51:01 +00:00
Mario Limonciello
f9ae630c5a trivial: Assume JSON means non-interactive
Don't show anything to a user that they need to interact with
when running in JSON mode.
2022-02-22 21:51:01 +00:00
Richard Hughes
b0ccd1f4e2 Add CLI support for disabling device prompting 2022-02-22 21:51:01 +00:00
Richard Hughes
f3a13f89dd Allow specifing the DeviceIntegrity flag from metadata 2022-02-22 19:12:06 +00:00
Richard Hughes
758d5d8c6f Add a flag to indicate the device is signed or unsigned
Devices without either flag are unknown.
2022-02-22 19:12:06 +00:00
Mario Limonciello
a0c9d6312c trivial: don't show probe errors for unsupported debices 2022-02-22 17:22:13 +00:00
Richard Hughes
2472b51b9e Add the JCat version to the built and runtime versions 2022-02-22 14:39:10 +00:00
Richard Hughes
7157ca79e4 Require libjcat 0.1.4
Although we can compile against older versions, we can't actually work
as current firmware.jcat metadata from the LVFS needs these commits:

109399e1f2
583df67e3e

If it helps, 0.1.4 was released in October *2020*.
2022-02-22 13:28:06 +00:00
Mario Limonciello
f301aabd45 trivial: don't run systemd check when running as a socket
We don't want to be checking for a systemd daemon when we just told
you that it is a socketed daemon. (Fixes: #4299)
2022-02-18 11:36:24 -06:00
Richard Hughes
f63080fbe2 Allow assigning issues to devices
This allows us to show in the tools if a device is currently affected
by a specific CVE. For instance, we could inform the user that a device
requires a critical firmware update that is being actively exploited.

Note, this also means we can show the user a firmware update is now
required, even though the firmware may not be available on the LVFS.

Also show the issue in the `fwupdmgr security` output, e.g.

    There are devices with issues:
      Samsung — MZVLB2T0HALB-000L7:
       • CVE-2022-12345
       • CVE-2022-54321
2022-02-16 14:50:29 +00:00
Richard Hughes
b2bb76dbdd Add X-BaseboardManagementController as an acceptable category 2022-02-16 14:08:01 +00:00
Richard Hughes
f7c69d794b Show the user when devices are updatable by inhibited
Fixes https://github.com/fwupd/fwupd/issues/4281
2022-02-14 16:03:12 +00:00
Richard Hughes
ad0b274cec trivial: Move the date_eol attribute to the component node
The LVFS has been changed to do the same, and no real vendors have
added EOL information yet.
2022-02-11 10:44:10 +00:00
Gaël PORTAY
73377b2a53 trivial: Add new category type for video display 2022-02-10 13:47:17 +00:00
Richard Hughes
b5e7a0be16 Do not use gettext before calling setlocale 2022-02-09 16:56:47 +00:00
Richard Hughes
b4fb6fa6aa flashrom: Fix loading devices in coreboot mode
We were specifying _REQUIRE_HWID but the plugin list was not yet loaded when we were trying all the HwIds.
2022-02-09 14:21:03 +00:00
Richard Hughes
9ea78077af trivial: Fix a logic thinko when adding the community warning in fwupdmgr 2022-02-08 17:10:28 +00:00
Richard Hughes
31dacb8687 Allow marking a device as EOL
This probably means it is unlikely to get any new security updates.
2022-02-07 16:03:44 +00:00
Richard Hughes
930e6f4e52 Get the host machine ID when running on Windows 2022-02-07 16:01:51 +00:00
Richard Hughes
2633b68cd8 trivial: Fix the vendor to battery threshold mapping
I broke this when optimizing fu_context_lookup_quirk_by_id() to only
take a GUID. Mea culpa.

Fixes https://github.com/fwupd/fwupd/issues/4250
2022-02-04 19:28:49 +00:00
Richard Hughes
7d8fef4139 trivial: Remove the unused com.redhat.fwupdate built version
We've not needed this for several years, and no firmware on the LVFS actually uses this.
2022-02-04 11:59:51 +00:00
Richard Hughes
dbd0995071 Add support for outputting versions in JSON format
To use this, do: 'fwupdmgr --version --json'
2022-02-03 15:42:57 +00:00
Richard Hughes
67d24b0f65 trivial: Add the HostBkc to the report metadata 2022-02-03 15:42:57 +00:00
Richard Hughes
5f50b5e9a1 trivial: Remove unused variable 2022-01-31 14:36:38 +00:00
Richard Hughes
bb1bcce863 Allow fwupd to operate without a D-Bus daemon
This adds support for optionally using a UNIX domain socket where a
D-Bus daemon may not be running.

To use this, launch the daemon and clients with something like
`FWUPD_DBUS_SOCKET=/var/run/fwupd.sock fwupdmgr get-devices`
2022-01-31 14:05:23 +00:00
Richard Hughes
47c92393de trivial: Always use the GCancellable in fwupdmgr 2022-01-31 13:05:41 +00:00
Richard Hughes
7290da5dda Allow the root user to ask the daemon to quit
This makes it easier to test the fwupd in the installed tests:

    sudo gdbus call --system \
    	--dest org.freedesktop.fwupd \
    	--object-path / \
    	--method org.freedesktop.fwupd.Quit
2022-01-31 10:47:26 +00:00
Richard Hughes
6eada0e067 Add a flag to indicate the firmware is not provided by the vendor
Also, force the user to accept this warning for every update.
2022-01-25 10:13:40 +00:00
Richard Hughes
8707d3d048 Translate the firmware flags when using fwupdmgr 2022-01-25 09:53:52 +00:00
Richard Hughes
02d8753097 Move the clear-history command to fwupdtool
This is perhaps a useful thing to do when debugging, but isn't the sort
of thing we need users to understand.
2022-01-21 15:25:05 +00:00
Richard Hughes
ffac7d6024 Merge the little-used clear-offline action into clear-results
Fixes https://github.com/fwupd/fwupd/issues/3581
2022-01-21 15:25:05 +00:00
Richard Hughes
38bab8fc4f Allow overriding daemon parameters using /var/etc/fwupd/daemon.conf
This is super useful for debugging immutable systems like ChromeOS.
2022-01-21 11:52:06 +00:00
Richard Hughes
122dee1a19 Allow specifying the BKC locally
Fixes https://github.com/fwupd/fwupd/issues/4040
2022-01-21 11:35:54 +00:00
Richard Hughes
59845f970e trivial: Fix a compile problem when fwupdmgr is built before fu-hash.h 2022-01-20 17:06:14 +00:00
Richard Hughes
fc4687f3e5 trivial: Add the missing keys for the daemon ModifyConfig method 2022-01-20 13:44:53 +00:00
Crag Wang
b728608baa Show results when calling get-details if failing requirements 2022-01-19 12:10:52 +00:00