Repository navigation
fix(operations): place a copy where the mount refuses links with EACCES - #1945
Conversation
|
Review: no bugs found. The change treats Behaviour change: a real "permission denied" now takes a different route (low)This only applies on mounts without
So
Accepting this seems reasonable. Mentioning it in the PR body would make it clear it's intended. Test coverage gaps (minor)
I didn't run the tests locally. |
…fused A link refused with EACCES now runs the capability probe, but a folder that cannot be written refuses the probe's file as well. Report that denial as before instead of falling through to Unsupported, which turned a refused move into a copy that failed later on the same error. Cover the symlink rung's EACCES arms and the existing-destination check alongside the EPERM set, and build the refusing mount from the sshfs preset.
|
Review pass: merged What changed and why
Local verification: |
Description
Copying a file into a mount that refuses
link()withEACCESalways failed withCould not copy <name>: Permission denied, and nothing was created at the destination.A KDE Connect SFTP mount of an Android phone is one such mount: its server implements no
hardlink or symlink extension, and sshfs reports the refusal as
EACCESrather thanEPERMorEOPNOTSUPP. Sincerenameat2(RENAME_NOREPLACE)also fails there (EINVAL,already learned as unsupported), the hard link was the only remaining publish rung, so the
whole copy aborted even though plain writes,
rename(),chmodand the rest all work.placement.rsclassifiedEPERMand theis_unsupportederrnos but letEACCESfallthrough to
PlaceError::Io, andprobeturned it intoOk(None), so the mount neverlearned anything and every paste repeated the failing
link().This treats
EACCESthe wayEPERMis already treated at the link rung, at the symlinkrung, and in the capability probe, so the mount is learned once and the copy falls back to
the exclusive-creation path that works there.
exchange_throughalready pairsErrno::ACCESSwithErrno::PERM, so this follows the existing convention.Visual evidence
N/A — no user-visible surface changed. The only difference is that a copy onto such a mount
now completes instead of showing the "Permission denied" error dialog.
How to test
kdeconnectdmounts itwith sshfs at
/run/user/<uid>/<device-id>./run/user/<uid>/<device-id>/storage/emulated/0/Download.Expected result: the file is copied. Before this change the paste failed with
Could not copy <name>: Permission deniedand created nothing.Without a phone, the added regression test covers it: the quirks harness refuses every link
with
EACCES, and placing a file must reach the reserved-file rung and recordhard_links: Some(false)for the mount.Related issue
Closes #1941