Skip to content

Commit 432c95e

Browse files
committed
doc: minor godoc improvements
Signed-off-by: Aleksa Sarai <[email protected]>
1 parent 90002f2 commit 432c95e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

doc.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
// **not** safe against race conditions where an attacker changes the
1717
// filesystem after (or during) the [SecureJoin] operation.
1818
//
19-
// The new API is made up of [OpenInRoot] and [MkdirAll] (and derived
20-
// functions). These are safe against racing attackers and have several other
21-
// protections that are not provided by the legacy API. There are many more
22-
// operations that most programs expect to be able to do safely, but we do not
23-
// provide explicit support for them because we want to encourage users to
24-
// switch to [libpathrs] which is a cross-language next-generation library that
25-
// is entirely designed around operating on paths safely.
19+
// The new API is available in the [pathrs-lite] subpackage, and provide
20+
// protections against racing attackers as well as several other key
21+
// protections against attacks often seen by container runtimes. As the name
22+
// suggests, [pathrs-lite] is a stripped down (pure Go) reimplementation of
23+
// [libpathrs]. The main APIs provided are [OpenInRoot], [MkdirAll], and
24+
// [procfs.Handle] -- other APIs are not planned to be ported. The long-term
25+
// goal is for users to migrate to [libpathrs] which is more fully-featured.
2626
//
2727
// securejoin has been used by several container runtimes (Docker, runc,
2828
// Kubernetes, etc) for quite a few years as a de-facto standard for operating
@@ -38,8 +38,10 @@
3838
// openat2(RESOLVE_BENEATH) which does not fit the usecase of container
3939
// runtimes and most system tools.
4040
//
41+
// [pathrs-lite]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite
4142
// [libpathrs]: https://github.com/openSUSE/libpathrs
4243
// [OpenInRoot]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite#OpenInRoot
4344
// [MkdirAll]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite#MkdirAll
44-
// [os.Root]; https:///pkg.go.dev/os#Root
45+
// [procfs.Handle]: https://pkg.go.dev/github.com/cyphar/filepath-securejoin/pathrs-lite/procfs#Handle
46+
// [os.Root]: https:///pkg.go.dev/os#Root
4547
package securejoin

pathrs-lite/procfs/procfs_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ type Handle struct {
3535
inner *procfs.Handle
3636
}
3737

38-
// Close close the resources associated with this Handle. Note that if this
39-
// Handle was created with [OpenProcRoot], on some kernels the underlying
38+
// Close close the resources associated with this [Handle]. Note that if this
39+
// [Handle] was created with [OpenProcRoot], on some kernels the underlying
4040
// procfs handle is cached and so this Close operation may be a no-op. However,
41-
// you should always call Close on Handles once you are done with them.
41+
// you should always call Close on [Handle]s once you are done with them.
4242
func (proc *Handle) Close() error { return proc.inner.Close() }
4343

4444
// OpenProcRoot tries to open a "safer" handle to "/proc" (i.e., one with the

0 commit comments

Comments
 (0)