UnregisterAuxPath removes path from the aux allowlist.
(path string)
| 75 | |
| 76 | // UnregisterAuxPath removes path from the aux allowlist. |
| 77 | func UnregisterAuxPath(path string) { |
| 78 | if path == "" { |
| 79 | return |
| 80 | } |
| 81 | abs, err := filepath.Abs(path) |
| 82 | if err != nil { |
| 83 | return |
| 84 | } |
| 85 | auxAllowedPathsMu.Lock() |
| 86 | defer auxAllowedPathsMu.Unlock() |
| 87 | filtered := auxAllowedPaths[:0] |
| 88 | for _, existing := range auxAllowedPaths { |
| 89 | if existing != abs { |
| 90 | filtered = append(filtered, existing) |
| 91 | } |
| 92 | } |
| 93 | auxAllowedPaths = filtered |
| 94 | } |
| 95 | |
| 96 | // auxAllowedPathsSnapshot returns a copy for safe iteration during validation. |
| 97 | func auxAllowedPathsSnapshot() []string { |