-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
rm: don't treat symlinks as write-protected #10232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
rm: don't treat symlinks as write-protected #10232
Conversation
f3f691e to
aad33db
Compare
CodSpeed Performance ReportMerging this PR will degrade performance by 4.56%Comparing Summary
Performance Changes
Footnotes
|
looks like entirely related to querying symlink metadata, I tried reversing the logic but found the branch needs to be always taken to keep the functionality |
aad33db to
6ef66b5
Compare
Detect symlinks in prompt_file() using fs::symlink_metadata() and handle them differently: - InteractiveMode::Always should still prompt with "remove symbolic link ...?". - For all other interactive modes, do not follow the symlink target or use the target's permissions to decide a write-protected prompt. Adds a unit test test_symlink_not_write_protected_prompt to verify that a symlink to a read-only file is not treated as a write-protected regular file.
6ef66b5 to
c2a1956
Compare

Detect symlinks in prompt_file() using fs::symlink_metadata() and handle them differently:
Adds a unit test test_symlink_not_write_protected_prompt to verify that a symlink to a read-only file is not treated as a write-protected regular file.
Closes #10222