Adjust r314851 to not require every brand to specify interpreter path.

Reported and tested by:	ed
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
kib 2017-03-22 22:06:48 +00:00
parent c426ea6953
commit 08a98416ad

View File

@ -318,7 +318,11 @@ __elfN(get_brandinfo)(struct image_params *imgp, const char *interp,
* Again, prefer strictly matching
* interpreter path.
*/
if (strlen(bi->interp_path) + 1 ==
if (interp_name_len == 0 &&
bi->interp_path == NULL)
return (bi);
if (bi->interp_path != NULL &&
strlen(bi->interp_path) + 1 ==
interp_name_len && strncmp(interp,
bi->interp_path, interp_name_len) == 0)
return (bi);