Age | Commit message (Collapse) | Author |
|
This reverts commit a169f51420795a212c3226f455e783ab8ac5cf47.
We really deal with two user namespaces. The initial/parent process maps
the target id range plus the current user id. The child process that
executes the workload only maps the target id range without the current
user id. The child opens the tar file while it still is in the initial
namespace, then unshares and once it only has the subid range mapped, it
performs the extraction. No clamping is necessary at this point. The
parent process maps additionally maps the current id in order to write
the tar file.
|
|
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.
|
|
The mode actually can only have these three distinct literals. While
more complex modes can get passed to TarFile.open, they're decomposed
there and only of these three is passed to the compressor openers.
|
|
zstandard.open actually consumes file objects. Hence there is little
benefit in not implementing the passing of a fileobj even though we
don't use it here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When decompression fails, we should raise a tarfile.ReadError rather
than a zstandard.ZstdError. Otherwise, tarfile gives up guessing.
|
|
* Drop supplementary groups. Very likely, those are not mapped inside
and they cannot cause much good.
* Sane permission for the root directory. Otherwise no non-root user
can access any files.
|
|
When TMPDIR has restrictive permissions, the namespace may be unable to
access the leading components. Thus we put the supervisor process
handling the cleanup into a different namespace that has all the ids
plus the current uid mapped. It'll then be able to perform the cleanup
(and the initial chown).
|
|
|