fst: hide sockets exposed via Filesystem
This is mostly useful for permissive defaults. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
11
fst/path.go
Normal file
11
fst/path.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package fst
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func deepContainsH(basepath, targpath string) (bool, error) {
|
||||
rel, err := filepath.Rel(basepath, targpath)
|
||||
return err == nil && rel != ".." && !strings.HasPrefix(rel, string([]byte{'.', '.', filepath.Separator})), err
|
||||
}
|
||||
Reference in New Issue
Block a user