php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63855
Patch ssh2-0.12 revision 2012-12-26 13:36 UTC by erez dot h at zend dot com

Patch ssh2-0.12 for ssh2 Bug #63855

Patch version 2012-12-26 13:36 UTC

Return to Bug #63855 | Download this patch
Patch Revisions:

Developer: erez.h@zend.com

--- ssh2.c.orig	2012-10-06 15:52:52.000000000 +0200
+++ ssh2.c	2012-12-25 12:12:50.511330000 +0200
@@ -677,7 +677,7 @@
 	}
 
 	SSH2_FETCH_NONAUTHENTICATED_SESSION(session, zsession);
-
+#ifndef _WIN32
 	// Explode '~/paths' stopgap fix because libssh2 does not accept tilde for homedir
 	// This should be ifdef'ed when a fix is available to support older libssh2 versions
 	pws = getpwuid(geteuid());
@@ -695,6 +695,7 @@
 		efree(privkey);
 		privkey = newpath;
 	}
+#endif
 
 	/* TODO: Support passphrase callback */
 	if (libssh2_userauth_publickey_fromfile_ex(session, username, username_len, pubkey, privkey, passphrase)) {
--- ssh2_fopen_wrappers.c.orig	2012-10-02 22:18:08.000000000 +0200
+++ ssh2_fopen_wrappers.c	2012-12-25 12:12:50.523330000 +0200
@@ -1126,6 +1126,8 @@
 		char buffer[8192];
 		size_t toread = MIN(8192, ssb.sb.st_size);
 		size_t bytesread = php_stream_read(local_file, buffer, toread);
+		size_t sent = 0;
+        size_t justsent = 0;
 
 		if (bytesread <= 0 || bytesread > toread) {
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed copying file 2");
@@ -1134,8 +1136,6 @@
 			RETURN_FALSE;
 		}
 
-		size_t sent = 0;
-		size_t justsent = 0;
 
 		while (bytesread - sent > 0) {
 			if ((justsent = libssh2_channel_write(remote_file, (buffer + sent), bytesread - sent)) < 0) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC