From: Ned Ludd Date: Thu, 15 Feb 2007 18:01:15 +0000 (+0000) Subject: - From: Stephane Billiart @busybox mailing list. tar no longer extracting with setuid... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cea68ddd146f3323f56e83eb8633f244c244fc9b;p=gentoo.git - From: Stephane Billiart @busybox mailing list. tar no longer extracting with setuid bits Package-Manager: portage-2.1.2_pre1 --- diff --git a/sys-apps/busybox/ChangeLog b/sys-apps/busybox/ChangeLog index 10e3b799cd92..13ea2a3ffe66 100644 --- a/sys-apps/busybox/ChangeLog +++ b/sys-apps/busybox/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-apps/busybox # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.126 2007/01/27 00:39:16 solar Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.127 2007/02/15 18:01:15 solar Exp $ + +*busybox-1.4.1-r2 (15 Feb 2007) + + 15 Feb 2007; +files/1.4.0/data_extract_all.patch, + +busybox-1.4.1-r2.ebuild: + - From: Stephane Billiart @busybox mailing list. tar no longer extracting + with setuid bits *busybox-1.4.1-r1 (27 Jan 2007) diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest index fd22cfc7f46e..1454b9c0102e 100644 --- a/sys-apps/busybox/Manifest +++ b/sys-apps/busybox/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX 1.2.0/bb.patch 1160 RMD160 fbee612ec7aea6ab9564bcd569e3ae69a553fceb SHA1 f88e645606a52f1192dea7e1509f30ec5c1d4c79 SHA256 5c0ee3389ae1b505c7dbf509bfc5d35279edf968ac2c1db25e9771c7e26754a2 MD5 26cfb25027beabeb14d99db5a8c4afd0 files/1.2.0/bb.patch 1160 RMD160 fbee612ec7aea6ab9564bcd569e3ae69a553fceb files/1.2.0/bb.patch 1160 @@ -25,6 +22,10 @@ AUX 1.4.0/bin2hex.patch 432 RMD160 5435664813aed4a15c9cf100e04506bbdf60c8b6 SHA1 MD5 f3dab8cf3fca7abb3561dbe7739e5ae2 files/1.4.0/bin2hex.patch 432 RMD160 5435664813aed4a15c9cf100e04506bbdf60c8b6 files/1.4.0/bin2hex.patch 432 SHA256 7535703dffb63dd6a0331fce82d542c786758dfe52f7c97491369dde3d35fd1a files/1.4.0/bin2hex.patch 432 +AUX 1.4.0/data_extract_all.patch 545 RMD160 88773f3504cbf3e66e83e4c7d017591f79c97c9f SHA1 a30e4cda7c4d0c58ca0cccf23bba8e013cbfdf79 SHA256 cb2b59cb27114771b0c8dc04b480434a85a912eae5e6b96639cfcf5917f7b87e +MD5 856258c2e8806dab258cd192160e2b24 files/1.4.0/data_extract_all.patch 545 +RMD160 88773f3504cbf3e66e83e4c7d017591f79c97c9f files/1.4.0/data_extract_all.patch 545 +SHA256 cb2b59cb27114771b0c8dc04b480434a85a912eae5e6b96639cfcf5917f7b87e files/1.4.0/data_extract_all.patch 545 AUX config-netboot 9853 RMD160 3d62cf31765adbc88c7a39f0f21223d7e73ef627 SHA1 0dc911793cd298a1e6f61073c2e37ba1c107f5f9 SHA256 75cae861b7bae144ca86998cb90dae9bcb0f54e09ed0c36d1ed81ad79a401e3d MD5 d9841a0171170d16bb121c696591e7ef files/config-netboot 9853 RMD160 3d62cf31765adbc88c7a39f0f21223d7e73ef627 files/config-netboot 9853 @@ -45,10 +46,14 @@ EBUILD busybox-1.4.1-r1.ebuild 8242 RMD160 26991c92f984f14a0bb9648148f59b00a1f7e MD5 f81ea3f600826d2b1808c82ce3ca23d0 busybox-1.4.1-r1.ebuild 8242 RMD160 26991c92f984f14a0bb9648148f59b00a1f7eadc busybox-1.4.1-r1.ebuild 8242 SHA256 62b73f790869faa0e5e7904341cda3f68a476ebadf49bac564adf7b29627127b busybox-1.4.1-r1.ebuild 8242 -MISC ChangeLog 20177 RMD160 fce0c5e4dca748d28bd64764d042b9a7384fa674 SHA1 e9104163721365fdb8469dfaced345a393f39ae3 SHA256 b3390b2c74ad5a477f1673ee3ff9aca375870a91a9d6820bc4b495c04ef45ce9 -MD5 939cfa79a2e44e4ba846b91c2fc2afb9 ChangeLog 20177 -RMD160 fce0c5e4dca748d28bd64764d042b9a7384fa674 ChangeLog 20177 -SHA256 b3390b2c74ad5a477f1673ee3ff9aca375870a91a9d6820bc4b495c04ef45ce9 ChangeLog 20177 +EBUILD busybox-1.4.1-r2.ebuild 8292 RMD160 e7e4f96bf6cc552d33c537a078915ef5538cf7e0 SHA1 189d9c4bb5d7f03b41afc22ec60b634445c37650 SHA256 3014d71b54d8c439b646be714241e2e21ca72a133d13348f5db2fc77d0c1fc44 +MD5 d572c35bf0dc2f7681e5511ead6745db busybox-1.4.1-r2.ebuild 8292 +RMD160 e7e4f96bf6cc552d33c537a078915ef5538cf7e0 busybox-1.4.1-r2.ebuild 8292 +SHA256 3014d71b54d8c439b646be714241e2e21ca72a133d13348f5db2fc77d0c1fc44 busybox-1.4.1-r2.ebuild 8292 +MISC ChangeLog 20405 RMD160 6ab9836efb04eace9bce1475175a97f5dc6c8b15 SHA1 498fec98560e5ecd08824c3f280d42088b1ef20c SHA256 b802a8464e9726f2b704489b878c93eab994704736e49aaf3051fc1abf4e2481 +MD5 a26db81c7eef093ce94e3d9efed8c42c ChangeLog 20405 +RMD160 6ab9836efb04eace9bce1475175a97f5dc6c8b15 ChangeLog 20405 +SHA256 b802a8464e9726f2b704489b878c93eab994704736e49aaf3051fc1abf4e2481 ChangeLog 20405 MISC metadata.xml 161 RMD160 77385273ea1d12ed4093a4167307486b74d1cf82 SHA1 aa4b2873e32de89c0b0aeb26b5782f77cb00948e SHA256 a11fdd02015a232398fdf22a20d26a95fc34d44c54513e6b26b6128d0b76122e MD5 8ef75eba39772bdd1a8facc7815dbebb metadata.xml 161 RMD160 77385273ea1d12ed4093a4167307486b74d1cf82 metadata.xml 161 @@ -62,10 +67,6 @@ SHA256 c4f8d0daf45f3cbcc2214257e7413c453fd28656722045c6709f591df9f95912 files/di MD5 a5150ef066e89f3b358fa27acad7e932 files/digest-busybox-1.4.1-r1 247 RMD160 bc8a40b9b31f95d7bdc81173a67d5ce67b6f082b files/digest-busybox-1.4.1-r1 247 SHA256 2669a53173c0714675b01a7293172ce8eaf36319abcd8ca389a9cd35b21f5b55 files/digest-busybox-1.4.1-r1 247 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.1 (GNU/Linux) - -iD8DBQFFuy+d8bi6rjpTunYRAvC9AJ9R4fxPKrK00wjmJ9uuCtKvEYE+cwCgkDkT -c26KU68fW4TYlmgjkxsvtIo= -=x2Ic ------END PGP SIGNATURE----- +MD5 a5150ef066e89f3b358fa27acad7e932 files/digest-busybox-1.4.1-r2 247 +RMD160 bc8a40b9b31f95d7bdc81173a67d5ce67b6f082b files/digest-busybox-1.4.1-r2 247 +SHA256 2669a53173c0714675b01a7293172ce8eaf36319abcd8ca389a9cd35b21f5b55 files/digest-busybox-1.4.1-r2 247 diff --git a/sys-apps/busybox/busybox-1.4.1-r2.ebuild b/sys-apps/busybox/busybox-1.4.1-r2.ebuild new file mode 100644 index 000000000000..8100aa4bbd31 --- /dev/null +++ b/sys-apps/busybox/busybox-1.4.1-r2.ebuild @@ -0,0 +1,265 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.4.1-r2.ebuild,v 1.1 2007/02/15 18:01:15 solar Exp $ + +inherit eutils flag-o-matic + +################################################################################ +# BUSYBOX ALTERNATE CONFIG MINI-HOWTO +# +# Busybox can be modified in many different ways. Here's a few ways to do it: +# +# (1) Emerge busybox with FEATURES=keepwork so the work directory won't +# get erased afterwards. Add a definition like ROOT=/my/root/path to the +# start of the line if you're installing to somewhere else than the root +# directory. This command will save the default configuration to +# ${PORTAGE_CONFIGROOT} (or ${ROOT} if ${PORTAGE_CONFIGROOT} is not +# defined), and it will tell you that it has done this. Note the location +# where the config file was saved. +# +# FEATURES=keepwork USE=savedconfig emerge busybox +# +# (2) Go to the work directory and change the configuration of busybox using its +# menuconfig feature. +# +# cd /var/tmp/portage/busybox*/work +# make menuconfig +# +# +# (3) Save your configuration to the default location and copy it to the +# savedconfig location as follows. Replace X.X.X by the version of +# busybox, and change the path if you're overriding ${ROOT} or +# ${PORTAGE_CONFIGROOT}. The file should overwrite the default config +# file that was written by the ebuild during step 1. +# +# cp .config /etc/portage/savedconfig/busybox-X.X.X.config +# +# (4) Execute the same command as in step 1 to build the new busybox config; +# the FEATURES=keepwork option is probably no longer necessary unless you +# want to modify the configuration further. +# +################################################################################ +# +# (1) Alternatively skip the above steps and simply emerge busybox with +# USE=savedconfig and edit the file it saves by hand. Then remerge bb as +# needed. +# +################################################################################ + + +#SNAPSHOT=20040726 +SNAPSHOT="" + +DESCRIPTION="Utilities for rescue and embedded systems" +HOMEPAGE="http://www.busybox.net/" +if [[ -n ${SNAPSHOT} ]] ; then + MY_P=${PN} + SRC_URI="http://www.busybox.net/downloads/snapshots/${PN}-${SNAPSHOT}.tar.bz2" +else + MY_P=${PN}-${PV/_/-} + SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2" +fi + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="debug static savedconfig make-symlinks" +RESTRICT="test" + +DEPEND="" + +S=${WORKDIR}/${MY_P} + +# then eventually turning on selinux would mean +# adding a dep: selinux? ( sys-libs/libselinux ) + +pkg_setup() { + # Catch most people for now #159497 ... delete this check + # once we move to stable for releases + if [[ $(LC_ALL="C" date +%Z) == "Local time zone must be set--see zic manual page" ]] ; then + eerror "You forgot to set up your /etc/localtime." + eerror "You should do so now." + die "forgetful admin detected" + fi +} + +busybox_config_option() { + case $1 in + y) sed -i -e "s:.*CONFIG_$2.*set:CONFIG_$2=y:g" .config;; + n) sed -i -e "s:CONFIG_$2=y:# CONFIG_$2 is not set:g" .config;; + *) use $1 \ + && busybox_config_option y $2 \ + || busybox_config_option n $2 + return 0 + ;; + esac + einfo $(grep "CONFIG_$2[= ]" .config) +} + +src_unpack() { + unset KBUILD_OUTPUT #88088 + + unpack ${MY_P}.tar.bz2 + cd "${S}" + + # patches go here! + epatch "${FILESDIR}"/1.4.0/bb.patch + epatch "${FILESDIR}"/1.4.0/bin2hex.patch + epatch "${FILESDIR}"/1.4.0/data_extract_all.patch + + # work around broken ass powerpc compilers + use ppc64 && append-flags -mminimal-toc + # flag cleanup + sed -i \ + -e 's: -Werror : :' \ + -e 's:-Os -falign-functions=1 -falign-jumps=1 -falign-loops=1::' \ + -e 's:-fomit-frame-pointer::' \ + Makefile.flags + sed -i 's:-Wl,--gc-sections::' Makefile + sed -i "/^CFLAGS.*:=/s:$: ${CFLAGS}:" Makefile + echo "CROSS_COMPILE := ${CHOST}-" >> Makefile.flags + + # check for a busybox config before making one of our own. + # if one exist lets return and use it. + # fine grained config control for user defined busybox configs. + # [package]-[version]-[revision].config + # [package]-[version].config + # [package].config + + if use savedconfig ; then + local conf root + [[ -r .config ]] && rm .config + for conf in {${PF},${P},${PN}}{,-${CHOST}} ; do + for root in "${PORTAGE_CONFIGROOT}" "${ROOT}" / ; do + configfile=${root}etc/portage/savedconfig/${conf}.config + if [[ -r ${configfile} ]] ; then + einfo "Found your ${configfile} and using it." + cp ${configfile} "${S}"/.config + yes "" | make oldconfig > /dev/null + return 0 + fi + done + done + ewarn "Could not locate user configfile, so we will save a default one" + fi + + # setup the config file + make allyesconfig > /dev/null + busybox_config_option n DMALLOC + busybox_config_option n FEATURE_SUID_CONFIG + busybox_config_option n BUILD_AT_ONCE + busybox_config_option n BUILD_LIBBUSYBOX + + # If these are not set and we are using a uclibc/busybox setup + # all calls to system() will fail. + busybox_config_option y FEATURE_SH_IS_ASH + busybox_config_option n FEATURE_SH_IS_NONE + + busybox_config_option static STATIC + busybox_config_option debug DEBUG + use debug \ + && busybox_config_option y NO_DEBUG_LIB \ + && busybox_config_option n DMALLOC \ + && busybox_config_option n EFENCE + + busybox_config_option selinux SELINUX + + # default a bunch of uncommon options to off + for opt in LOCALE_SUPPORT TFTP FTP{GET,PUT} IPCALC TFTP HUSH \ + LASH MSH INETD DPKG RPM2CPIO RPM FOLD LOGNAME OD CRONTAB \ + UUDECODE UUENCODE SULOGIN DC DEBUG_YANK_SUSv2 DEBUG_INIT \ + DEBUG_CROND_OPTION FEATURE_UDHCP_DEBUG TASKSET + do + busybox_config_option n ${opt} + done + + make oldconfig > /dev/null +} + +src_compile() { + unset KBUILD_OUTPUT #88088 + + emake busybox || die "build failed" + if ! use static ; then + mv busybox_unstripped{,.bak} + LDFLAGS="${LDFLAGS} -static" emake busybox || die "static build failed" + mv busybox_unstripped bb + mv busybox_unstripped{.bak,} + fi +} + +src_install() { + unset KBUILD_OUTPUT #88088 + + into / + newbin busybox_unstripped busybox || die + use static \ + && dosym busybox /bin/bb \ + || dobin bb + dosym bb /bin/busybox.static + + # bundle up the symlink files for use later + emake install || die + rm _install/bin/busybox + tar cf busybox-links.tar -C _install . || : #;die + insinto /usr/share/${PN} + doins busybox-links.tar || die + newins .config ${PF}.config || die + + dodoc AUTHORS README TODO + + cd docs || die + docinto txt + dodoc *.txt + docinto pod + dodoc *.pod + dohtml *.html *.sgml + + cd ../examples || die + docinto examples + dodoc inittab depmod.pl *.conf *.script undeb unrpm + + cd bootfloppy || die + docinto bootfloppy + dodoc * etc/* etc/init.d/* 2>/dev/null +} + +pkg_preinst() { + if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then + ewarn "setting USE=make-symlinks and emerging to / is very dangerous." + ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)." + ewarn "If you are creating a binary only and not merging this is probably ok." + ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is realy what you want." + die "silly options will destroy your system" + fi + + if use make-symlinks ; then + mv "${D}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die + fi + if use savedconfig ; then + mv "${D}"/usr/share/${PN}/${PF}.config "${T}"/ || die + fi +} + +pkg_postinst() { + if use make-symlinks ; then + cd "${T}" || die + mkdir _install + tar xf busybox-links.tar -C _install || die + cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed" + fi + + if use savedconfig ; then + local config_dir="${PORTAGE_CONFIGROOT:-${ROOT}}/etc/portage/savedconfig" + einfo "Saving this build config to ${config_dir}/${PF}.config" + einfo "Read this ebuild for more info on how to take advantage of this option" + mkdir -p "${config_dir}" + cp "${T}"/${PF}.config "${config_dir}"/${PF}.config + return 0 + fi + echo + einfo "This ebuild has support for user defined configs" + einfo "Please read this ebuild for more details and re-emerge as needed" + einfo "if you want to add or remove functionality for ${PN}" + echo +} diff --git a/sys-apps/busybox/files/1.4.0/data_extract_all.patch b/sys-apps/busybox/files/1.4.0/data_extract_all.patch new file mode 100644 index 000000000000..be66a5a0a6fc --- /dev/null +++ b/sys-apps/busybox/files/1.4.0/data_extract_all.patch @@ -0,0 +1,15 @@ +--- archival/libunarchive/data_extract_all.c.orig 2007-01-24 16:34:38.000000000 -0500 ++++ archival/libunarchive/data_extract_all.c 2007-02-11 17:22:14.000000000 -0500 +@@ -111,6 +111,12 @@ + lchown(file_header->name, file_header->uid, file_header->gid); + } + ++ if (!(archive_handle->flags & ARCHIVE_NOPRESERVE_PERM) && ++ (file_header->mode & S_IFMT) != S_IFLNK) ++ { ++ chmod(file_header->name, file_header->mode); ++ } ++ + if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) { + struct utimbuf t; + t.actime = t.modtime = file_header->mtime; diff --git a/sys-apps/busybox/files/digest-busybox-1.4.1-r2 b/sys-apps/busybox/files/digest-busybox-1.4.1-r2 new file mode 100644 index 000000000000..cfce130998b1 --- /dev/null +++ b/sys-apps/busybox/files/digest-busybox-1.4.1-r2 @@ -0,0 +1,3 @@ +MD5 5728403bce309cdabcffa414e2e64052 busybox-1.4.1.tar.bz2 1510432 +RMD160 6ea5461718fae52b9ee3b966e49a226a0685fd28 busybox-1.4.1.tar.bz2 1510432 +SHA256 2936318008322392716a9d3566bcff071cf5c97cb1df1f5953ec5b5a8a1701bb busybox-1.4.1.tar.bz2 1510432