www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: [libssh2] [ libssh2-Bugs-1960894 ] libssh2_scp_* do not handle whitespace in file names

[libssh2] [ libssh2-Bugs-1960894 ] libssh2_scp_* do not handle whitespace in file names

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 09 May 2008 02:50:08 -0700

Bugs item #1960894, was opened at 2008-05-09 09:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1960894&group_id=125852

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Heiner (heiner0)
Assigned to: Nobody/Anonymous (nobody)
Summary: libssh2_scp_* do not handle whitespace in file names

Initial Comment:
it seems that some libssh2 SCP functions do not correctly handle
whitespace in file names. When trying to copy a file named "with blanks"
using libssh2_scp_recv() I get an error message.

The reason is that libssh2 builds a "scp" command line that will be
run on the remote side, but does not take care to quote the file
name. It runs the equivalent of the following "ssh" command:

    scp -f with blanks

instead of (note the quotation marks):

    scp -f 'with blanks'

The code causing problems is in libssh2_scp_recv():

    memcpy(session->scpRecv_command, "scp -f ", sizeof("scp -f ") - 1);
    memcpy(session->scpRecv_command + sizeof("scp -f ") - 1, path,
           path_len);

    (Similar code is in libssh2_scp_send()).

Variable "path" should get correct quoting.

I attached the function shell_quotearg() that could be used for quoting
the path name.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1960894&group_id=125852

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-05-09

the libssh2 team