Skip to content

Commit

Permalink
Fix if not a real file, fix if source is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
JeGoi committed Oct 22, 2024
1 parent b6f1d22 commit fcffd65
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/pf/Firewalld/util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ sub util_all_icmp_blocks {
sub util_all_sources {
my $c = shift;
my $zc = shift;
if ( exists( $c->{"sources"} ) ) {
if ( exists( $c->{"sources"} ) && length($c->{"sources"}) > 0 ) {
my @t;
my $vl = $c->{"sources"} ;
foreach my $v ( @{ $vl } ) {
Expand Down Expand Up @@ -708,9 +708,14 @@ sub util_get_name_files_from_dir {
foreach my $file ( @files ) {
my $b = basename($file);
$b =~ s/\.[^.]+$//;
$xml{$b} = 1;
if (length($b)>2) {
$xml{$b} = 1;
}
}
if (scalar(keys(%xml))>0) {
return \%xml;

}
return \%xml;
}
return undef;
}
Expand Down

0 comments on commit fcffd65

Please sign in to comment.