New SFTP plugin available now
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2sqa_wizard
Thanks for checking!
2Sob
It's unfortunate that openssh supports it on the client side only. Maybe we should report it as a bug? About your fix: What happens when you connect with my code? Doesn't your code cause a memory leak? Or is the block freed by the openssh dll?
Thanks for checking!
2Sob
It's unfortunate that openssh supports it on the client side only. Maybe we should report it as a bug? About your fix: What happens when you connect with my code? Doesn't your code cause a memory leak? Or is the block freed by the openssh dll?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
It's not bug, just missing feature. RFC 4252 does not require it, it only says server SHOULD support it. What I find strange, is that I can't find any indication anywhere about someone missing it. I don't know, does everyone use only interactive SSH logins, where they can see the prompts?
Your code made TC crash after password change at "LIBSSH2_FREE(session, session->userauth_pswd_newpw)" in libssh2 (version 1.4.3, userauth.c, line 388). Variable userauth_pswd_newpw is second parameter for callback (as &session->userauth_pswd_newpw) and it does not get allocated anywhere, there's only definition "char *userauth_pswd_newpw".
Your code made TC crash after password change at "LIBSSH2_FREE(session, session->userauth_pswd_newpw)" in libssh2 (version 1.4.3, userauth.c, line 388). Variable userauth_pswd_newpw is second parameter for callback (as &session->userauth_pswd_newpw) and it does not get allocated anywhere, there's only definition "char *userauth_pswd_newpw".
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Actually your code *newpw = (char *)malloc(*newpw_len); allocates a new block of data every time this callback function is called. I guess that the block is freed by LIBSSH2_FREE, but it's not documented anywhere.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
There is a new version 1.4.1 of my plugin available now. Download from:
http://www.ghisler.com/plugins.htm
2Sob
I have made the correction you suggested, could you please try it? I had to change it a bit, though, because your suggestion didn't consider the terminating zero:
http://www.ghisler.com/plugins.htm
2Sob
I have made the correction you suggested, could you please try it? I had to change it a bit, though, because your suggestion didn't consider the terminating zero:
Code: Select all
int bufsize=(int)strlen(newpass)+1;
*newpw=(char*)malloc(bufsize);
strlcpy(*newpw,newpass,bufsize);
*newpw_len=bufsize;
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Almost there. It does not crash, password is changed, but immediately after that, login fails. Complete reconnect then works.
This works better:
--
Edit: And looking at it again, to be technically correct, you also want bufsize-1 for strlcpy(). Not that it really matters here, because newpass is not going to magically grow in length between the lines, but if it did (by miracle :), strlcpy() would again write after allocated memory.
This works better:
Code: Select all
*newpw_len=bufsize-1;
Edit: And looking at it again, to be technically correct, you also want bufsize-1 for strlcpy(). Not that it really matters here, because newpass is not going to magically grow in length between the lines, but if it did (by miracle :), strlcpy() would again write after allocated memory.
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Please could mention zlib where you mention the other two - in the instructions on the plugins page and the missing DLLs error message - that would have saved me a lot of time this morning.ghisler(Author) wrote:Please put all the DLLs from the libcurl archive to the TC directory. You probably forgot the zlib1.dll. Newer ssh versions depend on it.

- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2zbuzanic
Try using the option send the files via SCP instead of SFTP. This seems to be both faster and more reliable.
Try using the option send the files via SCP instead of SFTP. This seems to be both faster and more reliable.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Downloading should not change the remote permissions - at least there is no code in my plugin which would be doing that...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
sorry for dumb question... but I can't get rid of error "Please put libssh2.dll and libeay32.dll <...>" - I already tried to put dll files to all of three proposed locations, but the error is still there. Where should I dig?
Thanks in advance!
Windows 7 64-bit, TC v. 8.01 32-bit, cURL library v. 7.30.0.
Thanks in advance!
Windows 7 64-bit, TC v. 8.01 32-bit, cURL library v. 7.30.0.