[Rpm-maint] [rpm-software-management/rpm] Fix non-glob fallback regression in rpmGlob() (PR #2136)
Michal Domonkos
notifications at github.com
Tue Aug 2 08:12:18 UTC 2022
Replacing our non-glob short-circuitry with the GLOB_NOMAGIC flag might
have seemed like a straightforward change in commit
c10e2310e4c41a626b524ae71b3c4f87a29134b2 but it turns out it's not a 1:1
replacement due to the following differences from the original behavior:
- Non-glob filenames still make it past glob(3) to the URL and
lstat(2) code
- Patterns that are not well-formed (e.g. no closing bracket or brace)
are still treated as globs
- Curly braces aren't treated as "magic" chars by GLOB_NOMAGIC
- Trailing slash in a non-glob directory is stripped away by glob(3)
Avoid any surprise in the existing callers by re-adding the glob check,
only slightly simpler than the original rpmIsGlob() and
__glob_pattern_p() combo.
Treat the backslash as a "magic" char, though, as we want those to
always be discarded by glob(3) from the resulting filename, in order to
preserve the escape feature added in the above commit.
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/2136
-- Commit Summary --
* Fix non-glob fallback regression in rpmGlob()
-- File Changes --
M rpmio/rpmglob.c (34)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/2136.patch
https://github.com/rpm-software-management/rpm/pull/2136.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2136
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2136 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220802/97b6f5c0/attachment.html>
More information about the Rpm-maint
mailing list