forked from security/hakurei
It is completely nonsensical and highly error-prone to have multiple implementations of this in the same build. This should be switched at compile time instead therefore the split packages are pointless. Signed-off-by: Ophestra <cat@gensokyo.uk>
12 lines
275 B
Go
12 lines
275 B
Go
package app
|
|
|
|
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
|
|
}
|