mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 01:57:43 +00:00
parser: fix protocol error on older kernels caused by additional xtable
Older kernels do not support an xtable grouped with the policy dfa. The presence of a policy.dfa does not indicate whether we should create an xtable with the policy dfa. Instead the check should be if the kernel supports the extended permstable32 format. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
b72cae79cb
commit
d0062b6d4a
@ -545,12 +545,12 @@ void sd_serialize_profile(std::ostringstream &buf, Profile *profile,
|
||||
sd_write_struct(buf, "policydb");
|
||||
sd_serialize_dfa(buf, profile->policy.dfa, profile->policy.size,
|
||||
profile->policy.perms_table);
|
||||
if (profile->policy.dfa) {
|
||||
// fprintf(stderr, "profile %s: policy xtable\n", profile->name);
|
||||
// TODO: this is dummy exec make dependent on V1
|
||||
if (kernel_supports_permstable32) {
|
||||
sd_serialize_xtable(buf, profile->exec_table,
|
||||
profile->uses_prompt_rules && prompt_compat_mode == PROMPT_COMPAT_PERMSV1 ?
|
||||
profile->uses_prompt_rules &&
|
||||
prompt_compat_mode == PROMPT_COMPAT_PERMSV1 ?
|
||||
profile->policy.perms_table.size() : 0);
|
||||
|
||||
}
|
||||
sd_write_structend(buf);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user