Bug 219454 - scp: ambiguous target
Summary: scp: ambiguous target
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: openssh
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tomas Mraz
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-13 08:56 UTC by Rainer Traut
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-12-13 13:37:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Rainer Traut 2006-12-13 08:56:54 UTC
Description of problem:
scp fails to identify a target, if it contains spaces

Version-Release number of selected component (if applicable):
openssh-clients-3.9p1-8.RHEL4.17.1

How reproducible:
always if remote path has spaces

Steps to Reproduce:
1. # scp testfile tr@neptun:"/home/tr/dir with spaces/"
tr@neptun's password:
scp: ambiguous target

2. # scp testfile tr@neptun:'/home/tr/dir with spaces/'
tr@neptun's password:
scp: ambiguous target

3. # scp testfile tr@neptun:/home/tr/dir\ with\ spaces/
tr@neptun's password:
scp: ambiguous target

any variant I have forgotten?

Actual results:
scp fails to copy

Expected results:
scp should copy

Additional info:
Maybe fixed in later versions?

Comment 1 Rainer Traut 2006-12-13 09:58:29 UTC
both machines (source and target) are El4.4

Comment 2 Tomas Mraz 2006-12-13 13:37:56 UTC
scp is run on the remote side through shell and it expands the arguments. This
allows for example 'scp remote.server:*.c .'.

So the spaces must be double-escaped like this:

# scp testfile tr@neptun:'/home/tr/dir\ with\ spaces/'




Note You need to log in before you can comment on or make changes to this bug.