New SFTP plugin available now

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
Mikefield
Power Member
Power Member
Posts: 625
Joined: 2006-02-26, 19:13 UTC
Location: Oberursel, Germany HE

Post by *Mikefield »

Older versions are still online, you must only change the number in name :
http://ghisler.fileburst.com/beta/sftpplug05beta.zip
http://ghisler.fileburst.com/beta/sftpplug04beta.zip
and so on.

mf
Bankster - Word of the Year 2009
User avatar
Flint
Power Member
Power Member
Posts: 3310
Joined: 2003-10-27, 09:25 UTC
Location: Moscow, Russia
Contact:

Post by *Flint »

Mikefield wrote:4. Could not confirm. Checked here only with tcpview from sysinternals, but the connection is
closed on the client side.
Of course, you can't. :) As I said, it is reproduced only with one specific server I tested; connections to all other servers are closed correctly. That's why I suspect a misconfiguration on that server and asks for help in detecting this misconfiguration.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 9.51 / Win7 x64 SP1, Win10 x64
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

Tested the plugin version 06 on Windows XPSP2 with TC 6.56. Seems to be working quite fine, including UTF8 (however, in my case Auto-Detect did not detect UTF8 so I had to put it manually) but I found that when I set the user rights (chmod or filemod) of files to "666" in options, files are nevertheless uploaded to the server with the attributes "644". (sftpplug.ini also shows filemod=666). Is this a bug or something I missed?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Beta 0.7 is available now in the first message of this thread! Please update! Here is the list of additions and fixes:

- Read contents of HOME environment variable when double clicking on pseudo link "~" in root or home dir
- Allow user to break out of plugin root (e.g. servername.com/home/username) when following a link
- English properties dialog had default locale (which is Swiss German on my system)
- Socket was not closed after shutting down SFTP connection

With the old plugin it's possible. This is why the user ask for it.
I couldn't get that to work with the old plugin, how was it solved there? I mean, when you were in \\secure ftp\server\ and pressed Enter on [..], you landed in \\secure ftp and not in the parent dir on the server...

I found a solution for symbolic links in my plugin, though: If the link would go somewhere outside of the current plugin root, the plugin will show a warning that the plugin root will be set to the root of the file system. The downside is that the history will not work then because the paths are completely different after changing the root.

I have also added a pseudo link named "~" both to the root and the home dir, which brings the user to his home directory. This is done by reading the HOME environment variable, and if it fails, by going to /home/<loginname> directly.
But the "Cancel" doesn't bring Total Commander back to live. When the VPN connection brokes
there is no way to cancel the transfer.
Unfortunately I don't have access to a VPN connection, so I cannot test this, sorry. Can anyone reproduce this problem with a direct connection to the server?
Does this plug-in support FXP?
No, FXP does not exist with SSH. With SSH, both the commands and the transfers all go through the same encrypted tunnel between client and server. There is no way to make a direct tunnel between two servers.
The File Properties dialog is shown in German here.
Thanks for the warning, it was indeed still set to the system default (Swiss German). :)
It would be more logical for the users if pressing Disconnect while in plugin's root directory terminated all currently active connections instead of just closing the plugin panel.
I'm sorry but that's not under the control of the plugin.
Connections to one of the computers I tested SFTP with are not closed by TC when I disconnect
You seem to be right - I assumed that the sftp close would also close the socket, but apparently it doesn't. I have added that now.
when I see F7=new connection.txt it looks for me like a button F7 MkDir
Well, it's F7 because you have to create a new pseudo folder!
How can I force the plugin to be in english ? (Windows 2k french) ...Do I have to remove all the -french ressource part- ?
Probably yes, it's Windows which chooses the language from the resources, not the plugin. I don't know of any manual way to choose it, otherwise I would offer it as an option. Does anyone have an idea on how to do it?
Author of Total Commander
http://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3310
Joined: 2003-10-27, 09:25 UTC
Location: Moscow, Russia
Contact:

Post by *Flint »

ghisler(Author) wrote:Thanks for the warning, it was indeed still set to the system default (Swiss German).
Confirm the fix. :)
ghisler(Author) wrote:
Connections to one of the computers I tested SFTP with are not closed by TC when I disconnect
You seem to be right - I assumed that the sftp close would also close the socket, but apparently it doesn't. I have added that now.
I checked beta 7 and confirm that the connection is now closed with that server too. Thanks!
ghisler(Author) wrote:
when I see F7=new connection.txt it looks for me like a button F7 MkDir
Well, it's F7 because you have to create a new pseudo folder!
I meant that it is unusual to have text files in a plugin like that. For me this file looks like a pseudo-file executing some command (creating a new connection), and when I click it and see text file contents in my editor intead of command executing… well, it's a bit confusing.
ghisler(Author) wrote:
But the "Cancel" doesn't bring Total Commander back to live. When the VPN connection brokes
there is no way to cancel the transfer.
Unfortunately I don't have access to a VPN connection, so I cannot test this, sorry. Can anyone reproduce this problem with a direct connection to the server?
Well, as I posted here, I confirm TC hangup, and I use direct connection in local network (and one of the servers was even locally installed virtual machine).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 9.51 / Win7 x64 SP1, Win10 x64
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

