Commit Graph

555 Commits

Author SHA1 Message Date
Richard Hughes
945002f7a3 Fix build for MacOS
This is more for curiosity than anything else.
2022-03-15 14:37:28 +00:00
Richard Hughes
d3cba9a679 Add fwupd_client_disconnect() for future usage 2022-03-11 13:28:00 +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
4ce9972ce5 trivial: Don't leak the string even on critical failure
Not totally sure this is worthwhile, but it triggered a failure in the
RHEL tests we do - and it's less work to fix it than argue.
2022-03-08 16:01:16 +00:00
Mario Limonciello
6896e0ab52 trivial: switch from meson.source_root to meson.project_source_root
The former is deprecated in meson 0.56 or later.
2022-02-28 08:34:48 -06: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
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
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
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
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
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
3917714dd1 redfish: Change an expired password when required 2022-01-19 21:19:01 +00:00
Richard Hughes
c725e42e34 trivial: Fix various const issues 2022-01-03 22:46:23 +00:00
Richard Hughes
e17a107ce1 trivial: Cast the g_signal_connect() object to allow static analysis
This is useful when using https://gitlab.freedesktop.org/tartan/tartan
2022-01-03 22:46:23 +00:00
Richard Hughes
c4590f2f25 trivial: Add some missing g_return_val_if_fail() calls 2022-01-03 22:46:23 +00:00
Richard Hughes
2e99055d1e trivial: Add some more annotations for language bindings 2022-01-03 22:46:23 +00:00
Richard Hughes
3356d8a844 trivial: Add fwupd_device_get_root() for GUI use 2021-12-17 16:44:57 +00:00
Richard Hughes
cb110b55f8 trivial: Fix regression from 9f94dc9 on Ubuntu Focal 2021-12-17 12:19:39 +00:00
Richard Hughes
9f94dc97c4 trivial: Handle old JSON-Glib more gracefully
Fixes https://github.com/fwupd/fwupd/issues/4099
2021-12-16 19:29:49 +00:00
Mario Limonciello
27ac4f1fc2 trivial: libfwupd: correct building URI path
when run on Windows the following is emitted:

```
changing metadata URI from https://cdn.fwupd.org/downloads/firmware.xml.gz to
https://cdn.fwupd.org/downloads\firmware-02681-stable.xml.gz
```
2021-12-15 06:46:27 -06:00
Richard Hughes
3822422b1e trivial: Workaround two false 'unused' warnings from clang 2021-12-10 16:00:07 +00:00
Richard Hughes
beb29ff698 Add a sync-bkc subcommand to ensure a known set of firmware versions
Install or downgrade firmware on all devices to make the system match
a well known set. This allows two things:

 * Factory recovery where a device in the field has been upgraded
 * Ensuring a consistent set of tested firmware for a specific workload

A tag is assigned either during upload or added post-upload on the LVFS
which is included in the metadata. A single firmware can be marked with
multiple tags, and tags can be duplicated for different firmwares.
2021-11-29 15:16:14 +00:00
Richard Hughes
4fe8a36729 Add support for LVFS component tags
These allow us to tag components as being part of a set, e.g. a BKC.
2021-11-25 10:36:26 +00:00
Richard Hughes
6e651269ba Fix running the tests when fwupd is not installed
This probably regressed in 70f9124545 as
the callers actually expect an error in the GDBusError domain, rather
than one fixed up in the FwupdError domain.

Fixes https://github.com/fwupd/fwupd/issues/4014
2021-11-23 15:18:41 +00:00
Richard Hughes
5ebbfe7f7d Export the component release ID over DBus
This allows us to map a specific component on the LVFS without guessing
by using the generated checksum.
2021-11-19 06:55:53 +00:00
Gabriel Kerneis
3e8f09a0f7 Add HSI check that PCR registers 0-7 are not empty
Some BIOSes forget add measurements to PCR registers, which results in
all-zero checksums and breaks measured boot guarantees.

Fixes #3901
2021-11-17 16:21:52 +00:00
Richard Hughes
60612294f5 trivial: Use the device GType as the debugging root
We never show the fu_device_to_string() output to the user in normal
circumstances, and it's super useful for it to match the FuFirmware
format.
2021-11-15 14:59:52 +00:00
Richard Hughes
b87a909223 trivial: Do not show a critical warning is LANG is unset 2021-11-12 15:26:31 +00:00
Richard Hughes
4d63d4ad7c Use g_subprocess_communicate() to fix IPFS downloads
Since switching to a custom GMainContext we broke reading the stream of
the GSubprocess.
2021-11-09 09:22:18 +00:00
Richard Hughes
09b946cb40 trivial: Fix ctrl+c when downloading with IPFS 2021-11-09 09:22:18 +00:00
Richard Hughes
5e895b89c9 Use pre-computed namespace GUIDs to load 0.3% faster
This should also help memory fragmentation at startup too as we were
splitting a lot of very small strings.
2021-11-03 21:51:45 +00:00
Richard Hughes
81d0216d14 trivial: Make checking a GUID faster to speed up startup by 0.23%
We call this 570 times at startup, and it makes up a non-trivial amount
of the daemon startup time...
2021-11-03 21:51:45 +00:00
Richard Hughes
e3998eed5a trivial: Fix a tiny leak on request error path 2021-11-02 13:47:56 +00:00
Richard Hughes
a0cb743700 Show changes in HSI attributes when required
e.g. `fwupdmgr security --force` would display:

    Host Security Events
      2021-10-29 10:51:42:  ✘ Kernel lockdown disabled
      2021-10-29 10:51:42:  ✘ SecureBoot disabled
      2021-10-29 09:32:32:  ✔ IOMMU device protection enabled
      2021-10-29 09:28:52:  ✘ IOMMU device protection disabled
2021-11-01 06:58:44 +00:00
Richard Hughes
8120616c62 trivial: Add a fallback result for an HSI attribute
The fallback may represent the old state, or a state
that may be considered equivalent.
2021-11-01 06:58:44 +00:00
Richard Hughes
e9319699b4 trivial: Add fwupd_security_attr_copy() for future functionality 2021-10-29 13:09:45 +01:00
Richard Hughes
a085b4dd68 Add a 'created' property on the HSI security attribute 2021-10-28 17:25:40 +01:00
Richard Hughes
dbdd3740a3 Add support for loading the HSI result from a JSON blob
This is how we save it to the database, and we'll need to load old
records for future functionality.
2021-10-28 15:36:13 +01:00
Richard Hughes
95b82a1467 trivial: Add two missing _from_string() HSI helpers 2021-10-28 15:36:13 +01:00
Richard Hughes
164012b47b trivial: Ensure the plugin is loaded from the HSI attr variant 2021-10-28 15:36:13 +01:00
Richard Hughes
70f9124545 Show translated firmware release notes when provided
Send the users locale to the daemon so that it can be used to prefer
the localized update text over the default en_US version.

    $ LANG=fr_FR.UTF8 fwupdmgr get-details test.cab
    ...
    └─ACME Plan 9:
          Nouvelle version: 0.0.5
          Licence:          Propriétaire
          Urgence:          Faible
          Fournisseur:      ACME Ltd.
          Description:      Cette version stable corrige des bugs.

I decided to send the locale to the daemon rather than change the
`Description` to return GVariant to `a{ss}` as we also probably want
to support things like localized summary and URLs too in the future.
2021-10-24 18:59:15 +01:00
Richard Hughes
2d00cda464 Remove PLUGINBUILDDIR and use G_TEST_SRCDIR and G_TEST_BUILDDIR instead
This allows us to override the location we load data files from, which
allows us to do more kinds of installed tests in the future.

Also, move the global data/tests content into the place that it is used
as it was getting impossible to manage.
2021-10-21 18:36:22 +01:00
Richard Hughes
bc14f4c59c Support client-side abbreviated hashes
This allows the user to do something like `fwupdmgr get-releases a12d`
which is already supported daemon-side.
2021-10-18 11:16:45 +01:00
Gaël PORTAY
918006f8d5 trivial: Codespell fixes 2021-10-14 09:09:54 -05:00
Richard Hughes
d3706e0e0b Show the user a warning if updating may affect full-disk-encryption
Additionally, if the client does not set the feature flag `fde-warning`,
add an extra paragraph into the update description.

Fixes https://github.com/fwupd/fwupd/issues/3829
2021-10-09 08:09:38 +01:00
Richard Hughes
0fb485e434 Raise the client timeout value from 25 seconds
When coldplugging expensive servers with a huge number of Redfish
devices it takes about 30 seconds to start fwupd while we wait for the
BMC to return results.
2021-10-08 17:22:45 +01:00
Richard Hughes
478e44bc19 trivial: Do not use g_assert() in self test code
Note that g_assert() should not be used in unit tests, since it is a
no-op when compiling with G_DISABLE_ASSERT. Use g_assert() in production
code, and g_assert_true() in unit tests.

See https://github.com/fwupd/fwupd/issues/3790
2021-09-24 22:20:21 +01:00
Richard Hughes
494fd2736f Allow installing the LVFS remote, but disabled
This is a patch that I have to regenerate almost every rebase. Just
move it upstream as it's probably not RHEL specific.
2021-09-24 16:55:04 +01:00
Mario Limonciello
6ebccf1e1e Remove support for --ignore-power by frontends
This functionality broke a number of releases ago as part of
implementing device inhibition and was just noticed now.

Instead of fixing it, the preference seems to be to remove the
functionality as it exists today as inhibitions can happen for
a number of reasons.

To still allow people to override these power warnings (such as during
development) add a new daemon configuration item that can be used.

Fixes: #3778
2021-09-21 13:13:52 -05:00