[Rpm-maint] [rpm-software-management/rpm] Fix crash on Lua file trigger exiting with return'ed data (#3029) (PR #3235)

Panu Matilainen notifications at github.com
Wed Aug 7 10:02:21 UTC 2024


Reset the Lua stack on return from rpmluaRunScript() to discard any unhandled returned data from the scriptlet. This may happen if there's eg "return 0" from a non-macro scriptlet.

We could check for a numeric return value here and treat it as an exit code, but then what to do with other kinds of returned data? Our documentation states errors in Lua scriptlets should be signaled with Lua error() function, it seems better to stick with that and avoid introducing ambiguities and incompatibilities.

Update the existing file trigger tests to cover this case.

Fixes: #3029
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Fix crash on Lua file trigger exiting with return'ed data (#3029)

-- File Changes --

    M rpmio/rpmlua.c (2)
    M tests/data/SPECS/filetriggers.spec (11)
    M tests/rpmscript.at (3)

-- Patch Links --

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

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

Message ID: <rpm-software-management/rpm/pull/3235 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240807/2d91984e/attachment.html>


More information about the Rpm-maint mailing list