go/src/path
Andrew Ekstedt 98a0071a53 path,path/filepath: add Join examples with ".." components
People sometimes expect Join to trim .. components from its arguments
before joining, and are surprised that it doesn't. This is bad if they
were relying on that assumed behaviour to prevent directory traversal
attacks.

While a careful reading of the documentation for Join and Clean
might dispel this notion, it is not obvious at first glance.

Add a case to the examples to nudge people in the right direction.

Updates #40373

Change-Id: Ib5792c12ba1000811a0c0eb77048196d0b26da60
Reviewed-on: https://go-review.googlesource.com/c/go/+/249177
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2020-08-19 00:10:22 +00:00
..
filepath path,path/filepath: add Join examples with ".." components 2020-08-19 00:10:22 +00:00
example_test.go path,path/filepath: add Join examples with ".." components 2020-08-19 00:10:22 +00:00
match.go
match_test.go
path.go path: minor changes to improve documentation for Join 2019-11-20 20:51:13 +00:00
path_test.go path: fix mismatch between error message and corresponding test function 2019-08-08 00:38:10 +00:00