summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-08-18 16:08:14 +0100
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-09-06 12:13:53 +0100
commit9ccb531a5f99a7f399f352e79079188957f5a170 (patch)
treee676fa9477bc709a9f9437437d2d0543b61b5d5e /src/portable
parent77afbef6925d829d9c3da6636a873358846c0290 (diff)
downloadsystemd-9ccb531a5f99a7f399f352e79079188957f5a170.tar.gz
dissect-image: add extension-specific validation flag
Allows callers to specify which image type they are looking for
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/portable.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/portable/portable.c b/src/portable/portable.c
index 4044c523e1..b3fcf2719a 100644
--- a/src/portable/portable.c
+++ b/src/portable/portable.c
@@ -423,9 +423,16 @@ static int portable_extract_by_path(
if (r < 0)
return r;
if (r == 0) {
+ DissectImageFlags flags = DISSECT_IMAGE_READ_ONLY;
+
seq[0] = safe_close(seq[0]);
- r = dissected_image_mount(m, tmpdir, UID_INVALID, UID_INVALID, DISSECT_IMAGE_READ_ONLY);
+ if (!extract_os_release)
+ flags |= DISSECT_IMAGE_VALIDATE_OS_EXT;
+ else
+ flags |= DISSECT_IMAGE_VALIDATE_OS;
+
+ r = dissected_image_mount(m, tmpdir, UID_INVALID, UID_INVALID, flags);
if (r < 0) {
log_debug_errno(r, "Failed to mount dissected image: %m");
goto child_finish;