Commit af3aee9
committed
matches/exec: create path integrity check before execution
Fixes #518
Create function check_path_integrity which checks
the integrity of the path, with the following criteria:
- Only absolute paths
- Only non-empty paths
- Only directories in path
If the PATH env var does not pass the criteria,
an error is returned warning about the specific
path part that caused that error.
Tests:
- Added tests for both SingleExecMatcher and MultiExecMatcher
- Covered all PATH validation scenarios:
* Valid absolute directories
* Empty path segments
* Relative path segments
* File paths instead of directories
- Ensured safe environment variable handling with unsafe blocks
- Maintained consistent test patterns with existing serial tests
- Verified correct error handling for invalid PATH configurations
To avoid making the function that performs the check public,
tests were also added that verify that there is no error
with a valid PATH.1 parent d55e2f9 commit af3aee9
2 files changed
+374
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
16 | 38 | | |
17 | 39 | | |
18 | 40 | | |
| |||
30 | 52 | | |
31 | 53 | | |
32 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
33 | 59 | | |
34 | 60 | | |
35 | 61 | | |
| |||
112 | 138 | | |
113 | 139 | | |
114 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
115 | 145 | | |
116 | 146 | | |
117 | 147 | | |
| |||
0 commit comments