doublecmd icon indicating copy to clipboard operation
doublecmd copied to clipboard

DC does not respect permission denied from WFX plugins and clears the file panel content

Open lprot opened this issue 1 year ago • 16 comments

Version

Double Commander Version: 1.2.0 alpha Revision: 11324 Commit: d2416cc2a Build date: 2024/05/19 Lazarus: 3.99.0.0 FPC: 3.2.2 Platform: x86_64-Darwin-cocoa OS version: Mac OS X 12.7.5

Description

Can be reproduced on Termux connections. If you are in the root folder: image

Then you try to double click on [..] you just get the error in the log and DC clears the list: image

What is expected - DC stays where it is and just shows a popup "/data/data/ Permission denied".

lprot avatar May 20 '24 06:05 lprot

Just an inspiration how it is correctly done in Forklift: image

If ls fails, why to change anything?

lprot avatar May 20 '24 07:05 lprot

This is impossible. DC works differently.

alexx2000 avatar May 20 '24 07:05 alexx2000

This is impossible. DC works differently.

Why exactly is the error handling not possible?

lprot avatar May 20 '24 08:05 lprot

plugins like ftp use wfx api from totalcmd, the entire implementation occurs on the plugin side and dc receives a list of files, dc doesnt know the reason why the list comes empty, so in case of an error, the plugin reports it in the log via wfx api.

j2969719 avatar May 20 '24 08:05 j2969719

plugins like ftp use wfx api from totalcmd, the entire implementation occurs on the plugin side and dc receives a list of files, dc doesnt know the reason why the list comes empty, so in case of an error, the plugin reports it in the log via wfx api.

DC prints in the log that ls failed because of permissions. Why it cannot change the dir back to the same it was before calling [..] path?

Total Commander which uses SFTP WFX plugin just does not change the directory if receives the error (tried on the same server): image

Is DC WFX API somehow different from TC? https://github.com/ghisler/WFX-SDK/tree/master

lprot avatar May 20 '24 09:05 lprot

totalcmd supports error checking if the plugin uses the winapi call SetLastError, but in the cross-platform doublecmd this functionality is missing iirc

j2969719 avatar May 20 '24 09:05 j2969719

totalcmd supports error checking if the plugin uses the winapi call SetLastError, but in the cross-platform doublecmd this functionality is missing iirc

Why we cannot change/reconnect to the current dir in case we got permission denied in log? If that is not possible then it just makes no sense to use the plugin at all.

lprot avatar May 20 '24 09:05 lprot

getting a list of files and writing information to the log are in no way related to each other. dc doesnt know why the plugin decided to write something to the log.

j2969719 avatar May 20 '24 09:05 j2969719

getting a list of files and writing information to the log are in no way related to each other. dc doesnt know why the plugin decided to write something to the log.

Strange, I thought DC can control the content of the log file and properly react. Something is just very strange in the logic of implementation here.

lprot avatar May 20 '24 09:05 lprot

wfx api simply provides a callback which essentially writes a certain string (error/details) in the log window

j2969719 avatar May 20 '24 09:05 j2969719

wfx api simply provides a callback which essentially writes a certain string (error/details) in the log window

Still don't get why DC cannot control the call back and react correspondingly.

lprot avatar May 20 '24 11:05 lprot

File panel and log window are two independent entities. They are not related to each other in any way.

alexx2000 avatar May 20 '24 12:05 alexx2000

again, the plugin can write an error string to the log window at any time for any reason, not necessarily related to getting the list of files itself, and the wfx api does not provide the ability to distinguish between them

j2969719 avatar May 20 '24 12:05 j2969719

File panel and log window are two independent entities. They are not related to each other in any way.

Can't beleive they cannot exchange status :(

lprot avatar May 20 '24 12:05 lprot

The log window is basically not for this. As mentioned above SetLastError (errno under Unix) should be used.

But this will not help, because DC basically works differently. DC always changes the directory. And I don't see any problem in this. Typically, users work with accessible directories.

alexx2000 avatar May 20 '24 12:05 alexx2000

DC always changes the directory.

Here we talk about error in the logic of implementation. Directory cannot be changed if it does not have permission. This approach just leads to bad usability as you need to remember that you should not try to enter to directories w/o permission. The problem is, when you connect to the system for the first time and start to explore it, you do not understand from the log where you landed after error. It needs deeper investigation which makes no sense for the regular user.

lprot avatar May 20 '24 13:05 lprot