Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156135 - sun-jdk: Simplification of PaX marking via pax-utils.eclass
Summary: sun-jdk: Simplification of PaX marking via pax-utils.eclass
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-24 07:09 UTC by Kevin F. Quinn (RETIRED)
Modified: 2009-06-10 19:23 UTC (History)
2 users (show)

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


Attachments
Proposed patch using pax-utils to manipulate PaX flags (sun-jdk-1.5.0.09-r1.ebuild.diff,2.73 KB, patch)
2006-11-24 07:10 UTC, Kevin F. Quinn (RETIRED)
Details | Diff
Patch for pax-utils.eclass (pax-utils.eclass.patch,528 bytes, patch)
2006-12-02 02:36 UTC, Petteri Räty (RETIRED)
Details | Diff
Patch for pax-utils.eclass (pax-utils.eclass.patch,528 bytes, patch)
2006-12-02 02:48 UTC, Petteri Räty (RETIRED)
Details | Diff
Updated ebuild diff - using list-paxables() (sun-jdk-1.5.0.09-r1.ebuild.diff,2.64 KB, patch)
2006-12-02 03:38 UTC, Kevin F. Quinn (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin F. Quinn (RETIRED) gentoo-dev 2006-11-24 07:09:25 UTC
Hi.  I've added to portage an eclass (eutil, really) that provides functions to manipulate PaX flags on executables.  The eclass manages the use of the various PaX flag manipulation programs that may or may not be present on the build system, so that as these tools develop we can just modify the eclass without nagging all the affected packages.

To follow; a patch for the sun-jdk-1.5.0.09-r1 ebuild, for your perusal.  I've put the call at the start of src_install() instead of post_install(), so that the checksums recorded by portage in its database agree with what is on the filesystem.  If you're happy with that patch, let me know and I'll commit it and similar across all the jdk/jre packages (if you don't want me to touch anything I'll supply patches for them all here).
Comment 1 Kevin F. Quinn (RETIRED) gentoo-dev 2006-11-24 07:10:52 UTC
Created attachment 102665 [details, diff]
Proposed patch using pax-utils to manipulate PaX flags

Also worth noting is that the chpax method for PaX flags (currently used by the ebuilds) is slowly being deprecated.
Comment 2 Josh Nichols (RETIRED) gentoo-dev 2006-11-24 07:53:24 UTC
The patch certainly does clean things up. Perhaps the eclass could use a helper method for finding which should be tweaked? ie, something that would effectively do:
file ${S}/bin/* ${S}/jre/bin/* | grep ELF | sed -e 's/:.*$//'
Comment 3 Kevin F. Quinn (RETIRED) gentoo-dev 2006-11-24 08:32:29 UTC
Sounds useful - something like:

list-paxables() {
    file $* 2> /dev/null | grep ELF | sed -e 's/:.*$//'
}

so you could have:

    pax-mark m $(list-paxables ${S}/{jre/}bin)

I shy away from using a 'find', as ideally each ebuild should know exactly which files need the markings, and where they are.   In this case such a list would be tedious, and I'm pretty sure most if not all the jdk/jre executables use java themselves.
Comment 4 Josh Nichols (RETIRED) gentoo-dev 2006-11-27 20:58:47 UTC
That usage looks great to me.
Comment 5 Petteri Räty (RETIRED) gentoo-dev 2006-12-02 02:30:28 UTC
Tested this on my hardened server and the eclass or the usage in the ebuild is buggy:

/usr/portage//eclass/pax-utils.eclass: line 26:   /var/tmp/portage/sun-jdk-1.5.0.10/work/jdk1.5.0_10/bin/appletviewer: No such file or directory
Comment 6 Petteri Räty (RETIRED) gentoo-dev 2006-12-02 02:36:09 UTC
Created attachment 103180 [details, diff]
Patch for pax-utils.eclass

My guess wold be that this is what you want.
Comment 7 Petteri Räty (RETIRED) gentoo-dev 2006-12-02 02:48:01 UTC
Created attachment 103181 [details, diff]
Patch for pax-utils.eclass

My guess wold be that this is what you want.
Comment 8 Kevin F. Quinn (RETIRED) gentoo-dev 2006-12-02 03:35:48 UTC
Yes; sorry - had it fixed locally but not committed to CVS.
Comment 9 Kevin F. Quinn (RETIRED) gentoo-dev 2006-12-02 03:38:32 UTC
Created attachment 103184 [details, diff]
Updated ebuild diff - using list-paxables()
Comment 10 Petteri Räty (RETIRED) gentoo-dev 2006-12-03 13:27:57 UTC
(In reply to comment #9)
> Created an attachment (id=103184) [edit]
> Updated ebuild diff - using list-paxables()
> 

Yeah seems to work. Feel free to add the other VMs that need it. You can get that by checking the ebuilds that inherit java-vm* eclasses. Should also add the every slot of them. ;D sun-jdk and sun-jre-bin 1.5 are taken care off.
Comment 11 Kevin F. Quinn (RETIRED) gentoo-dev 2006-12-10 06:04:06 UTC
Quick q - just did blackdown-jdk but didn't do a rev-bump as I figured anyone who already has it installed and working doesn't need to re-emerge.  Would you prefer a rev-bump?
Comment 12 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-13 18:38:09 UTC
I think it's fine without a revbump.
Comment 13 Petteri Räty (RETIRED) gentoo-dev 2006-12-16 00:44:08 UTC
(In reply to comment #12)
> I think it's fine without a revbump.
> 

It's fine without a revbump for ~arch. I prefer to have revision bumps if there are only stable versions as stable versions should never be modified directly.
Comment 14 Alistair Bush (RETIRED) gentoo-dev 2009-06-10 19:23:16 UTC
Seems to have already been committed