diff options
author | Chris Boot <bootc@debian.org> | 2022-09-02 17:10:44 +0200 |
---|---|---|
committer | Philip Hands <phil@hands.com> | 2022-09-02 17:10:44 +0200 |
commit | d26e56c1b79550d5a77a227e06f16ed9597984da (patch) | |
tree | 1b50922f6fdb400fc0ffcfe6270184bd54ecd18a | |
parent | dd710e3f35b17eac0baf740a85c7dfed40323b25 (diff) |
Temporary hack re-enable invalid variable names
Forwarded: not-needed
Upstream busybox commit b6838b520 ("ash: [VAR] Sanitise environment
variable names on entry") breaks assumptions used by debian-installer's
preseed system. This results in settings passed to the installer on the
kernel command-line getting stripped out if they contain invalid
characters in the variable name, such as '/', which is actually very
common in this use case.
This is not a long term fix for this problem: a different approach is
needed to parse the values from the kernel command-line, but we don't
want to be responsible for holding up the debian-installer alpha
release any longer than it has already.
Gbp-Pq: Name temp-deb-installer-hack.patch
-rw-r--r-- | shell/Config.src | 7 | ||||
-rw-r--r-- | shell/ash.c | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/shell/Config.src b/shell/Config.src index 5efbf9995..b611a84d3 100644 --- a/shell/Config.src +++ b/shell/Config.src @@ -184,6 +184,13 @@ config FEATURE_SH_EMBEDDED_SCRIPTS the script in 'applets_sh' and a stub C file containing configuration in the appropriate subsystem directory. +config FEATURE_DI_ENV_HACK + bool "Use d-i environment variable hack" + default n + depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH + help + Do NOT use this. You don't want this. Really. + endif # Options common to all shells endmenu diff --git a/shell/ash.c b/shell/ash.c index 875403295..b4156d64a 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -14401,8 +14401,13 @@ init(void) initvar(); for (envp = environ; envp && *envp; envp++) { +#if ENABLE_FEATURE_DI_ENV_HACK + if (strchr(*envp, '=')) +#else p = endofname(*envp); - if (p != *envp && *p == '=') { + if (p != *envp && *p == '=') +#endif + { setvareq(*envp, VEXPORT|VTEXTFIXED); } } |