Inspect ELF header and reject any non-FreeBSD shared objects.
MFC after: 2 weeks
This commit is contained in:
parent
a060acb154
commit
97b79abc86
@ -171,7 +171,13 @@ char *argv[];
|
||||
warnx("%s: not a dynamic executable", *argv);
|
||||
file_ok = 0;
|
||||
} else if (hdr.elf.e_type == ET_DYN) {
|
||||
is_shlib = 1;
|
||||
if (hdr.elf.e_ident[EI_OSABI] & ELFOSABI_FREEBSD) {
|
||||
is_shlib = 1;
|
||||
} else {
|
||||
warnx("%s: not a FreeBSD ELF shared "
|
||||
"object", *argv);
|
||||
file_ok = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warnx("%s: not a dynamic executable", *argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user