Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 515582 - dev-java/oracle-jdk-bin does not preserve xattr pax-marks in src_install()
Summary: dev-java/oracle-jdk-bin does not preserve xattr pax-marks in src_install()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: paxctl-directly
  Show dependency tree
 
Reported: 2014-06-28 10:19 UTC by Jason Zaman
Modified: 2014-07-21 00:13 UTC (History)
0 users

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


Attachments
oracle-jdk-bin-1.7.0.65.ebuild.patch (file_515582.txt,1.15 KB, patch)
2014-07-20 22:25 UTC, Jason Zaman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Zaman gentoo-dev 2014-06-28 10:19:33 UTC
oracle-jdk-bin does the pax-marking in src_compile() and then when afterwards in src_install() uses 'cp -pPR' to "install" everything. 'cp -p' does not preserve xattrs.

I have moved to using xattr pax-marks on my system (PAX_MARKINGS="XT" in make.conf). blueness has released a wrapper for install that preserves xattrs.

Please either use "einstall" for the binaries or use "cp --preserve=mode,ownership,timestamps,xattrs" instead of only "cp -p"


Reproducible: Always

Steps to Reproduce:
1. use a hardened profile, set PAX_MARKINGS="XT" in make.conf
2. emerge oracle-jdk-bin
3.
Actual Results:  
the 'java' program does not run.
paxctl-ng -v /opt/oracle-jdk-bin-1.7.0.55/bin/java says not found for both types of pax-marks

Expected Results:  
the 'java' program should run.
paxctl-ng -v /opt/oracle-jdk-bin-1.7.0.55/bin/java should show xattr paxmarks
Comment 1 Ralph Sennhauser (RETIRED) gentoo-dev 2014-07-20 21:28:40 UTC
This is now done in:
 oracle-{jdk,jre}-bin-1.7.0.65
 oracle-{jdk,jre}-bin-1.8.0.11

Thanks for the report.
Comment 2 Jason Zaman gentoo-dev 2014-07-20 22:23:45 UTC
Hi,

Sorry to be a bother, this works for PaX but it has issues with SELinux :(

It looks like cp --preserve=xattr copies all xattrs including: security.selinux.
The problem is that this xattr is protected (actually all security.* are) and the copy fails.

It looks like for bin/* doins should be used. The am attaching a patch to 1.7.0.65 works for me.

-- Jason
Comment 3 Jason Zaman gentoo-dev 2014-07-20 22:25:51 UTC
Created attachment 381176 [details, diff]
oracle-jdk-bin-1.7.0.65.ebuild.patch

This uses dobin instead of cp --preserve=xattr since cp touches the SELinux xattrs too which is disallowed.
Comment 4 Ralph Sennhauser (RETIRED) gentoo-dev 2014-07-21 00:12:18 UTC
Solved it in a silighly different way. Updated in place and added a dependensy on the corresponding selinux policy. Thanks.