From 8a34cbb5666a80153ea06ba8d59f7406f311bb7a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 5 Jul 2016 13:39:42 -0700 Subject: Don't try to guess the build id type in file(1). They're really just arbitrary byte sequences of arbitrary length. Sure, a 20-byte sequence is _probably_ a SHA-1, but there's no way to know, so let's stop pretending... --- toys/posix/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix/file.c') diff --git a/toys/posix/file.c b/toys/posix/file.c index d3e80f4e..0cd9047c 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -136,7 +136,7 @@ static void do_elf_file(int fd, struct stat *sb) if (n_namesz==4 && !memcmp(note+12, "GNU", 4)) { if (n_type == 3 /*NT_GNU_BUILD_ID*/) { - printf(", BuildID[%s]=", (n_descsz==20)?"sha1":"md5"); + printf(", BuildID="); for (j = 0; j < n_descsz; ++j) printf("%02x", note[16 + j]); } } else if (n_namesz==8 && !memcmp(note+12, "Android", 8)) { -- cgit v1.2.3