forked from security/hakurei
This should make internal/app easier to work with for the upcoming params to shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
16 lines
290 B
Go
16 lines
290 B
Go
package app
|
|
|
|
import (
|
|
"path/filepath"
|
|
"strings"
|
|
)
|
|
|
|
func deepContainsH(basepath, targpath string) (bool, error) {
|
|
const upper = ".." + string(filepath.Separator)
|
|
|
|
rel, err := filepath.Rel(basepath, targpath)
|
|
return err == nil &&
|
|
rel != ".." &&
|
|
!strings.HasPrefix(rel, upper), err
|
|
}
|