-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
mv: shouldn't panic when xattr application fails #6727
Copy link
Copy link
Closed
Labels
Description
#[cfg(all(unix, not(any(target_os = "macos", target_os = "redox"))))]
fsxattr::apply_xattrs(to, xattrs).unwrap();https://github.com/uutils/coreutils/blob/main/src/uu/mv/src/mv.rs#L676-L677
This code panics when "moving" (copying) a file to a different filesystem, and applying the extended attrs fails. This can happen for many reasons:
- TOCTOU races (e.g. file was moved/deleted)
- destination filesystem doesn't support xattrs
- user doesn't have permissions to set xattrs
mv should not panic in those cases. Instead, it should probably output some form of warning message and continue moving the other files, or whatever GNU mv does.
Discovered while reviewing #6632 (comment)
Reactions are currently unavailable