From: Lennart Poettering Date: Wed, 3 Dec 2025 08:38:50 +0000 (+0100) Subject: mountfsd: return a better error when invalid file flags are specified on image fd X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9b60de478de510a5e38c80b195456806cdc2b98;p=thirdparty%2Fsystemd.git mountfsd: return a better error when invalid file flags are specified on image fd We already defined an error for this that we return for invalid dir fds passed in, let's add the same niceness to the image fds. --- diff --git a/src/mountfsd/mountwork.c b/src/mountfsd/mountwork.c index 4c321ce1c07..7de8784e326 100644 --- a/src/mountfsd/mountwork.c +++ b/src/mountfsd/mountwork.c @@ -353,6 +353,8 @@ static int vl_method_mount_image( } r = validate_image_fd(image_fd, &p); + if (r == -EREMOTEIO) + return sd_varlink_errorbo(link, "io.systemd.MountFileSystem.BadFileDescriptorFlags", SD_JSON_BUILD_PAIR_STRING("parameter", "imageFileDescriptor")); if (r < 0) return r;