Skip to content

Commit b971c61

Browse files
committed
More debugging.
1 parent a630ec2 commit b971c61

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

cap-primitives/src/windows/fs/open_unchecked.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ fn open_at(start: &fs::File, path: &Path, opts: &OpenOptions) -> io::Result<fs::
8989
Component::CurDir => (),
9090
}
9191
}
92+
dbg!(&rebuilt);
9293

9394
let mut wide = OsStr::encode_wide(rebuilt.as_os_str()).collect::<Vec<u16>>();
9495

tests/fs_additional.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,24 @@ fn dotdot_in_middle_of_symlink() {
10581058
assert_eq!(data, foo);
10591059
}
10601060

1061+
/// Same as `dotdot_in_middle_of_symlink`, but use two levels of `..`.
1062+
#[test]
1063+
fn hack() {
1064+
let tmpdir = tmpdir();
1065+
1066+
let foo = b"foo";
1067+
check!(tmpdir.write("target", foo));
1068+
check!(tmpdir.create_dir_all("b/c"));
1069+
let b = check!(tmpdir.open_dir("b"));
1070+
check!(symlink_dir("c\\..\\..", &b, "up"));
1071+
1072+
let path = "b/up/target";
1073+
let mut file = check!(tmpdir.open(path));
1074+
let mut data = Vec::new();
1075+
check!(file.read_to_end(&mut data));
1076+
assert_eq!(data, foo);
1077+
}
1078+
10611079
/// Same as `dotdot_in_middle_of_symlink`, but use two levels of `..`.
10621080
#[test]
10631081
fn dotdot_more_in_middle_of_symlink() {

0 commit comments

Comments
 (0)