This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"proxyctl/internal/pathutil"
|
||||
"proxyctl/internal/securefs"
|
||||
)
|
||||
|
||||
@@ -184,10 +185,7 @@ func ConfigPathWith(environment IdentityEnvironment) (string, error) {
|
||||
return configuration.Path, err
|
||||
}
|
||||
|
||||
func pathWithin(path, parent string) bool {
|
||||
relative, err := filepath.Rel(parent, path)
|
||||
return err == nil && relative != ".." && !strings.HasPrefix(relative, ".."+string(filepath.Separator))
|
||||
}
|
||||
func pathWithin(path, parent string) bool { return pathutil.Within(path, parent) }
|
||||
|
||||
type CommitError struct {
|
||||
Err error
|
||||
|
||||
Reference in New Issue
Block a user