Bug 2254

Summary: Better error message for globs that have too many results.
Product: Portable OpenSSH Reporter: Orion Poplawski <orion>
Component: sftpAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: enhancement CC: djm
Priority: P5    
Version: 6.6p1   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 2226    
Attachments:
Description Flags
Patch to detect GLOB_NOSPACE and return better error message none

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.