From a9b60de478de510a5e38c80b195456806cdc2b98 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 Dec 2025 09:38:50 +0100 Subject: [PATCH] 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. --- src/mountfsd/mountwork.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.47.3