php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58846 ssh2_scp_send doesn't work under libssh2 1.2 on symlink
Submitted: 2009-08-31 23:46 UTC Modified: 2012-10-16 19:08 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: amiroot at yahoo dot com Assigned:
Status: Open Package: ssh2 (PECL)
PHP Version: 5.2.10 OS: RHEL
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: amiroot at yahoo dot com
New email:
PHP Version: OS:

 

 [2009-08-31 23:46 UTC] amiroot at yahoo dot com
Description:
------------
I'm not sure it is a bug on libssh2 or the PECL package. 

I'm using ssh2 0.11 and libssh2 1.1 and recently I upgrade the libssh2 to 1.2. The upgrade goes quite smooth. I've some symlink on my remote machine I use ssh2 function to copy files inside the symlink folder. After upgrade libssh2 to 1.2 I found that the upload doesn't work for those symlink folders. A warning message prompt me that upload failed and only small part of the file is uploaded.

When I downgrade libssh2 back to 1.1 the problem get fixed. Anyone encountered the same problem?

Reproduce code:
---------------
$connection = ssh2_connect($val["ftp_host"], $val["ftp_port"]);
ssh2_auth_password($connection, $val["ftp_username"], $val["ftp_password"]);
ssh2_scp_send($connection, $local_file, $remote_file, 0664);

Expected result:
----------------
No error message at all.

Actual result:
--------------
Only part of the file being uploaded with an error message like this:

Warning:  ssh2_scp_send() [function.ssh2-scp-send]: Failed copying file in /xxx on line 24

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-25 08:13 UTC] stant at bestyle dot ru
I can confirm this bug.

PHP 5.2.10 (cli) (built: Sep 12 2009 19:15:01)
libssh2-1.2,2
FreeBSD 7.0-RELEASE-p1
 [2009-11-29 20:54 UTC] dwash59_2000 at yahoo dot com
+1 on this bug, seen on libssh2 1.2.2, fixed by reverting to 1.1 .
 [2011-08-16 10:40 UTC] fedesh03 at hotmail dot com
I confirm the Issue!
 [2012-06-23 11:23 UTC] langemeijer@php.net
-Status: Open +Status: Feedback
 [2012-06-23 11:23 UTC] langemeijer@php.net
I cannot reproduce this bug, even with old libssh2 1.2.2 packages from ubuntu.

Can you check if this problem still exists?
 [2012-06-24 05:53 UTC] amiroot at yahoo dot com
The file I tried is a binary file. Have you tried something like PDF or JPG? A file in around 1MB will suffice to replicate the issue.
 [2012-10-06 09:12 UTC] langemeijer@php.net
-Status: Feedback +Status: Open
 [2012-10-06 09:12 UTC] langemeijer@php.net
Could you give the latest TRUNK version a try? I've modified the ssh2_scp_send() 
code. It should be fixed, but if it's not, it is much more verbose about error 
situations than it previously was.
 [2012-10-16 19:08 UTC] langemeijer@php.net
A new ssh2 package is released. Please see if problem still occurs.
 [2012-10-17 09:26 UTC] amiroot at yahoo dot com
Unfortunately the new release hasn't fixed the issue.

Here are the environment I tested it.

OS: Linux RHEL4
libssh: 1.2.4
PHP: 5.2.17
SSH: 0.12
Code: Exactly the same as what I submitted in the initial comment.
Result:
No error at all. The file was uploaded to the remote server but the size is a little bit smaller. I tried a PDF (3MB) and a PPT (4.8M). The file uploaded left only 2.3M and 4.3M.
 [2024-07-12 06:26 UTC] willson453tom at gmail dot com
Thanks for creating this bug. (https://github.com)(https://www-mypascoconnect.com)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 19:01:32 2024 UTC