Bug 473167 - Dolphin allows renaming files that you do not have permissions to on an sftp connection
Summary: Dolphin allows renaming files that you do not have permissions to on an sftp ...
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-08 18:36 UTC by Antti Savolainen
Modified: 2023-08-22 14:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Savolainen 2023-08-08 18:36:45 UTC
SUMMARY
Demonstrative video: https://www.youtube.com/watch?v=ickDqRwjwRg
When I connect to another computer with sftp, all of the files are renameable according to the context menu. If I press enter to submit the new name, I get an access error but the name stays displayed on the file. Neither of these should be happening

STEPS TO REPRODUCE
1. Connect to another computer with sftp
2. Edit a filename that you don't have write permissions to

OBSERVED RESULT
The rename button is not greyed out like it is locally and after getting an "Access denied" error, the name edited name stays displayed

EXPECTED RESULT
Editing the name should not be possible if you do not have permissions but also, the name should revert to original after getting the error as a backup method.

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Comment 1 Méven Car 2023-08-22 14:36:38 UTC
Technical explanation:

We KFileItemListProperties::supportsMoving to determine if files can be renamed, but this does support the !local path of sftp:// protocol.
Adding this support there would mean adding a synchronous KIO::stat for a remote target, which can block the UI.
On the other hand Dolphin has a cache of the file hierarchy in its model, that could be used to determine this.