Ticket #114 (closed defect: outdated)

Opened 8 years ago

Last modified 7 years ago

libssh2_scp_send_ex in libssh2 1.2 doesn't work

Reported by: anonymous Owned by: bagder
Priority: normal Milestone:
Component: SCP Version: 1.2.2
Keywords: Cc: bagder, amiroot
Blocked By: Blocks:

Description

The function will file if you try to upload something to a folder which is a symlink to some other folder even if you have permission. It works properly under version 1.1. You can try this out if you upload a file large than 1 MB.

Change History

comment:1 Changed 8 years ago by anonymous

I'm using CentOS 5.3. I tested it under the PHP PECL package SSH2 0.11. Thanks

comment:2 Changed 8 years ago by bagder

Can you please clarify what "doesn't work" means more exactly?

Can you provide a test source (in C) that repeats the problem? (or does one of the samples from example/simple suffice?)

comment:3 Changed 8 years ago by amiroot

Hi, I just recalled that I've an account :p

Sorry that i just realized that there are samples from the sources code and I just tested with them. The problem laid down with scp_write and I found that it's not limited to symlink but also normal directories.

Once I uploaded a file with scp_write, it will tell you sending eof waiting for eof etc... and it quit decently. However, the size of the local file and the remote one are different. In some case it's a few k less but in some case it uploaded only 1/10 of the total content.

I tried the scp_write in 1.1 and it works prefect.

I can send you the file for testing in private. Thanks

comment:4 Changed 7 years ago by bagder

Is this still a problem in the recent git version? We've fixed several related issues.

comment:5 Changed 7 years ago by amiroot

The problem still exists. I tested with libssh2-1.2.2-20091020.tar.gz.

comment:6 Changed 7 years ago by anonymous

still have problem in lastest git. december 14 2009. centos 5.3.
problem same as amiroot

just simple running scp_write_non_blocking will hang in waiting eof

comment:7 Changed 7 years ago by bagder

  • Version set to 1.2.2

comment:8 Changed 7 years ago by amiroot

Problem still existing in 1.2.4 centos 5.3.

FYI the server is located in my office intranet and the programme try to access a server in public internet.

comment:9 Changed 7 years ago by bagder

Here's what I did to try to repeat it, only to see it working. Please be a lot more specific with details we NEED to repeat this problem.

First, I made a symlink in my local tmp dir to another dir:

$ ls -ld /home/daniel/tmp/upsymlink
lrwxrwxrwx 1 daniel daniel 6 Feb 21 18:56 /home/daniel/tmp/upsymlink -> upload

then I used the 'scp_write' example code to do an upload:
$ ./scp_write 127.0.0.1 [user] [password] local-file /home/daniel/tmp/upsymlink/tags

It said it worked, so I check the dir on the server:
$ ls -l /home/daniel/tmp/upsymlink/
total 4
-rw-r--r-- 1 daniel daniel 3773 Feb 21 19:23 tags

Now, please tell me what I need to adjust to make this fail the way you do?

comment:10 follow-up: Changed 7 years ago by stuge

It would also be helpful if you could attach a full debug log to this ticket. Create it by inserting libssh2_trace(session, ~0); into any program that shows the described problem.

comment:11 in reply to: ↑ 10 Changed 7 years ago by stuge

Replying to stuge:

Create it by inserting libssh2_trace(session, ~0); into any program that shows the described problem.

This requires libssh2 to be compiled with debugging enabled. Please configure libssh2 with --enable-debug and build yourself, if debugging is not enabled in the package in your distribution. Often it is not, so if calling libssh2_trace() does not lead to debug output please rebuild.

comment:12 Changed 7 years ago by bagder

This issue will be closed soon unless we get further details.

comment:13 Changed 7 years ago by bagder

  • Resolution set to outdated
  • Status changed from assigned to closed

Closing this issue since the reporter has vanished and we lack necessary information.

Note: See TracTickets for help on using tickets.