log_debug_errno(errno,"The early AppArmor policy cache directory %s does not exist.",cache_dir_path);
return0;
}
log_warning_errno(errno,"Failed to create a new AppArmor policy cache, ignoring: %m");
return0;
}
r=aa_policy_cache_replace_all(policy_cache,NULL);
if(r<0){
log_warning_errno(errno,"Failed to load the profiles from the early AppArmor policy cache directory %s, ignoring: %m",cache_dir_path);
return0;
}
log_info("Successfully loaded all binary profiles from AppArmor early policy cache at %s.",cache_dir_path);
r=aa_change_profile("systemd");
if(r<0){
if(errno==ENOENT)
log_debug_errno(errno,"Failed to change to AppArmor profile 'systemd'. Please ensure that one of the binary profile files in policy cache directory %s contains a profile with that name.",cache_dir_path);
else
log_error_errno(errno,"Failed to change to AppArmor profile 'systemd': %m");