Page MenuHome GnuPG

Kleopatra: no error if trying to write decrypted file to write-protected folder
Testing, NormalPublic

Description

With Kleopatra choose decrypt+ verify for a file. In dialog window choose a write protected folder as destination. Click save.

Expected behavior: An error should be shown to the user.

But there is no error message for the user, Debugview:

[7088] org.kde.pim.kleopatra: 0x9674af0 renaming "C:/Users/g10code.WIN-TEST3/AppData/Local/Temp/kleopatra-ScJFOC/test_ä.txt.jXPBlq" -> "C:/Users/g10code.WIN-TEST3/AppData/Local/Temp/kleopatra-ScJFOC/test_ä.txt"
[7088] org.kde.pim.kleopatra: 0x9674af0 succeeded
[7088] org.kde.pim.kleopatra: Collection Progress:  1000  total:  1000
[7088] org.kde.pim.kleopatra: Collection Progress:  1000  total:  1000
[7088] org.kde.pim.libkleo: not showing link (not available)
[7088] org.kde.pim.kleopatra: All done
[7088] org.kde.pim.kleopatra: ("test_ä.txt")
[7088] org.kde.pim.kleopatra: Moving  "C:/Users/g10code.WIN-TEST3/AppData/Local/Temp/kleopatra-ScJFOC/test_ä.txt"  to  "Z:/kann_weg/test_ä.txt"
[7088] org.kde.pim.kleopatra: 
[7088] org.kde.pim.kleopatra: Error:  "Die Datei „C:\\Users\\g10code.WIN-TEST3\\AppData\\Local\\Temp\\kleopatra-ScJFOC\\test_ä.txt“ kann nicht nach „Z:\\kann_weg\\test_ä.txt“ verschoben werden."

Edit: removed irrelevant part where the destination triggered Windows' Virtual Store feature.
Edit: @werner messed things up and reverted his edits. See T6503

Details

Version
Gpg4win-4.1.1-beta317

Event Timeline

At least the first part seems to be identical behavior to that described in T6488 for USB devices.

werner renamed this task from Kleopatra: no error if trying to write decrypted file to write-protected folder to Do not make use of the VirtualStore under Windows..May 23 2023, 12:43 PM
werner triaged this task as High priority.
werner added projects: gnupg24, gnupg22.
werner updated the task description. (Show Details)
werner renamed this task from Do not make use of the VirtualStore under Windows. to Kleopatra: no error if trying to write decrypted file to write-protected folder.May 23 2023, 1:17 PM
werner updated the task description. (Show Details)
werner removed projects: gnupg22, gnupg24.
ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.May 31 2023, 9:21 AM

Kleopatra explicitly checks if the output folder is writable using QFileInfo::isWritable. But: QFileInfo::isWritable mentions that NTFS permissions are not checked unless this is enabled explicitly (because it's an expensive operation). I'll try to enable it locally for the check.

ikloecker changed the task status from Open to Testing.May 31 2023, 10:57 AM
ikloecker removed ikloecker as the assignee of this task.
ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
ikloecker added a subscriber: ikloecker.

The output folder is now checked with enabled NTFS permissions check for writability. Hopefully, this fixes the problem on Windows.

For the upcoming gpg4win release I have kept the existing messages. For the next release the error messages have been improved.

ebo claimed this task.
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

reopened. Because of reverted commits there is again no error message when trying to write to a write protected folder, see T6917.

ebo lowered the priority of this task from High to Normal.Jan 5 2024, 4:10 PM
ikloecker changed the task status from Open to Testing.Jan 5 2024, 6:07 PM

This is actually fixed already for the next version (with commit https://dev.gnupg.org/rKLEOPATRA655abf9a75e5f1cce8bc52b1cda21440970edfd7). The fix will just not be backported to VSD 3.2 to minimize the risk of another regression.

ebo moved this task from Backlog to QA on the vsd33 board.