preserve original uid/gid of slave zone file

This commit is contained in:
2023-10-09 21:38:09 -04:00
parent 7b50aa74ab
commit c457fd1ed8

View File

@ -67,7 +67,9 @@ sub do_rewrite {
}
close $fh;
print "Installing new slave host list\n";
system("install -o bind -g bind $path /etc/bind/martnet.slave.zones.9");
my $old_uid = (lstat "/etc/bind/martnet.slave.zones.9")[4];
my $old_gid = (lstat "/etc/bind/martnet.slave.zones.9")[5];
system("install -o $old_uid -g $old_gid $path /etc/bind/martnet.slave.zones.9");
print "Reloading DNS files\n";
system("/usr/sbin/rndc reload");
}