Hi Monks,

I have an issue with Net::SSH2 between windows and Linux file transfers, where the program abends on initiating a file transfer and the file name contains an apostrophe (single quote "'") from windows to linux, but not the otherway around nor from Linux to Linux or BSD (or vice versa).

In other words the filename has a single quote on the windows host (why someone would do this is another thing, but it happens) ansd does not seem to be an issue with other character "()[]{}@#$%!" etc

with the debug option on, ssh2 reports the following

libssh2_scp_recv(ss->session, path, &st) -> 0x0 SSH Error (-28): LIBSSH2_ERROR_SCP_PROTOCOL - Failed to recv file

of course the program abend is part of the script and is triggered by the above failure.

a little more digging beyond the obvious perl issues such as parameter passing and string character escapes within the script and SSH2 mperl modules highlights the following

root@slack-one:/usr/local/lib/perl5# grep -R libssh2_scp_recv ./
Binary file ./auto/Net/SSH2/SSH2.so matches
root@slack-one:/usr/local/lib/perl5#

which is now a binary object created by the module make maker, as for the issue, I am assuming that the filename string breaks somewhere between the SSH2 lib and the perl interface, having no experience beyond installing these things from the cpan or other sources, my question would be where would I look into this or at least pass some pointers, clues or rfrences to any documentation that could be helpful in determining the problem.

in the interem i have resolved the issue by renaming the source file on windows from within the Linux perl script transfering the file and then renaming it once more, but it is an ugly solution ...


regards

In reply to >Windows filename troubles with Net::SSH2 by wet

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.