[Bug 3488] scp fails to locate remote paths containing a non-empty square bracket pair

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Oct 24 15:21:33 AEDT 2022


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

Damien Miller <djm at mindrot.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned-bugs at mindrot.org |djm at mindrot.org
                 CC|                            |djm at mindrot.org
   Attachment #3619|                            |ok?(dtucker at dtucker.net)
              Flags|                            |

--- Comment #4 from Damien Miller <djm at mindrot.org> ---
Created attachment 3619
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3619&action=edit
handle glob no-match conditions like olde scp

Original rcp-protocol scp would use the shell for remote glob(3)
expansion, and shells usually fall back in the case where the glob
expansion fails to considering the original path literally.

We can do this in scp in SFTP protocol mode using remote_glob()'s
GLOB_NOCHECK flag, which instructs it to return the original path if
expansion fails.

However, we also depend on GLOB_MARK to annotate directory paths with a
'/' suffix, and that doesn't happen to work for the GLOB_NOCHECK case.

So this changes three things:

1. Turns on GLOB_NOCHECK for the scp remote_glob() calls

2. Adds support to sftp-glob.c:remote_glob() to properly annotate
returned GLOB_NOCHECK paths when GLOB_MARK is enabled

3. Adds existence checks after remote_glob() when a GLOB_NOCHECK result
is returned so it can show a consistent error message for actually
missing files (rather than letting it fall through to the do_download()
call which doesn't do nice error messages).

-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list