]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Export variable in resolver system test
authorTom Krizek <tkrizek@isc.org>
Fri, 12 Jan 2024 14:03:53 +0000 (15:03 +0100)
committerTom Krizek <tkrizek@isc.org>
Thu, 21 Mar 2024 13:16:16 +0000 (14:16 +0100)
Variable assignment when calling subroutines might not be portable.
Notably, it doesn't work with FreeBSD shell, where the value of HOME
would be ignored in this case.

Since the commands are already executed in a subshell, export the HOME
variable to ensure it is properly handled in all shells.

(cherry picked from commit 86a192cecea5413db85b30fb478cc48986452fe4)

bin/tests/system/resolver/tests.sh

index 165cfea98b26f9e359713e5fb08933f7773e6299..fc05635e310d5bc0b90515388c48820aa5f93fc2 100755 (executable)
@@ -627,9 +627,21 @@ n=$((n + 1))
 echo_i "check that '-t aaaa' in .digrc does not have unexpected side effects ($n)"
 ret=0
 echo "-t aaaa" >.digrc
-(HOME="$(pwd)" dig_with_opts @10.53.0.4 . >dig.out.1.${n}) || ret=1
-(HOME="$(pwd)" dig_with_opts @10.53.0.4 . A >dig.out.2.${n}) || ret=1
-(HOME="$(pwd)" dig_with_opts @10.53.0.4 -x 127.0.0.1 >dig.out.3.${n}) || ret=1
+(
+  HOME="$(pwd)"
+  export HOME
+  dig_with_opts @10.53.0.4 . >dig.out.1.${n}
+) || ret=1
+(
+  HOME="$(pwd)"
+  export HOME
+  dig_with_opts @10.53.0.4 . A >dig.out.2.${n}
+) || ret=1
+(
+  HOME="$(pwd)"
+  export HOME
+  dig_with_opts @10.53.0.4 -x 127.0.0.1 >dig.out.3.${n}
+) || ret=1
 grep ';\..*IN.*AAAA$' dig.out.1.${n} >/dev/null || ret=1
 grep ';\..*IN.*A$' dig.out.2.${n} >/dev/null || ret=1
 grep 'extra type option' dig.out.2.${n} >/dev/null && ret=1