]> git.ipfire.org Git - thirdparty/systemd.git/commit
machined: add new OpenRootDirectory() call to Machine objects
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Apr 2016 09:13:16 +0000 (11:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Apr 2016 13:24:46 +0000 (15:24 +0200)
commitae20320785da548130929ad2af758be4803931a7
tree403f5b1500228b8689cfa112eaf08bcab1e57df9
parent5d1ce25728856956c1fbfe05b491067f83bd2216
machined: add new OpenRootDirectory() call to Machine objects

This new call returns a file descriptor for the root directory of a container.
This file descriptor may then be used to access the rest of the container's
file system, via openat() and similar calls. Since the file descriptor returned
is for the file system namespace inside of the container it may be used to
access all files of the container exactly the way the container itself would
see them. This is particularly useful for containers run directly from
loopback media, for example via systemd-nspawn's --image= switch. It also
provides access to directories such as /run of a container that are normally
not accessible to the outside of a container.

This replaces PR #2870.

Fixes: #2870
src/machine/machine-dbus.c
src/machine/machine-dbus.h
src/machine/machined-dbus.c