assert-rs / predicates-rs

Boolean-valued predicate functions in Rust
docs.rs/predicates
Apache License 2.0
175 stars 29 forks source link

Symlinks pointing to regular files are detected as regular files #139

Closed SoresViktor closed 1 year ago

SoresViktor commented 1 year ago

Here, on line 35, I think it should be file_type, not path: https://github.com/assert-rs/predicates-rs/blob/8204e4496cd23358fae6a15ac04aa742e25242ab/src/path/ft.rs#L25-L39 Path::is_file always follows symlinks and will return true if the symlink points to a regular file.

This is probably the root cause of assert-rs/assert_fs#70.

epage commented 1 year ago

Thanks for catching that!

SoresViktor commented 1 year ago

Wow, fastest fix ever.