openSUSE / libpathrs

C-friendly API to make path resolution safer on Linux.
GNU Lesser General Public License v3.0
83 stars 6 forks source link

root: add mkdir_all() implementation #51

Closed cyphar closed 3 months ago

cyphar commented 3 months ago

This is primarily necessary because Go users expect to be able to use os.MkdirAll (which is not safe to use with an active attacker). We could try to implement this just for Go within the bindings code, but it turns out that you need to have a fairly intricate resolve_partial() implementation for this to be efficient (especially for the opath resolver).

This implementation is based on filepath-securejoin's safe MkdirAll implementation.

Fixes #10 Signed-off-by: Aleksa Sarai cyphar@cyphar.com


This still needs: