mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Support rock-format caches
This commit is contained in:
@ -39,7 +39,8 @@ if (!$in{'nouser'}) {
|
||||
# valid directives)
|
||||
my @cachestruct = &find_config("cache_dir", $conf, 2);
|
||||
if ($squid_version >= 2.3) {
|
||||
@cachestruct = grep { $_->{'values'}->[1] =~ /^\// } @cachestruct;
|
||||
@cachestruct = grep { $_->{'values'}->[1] =~ /^\// &&
|
||||
-d $_->{'values'}->[1] } @cachestruct;
|
||||
}
|
||||
else {
|
||||
@cachestruct = grep { $_->{'values'}->[0] } @cachestruct;
|
||||
|
@ -528,7 +528,9 @@ my (@caches, $coss);
|
||||
my @cachestruct = &find_config("cache_dir", $conf);
|
||||
my $disabled = 0;
|
||||
if ($distoo && !@cachestruct) {
|
||||
# Check disabled cache directives, but exclude ones that don't exist
|
||||
@cachestruct = &find_config("cache_dir", $conf, 1);
|
||||
@cachestruct = grep { -e $_->{'values'}->[1] } @cachestruct;
|
||||
$disabled = 1 if (@cachestruct);
|
||||
}
|
||||
if (@cachestruct) {
|
||||
@ -548,13 +550,13 @@ if (!@caches) {
|
||||
if ($coss) {
|
||||
# Allow COSS files too
|
||||
foreach my $c (@caches) {
|
||||
return 0 if (!-f $c && (!-d $c || !-d "$c/00"));
|
||||
return 0 if (!-f $c && (!-d $c || (!-d "$c/00" && !-r "$c/rock")));
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Check for dirs only
|
||||
foreach my $c (@caches) {
|
||||
return 0 if (!-d $c || !-d "$c/00");
|
||||
return 0 if (!-d $c || (!-d "$c/00" && !-r "$c/rock"));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user