]> Cypherpunks repositories - gostls13.git/commitdiff
os: document that OpenRoot follows symlinks
authorDamien Neil <dneil@google.com>
Tue, 18 Feb 2025 17:36:14 +0000 (09:36 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 18 Feb 2025 18:00:13 +0000 (10:00 -0800)
OpenRoot is expected to be called with a trusted path,
and does not attempt to defend against symlinks in that path.

Fixes #71806

Change-Id: Ib8b2e123e323d22d5c23ed9f711d21995139a7ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/650355
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/os/root.go

index fd3b603ed8380530678bb3e3d0624efd80e7aa43..a7e667b3c823af7353a60866d89e99e9d3653582 100644 (file)
@@ -76,6 +76,7 @@ const (
 )
 
 // OpenRoot opens the named directory.
+// It follows symbolic links in the directory name.
 // If there is an error, it will be of type *PathError.
 func OpenRoot(name string) (*Root, error) {
        testlog.Open(name)