From 598fd4da1cf9665834110583fd9133073cc12481 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 2 Dec 2022 15:05:49 +0100 Subject: 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) --- src/dissect/dissect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dissect') 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: -- cgit v1.2.1