[PATCH 3/6] nginx.eclass: avoid heredoc in global scope

Sam James <[email protected]> Fri, 10 Jul 2026 17:41:09 +0100
Newsgroups gmane.linux.gentoo.devel
Message-ID <1a82f864352ddb2c7cb9c94ff0d5d91152e9a08e.1783701661.git.sam@gentoo.org>
A heredoc may cause the use of a temporary file with < EAPI 9 and even
then still with >= EAPI 9 if the input is large. This becomes a problem
if sandboxing is applied to metadata generation.

Closes: https://bugs.gentoo.org/978940
Signed-off-by: Sam James <[email protected]>
---
 eclass/nginx.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/nginx.eclass b/eclass/nginx.eclass
index c77cbcf64eb20..1212d296173b1 100644
--- a/eclass/nginx.eclass
+++ b/eclass/nginx.eclass
@@ -376,7 +376,8 @@ _ngx_set_mod_required_use() {
 		if has "${mod}" "${_NGX_MODULES[@]#+}"; then
 			result=''
 			# Feed comma-delimited dependencies into the dep_list array.
-			IFS=, read -ra dep_list <<< "${_NGX_DEP_TABLE[${mod}]}"
+			mapfile -td ',' dep_list < <(printf %s "${_NGX_DEP_TABLE[${mod}]}")
+
 			for dep in "${dep_list[@]}"; do
 				has "${dep}" "${_NGX_MODULES[@]#+}" &&
 					result+=" nginx_modules_${dep}"
-- 
2.55.0