Warn if chroot dir looks wrong

This commit is contained in:
Jamie Cameron
2013-11-24 17:38:42 +00:00
parent c931fd6e3a
commit 09694fd458
2 changed files with 23 additions and 1 deletions

View File

@@ -83,6 +83,27 @@ if ($need_create) {
exit;
}
# Check for possibly invalid chroot, which shows up as missing zone files
if (@zones && $access{'zones'} eq '*' && !$access{'ro'}) {
my @missing;
foreach my $z (@zones) {
if ($z->{'type'} eq 'master' && $z->{'file'} &&
!-r $z->{'file'}) {
push(@missing, $z->{'file'});
}
}
if (scalar(@missing) >= scalar(@zones)/2) {
if ($chroot && $chroot ne '/') {
print "<b>",&text('index_ewrongchroot',
scalar(@missing), "<tt>$chroot</tt>"),"</b><p>\n";
}
else {
print "<b>",&text('index_emissingchroot',
scalar(@missing)),"</b><p>\n";
}
}
}
if ($access{'defaults'}) {
# display global options
print &ui_subheading($text{'index_opts'});

View File

@@ -60,7 +60,8 @@ index_massupdate=Update Records in Selected
index_masscreate=Add Record to Selected
index_massrdelete=Delete Records in Selected
index_bind=BIND
index_ewrongchroot=Warning : The chroot directory $2 that Webmin thinks BIND is using may be incorrect. The zone files for $1 domains could not be found.
index_emissingchroot=Warning : Webmin thinks that BIND is not using a chroot directory, but that may be incorrect. The zone files for $1 domains could not be found.
master_title=Edit Master Zone
master_ecannot=You are not allowed to edit this zone
master_egone=Zone $1 does not exist in any view