From 8dde14f93e3558e96eb1c84fb3d18682484d4bda Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 9 Sep 2020 21:25:30 +0200 Subject: [PATCH] bash: prevent aliasing of libc's 'getenv' By default, bash brings its own version of 'getenv', named exactly like the libc function. This becomes a problem in fork/execve scenarios if the dynamic linker resolves 'getenv' to the bash binary instead of the libc. This patch fixes the generate step of the genodians.org scenario. Issue #3882 --- repos/ports/src/noux-pkg/bash/target.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/repos/ports/src/noux-pkg/bash/target.inc b/repos/ports/src/noux-pkg/bash/target.inc index a0506d6758..7a6b1bee4e 100644 --- a/repos/ports/src/noux-pkg/bash/target.inc +++ b/repos/ports/src/noux-pkg/bash/target.inc @@ -1,4 +1,12 @@ CONFIGURE_ARGS = --without-bash-malloc + +# +# Avoid aliasing with the libc 'getenv' to prevent the dynamic linker from +# resolving libc-internal references to the bash binary, which causes +# trouble for fork/execve. +# +CONFIGURE_ARGS += bash_cv_getenv_redef=no + CFLAGS += -Dsh_xfree=free #