diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-02-01 21:11:02 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-02-01 21:11:02 -0500 |
commit | e36b65a11a7fa72e4b43f89c71441884269f0522 (patch) | |
tree | a5689bc6178f6665e0c441bc7f2243f0fff49cf7 /Cargo.toml | |
parent | 11ad7ab204f415d6e3af35b9e8c8907092857266 (diff) |
windows: fix OneDrive traversals
This commit fixes a bug on Windows where directory traversals were
completely broken when attempting to scan OneDrive directories that use
the "file on demand" strategy.
The specific problem was that Rust's standard library treats OneDrive
directories as reparse points instead of directories, which causes
methods like `FileType::is_file` and `FileType::is_dir` to always return
false, even when retrieved via methods like `metadata` that purport to
follow symbolic links.
We fix this by peppering our code with checks on the underlying file
attributes exposed by Windows. We consider an entry a directory if and
only if the directory bit is set on the attributes. We are careful to
make sure that the code remains the same on non-Windows platforms.
Note that we also bump the dependency on `walkdir`, which contains a
similar fix for its traversals.
This bug is recorded upstream:
https://github.com/rust-lang/rust/issues/46484
Upstream also has a pending PR:
https://github.com/rust-lang/rust/pull/47956
Fixes #705
Diffstat (limited to 'Cargo.toml')
-rw-r--r-- | Cargo.toml | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -51,6 +51,10 @@ same-file = "1" termcolor = { version = "0.3.3", path = "termcolor" } globset = { version = "0.2.1", path = "globset" } +[target.'cfg(windows)'.dependencies.winapi] +version = "0.3" +features = ["std", "winnt"] + [build-dependencies] clap = "2.26" lazy_static = "1" |