libsepol: improve policy lookup failure message
If a policy version cannot be found include the policy target, and a module prefix for non kernel policies in the message. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
e81a05a505
commit
fa3a1bcaf3
|
@ -2252,8 +2252,10 @@ int policydb_write(policydb_t * p, struct policy_file *fp)
|
||||||
info = policydb_lookup_compat(p->policyvers, p->policy_type,
|
info = policydb_lookup_compat(p->policyvers, p->policy_type,
|
||||||
p->target_platform);
|
p->target_platform);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
ERR(fp->handle, "compatibility lookup failed for policy "
|
ERR(fp->handle, "compatibility lookup failed for %s%s policy version %d",
|
||||||
"version %d", p->policyvers);
|
p->target_platform == SEPOL_TARGET_SELINUX ? "selinux" : "xen",
|
||||||
|
p->policy_type == POLICY_KERN ? "" : " module",
|
||||||
|
p->policyvers);
|
||||||
return POLICYDB_ERROR;
|
return POLICYDB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue