libpathrs v0.1.1 -- "頒布と聞いたら蛇に睨まれた蛙になるよ"
This is the first patch release of the 0.1.z branch of libpathrs. The
primary fixes are related to packaging the Python libpathrs bindings for
distributions.
-
procfs: add support for operating on files in the
/proc
root (or other
processes) withProcfsBase::ProcRoot
.While the cached file descriptor shouldn't leak into containers (container
runtimes know to setPR_SET_DUMPABLE
, and our cached file descriptor is
O_CLOEXEC
), I felt a little uncomfortable about having a global unmasked
procfs handle sitting around inlibpathrs
. So, in order to avoid making a
file descriptor leak by alibpathrs
user catastrophic,libpathrs
will
always try to use a "limited" procfs handle as the global cached handle
(which is much safer to leak into a container) and for operations on
ProcfsBase::ProcRoot
, a temporary new "unrestricted" procfs handle is
created just for that operartion. This is more expensive, but it avoids a
potential leak turning into a breakout or other nightmare scenario. -
python bindings: The
cffi
build script is now a little easier to use for
distributions that want to build the python bindings at the same time as the
main library. After compiling the library, set thePATHRS_SRC_ROOT
environment variable to the root of thelibpathrs
source directory. This
will instruct thecffi
build script (when called fromsetup.py
or
python3 -m build
) to link against the library built in the source directory
rather than using system libraries. As long as you install the same library
later, this should cause no issues.Standard wheel builds still work the same way, so users that want to link
against the system libraries don't need to make any changes.
-
Root::mkdir_all
no longer does strict verification that directories craeted
bymkdir_all
"look right" after opening each component. These checks didn't
protect against any practical attack (since an attacker could just get us to
use a directory by creating it beforeRoot::mkdir_all
and we would happily
use it) and just resulted in spurious errors when dealing with complicated
filesystem configurations (POSIX ACLs, weird filesystem-specific mount
options). (#71) -
capi: Passing invalid
pathrs_proc_base_t
values topathrs_proc_*
will now
return an error rather than resulting in Undefined Behaviour™.
Thanks to the following people who made this release possible:
- Aleksa Sarai [email protected]
- Ayose [email protected]
Signed-off-by: Aleksa Sarai [email protected]