Skip to content

Commit 2ba123b

Browse files
README: Avoid directory traversal
1 parent 8c1519b commit 2ba123b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,22 @@ components = ["rust-src"]
245245

246246
<br>
247247

248+
## Avoid directory traversal
249+
250+
If you re-use the failing `.rs` files, have them (and their respective
251+
`.stderr` files) positioned so that `t.compile_fail(...)` accesses them only
252+
in subdirectories ("sub/sub/dir/test01.rs"), and not involving any parent
253+
traversal ("../neighbor-dir/tests01.rs"). Otherwise the generated `.stderr`
254+
files may include absolute resolved paths, and they may fail in different
255+
environment.
256+
257+
Alternatively, create symlinks that involve any parent traversal "..". Have
258+
those symlinks themselves located under a (sub-sub...)directory of where you
259+
invoke `t.compile_fail(...)`, so that the path you pass to
260+
`t.compile_fail(...)` itself does not include any "..".
261+
262+
<br>
263+
248264
#### License
249265

250266
<sup>

0 commit comments

Comments
 (0)