Bug 2254 - Better error message for globs that have too many results.
Summary: Better error message for globs that have too many results.
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 6.6p1
Hardware: All All
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_6_7
  Show dependency treegraph
 
Reported: 2014-07-09 04:33 AEST by Orion Poplawski
Modified: 2014-10-08 08:00 AEDT (History)
1 user (show)

See Also:


Attachments
Patch to detect GLOB_NOSPACE and return better error message (1.51 KB, patch)
2014-07-09 04:33 AEST, Orion Poplawski
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Orion Poplawski 2014-07-09 04:33:42 AEST
Created attachment 2454 [details]
Patch to detect GLOB_NOSPACE and return better error message

sftp uses remote_glob() with ls and get, which sets GLOB_LIMIT, so it is possible that a "get a*" command could exhaust the default limit.  In this case you get the unhelpful error message:

sftp> get ssw*
File "/data/cora1/leka/AIA/ssw*" not found.

With the attached patch you get a better error message:

sftp> get ssw*
Too many matches for "/data/cora1/leka/AIA/ssw*".
sftp> ls ssw*
Can't ls: Too many matches for "/data/cora1/leka/AIA/ssw*"
Comment 1 Damien Miller 2014-07-09 11:45:19 AEST
Patch applied - thanks! This will be in openssh-6.7
Comment 2 Damien Miller 2014-10-08 08:00:55 AEDT
Close all bugs left open from 6.6 and 6.7 releases.