I've been looking at systems like runc, and notice they have a dependency on libpathrs, which:
"implements a set of C-friendly APIs (written in Rust) to make path resolution within a potentially-untrusted directory safe on GNU/Linux. There are countless examples of security vulnerabilities caused by bad handling of paths (symlinks make the issue significantly worse)."
This dependency on external Rust libraries makes things difficult for pure Go environments such as u-root; further, libpathrs *support* being limited to Linux is an issue, as some of the security vulnerabilities (e.g. around symlinks) are not just on Linux.
Further, the libpathrs *implementation* has deep dependencies on Linux.
Hence,this note, and why I'm asking on golang-dev, and not -nuts: does something like libpathrs exist somewhere in a Go package? Should it, more properly, be in filepath as a set of functions, or in some other std package? This feels a bit like crypto: never roll your own, which is kind of what is happening out there.
If you're going to tell me this should be a proposal, I'll go that path, I was not quite sure how to ask the question.
Thanks