DC does not respect permission denied from WFX plugins and clears the file panel content
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:
Then you try to double click on [..] you just get the error in the log and DC clears the list:
What is expected - DC stays where it is and just shows a popup "/data/data/ Permission denied".
Just an inspiration how it is correctly done in Forklift:
If ls fails, why to change anything?
This is impossible. DC works differently.
This is impossible. DC works differently.
Why exactly is the error handling not possible?
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.
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):
Is DC WFX API somehow different from TC? https://github.com/ghisler/WFX-SDK/tree/master
totalcmd supports error checking if the plugin uses the winapi call SetLastError, but in the cross-platform doublecmd this functionality is missing iirc
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.
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.
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.
wfx api simply provides a callback which essentially writes a certain string (error/details) in the log window
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.
File panel and log window are two independent entities. They are not related to each other in any way.
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
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 :(
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.
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.