Commit 18931e4
rm: don't treat symlinks as write-protected
GNU rm does not check for write-protection on symbolic links; it
instead prompts to "remove symbolic link" regardless of the link's
permissions or its target's status.
This change:
- Ensures `prompt_file` checks for symlinks specifically using
`symlink_metadata`, avoiding the incorrect "write-protected" prompt.
- Refactors permission checks into `is_writable_metadata` to allow
using the already-fetched metadata, which also optimizes performance
by reducing redundant `stat` calls.
- Updates `prompt_file_permission_readonly` to operate on metadata directly.1 parent e38de0f commit 18931e4
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
1239 | | - | |
1240 | 1239 | | |
1241 | 1240 | | |
1242 | 1241 | | |
| |||
0 commit comments