Handle SELinux getattr denials in open() processing

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-09-26 09:34:08 -07:00
parent 8b4b965f63
commit baa791a1e3
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -42,6 +42,7 @@ use autouse 'Carp' => qw(longmess confess);
use Scalar::Util 'reftype'; use Scalar::Util 'reftype';
use FindBin; use FindBin;
use Digest::SHA qw(sha1_hex); use Digest::SHA qw(sha1_hex);
use Errno qw(:POSIX);
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
# #
@ -754,7 +755,7 @@ sub initialize( $;$$) {
TC_SCRIPT => '', TC_SCRIPT => '',
EXPORT => 0, EXPORT => 0,
KLUDGEFREE => '', KLUDGEFREE => '',
VERSION => "5.1.5-RC1", VERSION => "5.1.8-Beta1",
CAPVERSION => 50106 , CAPVERSION => 50106 ,
BLACKLIST_LOG_TAG => '', BLACKLIST_LOG_TAG => '',
RELATED_LOG_TAG => '', RELATED_LOG_TAG => '',
@ -2569,17 +2570,21 @@ sub open_file( $;$$$$ ) {
assert( ! defined $currentfile ); assert( ! defined $currentfile );
if ( -f $fname && -s _ ) { if ( -f $fname ) {
$first_entry = 0; if ( -s _ ) {
$file_format = supplied $cf ? $cf : 1; $first_entry = 0;
$max_format = supplied $mf ? $mf : 1; $file_format = supplied $cf ? $cf : 1;
$comments_allowed = supplied $ca ? $ca : 0; $max_format = supplied $mf ? $mf : 1;
$nocomment = $nc; $comments_allowed = supplied $ca ? $ca : 0;
do_open_file $fname;; $nocomment = $nc;
return do_open_file $fname;
}
} else { } else {
$ifstack = @ifstack; $!{ENOENT} or fatal_error "Unable to open file $fname: " . $!;
'';
} }
$ifstack = @ifstack;
'';
} }
# #