]> git.ipfire.org Git - thirdparty/dracut.git/commit
fix(10i18n): stop leaking shell options
authorPavel Valena <pvalena@redhat.com>
Fri, 25 Mar 2022 16:26:19 +0000 (17:26 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 4 Apr 2022 08:00:10 +0000 (08:00 +0000)
commitf3441cc7c577554dde04a9fe90638f779bb0a411
treee63d40e7064b802f1225d6a341b6b25d87dbd373
parentf63faaa68f8d60ca302b7a970873897ee4a5db2c
fix(10i18n): stop leaking shell options

Avoid using shell options in findkeymap, instead of using a wrapper[*]
to restore the previous options. Using mapfile and find to generate the list
of files also has the benefit of being more readable in this case.

[*] Reverted commit 35064768ebf14d3ec6bf3f7df52580fb4920ea3d
Original issue description from Michal Hecko <mhecko@redhat.com>:

The findkeymap function manipulates the shell options and relies on
restoring them using the trap. However, as the function might be called
recursively, each recursive invocation changes the signal handler to its
own. As the recursion is entered with shell options already modified,
the changed trap handler is replaced with restoration to the modified
shell options, not the original ones.
modules.d/10i18n/module-setup.sh