Don't require the presence of the compat_3_brand.

The existing ELF image activator requires the brandinfo to provide such
a string unconditionally, even if the executable format in question
doesn't use this type of branding. Skip matching when it's a null
pointer.

Reviewed by:	kib
MFC after:	2 weeks
This commit is contained in:
Ed Schouten 2017-03-23 14:09:45 +00:00
parent 8293738e64
commit 0fe9832013

View File

@ -312,8 +312,9 @@ __elfN(get_brandinfo)(struct image_params *imgp, const char *interp,
continue;
if (hdr->e_machine == bi->machine &&
(hdr->e_ident[EI_OSABI] == bi->brand ||
(bi->compat_3_brand != NULL &&
strcmp((const char *)&hdr->e_ident[OLD_EI_BRAND],
bi->compat_3_brand) == 0)) {
bi->compat_3_brand) == 0))) {
/* Looks good, but give brand a chance to veto */
if (!bi->header_supported ||
bi->header_supported(imgp)) {