diff options
author | Luca Boccassi <bluca@debian.org> | 2022-05-20 12:24:45 +0100 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2022-05-20 13:08:45 +0100 |
commit | 7b2e763242e7736ef941f275977aa0c30d832c63 (patch) | |
tree | 85f3967baadce7c95c586cc22bf5db8756e59521 /src/portable | |
parent | a2cf73f0b602a93a32107cfc066a5e307263c577 (diff) | |
download | systemd-7b2e763242e7736ef941f275977aa0c30d832c63.tar.gz |
portable: reject root directories without an ID field in os-release
We always require at least ID to be set in os-release, reject
and propagate error to the caller instead of asserting later
Diffstat (limited to 'src/portable')
-rw-r--r-- | src/portable/portable.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/portable/portable.c b/src/portable/portable.c index 2191d6c653..c4f42f9500 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -582,6 +582,8 @@ static int extract_image_and_extensions( "PORTABLE_PREFIXES", &prefixes); if (r < 0) return r; + if (isempty(id)) + return sd_bus_error_set_errnof(error, SYNTHETIC_ERRNO(ESTALE), "Image %s os-release metadata lacks the ID field", name_or_path); if (prefixes) { valid_prefixes = strv_split(prefixes, WHITESPACE); |