Page MenuHome GnuPG

Kleopatra: moving decrypted Folder to USB device fails
Closed, ResolvedPublic

Description

Decrypting a tar.gpg archive file with standard settings apparently works:

But after clicking "Save all", there is no further information shown to the user and no new Folder appears on the USB stick.

Debugview shows:

[8136] org.kde.pim.kleopatra: Moving "C:/Users/g10code.WIN-TEST3/AppData/Local/Temp/kleopatra-AtABCN/Program Files (x86)" to "F:/Program Files (x86)_1"
[8136] org.kde.pim.kleopatra: 
[8136] org.kde.pim.kleopatra: Error:  "<html><p>Die Datei ‘<tt>C:\\Users\\g10code.WIN-TEST3\\AppData\\Local\\Temp\\kleopatra-AtABCN\\Program Files (x86)</tt>’ kann nicht nach ‘<tt>F:\\Program Files (x86)_1</tt>’ verschoben werden.</p>\n\n<p><i>Zugriff verweigert auf F:/Program Files (x86)_1.</i></p></html>"

(Note: That is F:\ and not C:\)

Details

Version
Gpg4win-4.1.1-beta317

Event Timeline

Before you ask: I can write on that device and it works with gpgtar on the commandline:

gpgtar -v --status-fd 2 -C f: -d c:\Users\g10code.WIN-TEST3\Documents\testordner.tar.gpg
aheinecke added a subscriber: aheinecke.

So the reason this fails is the same as it was back when T3547 was fixed. MoveFile does not work across directories, and even MoveFileEx that supports this for files does not support this for directories.

kio/src/ioslaves/file/file_win.cpp just does a plain MoveFile ( https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa ) in their code sadly there is also no recursive copy in that code so I would need to extend that with the code from Kleopatra. Which Ingo wanted to remove because it had some issues. T6373

What I find confusing is that in kio/core/copyjob.cpp I get a debug line saying in startRenameJob:
" qCDebug(KIO_COPYJOB_DEBUG) << m_currentSrcURL << "->" << dest << "trying direct rename first";"

As if there would be a fallback if direct rename does not work. But I don't see it.

So the good news is that I know how to solve this issue by going back to the old code, but I would like to talk to ingo about how the old code could / should be improved first before.

ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.May 30 2023, 9:59 AM
ikloecker changed the task status from Open to Testing.May 30 2023, 11:58 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.

Fixed as suggested by Andre. Additionally, I have added support for hidden files in the old code (which are probably not really a thing on Windows). The downside is that there is no progress on Windows (as before the switch to using KIO::move).

works (at least for small directories)

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

works for 4,1 GB, too.
(Tested with Gpg4win-4.2.0-beta346)