Bug 24061 - powerpc-ibm-aix-ar sets bogus file permissions when extracting
Summary: powerpc-ibm-aix-ar sets bogus file permissions when extracting
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.31
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-04 00:35 UTC by Wolfgang Thaller
Modified: 2019-01-04 02:09 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
a possible fix that works for me (1.23 KB, patch)
2019-01-04 00:35 UTC, Wolfgang Thaller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 cvs-commit@gcc.gnu.org 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.