Bug 22513 - If patterns has a trailing slash then glob has to match directories only
Summary: If patterns has a trailing slash then glob has to match directories only
Status: RESOLVED DUPLICATE of bug 10278
Alias: None
Product: glibc
Classification: Unclassified
Component: glob (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-28 21:03 UTC by Dmitry Goncharov
Modified: 2018-10-04 17:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Goncharov 2017-11-28 21:03:43 UTC
If patterns has a trailing slash then glob has to match directories only.

http://pubs.opengroup.org/onlinepubs/9699919799/.

Here posix specifies
"An ordinary character is a pattern that shall match itself. It can be any character in the supported character set except for NUL, those special shell characters in Quoting that require quoting, and the following three special pattern characters."

If the pattern is only 2 characters long (e.g. */) glob already matches directories only. If the pattern is longer e.g. hello*/ then glob matches only directories or files and directoires depending on type in readdir_result.
Comment 1 Florian Weimer 2018-10-04 17:35:40 UTC
Fixed in glibc 2.19.

*** This bug has been marked as a duplicate of bug 10278 ***