Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649524 - prepstrip: Preservation of extended attributes using getfattr+setfattr does not preserve extended attributes outside of user namespace
Summary: prepstrip: Preservation of extended attributes using getfattr+setfattr does n...
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-03-04 02:23 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2018-07-02 18:46 UTC (History)
1 user (show)

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


Attachments
Patch (portage.patch,1.00 KB, patch)
2018-03-04 02:38 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2018-03-04 02:23:05 UTC
getfattr(1) man page says:

  -m pattern, --match=pattern
    Only include attributes with names matching the regular
    expression pattern. The default value for pattern is "^user\\.",
    which includes all the attributes in the user namespace.
    Specify "-" for including all attributes. Refer to attr(5)
    for a more detailed discussion of namespaces.

getfattr without '-m -' (or '-m ".*"') is called here:
https://gitweb.gentoo.org/proj/portage.git/tree/bin/ebuild-helpers/prepstrip?id=891926ba231380c4aa0768be0aa0ae1ed2bc6ae7#n36

This results in not preserving extended attributes outside of user namespace (e.g. security.capability attribute).
Comment 1 Arfrever Frehtes Taifersar Arahesis 2018-03-04 02:38:39 UTC
Created attachment 522250 [details, diff]
Patch
Comment 2 Larry the Git Cow gentoo-dev 2018-03-04 02:41:39 UTC
The bug has been referenced in the following commit(s):

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

commit aff97baa3625cabdf71fea9a0256381282040860
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-03-04 02:33:44 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-03-04 02:40:47 +0000

    prepstrip: Preserve xattr outside of user namespace.
    
    Pass '-m -' to getfattr for including all extended attributes, because
    getfattr defaults to including only user.* extended attributes.
    
    Bug: https://bugs.gentoo.org/649524

 bin/ebuild-helpers/prepstrip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}
Comment 3 Zac Medico gentoo-dev 2018-03-04 02:42:15 UTC
Thanks!
Comment 4 Zac Medico gentoo-dev 2018-07-02 18:46:35 UTC
Fixed in portage-2.3.40-r1.