Repository navigation
Commit dbd9188
Kevin Arthur
fix(desktop): reject dot/dotdot lexically in resolve_user_path
On Windows, Path::exists() collapses a trailing 'Temp\X\..' to 'Temp'
even when X doesn't exist, so the walk-up loop never saw the '..'
component and traversal was silently accepted (the
resolve_user_path_rejects_dotdot test failed on the windows-latest
runner). Reject '.' and '..' components lexically before any syscall so
behaviour is identical across platforms. Verified: all 7 resolve_user_path
tests pass on Linux.1 parent 6de4a1b commit dbd9188
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
165 | 180 | | |
166 | 181 | | |
167 | 182 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
| |||
0 commit comments