bugGNU Wget - Bugs: bug #20327, Add SFTP support


bug #20327: Add SFTP support

Submitter:  Micah Cowan <micahcowan>
Submitted:  Tue 03 Jul 2007 07:40:33 AM UTC
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Status:  Confirmed
Privacy:  Public Assigned to:  micahcowan
Originator Name:  Open/Closed:  Open
Release:  None Operating System:  None
Reproducibility:  None Fixed Release:  None
Planned Release:  2.0 Regression:  None
Work Required:  None Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Sat 31 May 2008 08:30:35 PM UTC, comment #7: 

I would rather suggest you base SFTP code on an existing library, such as the libssh2.

Or possibly even consider switching entirely to libcurl (which already supports SFTP based on libssh2)...

(Yeah, as libcurl author and libssh2 project contributor I'm very biased to both the above libs)

Daniel Stenberg <bagder>
Sat 31 May 2008 07:39:42 PM UTC, comment #6: 

[rakesh@rocky sftp]# ./a.out rakesh@ /home/rakesh/Desktop/new/Fedora-9-i386-DVD/Fedora-9-i386-DVD.iso
rakesh@'s password:
write: nread(4096) != nwrite(4294967295)
write: nread(4096) != nwrite(4294967295)
write: nread(4096) != nwrite(4294967295)
write: nread(4096) != nwrite(4294967295)
write: nread(4096) != nwrite(4294967295)
write: nread(4096) != nwrite(4294967295)
It breaks after 1.3 GB copied
Total size 3.4 GB

Rakesh Pandit <rakeshpandit>
Sat 31 May 2008 05:42:10 AM UTC, comment #5: 

That sounds reasonable. Till then I will focus on hardening my prototype into something more mature.

Debarshi Ray <debarshiray>
Fri 30 May 2008 06:48:17 PM UTC, comment #4: 

FYI, Debarshi,

I suspect that you'll find your chief difficulty to be actually rolling the code into Wget itself, whose code isn't currently flexible enough to make such a change easily.

In particular, the http_loop and ftp_loop functions, both of which are responsible to retry the download until it succeeds (or fails hard), share a lot of logic, and need to be refactored (something I'm hoping to tackle soon). Rather than roll yet another sftp_loop function, it'll probably be a little easier to wait until I can refactor it into a single url_loop function.

Micah Cowan <micahcowan>
Fri 30 May 2008 05:29:22 PM UTC, comment #3: 

I just tested in my LAN first :

[rpmbuild@rocky sftp]$ ./a.out rakesh@ /home/rakesh/Desktop/new/Fedora-9-i386-DVD/Fedora-9-i386-DVD.iso
rakesh@'s password:
SSH_FXP_READ: wrong request id (0) != 3
[rpmbuild@rocky sftp]$

Am I using the arguments correctly as expected?

Rakesh Pandit <rakeshpandit>
Fri 30 May 2008 02:53:46 PM UTC, comment #2: 

I have a simple non-interactive SFTP downloader ready now. Even though it is not the latest, I followed draft-ietf-secsh-filexfer-02, which describes version 3 of the protocol, because that is what openssh-5.0p1 and GNOME's Gvfs are also implementing.

To use the prototype:
$ tar -xzf sftp.tar.gz
$ cd sftp
$ gcc sftp.c buffer.c utility.c
$ ./a.out <hostname> <remotefilepath>

(file #15769)

Debarshi Ray <debarshiray>
Wed 28 May 2008 08:32:32 PM UTC, comment #1: 

rishi from IRC [(n=rishi@gnu-india/supporter/debarshi): Debarshi Ray] has been working on something for this.

Micah Cowan <micahcowan>
Tue 03 Jul 2007 07:40:33 AM UTC, original submission:  

Micah Cowan <micahcowan>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #15772:  sftp.tar.gz added by debarshiray (4KiB - application/x-gzip - Updated prototype (fixed bug while fetching bigger files))
file #15769:  sftp.tar.gz added by debarshiray (4KiB - application/x-gzip - Prototype non-interactive SFTP downloader)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bagder (Posted a comment)
  • -email is unavailable- added by rakeshpandit (Posted a comment)
  • -email is unavailable- added by debarshiray (Updated the item)
  • -email is unavailable- added by micahcowan (Submitted the item)

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-05-31 debarshiray Attached File- Added sftp.tar.gz, #15772
    2008-05-30 debarshiray Attached File- Added sftp.tar.gz, #15769
    2008-05-28 micahcowan Assigned toNone micahcowan
    2008-01-27 micahcowan Planned Release1.15 2.0
    2007-07-20 micahcowan Planned ReleaseNone 1.15

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code