New SFTP plugin available now

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48241
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

My plugin passes the mode to the libssh2_sftp_mkdir function. However, some servers may not support the mode parameter of the create directory function...
Author of Total Commander
https://www.ghisler.com
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

ghisler(Author) wrote:My plugin passes the mode to the libssh2_sftp_mkdir function. However, some servers may not support the mode parameter of the create directory function...
The plugin creates directories in that server but it creates them as "755" and not "777" even if "777" is set in preferences. Is there a way to determine whether the server actually supports this or not?

Earlier I used the old SFTP plugin "SFTP Connections" which set both file and directory rights correctly (after I had modified a line in the wfx) in the same server. But your plugin is better since it supports UTF-8.
#68776 Personal Licence
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48241
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, no idea - it may also be a bug in the used sftp dll. Which version of the dll do you use?
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Another little patch:

http://web.hisoftware.cz/sob/download/sftpplug_src08beta-fix.patch

This one fixes address/port parsing. The original code just looked for ":" as the port delimiter. It was good only as long as no one tried to enter numeric IPv6 address and that's exactly what I did yesterday.

If anyone feels my code doesn't look exactly nice, then you're most probably correct - C pointers and I just don't get along. ;)
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

ghisler(Author) wrote:Sorry, no idea - it may also be a bug in the used sftp dll. Which version of the dll do you use?
libssh2.dll is version 0.18 (170,496 B; binary by Günter Knauf from libcurl 7.19.0; it seems that 0.18 is the latest for Win32 anyway)

libeay32.dll is dated 08 June 2008 (1,536,143 B)
libssl32.dll is dated 08 June 2008 (328,817 B)
(both also from the libcurl 7.19.0 package)

STFPPlug is 0.8 beta

I could not find any other sftp server to test with but I can try to get you a test account (for SFTP) on the server I am using.
#68776 Personal Licence
User avatar
Mikefield
Power Member
Power Member
Posts: 628
Joined: 2006-02-26, 19:13 UTC
Location: Oberursel, Germany HE

Post by *Mikefield »

You can use the mini-sftp-server for additional tests. Link below
http://www.coreftp.com/server/download/msftpsrvr.exe

mf
Bankster - Word of the Year 2009
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

The CoreFTP mini-server otherwise works well with SFTPPlug but here the server does not let the user put chmod 777 for directories (dirs are set as 666).

In TotalCommander with SFTPPlug I can make a directory (which is always set to 755 by the plugin) and then use the Change Attributes dialog from the file menu to set the dir rights to 777. (So yes, there is a workaround but it is not the most comfortable one.)

When I access CoreFTP mini-server through SFTPPlug, I cannot even change dir rights to 777 via the Change Attributes dialog (the dir rights stay 666).
#68776 Personal Licence
JOUBE
Power Member
Power Member
Posts: 1508
Joined: 2004-07-08, 08:58 UTC

Post by *JOUBE »

andres992 wrote:When I access CoreFTP mini-server through SFTPPlug, I cannot even change dir rights to 777 via the Change Attributes dialog (the dir rights stay 666).
...Because CoreFTP works on Windows.

JOUBE
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

The server I had the original problem (777 not set automatically, although defined in preferences) with is running on Linux and using OpenSSH for SFTP.
#68776 Personal Licence
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48241
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2Sob
Thanks, I will apply your patch to the next beta!

2andres992
What I could do is create the directory, and then set the rights with a second call to CHMOD (as if you changed it manually). This is a workaround to a server bug, but better than nothing. On my Cpanel servers ghisler.com and ghisler.ch it works directly...).
Author of Total Commander
https://www.ghisler.com
andres992
Member
Member
Posts: 124
Joined: 2006-04-12, 21:26 UTC

Post by *andres992 »

ghisler(Author) wrote:What I could do is create the directory, and then set the rights with a second call to CHMOD (as if you changed it manually). This is a workaround to a server bug, but better than nothing.
Thanks! Such workaround would probably make the plugin foolproof as to any tricky servers like the one I am using.
#68776 Personal Licence
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48241
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, please contact me by e-mail to support at ghisler dot com for a test version, it would be great if you could test it before I release a new public beta.
Author of Total Commander
https://www.ghisler.com
Sven Giermann
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-19, 10:42 UTC

Post by *Sven Giermann »

ghisler(Author) wrote:Unfortunately it's not that easy. Uploading and downloading would be quite easy to add, I would just call libssh2_scp_send_ex and libssh2_scp_recv. However, there is no function for reading the directory listing. I would probably need to open a shell session, and then send the ls -a command and parse it manually...
Would it be able to support a hybrid mode?
- read directory listing through SFTP
- transfer files through SCP

The reason for this question is, that I recognized big speed differenced between both. Not on all of my servers, but on many!
I could transfer files with the (old) SFTP-Plugin at about 1 MByte/s, with 'pscp -sftp' at 0.5 MByte/s and with 'pscp -scp' at 8-9 MByte/s...

So I would be glad to see TC transfer files via SCP instead of SFTP, although this leaves the need for the server to support SFTP as well.

Sven.
JOUBE
Power Member
Power Member
Posts: 1508
Joined: 2004-07-08, 08:58 UTC

Post by *JOUBE »

Sven Giermann wrote:I could transfer files with the (old) SFTP-Plugin at about 1 MByte/s, with 'pscp -sftp' at 0.5 MByte/s and with 'pscp -scp' at 8-9 MByte/s...
...and the transfer rate with "pscp"? (without any forced protocol [1])
...and the transfer rate of batch mode of "psftp"?

JOUBE

[1] PuTTY User Manual: Normally PSCP will attempt to use the SFTP protocol, and only fall back to the SCP protocol if SFTP is not available on the server.
Sven Giermann
Junior Member
Junior Member
Posts: 7
Joined: 2008-11-19, 10:42 UTC

Post by *Sven Giermann »

@JOUBE:
I did not try PSFTP, but as you quoted PSCP used sftp by default and returns the same throughput. So would like to have a '-scp' switch for our sftp-Plugin as well...
Post Reply