Age | Commit message (Collapse) | Author |
|
Allow reserving a particular range instead of allocating a suitable
large range of an IDAllocation. This is useful when a directory
hierarchy defines the allocation and we merely want to verify it to be
assigned.
|
|
It serves two main purposes. For one thing, it allows telling bare
integers and file descriptors apart on a typing level similar to a
NewType. For another it adds common methods to a file descriptor and
enables closing it via a context manager.
|
|
|
|
It is a bit like an async version of shutil.copyfileobj but for bare
file descriptors and has an optimized version for pipes.
|
|
os.splice from Python >= 3.10 is good enough.
This reverts commit 056c1f964f55adedc17f8d7bddef1f48c73852c7.
|
|
|
|
|
|
|
|
When booting systemd, it'll create these symlinks, but when doing an
application container, nothing does this and we risk creating regular
files there.
|
|
This is a mixin subclass for TarFile that enables it to restore and
apply linux extended attributes as PAX headers in the SCHILY.xattr.*
format. As a consequence, this enables us to process tar archives
containing file system capabilities.
|
|
Move the generic tar utilities from the chroottar.py example into a
linuxnamespaces module as dealing with tar archives is a fairly common
thing when dealing with namespaces.
|
|
|
|
|
|
|
|
Passing None as name also yields libc functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It does not make sense to read a link after having followed it.
|
|
Also allow joining an AtLocation. When doing that note that any kind of
absolute location object (absolute path without fd and any location with
an fd) results in just that latter location just like os.path.join
returns the latter path when it is absolute.
Fixes: 034f732a1af4 ("initial checkin")
|
|
|
|
|
|
Fixes: 1c265b6e11c3 ("add os.stat wrapper AtLocation.stat")
|
|
|
|
These are the is_* family and exists all from pathlib.Path.
|
|
|
|
|
|
This mirrors what was done for pathlib.Path to avoid confusion about
argument order.
|
|
|
|
This is similar to pathlib.Path.is_absolute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
As we learn from util-linux, MS_RDONLY is ignored on MS_BIND. Rather
than remount, just use the new mount API as it doesn't suffer this
limitation.
|
|
|
|
In particular, one can now pass newdev = origdev.
|
|
|
|
Fixes: 1de72653e0b9 ("add function linuxnamespaces.populate_sys")
|
|
|
|
|
|
pathlib.Path(somebytes) fails. Hence bytes is not actually convertible
and should not be included in PathConvertible. Then, we can simplify
matters in quite a few places by knowing that the thing we work with is
not bytes.
|
|
Adding an async write does not work for values larger than 1, because
the fd becomes writable once a value of 1 can be written, but a larger
value might still cause EAGAIN putting us into a busy loop. Hitting the
limit with writing ones is implausible, so async code can just use the
synchronous write method.
|
|
The textual representation matches util-linux. Not all flag values can
be represented textually.
|
|
When using sys.exit, we actually raise a SystemExit exception and as a
consequence exit all context managers. If a particular context manager
pertains only the process at hand, we don't really care, because our
process is supposed to vanish. If a context manager changes external
state such as tempfile.NamedTemporaryFile, this is very bad and
unexpected. We need to ensure that such cleanup is not performed.
This also simplifies the test suite that had to emulate this behaviour
already as pytest uses a context manager.
|