forked from security/hakurei
internal/app: declutter and merge small files
This should make internal/app easier to work with for the upcoming params to shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -6,6 +6,10 @@ import (
|
||||
)
|
||||
|
||||
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, string([]byte{'.', '.', filepath.Separator})), err
|
||||
return err == nil &&
|
||||
rel != ".." &&
|
||||
!strings.HasPrefix(rel, upper), err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user