-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Milestone
Description
NotBefore::Filename and NotBefore::FilenamePart store a PathBuf but the read_dir_first implementation only considers the file_name of this path. This can be confusing and lead to subtle bugs. I would suggest to either ensure that path.file_name() == path in the NotBefore constructors or to just use a raw string or byte array.
trussed/src/store/filestore.rs
Lines 171 to 178 in 805fe76
| .find(|(_, entry)| match not_before { | |
| NotBefore::None => true, | |
| NotBefore::Filename(path) => entry.file_name() == &**path, | |
| NotBefore::FilenamePart(path) => match entry.file_name().cmp_str(path) { | |
| Ordering::Less => false, | |
| Ordering::Equal | Ordering::Greater => true, | |
| }, | |
| }) |
Metadata
Metadata
Assignees
Labels
No labels