]> git.ipfire.org Git - thirdparty/systemd.git/commit
dissect: Make --mount/--unmount/--with work unprivileged
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Fri, 26 Dec 2025 21:18:29 +0000 (22:18 +0100)
committerDaan De Meyer <daan@amutable.com>
Thu, 12 Feb 2026 08:43:07 +0000 (09:43 +0100)
commitef155c909a53fc1c04c8ea5cd4b032e548b91a87
tree6d13cfb124a543000136d5dc3f485fa6e4da6091
parentfe0114db8e9f87042fcaa94fd3c16d5be85f8f16
dissect: Make --mount/--unmount/--with work unprivileged

Let's check for CAP_SYS_ADMIN instead of root for these, and make
unmounting more graceful if we can't access the backing loop device
because of permission issues. This allows mounting and unmounting images
from an unprvileged mount namespace. The actual files in the image will
end up owned by nobody:nobody because we'll be in an unprivileged user
namespace, but assuming the directory permissions are not too strict, this
still allows interacting with the image in useful ways.
src/dissect/dissect.c