diff options
author | Mike Frysinger <vapier@gentoo.org> | 2003-07-09 14:53:59 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2003-07-09 14:53:59 +0000 |
commit | a836cd792c428363d23ac8421a014e72eda445d3 (patch) | |
tree | f8e108b4b8742f607a16dd45ab4b54ba3ab9ad38 /app-shells | |
parent | some new official patches, apply without modification (diff) | |
download | historical-a836cd792c428363d23ac8421a014e72eda445d3.tar.gz historical-a836cd792c428363d23ac8421a014e72eda445d3.tar.bz2 historical-a836cd792c428363d23ac8421a014e72eda445d3.zip |
initial ebuild
Diffstat (limited to 'app-shells')
-rw-r--r-- | app-shells/sandboxshell/ChangeLog | 8 | ||||
-rw-r--r-- | app-shells/sandboxshell/Manifest | 5 | ||||
-rw-r--r-- | app-shells/sandboxshell/files/digest-sandboxshell-0.1 | 0 | ||||
-rw-r--r-- | app-shells/sandboxshell/files/sandboxshell | 37 | ||||
-rw-r--r-- | app-shells/sandboxshell/files/sandboxshell.conf | 61 | ||||
-rw-r--r-- | app-shells/sandboxshell/sandboxshell-0.1.ebuild | 24 |
6 files changed, 135 insertions, 0 deletions
diff --git a/app-shells/sandboxshell/ChangeLog b/app-shells/sandboxshell/ChangeLog new file mode 100644 index 000000000000..34702c218d6d --- /dev/null +++ b/app-shells/sandboxshell/ChangeLog @@ -0,0 +1,8 @@ +# ChangeLog for app-shells/sandboxshell +# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/ChangeLog,v 1.1 2003/07/09 14:53:38 vapier Exp $ + +*sandboxshell-0.1 (09 Jul 2003) + + 09 Jul 2003; Mike Frysinger <vapier@gentoo.org> : + Initial import. Ebuild submitted by me. diff --git a/app-shells/sandboxshell/Manifest b/app-shells/sandboxshell/Manifest new file mode 100644 index 000000000000..d5abb79c0d0f --- /dev/null +++ b/app-shells/sandboxshell/Manifest @@ -0,0 +1,5 @@ +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-sandboxshell-0.1 0 +MD5 540f05af4f7a2f11076c74fab84d6fae files/sandboxshell 1280 +MD5 594776a344f376d9c30276b17b12d42d files/sandboxshell.conf 1561 +MD5 e9b12ed968232649b988e6240b669d67 sandboxshell-0.1.ebuild 645 +MD5 13d32120b2140672efccbbdbba87e66e ChangeLog 356 diff --git a/app-shells/sandboxshell/files/digest-sandboxshell-0.1 b/app-shells/sandboxshell/files/digest-sandboxshell-0.1 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/app-shells/sandboxshell/files/digest-sandboxshell-0.1 diff --git a/app-shells/sandboxshell/files/sandboxshell b/app-shells/sandboxshell/files/sandboxshell new file mode 100644 index 000000000000..68bd3fb22cee --- /dev/null +++ b/app-shells/sandboxshell/files/sandboxshell @@ -0,0 +1,37 @@ +#!/bin/bash +# Written by vapier@gentoo.org +# public-domain code ... z0r ... +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell,v 1.1 2003/07/09 14:53:39 vapier Exp $ + +. /sbin/functions.sh +. /etc/profile + +# sanity checks ... +cd ${PWD} || { + eerror "Could not access ${PWD}" + exit 1 +} + +export LD_PRELOAD=/lib/libsandbox.so +export SANDBOX_LIB=/lib/libsandbox.so +export SANDBOX_LOG="/tmp/sandboxme-$(date '+%d.%m.%Y-%H.%M.%S').log" +export SANDBOX_DEBUG_LOG="${SANDBOX_LOG}.debug" +export SANDBOX_DENY="" +export SANDBOX_READ="/" +export SANDBOX_WRITE="/dev/tty:/dev/pts:/dev/null:/tmp" +export SANDBOX_PREDICT="${HOME}/.bash_history" +export SANDBOX_ON="1" + +einfo "Loading sandboxed shell" +einfo " Log File: ${SANDBOX_LOG}" +einfo " Debug Log File: ${SANDBOX_DEBUG_LOG}" +einfo " sandboxon: turn sandbox on" +einfo " sandboxoff: turn sandbox off" +einfo " addread <path>: allow <path> to be read" +einfo " addwrite <path>: allow <path> to be written" +einfo " adddeny <path>: deny access to <path>" +einfo " addpredict <path>: allow fake access to <path>" + +export SANDBOX_ACTIVE="armedandready" +export SANDBOX_WRITE="${SANDBOX_WRITE}:`pwd`:/etc/mtab:/dev/ram5:/root/.ccache" +exec /bin/bash --init-file /etc/sandboxshell.conf diff --git a/app-shells/sandboxshell/files/sandboxshell.conf b/app-shells/sandboxshell/files/sandboxshell.conf new file mode 100644 index 000000000000..276fd8f89797 --- /dev/null +++ b/app-shells/sandboxshell/files/sandboxshell.conf @@ -0,0 +1,61 @@ +#!/bin/bash +# Written by vapier@gentoo.org +# public-domain code ... z0r ... +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell.conf,v 1.1 2003/07/09 14:53:39 vapier Exp $ + +source /etc/profile + +# do ebuild environment loading ... detect if we're in portage +# build area or not ... uNF uNF uNF +#sbs_pdir=`portageq envvar PORTAGE_TMPDIR`/portage/ #portageq takes too long imo +if [ -z "${PORTAGE_TMPDIR}" ] ; then + sbs_gpdir=`( source /etc/make.globals && echo $PORTAGE_TMPDIR ) 2> /dev/null` + sbs_cpdir=`( source /etc/make.conf && echo $PORTAGE_TMPDIR ) 2> /dev/null` + [ -z "${sbs_cpdir}" ] \ + && sbs_pdir=${sbs_gpdir} \ + || sbs_pdir=${sbs_cpdir} +else + sbs_pdir=${PORTAGE_TMPDIR} +fi +[ -z "${sbs_pdir}" ] && sbs_pdir=/var/tmp +sbs_pdir=${sbs_pdir}/portage/ + +if [ "${PWD:0:${#sbs_pdir}}" == "${sbs_pdir}" ] ; then + sbs_bdir=`echo ${PWD:${#sbs_pdir}} | cut -d/ -f1` + sbs_tmpenvfile=${sbs_pdir}${sbs_bdir}/temp/environment + if [ -e "${sbs_tmpenvfile}" ] ; then + echo "Found environment at ${sbs_tmpenvfile}" + printf " * Would you like to load the environment? " + read env + sbs_PREPWD=${PWD} + [ "${env}" == "y" ] && source ${PWD}/temp/environment 2> /dev/null + PWD=${sbs_PREPWD} + fi +fi + +cd ${PWD} +export PS1="[s]${PS1}" + +adddeny() { + export SANDBOX_DENY="$SANDBOX_DENY:$1" +} + +addpredict() { + export SANDBOX_PREDICT="$SANDBOX_PREDICT:$1" +} + +addread() { + export SANDBOX_READ="$SANDBOX_READ:$1" +} + +addwrite() { + export SANDBOX_WRITE="$SANDBOX_WRITE:$1" +} + +sandboxon() { + export SANDBOX_ON="1" +} + +sandboxoff() { + export SANDBOX_OFF="0" +} diff --git a/app-shells/sandboxshell/sandboxshell-0.1.ebuild b/app-shells/sandboxshell/sandboxshell-0.1.ebuild new file mode 100644 index 000000000000..3a3a1ef7e978 --- /dev/null +++ b/app-shells/sandboxshell/sandboxshell-0.1.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/sandboxshell-0.1.ebuild,v 1.1 2003/07/09 14:53:39 vapier Exp $ + +DESCRIPTION="launch a sandboxed shell ... useful for debugging ebuilds" +HOMEPAGE="http://wh0rd.org/" +SRC_URI="" + +LICENSE="public-domain" +SLOT="0" +# if portage works, this will work ;) +KEYWORDS="x86 amd64 alpha arm hppa mips ppc sparc" + +DEPEND="" +RDEPEND="sys-apps/portage + app-shells/bash" + +S=${WORKDIR} + +src_install() { + dobin ${FILESDIR}/sandboxshell + insinto /etc + doins ${FILESDIR}/sandboxshell.conf +} |