diff options
author | Ralph Sennhauser <sera@gentoo.org> | 2011-11-12 13:05:33 +0000 |
---|---|---|
committer | Ralph Sennhauser <sera@gentoo.org> | 2011-11-12 13:05:33 +0000 |
commit | ced4e376b4d9cbe92a179b4e68e30162e95fae9c (patch) | |
tree | 3c0cce3e0a321df51b2e2cd476d618613bc76b6d /eclass | |
parent | Remove gmtp from MISC-FREE as it's gone from the tree, bug 390229. (diff) | |
download | historical-ced4e376b4d9cbe92a179b4e68e30162e95fae9c.tar.gz historical-ced4e376b4d9cbe92a179b4e68e30162e95fae9c.tar.bz2 historical-ced4e376b4d9cbe92a179b4e68e30162e95fae9c.zip |
Add java-vm_sandbox-predict for installing a sandbox control file along with any JVM that needs it. Bug 388937#c1
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/java-vm-2.eclass | 26 |
2 files changed, 29 insertions, 3 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index b5d9f49afe21..6580f9f89ca8 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.7 2011/11/11 07:06:25 dirtyepic Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.8 2011/11/12 13:05:33 sera Exp $ + + 12 Nov 2011; Ralph Sennhauser <sera@gentoo.org> java-vm-2.eclass: + Add java-vm_sandbox-predict for installing a sandbox control file along with + any JVM that needs it. Bug 388937#c1 11 Nov 2011; Ryan Hill <dirtyepic@gentoo.org> flag-o-matic.eclass: Test that appended flags are valid. This allows people to add flags that were diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass index a22f77673d9a..4435f447658e 100644 --- a/eclass/java-vm-2.eclass +++ b/eclass/java-vm-2.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.36 2011/10/30 11:06:38 caster Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.37 2011/11/12 13:05:33 sera Exp $ # ----------------------------------------------------------------------------- # @eclass-begin @@ -204,6 +204,28 @@ java-vm_revdep-mask() { elog "USE flags (typically X, alsa, odbc) and some Java code may fail without them." } +# ----------------------------------------------------------------------------- +# @ebuild-function java-vm_sandbox-predict +# +# Install a sandbox control file. Specified paths won't cause a sandbox +# violation if opened read write but no write takes place. See bug 388937#c1 +# +# @example +# java-vm_sandbox-predict /dev/random /proc/self/coredump_filter +# ----------------------------------------------------------------------------- +java-vm_sandbox-predict() { + debug-print-function ${FUNCNAME} "$*" + [[ -z "${1}" ]] && die "${FUNCNAME} takes at least one argument" + + has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" + + local path path_arr=("$@") + IFS=":" path="${path_arr[*]}" + dodir /etc/sandbox.d + echo "SANDBOX_PREDICT=\"${path}\"" > "${ED}/etc/sandbox.d/20${VMHANDLE}" \ + || die "Failed to write sandbox control file" +} + java_get_plugin_dir_() { has ${EAPI:-0} 0 1 2 && ! use prefix && EPREFIX= echo "${EPREFIX}"/usr/$(get_libdir)/nsbrowser/plugins |