]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
discover-image: mount as read-only when extracting metadata
authorLuca Boccassi <luca.boccassi@microsoft.com>
Thu, 22 Jul 2021 21:21:10 +0000 (22:21 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jul 2021 12:07:58 +0000 (14:07 +0200)
We don't need to modify the image, and the loopback device is already set to read-only.

src/shared/discover-image.c

index 5c833afc788b0c8b15143a7b82caa2cbc4485b68..521264ec29b3b194a8f636fe76157004746b6c5e 100644 (file)
@@ -1208,6 +1208,7 @@ int image_read_metadata(Image *i) {
                                 DISSECT_IMAGE_GENERIC_ROOT |
                                 DISSECT_IMAGE_REQUIRE_ROOT |
                                 DISSECT_IMAGE_RELAX_VAR_CHECK |
+                                DISSECT_IMAGE_READ_ONLY |
                                 DISSECT_IMAGE_USR_NO_ROOT,
                                 &m);
                 if (r < 0)