mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
If a slave zone is in binary format, convert it to text when it becomes a master http://virtualmin.com/node/36245
This commit is contained in:
@@ -14,6 +14,10 @@ $file = &find("file", $zconf->{'members'});
|
||||
if (!$file) {
|
||||
&error($text{'convert_efile'});
|
||||
}
|
||||
$file = &make_chroot(&absolute_path($file));
|
||||
if (!-s $file) {
|
||||
&error(&text('convert_efilesize', $file));
|
||||
}
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
|
||||
# Change the type directive
|
||||
@@ -26,5 +30,19 @@ if (!$file) {
|
||||
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($zconf->{'file'}));
|
||||
|
||||
# Convert from binary slave format to text
|
||||
if (&is_raw_format_records($file)) {
|
||||
&has_command("named-compilezone") ||
|
||||
&error($text{'convert_ebinary'});
|
||||
$temp = &transname();
|
||||
©_source_dest($file, $temp);
|
||||
$out = &backquote_logged("named-compilezone -f raw -F text ".
|
||||
"-o $file $zone->{'name'} $temp 2>&1");
|
||||
&error(&text('convert_ecompile', "<tt>".&html_escape($out)."</tt>"))
|
||||
if ($?);
|
||||
&unlink_file($temp);
|
||||
}
|
||||
|
||||
&redirect("");
|
||||
|
||||
|
||||
@@ -824,6 +824,9 @@ log_dnssec=Change DNSSEC key re-signing
|
||||
|
||||
convert_err=Failed to convert zone
|
||||
convert_efile=A records file must be specified before a slave zone can be converted to a master.
|
||||
convert_efilesize=Records file $1 does not exist or is empty
|
||||
convert_ebinary=The command needed to convert from a binary slave zone to a text format master is not installed
|
||||
convert_ecompile=Binary to text format conversion failed : $1
|
||||
|
||||
whois_title=WHOIS Information
|
||||
whois_header=Output from command $1 ..
|
||||
|
||||
Reference in New Issue
Block a user