Improve the fix for SELinux "getattr" denials

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-09-28 15:16:00 -07:00
parent baa791a1e3
commit 3d2e9eb93e
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -1994,6 +1994,7 @@ sub find_file($)
for my $directory ( @config_path ) {
my $file = "$directory$filename";
return $file if -f $file;
$!{ENOENT} || fatal_error "Unable to access $file: " . $!;
}
"$config_path[0]$filename";
@ -2570,21 +2571,17 @@ sub open_file( $;$$$$ ) {
assert( ! defined $currentfile );
if ( -f $fname ) {
if ( -s _ ) {
$first_entry = 0;
$file_format = supplied $cf ? $cf : 1;
$max_format = supplied $mf ? $mf : 1;
$comments_allowed = supplied $ca ? $ca : 0;
$nocomment = $nc;
return do_open_file $fname;
}
if ( -f $fname && -s _ ) {
$first_entry = 0;
$file_format = supplied $cf ? $cf : 1;
$max_format = supplied $mf ? $mf : 1;
$comments_allowed = supplied $ca ? $ca : 0;
$nocomment = $nc;
do_open_file $fname;
} else {
$!{ENOENT} or fatal_error "Unable to open file $fname: " . $!;
$ifstack = @ifstack;
'';
}
$ifstack = @ifstack;
'';
}
#