The chmod attributes problem I described a few posts ago seems still to be there in 0.7 beta. Even when I changed the string "644" (the offered default value) to "666" in *.wfx in hex, the files are still written to the server as "644". I also think it would be a good idea to show chmod operations in the log.
User avatar
Mikefield
Power Member
Power Member
Posts: 625
Joined: 2006-02-26, 19:13 UTC
Location: Oberursel, Germany HE

Post by *Mikefield »

ghisler(Author) wrote:- Read contents of HOME environment variable when double clicking on pseudo link "~" in root or home dir
- Allow user to break out of plugin root (e.g. servername.com/home/username) when following a link

I couldn't find the pseudo link "~" how can it be used?
ghisler(Author) wrote:I couldn't get that to work with the old plugin, how was it solved there? I mean, when you were in \\secure ftp\server and pressed Enter on [..], you landed in \\secure ftp and not in the parent dir on the server...

The \\secure ftp\server\ is the root dir of the server, not the home dir. It's correct that you landed in \\secure ftp .
But, when in the new plugin, home dir is set to \\secure ftp\server\var\, then it is not possible to go to \\secure ftp\server\
when pressed Enter on [..] in \\secure ftp\server\var\! That is the problem.
The old sftp plugin connects always to the root dir \\secure ftp\server\.
To enter the home dir it uses the "cd" command to go to the home dir.

Let me explain how I understand the differences from the plugins.
old plugin:
1st: Plugin connect to \\secure ftp\server\ Port 22 -> server root dir
2nd: Plugin send "cd /var" -> server home dir where I wish to land in after connect
3rd: I press Enter on [..] once to go back to \\secure ftp\server\ -> root dir
Result: Enter the parent dir on the server \\secure ftp\server\ is possible.

new plugin:
1st: Plugin connect to \\secure ftp\server\var\ Port 22 -> server home dir where I wish to land in, not server root dir
2nd: I press Enter on [..] once, go back to \\secure ftp it is not possible to go to \\secure ftp\server\ -> server root dir
Result: Enter the parent dir on the server \\secure ftp\server\ is not possible.
ghisler(Author) wrote: I found a solution for symbolic links in my plugin, though: If the link would go somewhere outside of the current plugin root, the plugin will show a warning that the plugin root will be set to the root of the file system. The downside is that the history will not work then because the paths are completely different after changing the root.

I have also added a pseudo link named "~" both to the root and the home dir, which brings the user to his home directory. This is done by reading the HOME environment variable, and if it fails, by going to /home/<loginname> directly.

See above, I couldn't found this link.
ghisler(Author) wrote:Unfortunately I don't have access to a VPN connection, so I cannot test this, sorry. Can anyone reproduce this problem with a direct connection to the server?

Flint just answers. When I back from vacation on monday, I can test at work too if needed.

mf
Bankster - Word of the Year 2009
User avatar
roentgen
Power Member
Power Member
Posts: 757
Joined: 2005-12-03, 19:58 UTC

Post by *roentgen »

Canceling an upload sets the view in SFTP panel to a local drive. I need to Alt+Down to go back.

Resuming an aborted upload just hangs.

Going to already visited dirs has some problems: no file listing or even doubled items - screenshot.

