Skip to content

Commit 87322f9

Browse files
committed
fix: canonicalize graveyard path in check
1 parent a0a7dd4 commit 87322f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ fn bury_target<const FILE_LOCK: bool>(
163163

164164
if inspect && !should_we_bury_this(target, source, metadata, mode, stream)? {
165165
// User chose to not bury the file
166-
} else if source.starts_with(graveyard) {
166+
} else if source.starts_with(
167+
dunce::canonicalize(graveyard)
168+
.map_err(|e| Error::new(e.kind(), "Failed to canonicalize graveyard path"))?,
169+
) {
167170
// If rip is called on a file already in the graveyard, prompt
168171
// to permanently delete it instead.
169172
if force

0 commit comments

Comments
 (0)