| 1 |
// Copyright 2024 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
//go:build plan9 |
| 6 |
|
| 7 |
package os |
| 8 |
|
| 9 |
import ( |
| 10 |
"internal/filepathlite" |
| 11 |
) |
| 12 |
|
| 13 |
func checkPathEscapes(r *Root, name string) error { |
| 14 |
if r.root.closed.Load() { |
| 15 |
return ErrClosed |
| 16 |
} |
| 17 |
if !filepathlite.IsLocal(name) { |
| 18 |
return errPathEscapes |
| 19 |
} |
| 20 |
return nil |
| 21 |
} |
| 22 |
|
| 23 |
func checkPathEscapesLstat(r *Root, name string) error { |
| 24 |
return checkPathEscapes(r, name) |
| 25 |
} |