Bug 24061

Summary: powerpc-ibm-aix-ar sets bogus file permissions when extracting
Product: binutils Reporter: Wolfgang Thaller <wolfgang.thaller>
Component: binutilsAssignee: Alan Modra <amodra>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.31   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: a possible fix that works for me

Description Wolfgang Thaller 2019-01-04 00:35:45 UTC
Created attachment 11510 [details]
a possible fix that works for me

Commit 29866fa186ee3ebda5242221607dba360b2e541e introduced a bug where the file mode field is read from .a files as decimal, even though it is stored as octal.

This leads to seemingly random permissions on files extracted from an archive.
Comment 1 Sourceware Commits 2019-01-04 02:05:42 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=677bd4c69d0eda4f2ae635d793f23c0b1413a9e9

commit 677bd4c69d0eda4f2ae635d793f23c0b1413a9e9
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Jan 4 12:18:36 2019 +1030

    PR24061, powerpc-ibm-aix-ar sets bogus file permissions when extracting
    
    Mode field should be read in octal, all the rest in decimal.  Do so.
    
    	PR 24061
    	PR 21786
    	* coff-rs6000.c (GET_VALUE_IN_FIELD): Add base parameter and
    	adjust all callers.
    	(EQ_VALUE_IN_FIELD): Likewise.
    	* coff64-rs6000.c (GET_VALUE_IN_FIELD): Likewise.
Comment 2 Alan Modra 2019-01-04 02:09:08 UTC
Fixed.