From: Daan De Meyer Date: Sat, 21 Feb 2026 20:36:16 +0000 (+0100) Subject: dissect: Go via service on ENOENT from loop_device_make() as well X-Git-Tag: v260-rc1~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=104579e40121d4ea4bf2d6b7174b9849cc6dd56c;p=thirdparty%2Fsystemd.git dissect: Go via service on ENOENT from loop_device_make() as well ENOENT means /dev/loop-control isn't there which means we're in a container and should go via mountfsd. At the same time, reverse the check for fatal actions as almost all actions can be done via mountfsd, only --attach needs the loop device. --- diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 250be1af3d1..aafbd872ae7 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -2178,10 +2178,10 @@ static int run(int argc, char *argv[]) { else r = loop_device_make_by_path(arg_image, open_flags, /* sector_size= */ UINT32_MAX, loop_flags, LOCK_SH, &d); if (r < 0) { - if (!ERRNO_IS_PRIVILEGE(r) || !IN_SET(arg_action, ACTION_MOUNT, ACTION_UMOUNT, ACTION_WITH, ACTION_DISSECT, ACTION_LIST, ACTION_MTREE, ACTION_COPY_FROM, ACTION_COPY_TO, ACTION_SHIFT)) + if ((r != -ENOENT && !ERRNO_IS_PRIVILEGE(r)) || arg_action == ACTION_ATTACH) return log_error_errno(r, "Failed to set up loopback device for %s: %m", arg_image); - log_debug_errno(r, "Lacking permissions to set up loopback block device for %s, using service: %m", arg_image); + log_debug_errno(r, "Lacking permissions or missing /dev/loop-control to set up loopback block device for %s, using service: %m", arg_image); arg_via_service = true; } else { if (arg_loop_ref) {