[Rpm-maint] [rpm-software-management/rpm] Catch runaway forked children from Lua scriptlets centrally (PR #2421)

Panu Matilainen notifications at github.com
Thu Mar 9 08:50:29 UTC 2023


Commit 2d418ad3c11bcf0261d0022ac177d13284a8d5fb added a safety catch for runaway children from package scriptlets, but we have many other ways to run Lua scriptlets too, and runaway children are equally harmful in them all. Catch them all centrally by wrapping lua_pcall() instead.

Besides handling more cases, there are a couple of more subtle improvements here: rpmlog() in a child process is undefined behavior due to the locking it does, but also nonsensical - rpmlog() is more than fprintf() and any warnings/errors it collects end up in the wrong process. Check and log from the parent instead.

Finally, make it a warning instead of an error because we're not failing the scriptlet because of this, and make the message more generic as besides exec(), this can be avoided by waiting for the child in the script too.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Catch runaway forked children from Lua scriptlets centrally

-- File Changes --

    M lib/rpmscript.c (6)
    M rpmio/rpmlua.c (33)

-- Patch Links --

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

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

Message ID: <rpm-software-management/rpm/pull/2421 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230309/acb85173/attachment-0001.html>


More information about the Rpm-maint mailing list