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)
|
||||
if err != nil {
|
||||
continue
|
||||
// Resolve the path correctly based on cwd:
|
||||
// - Absolute paths: use as-is (cleaned)
|
||||
// - 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] {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue