[Rpm-maint] [rpm-software-management/rpm] Fix non-glob fallthrough in rpmGlob() (PR #2151)

Michal Domonkos notifications at github.com
Mon Aug 15 15:49:35 UTC 2022


Now that we directly use GLOB_NOMAGIC to implement a fallthrough for
non-glob patterns since commit 9e541c6a7da076bc1c1beb1ee45fd5fdd735358c,
we may ironically end up subjecting such patterns to the lstat(2) check
at the end if they're directories, and thus possibly not return them.

While the actual impact on our codebase seems to be minimal, mostly in
terms of pushing the point of failure elsewhere and possibly printing a
different error message, for the sake of consistency with the idea of
GLOB_NOMAGIC, fix this by bringing back the short-circuit check.

While at it, make it a bit simpler than the original rpmIsGlob() by
leaving out the well-formedness check (i.e. if a bracket/brace has a
closing counterpart) as that's not what GLOB_NOMAGIC does either.
Remove the now unused next_brace_sub() as part of that.

As a nice bonus, we are now again POSIX-compliant as GLOB_NOMAGIC is a
GNU extension.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2151

-- Commit Summary --

  * Fix non-glob fallthrough in rpmGlob()

-- File Changes --

    M rpmio/rpmglob.c (32)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2151.patch
https://github.com/rpm-software-management/rpm/pull/2151.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2151
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2151 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220815/80bc0744/attachment.html>


More information about the Rpm-maint mailing list