Summary: | glob("/foo/*/") may also match regular & other kind of files, not just directories | ||
---|---|---|---|
Product: | glibc | Reporter: | Șpagoveanu <spagoveanu> |
Component: | glob | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gadelat, stephane+sourceware |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | 2.36 | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Șpagoveanu
2020-03-12 07:45:41 UTC
Note that it was reported at https://unix.stackexchange.com/questions/638955/what-could-be-a-cause-for-getdents-returning-different-results-on-2-systems, there about a "prl_fs" filesystem (likely related to some Parallel virtualisation software). I can reproduce it with glibc 2.33, and also with broken symlinks: $ mkdir -p testdir/dir $ ln -s /no/such/file testdir/broken $ ./glob 'testdir/*/' testdir/broken testdir/dir/ Note that while the issue can be reproduced with ./*/ or b*/, I can't reproduce it with */ $ cd testdir $ ../glob './*/' ./broken ./dir/ $ ../glob 'b*/' broken $ ../glob '*/' dir/ Fixed in 2.36 by commit 7c477b57a3. |