From: Luca Boccassi Date: Mon, 23 Mar 2026 00:51:29 +0000 (+0000) Subject: mountfsd: fix readOnly flag inversion X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F41273%2Fhead;p=thirdparty%2Fsystemd.git mountfsd: fix readOnly flag inversion mountfsd applies R/O when the varlink readOnly flag is set to false Reported on yeswehack.com as YWH-PGM9780-164 Follow-up for 702a52f4b5d49cce11e2adbc740deb3b644e2de0 --- diff --git a/src/mountfsd/mountwork.c b/src/mountfsd/mountwork.c index 922bcb1b189..f3f80b1c274 100644 --- a/src/mountfsd/mountwork.c +++ b/src/mountfsd/mountwork.c @@ -521,7 +521,7 @@ static int vl_method_mount_image( r = loop_device_make( image_fd, - p.read_only == 0 ? O_RDONLY : O_RDWR, + p.read_only > 0 ? O_RDONLY : O_RDWR, 0, UINT64_MAX, UINT32_MAX, @@ -532,7 +532,7 @@ static int vl_method_mount_image( return r; DissectImageFlags dissect_flags = - (p.read_only == 0 ? DISSECT_IMAGE_READ_ONLY : 0) | + (p.read_only > 0 ? DISSECT_IMAGE_READ_ONLY : 0) | (p.growfs != 0 ? DISSECT_IMAGE_GROWFS : 0) | DISSECT_IMAGE_DISCARD_ANY | DISSECT_IMAGE_FSCK |