1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-06-19 09:48:03 +02:00

51889: fix module loading problem with full RELRO

If full RELRO (relocation read-only, one of the security enhancement
methods for ELF-based systems) is used when building zsh (as in binary
packages of most Linuxes), loading a module (e.g. zsh/zftp) fails unless
all the modules it depends on are already loaded. With this patch the
necessary modules are automatically loaded.
This commit is contained in:
Jun-ichi Takimoto 2023-06-26 17:13:04 +09:00
parent 1b9bc3441c
commit a84fdd7c8f
3 changed files with 29 additions and 1 deletions

View file

@ -1,5 +1,9 @@
2023-06-26 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 51889: Src/Modules/zftp.c, Src/mkbltnmlst.sh: enable loading a
module (e.g. zftp) that depends on other modules even if zsh is
built with the full RELRO
* 51884: Doc/Zsh/params.yo, Src/params.c, Src/utils.c,
Test/D04parameter.ztst: if MULTIBYTE option is on and IFS contains
invalid bytes in curret locale then reset it to default

View file

@ -3172,7 +3172,7 @@ static struct features module_features = {
int
setup_(UNUSED(Module m))
{
return (require_module("zsh/net/tcp", NULL, 0) == 1);
return 0;
}
/**/

View file

@ -76,6 +76,30 @@ for x_mod in $x_mods; do
test "x$linked" = xno && echo "#endif"
done
# if dynamic module 'mod' with load=no has moddeps in its .mdd,
# then output add_dep(mod, dep) for each 'dep' in moddeps.
dyn_mods="`grep ' link=dynamic .* load=no ' $CFMOD | \
sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`"
for mod in $dyn_mods; do
modfile="`grep '^name='$mod' ' $CFMOD | \
sed -e 's/^.* modfile=//' -e 's/ .*//'`"
if test "x$modfile" = x; then
echo >&2 "WARNING: no name for \`$mod' in $CFMOD (ignored)"
continue
fi
unset moddeps
. $srcdir/../$modfile
if test -n "$moddeps"; then
echo '#ifdef DYNAMIC'
echo "/* non-linked-in known module \`$mod' */"
for dep in $moddeps; do
echo " add_dep(\"$mod\", \"$dep\");"
done
echo '#endif'
fi
done
echo
done_mods=" "
for bin_mod in $bin_mods; do