Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178180336
D62282.1796209866.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62282.1796209866.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 2, 11:11 AM (19 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42141045
Default Alt Text
D62282.1796209866.diff (1 KB)
Attached To
Mode
D62282: imgact_elf: try the header-only brand match last
Attached
Detach File
Event Timeline