refactor(shell): move path boundary guard after safe-path check
This commit is contained in:
parent
3981a1a58e
commit
1c62971dc3
1 changed files with 4 additions and 4 deletions
|
|
@ -407,10 +407,6 @@ func (t *ExecTool) guardCommand(command, cwd string) string {
|
|||
}
|
||||
}
|
||||
|
||||
if !isPathBoundary(cmd, loc[0]) {
|
||||
continue
|
||||
}
|
||||
|
||||
p, err := filepath.Abs(raw)
|
||||
if err != nil {
|
||||
continue
|
||||
|
|
@ -420,6 +416,10 @@ func (t *ExecTool) guardCommand(command, cwd string) string {
|
|||
continue
|
||||
}
|
||||
|
||||
if !isPathBoundary(cmd, loc[0]) {
|
||||
continue
|
||||
}
|
||||
|
||||
rel, err := filepath.Rel(cwdPath, p)
|
||||
if err != nil {
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue