Commit c617daea3f for bind

commit c617daea3f9271acdadb4b70134830d5ad6b7039
Author: Mark Andrews <marka@isc.org>
Date:   Wed Sep 30 12:28:04 2026 +1000

    Add the ability to set environment variables when starting named

diff --git a/REUSE.toml b/REUSE.toml
index 5ab75c1806..06414e623c 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -153,6 +153,7 @@ path = [
 	"**/named.ednsformerr",
 	"**/named.ednsnotimp",
 	"**/named.ednsrefused",
+	"**/named.env",
 	"**/named.maxudp1460",
 	"**/named.maxudp512",
 	"**/named.noaa",
diff --git a/bin/tests/system/start.pl b/bin/tests/system/start.pl
index 551b6da369..61dfe14c6d 100755
--- a/bin/tests/system/start.pl
+++ b/bin/tests/system/start.pl
@@ -262,7 +262,7 @@ sub construct_ns_command {

 			$line =~ s/#.*$//;

-			$command .= $line;
+			$command .= $line." ";

 			last;
 		}
@@ -296,6 +296,26 @@ sub construct_ns_command {
 	# get the shell to report the pid of the server ($!)
 	$command .= " echo \$!";

+	my $env_file = $testdir . "/" . $server . "/" . "named.env";
+	if (-e $env_file) {
+		my $env = "env ";
+
+		open(my $fh, "<", $env_file) or die "unable to read env_file \"$env_file\" ($OS_ERROR)\n";
+
+		while(my $line=<$fh>) {
+			next if ($line =~ /^\s*$/); #discard blank lines
+			next if ($line =~ /^\s*#/); #discard comment lines
+
+			chomp $line;
+
+			$env .= $line." ";
+
+			last;
+		}
+
+		$command = $env . $command
+	}
+
 	return $command;
 }