@giacomo or somebody else who understands it
Can you help me to understand the following template fragment: I have a problem by understanding why file gets an expressionlist and the other categories not.
{
use File::Find;
use File::Basename;
my $exprstatus = $squidguard{'Expressions'} || 'disabled';
our %categories;
our @files;
sub wanted() {
my %tmp;
if ( -d $File::Find::name ) {
my $domains = $File::Find::name."/domains";
my $expressions = $File::Find::name."/expressions";
if ( -e $domains ) {
$tmp{'domains'} = $domains;
}
if ( -e $expressions ) {
$tmp{'expressions'} = $expressions;
}
if ( -e $domains || -e $expressions ) {
my $category = $_;
if ( $File::Find::name eq '/var/squidGuard/blacklists/custom/whitelist') {
$category = 'nh_whitelist';
}
if ( $File::Find::name eq '/var/squidGuard/blacklists/custom/blacklist') {
$category = 'nh_blacklist';
}
$categories{$category} = \%tmp;
}
}
}
find (\&wanted, "/var/squidGuard/blacklists/");
while (($key, $value) = each(%categories)) {
$OUT.="category \"$key\" {\n";
if (defined($value->{'domains'})) {
$OUT .= " domainlist ".$value->{'domains'}."\n";
}
if (defined($value->{'expressions'}) && ( $exprstatus eq 'enabled' || $key eq 'files')) {
$OUT .= " expressionlist ".$value->{'expressions'}."\n";
}
$OUT.="}\n";
}
}
It’s from
/etc/e-smith/etc/templates/ufdbguard/ufdbGuard.conf/20categories
At
there is a config with expressionlists, so it could be possible, but like @giacomo said, probably with deep modifications.