Skip to content

Commit

Permalink
Merge pull request #19936 from dzedro/nscd
Browse files Browse the repository at this point in the history
apparmor: Workaround nscd bug on 15-SP3
  • Loading branch information
dzedro authored Aug 12, 2024
2 parents 5368ac7 + 9c31614 commit f6932c3
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions lib/services/apparmor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ sub check_aa_enforce {
# Recalculate profile name in case
$named_profile = $self->get_named_profile($profile_name);

validate_script_output "aa-disable $executable_name", sub {
m/Disabling.*nscd/;
}, timeout => 180;
if (is_sle('=15-SP3') && script_run("aa-disable $executable_name") == 1) {
record_soft_failure('bsc#1229029');
return;
}
else {
validate_script_output "aa-disable $executable_name", sub {
m/Disabling.*nscd/;
}, timeout => 180;
}

# Check if /usr/sbin/ntpd is really disabled
die "$executable_name should be disabled"
Expand Down Expand Up @@ -108,12 +114,18 @@ sub check_aa_complain {
assert_script_run "cp -r /etc/apparmor.d $aa_tmp_prof";

foreach my $cmd (@aa_complain_cmds) {
validate_script_output $cmd, sub {
m/Setting.*nscd to complain mode/s;
}, timeout => 180;
if (is_sle('=15-SP3') && script_run("$cmd") == 1) {
record_soft_failure('bsc#1229029');
return;
}
else {
validate_script_output $cmd, sub {
m/Setting.*nscd to complain mode/s;
}, timeout => 180;

# Restore to the enforce mode
assert_script_run "aa-enforce usr.sbin.nscd";
# Restore to the enforce mode
assert_script_run "aa-enforce usr.sbin.nscd";
}
}

# Clean Up
Expand Down

0 comments on commit f6932c3

Please sign in to comment.