Bug 482

Summary: readconf doesn't accept paths with spaces in them
Product: Portable OpenSSH Reporter: scott rankin <spaceacademy>
Component: sshAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: normal CC: David.Monniaux, harry
Priority: P2 Keywords: needs-release-note
Version: -current   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 1155    
Attachments:
Description Flags
Allow embedded spaces in tokens by preceding with a backslash
none
Same again with (hopefully) less bugs.
none
Same again with (hopefully) less bugs.
none
Fix handling of double-escapes (ie "\\")
none
Support double-quoting of config arguments none

Description scott rankin 2003-02-01 05:13:08 AEDT
If I modify my config to change Identityfile to something like:
Identityfile /cygdrive/c/documents and settings/user/my documents/.ssh/id_rsa

process_config_line() of readconf.c just calls strdelim() once so the path will
be truncated at the first space.

ssh fails with the error that there is garbage at the end of this line.
Comment 1 Damien Miller 2003-02-24 13:23:32 AEDT
Can you use DOS-style paths as a workaround, e.g. /docume~1/

This is a bug in the parser though
Comment 2 scott rankin 2003-02-24 18:14:23 AEDT
DOS style pathing, /docume~1/ does work around the parsing of the token at the
first space.

sorry I haven't provided a patch. I have been too busy. I know. lame.
Comment 3 Darren Tucker 2003-06-28 13:13:49 AEST
*** Bug 579 has been marked as a duplicate of this bug. ***
Comment 4 Darren Tucker 2005-12-13 19:24:18 AEDT
*** Bug 1099 has been marked as a duplicate of this bug. ***
Comment 5 Darren Tucker 2005-12-13 21:57:26 AEDT
Created attachment 1038 [details]
Allow embedded spaces in tokens by preceding with a backslash

This patch allows embedded spaces in config tokens by preceding the space with a backslash, eg

AllowUsers John\ Smith
Comment 6 Darren Tucker 2005-12-13 23:15:45 AEDT
Created attachment 1039 [details]
Same again with (hopefully) less bugs.
Comment 7 Darren Tucker 2005-12-13 23:15:53 AEDT
Created attachment 1040 [details]
Same again with (hopefully) less bugs.
Comment 8 Darren Tucker 2005-12-13 23:38:04 AEDT
Created attachment 1041 [details]
Fix handling of double-escapes (ie "\\")
Comment 9 Darren Tucker 2005-12-13 23:41:34 AEDT
This is not specific to Cygwin, but other OSes don't tend to have spaces in either usernames or file paths so it's not usually a problem elsewhere.
Comment 10 Harry Johnston 2005-12-15 12:02:47 AEDT
(In reply to comment #9)

Not true, Mac OS X routinely has spaces appearing in file paths, e.g., bug 579.

  Harry.
Comment 11 Darren Tucker 2005-12-21 00:14:51 AEDT
(In reply to comment #10)
> Not true, Mac OS X routinely has spaces appearing in file paths, e.g., bug 579.

OK, make that "most sane OSes don't tend to..." :-)

I've been thinking about it and I think allowing quotes instead would be more logical for people, eg: AllowUsers "John Smith" .

When I get a chance I'll change the patch to do this.
Comment 12 Darren Tucker 2006-02-26 14:28:03 AEDT
Created attachment 1084 [details]
Support double-quoting of config arguments

Support config directives of the form:
        User "John Smith"

Includes corresponding man page updates (that part of the patch probably won't apply to anything except -current, though).
Comment 13 Darren Tucker 2006-03-13 21:19:39 AEDT
Patch applied, thanks to all.  This will be in 4.4.

needs-release-note because it's a user-visible change, albeit a small one.
Comment 14 Darren Tucker 2006-09-28 19:25:18 AEST
With the release of 4.4, we believe that this bug is now closed.  For information about the release please see http://www.openssh.com/txt/release-4.4 .