summaryrefslogtreecommitdiff
path: root/src/dissect
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-12-02 15:05:49 +0100
committerLennart Poettering <lennart@poettering.net>2023-04-05 20:49:48 +0200
commit598fd4da1cf9665834110583fd9133073cc12481 (patch)
treee367ec67874d9c34a8da78403b69a028a9ec191f /src/dissect
parentdee4a6237ab5913a6cac3f2afa5ba6ae1f35080a (diff)
downloadsystemd-598fd4da1cf9665834110583fd9133073cc12481.tar.gz
dissect: disallow empty partition tables
If we don't find a single useful partition table, refusing dissection. (Except in systemd-dissect, when we are supposed to show DDI information, in that case allow this to run and show general DDI information, i.e. size, UUID and name at least)
Diffstat (limited to 'src/dissect')
-rw-r--r--src/dissect/dissect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c
index f89a9dff20..b53c2cc357 100644
--- a/src/dissect/dissect.c
+++ b/src/dissect/dissect.c
@@ -501,7 +501,8 @@ static int parse_argv(int argc, char *argv[]) {
if (r < 0)
return r;
- arg_flags |= DISSECT_IMAGE_READ_ONLY;
+ /* when dumping image info be even more liberal than otherwise, do not even require a single valid partition */
+ arg_flags |= DISSECT_IMAGE_READ_ONLY|DISSECT_IMAGE_ALLOW_EMPTY;
break;
case ACTION_MOUNT: