diff options
Diffstat (limited to 'sys-apps/sandbox')
-rw-r--r-- | sys-apps/sandbox/Manifest | 3 | ||||
-rw-r--r-- | sys-apps/sandbox/files/musl.patch | 42 | ||||
-rw-r--r-- | sys-apps/sandbox/sandbox-2.18.ebuild | 74 |
3 files changed, 119 insertions, 0 deletions
diff --git a/sys-apps/sandbox/Manifest b/sys-apps/sandbox/Manifest index 4f6f8c95d03c..73b6245dd794 100644 --- a/sys-apps/sandbox/Manifest +++ b/sys-apps/sandbox/Manifest @@ -1,12 +1,15 @@ AUX 09sandbox 37 BLAKE2B 181213e2cc0bcfa328310cced40bfaba4530d8d2f80e892cb5649d5277c5d59d345ce96ca802a5529a22892c929bafac04c616458fa147a3bee5c89d31b0baf1 SHA512 4e8a9c58debde6480224a45559c5f2db4765213d151e47937f9142f110cac3681bf6402acaf21249a37bb17398e7bc00ae7feee68ecdb5b9363c432eac1b052a +AUX musl.patch 1497 BLAKE2B 677d35a52cde1f4f1806888d145c76676e6674188c338162602d097a4571696489a14dcea07cf10abbbcfd394a7adda8256e53a2bb5766b37fda1b8b8e74ed55 SHA512 397be258d722413d8e4392bb9124802e02d9e10139ec77cdfc252717386d6bd60bbacbb59d23f838318b1e1452ad2a36fdd2530c5a8859494ddcbd77862e07f9 DIST sandbox-2.12.tar.xz 424252 BLAKE2B 55eb06cbc15ad9ff8b0c272b8d071591ce3533a6ff807719df79131e6c966d60c3b37d9d8e4e1d466df0992836c4594bf6927b496ecb343a71d7b0656219a6d7 SHA512 98bd2ee8807d81e65ee0c9f11cfaf2b37da2ee4d8763c68d18c0ff6b14f3cc847ae2d3a0aa30cbe86063a2108ed4d4dcf7cc3fc4f37cb7549d266d4c1989c2a9 DIST sandbox-2.13.tar.xz 424968 BLAKE2B efcbf527853e8cfe8b3fec026041f55f51cba78029f92195ec76a45e84cb2b6cc129267c6e50608584607de72a86b2e7836e77f20677de9b94bb5c40999e4712 SHA512 46ad79335e51a1ec0aaa34ab5eeabe9d007818c518682409c5aaf97d49ec23021ece8fa53264ce5332cdd04ef6b3fd9beff0dc0a3cb5dfe2f9b6a6e359f8c1cf DIST sandbox-2.14.tar.xz 426992 BLAKE2B a30984f613b773cb5e53b2b0297ada32d11797699418aebf3014e11f3ec2b69a1c4b4e22ce96c28b1df022617cab6787cfe61f84b37ed61e966ac425eae1c7eb SHA512 b84584cffc54678646798bc58d8b60cdc10a0a58c9f1a49276dcac205a06dd7a2e664d2a9c40c78b48eae8ac36e3ac498ba35674f10e6e06c3c2bab777e05ced DIST sandbox-2.15.tar.xz 426948 BLAKE2B e40bb728192ef3793a9129bc88a63878516b0977a19effd5b02ded644ec6fe1627fab34786b22024957d96725fc5c53f488f7b09119be7b7ca91692dcee985dc SHA512 7249b594864267311ce8e2c04275df49c6d8e8e811dde5780f7f676cb43928728b9abed77beb8f5ee32061efcdb03753cce44d5bf1827bd519d6be8fa54912e6 DIST sandbox-2.17.tar.xz 431700 BLAKE2B 461404f5b98ac83d9e5bc63fc7251cdfbb04a0ccedb340a7a5b8595b68ab34034a56c0a0cfa8478961c9282f6450de89ef5b512b13d427a7f63c17a4141cbcbf SHA512 b5d7a76d894471f6610b41aa05f007d257c69ae5c90f8db455d626e0d1209b9d276678c36e90d2e4214d15074512be182b4f5f905ed2b7e236ff714cbf51958f +DIST sandbox-2.18.tar.xz 427760 BLAKE2B 26199ff8f919dcecdfdb74d508e0802e2e929a003ff1caddc54c1ea0f7887938c4f69065e585d61f7e96b29be26a34a1cdb62b397309e993511097ecaebe0620 SHA512 1775d4d6f80d414ab94eafae73966c12c4dd80857e21f0849703a3230ddb80501d8e574b14296e554932766cd71aa7b48a802fc388aaab43ba882ee7d005a60d EBUILD sandbox-2.12.ebuild 1922 BLAKE2B f3a63b14db2fddd2ad914481e76bdaa7116db993b00eb901aa033ebeef57042607169427cd6ccca9df5d2a4fea3fd420aaba08e28ca9eb04d17eb902fc200222 SHA512 7a7c10066eb2d05ee1090bf1d01d001d32d9fa12d01eb825d25bf5469b5eef3d0fc9779952c78e5509bdb7b347750174452880095b9649c10490e1d9c057120f EBUILD sandbox-2.13.ebuild 1919 BLAKE2B 3dafabc7d19ba0b4bfa327761fcf9dc51814ef3fc64b0e90f6c396673af04312b800724b29ac786b0bc7b293267c9ba375e83280a52170bcaa657043426c3827 SHA512 5bbcb60d15ddb8e179689668fd0ec1e923f5374e22caf8e4a180e2f7569babca5098993e884414299bc7032678f53b2017c1f2d1565b512b3189e77b92af0e47 EBUILD sandbox-2.14.ebuild 1932 BLAKE2B ccf40b2fc278a09bee5445b339456ef2532a8b95862d70843a2f543dc75363e0554eb99ee6e33eb77b39763de0cde70ac59ce81fd6d31b1208ef5cfa0269aa96 SHA512 afb04d1b36ccb5c542c9f6b5aa69f19a5eb4dcb4f045126f19352cde5c14e64f5efcfb14bc17e7caa3a59cb22be1ce9830440454ac16775fc6bd94515f658f1c EBUILD sandbox-2.15.ebuild 1932 BLAKE2B ccf40b2fc278a09bee5445b339456ef2532a8b95862d70843a2f543dc75363e0554eb99ee6e33eb77b39763de0cde70ac59ce81fd6d31b1208ef5cfa0269aa96 SHA512 afb04d1b36ccb5c542c9f6b5aa69f19a5eb4dcb4f045126f19352cde5c14e64f5efcfb14bc17e7caa3a59cb22be1ce9830440454ac16775fc6bd94515f658f1c EBUILD sandbox-2.17.ebuild 1838 BLAKE2B 4c01e2be81405877a9864614afb99cd88c4ff39445e965e863b846617b0ce7f7f248d1a5c7bdbb9acc9edac0d2bb2c9526cc6978049b1e45d1354478a7de1672 SHA512 9a52dc34a47ea94d28be05e20448543ee0aeb9188a4fcc83f1aec501ad5f44990a09eee0ea1bb69b3b7cc0051efc419595a9a36952167ddc9750ebba459908bf +EBUILD sandbox-2.18.ebuild 1917 BLAKE2B be7f09adcd4d36a131f2908063c2389a89a7a5ff31ccba51df08e31a84feb14236f0827c1e9f016f051beafd5c044132a9f4a2fcd3d1ab708a2c020a8147aebe SHA512 0cb24bac889981cd9e537e120fc32f2300c3f52ead422348532ad7ba285abcd82fd69e5d69a91d0f3ffde0752b0de780737439e8c3166a095dd7d6ce47886e37 MISC metadata.xml 252 BLAKE2B d709f9b334b2810c5ffe7d73ef430f0f347f26f7649bca4bb8803c8e0be106534bcee6efae4f80b6fb1781b09284bb3dbc32d8dff4a3aa01a924fd3437b9da7c SHA512 de8b6a78dcc379d1d34960caecdab8da9fdb9a9f010ec8611cab79487b5f28f6ae80c8b0884731fa91c4ae98482a195faa8d1ec911b1d95fafdfe9cd622cc5d9 diff --git a/sys-apps/sandbox/files/musl.patch b/sys-apps/sandbox/files/musl.patch new file mode 100644 index 000000000000..419d067f2a29 --- /dev/null +++ b/sys-apps/sandbox/files/musl.patch @@ -0,0 +1,42 @@ +--- a/libsandbox/trace.c ++++ b/libsandbox/trace.c +@@ -10,7 +10,16 @@ + #include "sb_nr.h" + + static long do_peekdata(long offset); +-static long _do_ptrace(enum __ptrace_request request, const char *srequest, void *addr, void *data); ++/* Note on _do_ptrace argument types: ++ glibc defines ptrace as: ++ long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data); ++ musl defines ptrace as: ++ long ptrace(int, ...); ++ ++ Let's clobber to 'int' lowest common denominator. ++ */ ++typedef int sb_ptrace_req_t; ++static long _do_ptrace(sb_ptrace_req_t request, const char *srequest, void *addr, void *data); + #define do_ptrace(request, addr, data) _do_ptrace(request, #request, addr, data) + #define _trace_possible(data) true + +@@ -44,7 +53,7 @@ static void trace_exit(int status) + _exit(status); + } + +-static long _do_ptrace(enum __ptrace_request request, const char *srequest, void *addr, void *data) ++static long _do_ptrace(sb_ptrace_req_t request, const char *srequest, void *addr, void *data) + { + long ret; + try_again: +--- a/scripts/gen_symbol_header.awk ++++ b/scripts/gen_symbol_header.awk +@@ -117,6 +117,10 @@ END { + gsub(/@|\./, "_", sym_real_name); + } + ++ # Avoid libc's symbol rename via #define. musl defines aliases as: ++ # #define mkstemp64 mkstemp ++ # #define mkstemps64 mkstemps ++ printf("#undef %s\n", sym_index); + printf("#define symname_%s \"%s\"\n", sym_real_name, sym_index); + + # We handle non-versioned libc's by setting symver_* diff --git a/sys-apps/sandbox/sandbox-2.18.ebuild b/sys-apps/sandbox/sandbox-2.18.ebuild new file mode 100644 index 000000000000..179163388c4e --- /dev/null +++ b/sys-apps/sandbox/sandbox-2.18.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils flag-o-matic multilib-minimal multiprocessing pax-utils + +DESCRIPTION="sandbox'd LD_PRELOAD hack" +HOMEPAGE="https://www.gentoo.org/proj/en/portage/sandbox/" +SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86" +IUSE="" + +DEPEND="app-arch/xz-utils + >=app-misc/pax-utils-0.1.19" #265376 +RDEPEND="" + +has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice" + +sandbox_death_notice() { + ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:" + ewarn "FEATURES='-sandbox -usersandbox' emerge sandbox" +} + +multilib_src_configure() { + filter-lfs-flags #90228 + + ECONF_SOURCE="${S}" econf +} + +multilib_src_test() { + # Default sandbox build will run with --jobs set to # cpus. + emake check TESTSUITEFLAGS="--jobs=$(makeopts_jobs)" +} + +multilib_src_install_all() { + doenvd "${FILESDIR}"/09sandbox + + keepdir /var/log/sandbox + fowners root:portage /var/log/sandbox + fperms 0770 /var/log/sandbox + + dodoc AUTHORS ChangeLog* NEWS README +} + +pkg_preinst() { + chown root:portage "${ED}"/var/log/sandbox + chmod 0770 "${ED}"/var/log/sandbox + + local v + for v in ${REPLACING_VERSIONS}; do + # 1.x was removed from ::gentoo in 2016 + if [[ ${v} == 1.* ]] ; then + local old=$(find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*') + if [[ -n ${old} ]] ; then + elog "Removing old sandbox libraries for you:" + find "${EROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -print -delete + fi + fi + done +} + +pkg_postinst() { + local v + for v in ${REPLACING_VERSIONS}; do + # 1.x was removed from ::gentoo in 2016 + if [[ ${v} == 1.* ]] ; then + chmod 0755 "${EROOT}"/etc/sandbox.d #265376 + fi + done +} |