Page MenuHomeFreeBSD

D62282.1796212371.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D62282.1796212371.diff

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -440,19 +440,6 @@
if (bi_m != NULL)
return (bi_m);
- /* No known brand, see if the header is recognized by any brand */
- for (i = 0; i < MAX_BRANDS; i++) {
- bi = elf_brand_list[i];
- if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY ||
- bi->header_supported == NULL)
- continue;
- if (hdr->e_machine == bi->machine) {
- ret = bi->header_supported(imgp, NULL, NULL);
- if (ret)
- return (bi);
- }
- }
-
/* Lacking a known brand, search for a recognized interpreter. */
if (interp != NULL) {
for (i = 0; i < MAX_BRANDS; i++) {
@@ -484,6 +471,23 @@
bi->header_supported(imgp, NULL, NULL)))
return (bi);
}
+
+ /*
+ * No known brand, see if the header is recognized by any brand.
+ * This is a guess, so the interpreter and the fallback brand the
+ * administrator has set come first.
+ */
+ for (i = 0; i < MAX_BRANDS; i++) {
+ bi = elf_brand_list[i];
+ if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY ||
+ bi->header_supported == NULL)
+ continue;
+ if (hdr->e_machine == bi->machine) {
+ ret = bi->header_supported(imgp, NULL, NULL);
+ if (ret)
+ return (bi);
+ }
+ }
return (NULL);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 2, 11:52 AM (19 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42141045
Default Alt Text
D62282.1796212371.diff (1 KB)

Event Timeline