All the above tested on Cygwin SFTP server. I'll try to test on a real Linux box and post the results.
TC for Linux please!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, as I posted here, I confirm TC hangup, and I use direct connection in local network
I could reproduce it now too. It seems that libssh2_sftp_read hangs for quite a while when I pull out the LAN cable of the router during a download - but it eventually returns. The problem is the then following call to libssh2_sftp_close, which hangs forever. I will put another abort check and a 5 second timeout in that call to avoid the hang.
The chmod attributes problem I described a few posts ago seems still to be there in 0.7 beta. Even when I changed the string "644" (the offered default value) to "666" in *.wfx in hex, the files are still written to the server as "644".
I'm sorry, I didn't see your original post. It's really strange, I'm setting the file mode when creating the remote file with libssh2_sftp_open. I'm sure that it worked some time in the past, but strangely it doesn't work in any older version. I will therefore initially create the file with mode=0644 and change the mode after closing the file.
I couldn't find the pseudo link "~" how can it be used?
You can only see it when connecting directly to the root or to /home on the server. TC will show the "~" link in the directory listing then. TC will show just the "~" link when listing of these dirs is forbidden.
Let me explain how I understand the differences from the plugins.
old plugin:
1st: Plugin connect to \\secure ftp\server\ Port 22 -> server root dir
2nd: Plugin send "cd /var" -> server home dir where I wish to land in after connect
3rd: I press Enter on [..] once to go back to \\secure ftp\server\ -> root dir
Result: Enter the parent dir on the server \\secure ftp\server\ is possible.
I still don't understand how this should work! When you connect like this, then after step 3 you are in
\\secure ftp\server\
and the plugin shows the contents of /var . But when you now press Enter on [..], Total Commander will return to
the list of connections (\\secure ftp) !
Canceling an upload sets the view in SFTP panel to a local drive. I need to Alt+Down to go back.
This happens when the server still hangs from the aborted transfer, so the plugin gets an error back when requesting the file list. I will try to wait a bit longer for libssh2_sftp_close when the user presses ESC. Currently only clicking on the abort button will abort the transfer gracefully.
Resuming an aborted upload just hangs.
I will check that.
Going to already visited dirs has some problems: no file listing or even doubled items
Sorry, cannot reproduce. TC does not cache the dirs.
Author of Total Commander
http://www.ghisler.com
User avatar
Mikefield
Power Member
Power Member
Posts: 625
Joined: 2006-02-26, 19:13 UTC
Location: Oberursel, Germany HE

Post by *Mikefield »

ghisler(Author) wrote:
Let me explain how I understand the differences from the plugins.
old plugin:
1st: Plugin connect to \\secure ftp\server\ Port 22 -> server root dir
2nd: Plugin send "cd /var" -> server home dir where I wish to land in after connect
3rd: I press Enter on [..] once to go back to \\secure ftp\server\ -> root dir
Result: Enter the parent dir on the server \\secure ftp\server\ is possible.
I still don't understand how this should work! When you connect like this, then after step 3 you are in
\\secure ftp\server\ and the plugin shows the contents of /var . But when you now press Enter on [..],
Total Commander will return to the list of connections (\\secure ftp) !
At step 3, the plugin shows the content of \\secure ftp\server\ not of \var.
Home dir is used, that the plugin goes to a specified directory, which I don't want enter manually.
But it's needed to go back to the server root.

mf
Bankster - Word of the Year 2009
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 39935
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

At step 3, the plugin shows the content of \\secure ftp\server\ not of \var.
Home dir is used, that the plugin goes to a specified directory, which I don't want enter manually.
You mean the plugin goes by itself to \\secure ftp\server\var when connecting? How does it dow that? The plugin interface does not support it...
Author of Total Commander
http://www.ghisler.com
CoolWater
Power Member
Power Member
Posts: 681
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

2ghisler(Author)

Btw... UTF-8 recognition works perfectly ;)

Regards,
CoolWater
TucknDar
Senior Member
Senior Member
Posts: 227
Joined: 2003-02-07, 09:44 UTC
Location: Oslo
Contact:

Post by *TucknDar »

Love this plugin! Thanks!
license #76904
User avatar
Mikefield
Power Member
Power Member
Posts: 625
Joined: 2006-02-26, 19:13 UTC
Location: Oberursel, Germany HE

Post by *Mikefield »

ghisler(Author) wrote:
At step 3, the plugin shows the content of \\secure ftp\server\ not of \var.
Home dir is used, that the plugin goes to a specified directory, which I don't want enter manually.
You mean the plugin goes by itself to \\secure ftp\server\var when connecting? How does it dow that? The plugin interface does not support it...
Yepp! When the plugin is connected to the server, e.g. \\secure ftp\server\, it send the
command "cd /var". That's all. The /var is set in the configuration, field "homedir" in the old plugin.


mf
Bankster - Word of the Year 2009
BashGordon
Junior Member
Junior Member
Posts: 4
Joined: 2008-08-15, 09:13 UTC

Post by *BashGordon »

Beta 0.7 is available now in the first message of this thread! Please update! Here is the list of additions and fixes:
Changing into a directory with a name containing UTF8 characters still gives "Failed opening remote file". Could anybody, please, confirm this to be sure that this is not due to some server misconfiguration on my side? Thanks!
Mikefield wrote: Yepp! When the plugin is connected to the server, e.g. \\secure ftp\server\, it send the
command "cd /var". That's all. The /var is set in the configuration, field "homedir" in the old plugin.
I second the idea to connect to the root directory and cd'ing to the dir set in the connection settings subsequently. This gives max degrees of freedom. If the server admin does not want you to see root he will chroot the ssh server. And if listing root directory is forbidden (as on one of our servers) and no dir is set in connection settings, the plugin could cd to ~.

Thanks! Best,
Bash
Post Reply