fix(mv): don't panic if apply_xattrs fails#6936
Merged
sylvestre merged 1 commit intouutils:mainfrom Dec 9, 2024
Merged
Conversation
This commit fixes issue uutils#6727 by returning the error status instead of causing a panic. It aligns with the original GNU mv more closely.
Contributor
|
Could you please add a test to make sure we don't regress? Thanks |
Contributor
Author
|
@sylvestre Thx. I thought about adding a test. However, it seems we have a problem here. The most reliable way to reproduce the issue is by moving the directory to a filesystem that does not support xattrs. But this requires mounting the filesystem first, which requires root privileges. Running or requiring tests with root privileges seems like a very questionable approach. dd if=/dev/zero of=fs bs=1M count=32
mkfs.vfat fs
mkdir dst
sudo mount fs dst #<--problem Possibly, I overlooked something. If you have any ideas, please let me know. |
Contributor
|
ok, it is good enough then :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About
This commit fixes #6727 by returning the error status instead of causing a panic. It aligns with the original GNU mv more closely
Before
After
GNU mv
Testing environment
Commands for preparing a directory with xattrs
Thank you