diff options
| author | Damien Neil <dneil@google.com> | 2022-11-17 10:06:50 -0800 |
|---|---|---|
| committer | Damien Neil <dneil@google.com> | 2022-11-17 18:24:36 +0000 |
| commit | 217ed955887bd59780313bb468862a697b75decd (patch) | |
| tree | aff29b8e22094702e9878651b1b47b9b606fd818 /src/path/filepath/path_test.go | |
| parent | 38b9ff60071fc40d197e7002db1320539e74a678 (diff) | |
| download | go-217ed955887bd59780313bb468862a697b75decd.tar.xz | |
path/filepath: detect Windows CONIN$ and CONOUT$ paths in IsLocal
CreateFile creates a handle to the console input or screen buffer
when opening a file named CONIN$ or CONOUT$:
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#consoles
Detect these paths as non-local.
For #56219.
Change-Id: Ib09e76a110d6ec09aef8038074b9bcbae09d00d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/451657
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/path/filepath/path_test.go')
| -rw-r--r-- | src/path/filepath/path_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go index 89fd6cb5a2..41e70c2dbe 100644 --- a/src/path/filepath/path_test.go +++ b/src/path/filepath/path_test.go @@ -174,6 +174,11 @@ var winislocaltests = []IsLocalTest{ {`C:`, false}, {`C:\a`, false}, {`..\a`, false}, + {`CONIN$`, false}, + {`conin$`, false}, + {`CONOUT$`, false}, + {`conout$`, false}, + {`dollar$`, true}, // not a special file name } var plan9islocaltests = []IsLocalTest{ |
