[Bug 1814] New: scp get file prepends -- before filename

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Fri Sep 3 18:34:54 EST 2010


https://bugzilla.mindrot.org/show_bug.cgi?id=1814

           Summary: scp get file prepends -- before filename
           Product: Portable OpenSSH
           Version: 5.5p1
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: scp
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: srigelsford at googlemail.com


Hi,

First bug file, so bear with me.
I am trying to use openssh scp to retrieve a file from a router.
This works with previous versions of openssh, but for some reason this
version is inserting -- into the command, confusing the router.

The command I am using is:
scp username at IP_address:file_name Destination_file_name

The debug output is:
sam at Laptop:~$ scp -v  sam at router:ns_sys_config config
Executing: program /usr/bin/ssh host router, user sam, command scp -v
-f -- ns_sys_config
OpenSSH_5.5p1 Debian-4ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to router [172.16.16.189] port 22.
debug1: Connection established.
debug1: identity file /home/sam/.ssh/id_rsa type -1
debug1: identity file /home/sam/.ssh/id_rsa-cert type -1
debug1: identity file /home/sam/.ssh/id_dsa type -1
debug1: identity file /home/sam/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version NetScreen
debug1: no match: NetScreen
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-sha1 none
debug1: kex: client->server aes128-cbc hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host 'vpnfwpr01' is known and matches the DSA host key.
debug1: Found key in /home/sam/.ssh/known_hosts:12
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password
debug1: Next authentication method: password
sam at router's password: 
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.utf8
debug1: Sending command: scp -v -f -- ns_sys_config
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 1488, received 1064 bytes, in 0.0 seconds
Bytes per second: sent 30047.3, received 21485.4
debug1: Exit status 1



The router debug shows:
## 2010-09-02 14:18:42 : SSH conn: command = scp -f -- ns_sys_config ##
2010-09-02 14:18:42 : >>> ssh_2nd_scp_authentication(un='srigelsford',
vsys='Root') ## 2010-09-02 14:18:42 : <<<
ssh_2nd_scp_authentication(aaid=30) = 1 ## 2010-09-02 14:18:42 : SCP:
>>> scp_create_session(command=scp -f -- ns_sys_config) ## 2010-09-02
14:18:42 : SCP: <<< scp_create_session() = 0 ## 2010-09-02 14:18:42 :
SSH state trans: SSH_STATE_CONNECTING(9) -> SSH_STATE_DISCONNECTING(11) 


A working version of OpenSSH does the following:
## 2010-09-03 19:33:53 : SSH conn: command = scp -f ns_sys_config ##
2010-09-03 19:33:53 : >>> ssh_2nd_scp_authentication(un='netscreen',
vsys='Root') ## 2010-09-03 19:33:53 : <<<
ssh_2nd_scp_authentication(aaid=4) = 1 ## 2010-09-03 19:33:53 : SCP:
>>> scp_create_session(command=scp -f ns_sys_config) ## 2010-09-03
19:33:53 : SCP: >>> scp_ctx_alloc() ## 2010-09-03 19:33:53 : SCP: <<<
scp_ctx_alloc() ## 2010-09-03 19:33:53 : SCP: >>>
scp_file_init(fn=ns_sys_config) ## 2010-09-03 19:33:53 : SCP: <<<
scp_file_init(fh=00000000, fs=5566) ## 2010-09-03 19:33:53 : SCP: <<<
scp_create_session() = 1


The issue seems to be the -- between the -f argument and the filename.
I have exhausted my googling abilities to no avail, so guess i might be
one of the first to have this problem.

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list