Date: Wed, 21 Feb 2001 16:14:44 -0800 (PST) From: Jim.Pirzyk@disney.com To: FreeBSD-gnats-submit@freebsd.org Subject: bin/25271: brandelf does not add string for file(1) to find Message-ID: <200102220014.f1M0EiO40669@snoopy.fan.fa.disney.com>
next in thread | raw e-mail | index | archive | help
>Number: 25271
>Category: bin
>Synopsis: brandelf use to add the string for file(1) to use
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Feb 21 16:20:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Jim Pirzyk
>Release: FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:
Standard FreeBSD 4.2-RELEASE system..
>Description:
brandelf in the 3.x days would write a string into the elf binary,
now it only writes the byte code.
>How-To-Repeat:
Run brandelf from 3.x on a elf binary and then run it from 4.x on
another copy of the binary and run the file command over it.
>Fix:
*** ./src/usr.bin/brandelf/brandelf.c.orig Fri Jul 7 01:32:13 2000
--- ./src/usr.bin/brandelf/brandelf.c Wed Feb 21 16:11:21 2001
***************
*** 142,147 ****
--- 142,153 ----
}
else {
buffer[EI_OSABI] = type;
+
+ /* Also add the assocated string so file(1) finds it */
+ strncpy(buffer+EI_ABIVERSION,
+ iselftype(buffer[EI_OSABI]),
+ EI_NIDENT-EI_ABIVERSION);
+
lseek(fd, 0, SEEK_SET);
if (write(fd, buffer, EI_NIDENT) != EI_NIDENT) {
warn("error writing %s %d", argv[0], fd);
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102220014.f1M0EiO40669>
