Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653352 - Stripping of files broken with >=sys-apps/file-5.33
Summary: Stripping of files broken with >=sys-apps/file-5.33
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 651804
  Show dependency tree
 
Reported: 2018-04-17 01:35 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2018-07-02 18:51 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2018-04-17 01:35:37 UTC
sys-apps/file-5.33 changed output for ELF files, which results in no files (either executables or libraries) being stripped.

Example showing difference ("LSB shared object" versus "LSB pie executable"):

# file --version
file-5.32
magic file from /usr/share/misc/magic
# file /usr/bin/wpa_cli
/usr/bin/wpa_cli: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 4.0.0, not stripped


# file --version
file-5.33
magic file from /usr/share/misc/magic
# file /usr/bin/wpa_cli
/usr/bin/wpa_cli: ELF 64-bit LSB pie executable x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 4.0.0, not stripped
Comment 1 Arfrever Frehtes Taifersar Arahesis 2018-04-17 01:53:47 UTC
Relevant change in source code of sys-apps/file is probably:

--- file-5.32/magic/Magdir/elf
+++ file-5.33/magic/Magdir/elf
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: elf,v 1.70 2016/06/02 12:36:30 christos Exp $
+# $File: elf,v 1.72 2018/02/24 19:50:04 christos Exp $
 # elf:  file(1) magic for ELF executables
 #
 # We have to check the byte order flag to see what byte order all the
@@ -48,8 +48,9 @@
 !:mime application/x-object
 >16    leshort         2               executable,
 !:mime application/x-executable
->16    leshort         3               shared object,
-!:mime application/x-sharedlib
+>16    leshort         3               ${x?pie executable:shared object}
+
+!:mime application/x-${x?pie-executable:sharedlib}
 >16    leshort         4               core file
 !:mime application/x-coredump
 # Core file detection is not reliable.
Comment 2 Larry the Git Cow gentoo-dev 2018-04-17 02:14:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=ae6d6aa22d074c04cd9caefe1ca02bf615bfd86f

commit ae6d6aa22d074c04cd9caefe1ca02bf615bfd86f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-04-17 02:06:38 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-04-17 02:11:19 +0000

    estrip, install-qa-check.d/10ignored-flags: fix bug 653352
    
    Update detection of ELF files to work with >=sys-apps/file-5.33.
    
    Bug: https://bugs.gentoo.org/653352

 bin/estrip                             | 3 ++-
 bin/install-qa-check.d/10ignored-flags | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)}
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-17 06:27:14 UTC
Would be nice to mask this to give people a while to upgrade their package managers.
Comment 4 Zac Medico gentoo-dev 2018-07-02 18:51:36 UTC
Fixed in portage-2.3.40-r1.