Merge 89085d9edf into 412705783d
This commit is contained in:
commit
33758ad564
1 changed files with 9 additions and 3 deletions
|
|
@ -1094,9 +1094,15 @@ func (t *ExecTool) guardCommand(command, cwd string) string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := filepath.Abs(raw)
|
// Resolve the path correctly based on cwd:
|
||||||
if err != nil {
|
// - Absolute paths: use as-is (cleaned)
|
||||||
continue
|
// - Relative paths: join with cwd to resolve correctly
|
||||||
|
var p string
|
||||||
|
if filepath.IsAbs(raw) {
|
||||||
|
p = filepath.Clean(raw)
|
||||||
|
} else {
|
||||||
|
p = filepath.Join(cwdPath, raw)
|
||||||
|
p = filepath.Clean(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if safePaths[p] {
|
if safePaths[p] {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue