summaryrefslogtreecommitdiffstats
path: root/src/test/test-boot-timestamps.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-06-22 18:47:37 +0200
committerLennart Poettering <lennart@poettering.net>2018-10-08 21:40:44 +0200
commit337eed30e409db3770184b4d36eb6aeeb4e605fe (patch)
tree3cb6568e7b22c7452b44d41180d07ae1d88c4ea5 /src/test/test-boot-timestamps.c
parentefi: detect containers in is_efi_boot() (diff)
downloadsystemd-337eed30e409db3770184b4d36eb6aeeb4e605fe.tar.xz
systemd-337eed30e409db3770184b4d36eb6aeeb4e605fe.zip
efivars: check whether we are booted with EFI before reading/writing to variables
We do these checks only for the high-level calls as for the low-level ones it might make sense in some exotic uses to read the host EFI data from a container or so.
Diffstat (limited to 'src/test/test-boot-timestamps.c')
-rw-r--r--src/test/test-boot-timestamps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-boot-timestamps.c b/src/test/test-boot-timestamps.c
index d45ca8c920..7e659f178d 100644
--- a/src/test/test-boot-timestamps.c
+++ b/src/test/test-boot-timestamps.c
@@ -41,7 +41,7 @@ static int test_efi_loader(void) {
r = efi_loader_get_boot_usec(&loader_start, &loader_exit);
if (r < 0) {
- bool ok = r == -ENOENT || (getuid() != 0 && r == -EACCES);
+ bool ok = r == -ENOENT || (getuid() != 0 && r == -EACCES) || r == -EOPNOTSUPP;
log_full_errno(ok ? LOG_DEBUG : LOG_ERR,
r, "Failed to read EFI loader data: %m");
@@ -64,7 +64,7 @@ static int test_boot_timestamps(void) {
r = boot_timestamps(NULL, &fw, &l);
if (r < 0) {
- bool ok = r == -ENOENT || (getuid() != 0 && r == -EACCES);
+ bool ok = r == -ENOENT || (getuid() != 0 && r == -EACCES) || r == -EOPNOTSUPP;
log_full_errno(ok ? LOG_DEBUG : LOG_ERR,
r, "Failed to read variables: %m");