Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
close(KDCCONF);
}
+sub mk_resolv_conf($$)
+{
+ my ($ctx) = @_;
+
+ unless (open(RESOLV_CONF, ">$ctx->{resolv_conf}")) {
+ warn("can't open $ctx->{resolv_conf}$?");
+ return undef;
+ }
+
+ print RESOLV_CONF "nameserver $ctx->{dns_ipv4}\n";
+ print RESOLV_CONF "nameserver $ctx->{dns_ipv6}\n";
+ close(RESOLV_CONF);
+}
+
sub realm_to_ip_mappings
{
# this maps the DNS realms for the various testenvs to the corresponding
$env->{RESOLV_CONF} = "$prefix_abs/resolv.conf";
$env->{TESTENV_DIR} = $prefix_abs;
- open(RESOLV_CONF, ">$env->{RESOLV_CONF}");
- print RESOLV_CONF "nameserver $env->{SERVER_IP}\n";
- print RESOLV_CONF "nameserver $env->{SERVER_IPV6}\n";
- close(RESOLV_CONF);
+ my $ctx = undef;
+ $ctx->{resolv_conf} = $env->{RESOLV_CONF};
+ $ctx->{dns_ipv4} = $env->{SERVER_IP};
+ $ctx->{dns_ipv6} = $env->{SERVER_IPV6};
+ Samba::mk_resolv_conf($ctx);
my @preargs = ();
my @args = ();