diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2009-03-24 09:26:04 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2009-03-24 09:26:04 +0000 |
commit | b2a03ac46e5ed3ed88e440508feaabc0503f7267 (patch) | |
tree | 6394ad136fcfeec061112c82e4f1548bbd658f22 /sys-cluster/util-vserver | |
parent | Version bump (#261462). Thanks to Kai Dietrich (diff) | |
download | historical-b2a03ac46e5ed3ed88e440508feaabc0503f7267.tar.gz historical-b2a03ac46e5ed3ed88e440508feaabc0503f7267.tar.bz2 historical-b2a03ac46e5ed3ed88e440508feaabc0503f7267.zip |
fix mmap problems wrt #228135
Package-Manager: portage-2.2_rc25/cvs/Linux i686
Diffstat (limited to 'sys-cluster/util-vserver')
-rw-r--r-- | sys-cluster/util-vserver/ChangeLog | 10 | ||||
-rw-r--r-- | sys-cluster/util-vserver/Manifest | 5 | ||||
-rw-r--r-- | sys-cluster/util-vserver/files/util-vserver-0.30.215-2718.patch | 62 | ||||
-rw-r--r-- | sys-cluster/util-vserver/files/util-vserver-0.30.215-dietmmap.patch | 49 | ||||
-rw-r--r-- | sys-cluster/util-vserver/util-vserver-0.30.215-r3.ebuild | 146 |
5 files changed, 270 insertions, 2 deletions
diff --git a/sys-cluster/util-vserver/ChangeLog b/sys-cluster/util-vserver/ChangeLog index db7a2c5bdbef..d94a94314411 100644 --- a/sys-cluster/util-vserver/ChangeLog +++ b/sys-cluster/util-vserver/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-cluster/util-vserver # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/ChangeLog,v 1.95 2009/03/04 21:20:24 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/ChangeLog,v 1.96 2009/03/24 09:26:03 hollow Exp $ + +*util-vserver-0.30.215-r3 (24 Mar 2009) + + 24 Mar 2009; Benedikt Böhm <hollow@gentoo.org> + +files/util-vserver-0.30.215-2718.patch, + +files/util-vserver-0.30.215-dietmmap.patch, + +util-vserver-0.30.215-r3.ebuild: + fix mmap problems wrt #228135 *util-vserver-0.30.215-r2 (04 Mar 2009) diff --git a/sys-cluster/util-vserver/Manifest b/sys-cluster/util-vserver/Manifest index 66f16580bf90..3d569fe7160b 100644 --- a/sys-cluster/util-vserver/Manifest +++ b/sys-cluster/util-vserver/Manifest @@ -1,6 +1,8 @@ AUX bash_completion 7568 RMD160 45feafa30f715fb287403518eee8c45fecfe418e SHA1 d281bcad111df21ab0f37703142dd102145d784e SHA256 2232166a5aed9857a7a5c30adfdd4ea944e0608a29fad05f229b8cef2d61795d AUX util-vserver-0.30.214-baselayout2_path.patch 648 RMD160 7775e5bc109774f9f253a88157739b5eb88ffc87 SHA1 fe8a94e8e0c76989b6d7268f9c9a07183a63b183 SHA256 59ad64c7b5356c16f500dc328eec989844301adeeefd4fe968955a03e9eb2630 +AUX util-vserver-0.30.215-2718.patch 3088 RMD160 9f8706359790c3ed1e38abb3923976c00635e92a SHA1 a95c19e51c8bea6b1f537e47f190737a8a9d2cb3 SHA256 1411d738d1d82a6972af266eefa89c3924db95f58f7e620eaf4123dc9310573f AUX util-vserver-0.30.215-capget.patch 2813 RMD160 65e601b1f32e0bf6d078c45bf3e6f030c6cec14a SHA1 da0f07d49211b07530d40812af2a731a7a49a547 SHA256 0ef843ccaac93acbac69e082e26b7b901d1a72c78f3552cd7c55e758997f1a3c +AUX util-vserver-0.30.215-dietmmap.patch 2175 RMD160 30c191cb7a5e0b7a8fc667197a8c6d03fb591166 SHA1 f4ef6f4820aa105f3013faeb3f104a9cbcd0ae19 SHA256 c54d9c44199c705c52efef4bc50c436dafa0738c50a96c5728bf002885f32403 AUX util-vserver-0.30.215-openrc.patch 1138 RMD160 936fe40430a9dcd0f8924d435952400bdfdbf858 SHA1 021d40edec6f602a050c01d1924ca990714face0 SHA256 f6a4d24c708ee882e506f63ad16cf259c06ef7840d860f77da74d8e970e9297c AUX util-vserver-0.30.215-typo.patch 564 RMD160 7b0619e24b9e30b4ba4bca2f0476a1f62206a3f4 SHA1 53d8d6e205175736280bafde41274501adbbfd9d SHA256 f0e809a33f32cf49e34f9c8c65803ba6bf96ecd2a233eb48338dbab3923a3c6b DIST util-vserver-0.30.214.tar.bz2 676250 RMD160 fbcf8b23719af991443d59f6c8670e99e2b746d6 SHA1 d0996cd6415db91c869912680e9b9798edd57228 SHA256 c88a27ccd1593f4396e1cf4aca37c715c7618a77d709ad63c7cc744ca1557c45 @@ -8,6 +10,7 @@ DIST util-vserver-0.30.215.tar.bz2 695414 RMD160 62d34d2149fc949f27f7e08e8f40779 EBUILD util-vserver-0.30.214.ebuild 3796 RMD160 72ac310d3f0344711f5d90c47753ef3aef325744 SHA1 53e1e3cb6fe4220ef106526e48d2c660c7376934 SHA256 05a66ce65ba97088a26f1b9c7d96bffb805ee4fa7a8f619758fa2b1a293ba97b EBUILD util-vserver-0.30.215-r1.ebuild 3837 RMD160 f23b44793e858e9e7bee791d508265e631672012 SHA1 9bc045fcdcf72856088eb45089d4e4bb16e6d537 SHA256 7cf9a543fa1be0315b469b4534edb59cd088a15bf891f57abe81fcfc04a41b80 EBUILD util-vserver-0.30.215-r2.ebuild 3875 RMD160 a2c2ae0252c95adce3c5b851ae145b763d332f72 SHA1 71b1b9711e9281bf721eaefed07deabd93365cc9 SHA256 bea5f06020edc52b9aaf2688eb70274e2be4e6fdc051b1d962fdacc34bb8d20a +EBUILD util-vserver-0.30.215-r3.ebuild 4107 RMD160 aaa90df9f5eaf2a4526e847a74bd59da29f4e5f3 SHA1 9fb67fe3a522fb93100ab9a87c7e2be4bab7a00a SHA256 fb4409b16c787caa8685e07a07b8f3e99c82def7770f8b2b22c4e61ab44e70a6 EBUILD util-vserver-0.30.215.ebuild 3792 RMD160 11914d6a9270117bebdc4923e21d536c0143b66b SHA1 45a56191b6cbca887a403290a3b02d3bcf4bcdaa SHA256 f0197cd48fb18fb97f223e460819c81b9f489d5402821383090f5bdbf54e97f7 -MISC ChangeLog 19536 RMD160 dbdc30d02de1c175cf973dbe763fe8e0fe4f51f7 SHA1 e4d4db082c37d257138a57a12b5498d556be6be7 SHA256 296c600e1a7ffe6aedeb2fe041f6322430d8d89888e1a4cbffaa60db5adb75f4 +MISC ChangeLog 19786 RMD160 7fc86607cb39ac6f0fde555eb1c4bb24a9f6aae4 SHA1 2d36eb263150deb7cf55830daad175f58bc2a22e SHA256 b61195ea91ffca76baff75ef4811fbb43209526fe6697f331d6054efa4dac136 MISC metadata.xml 518 RMD160 62a73756fb710a0464dd24600e7ec70c82e13021 SHA1 78ee9f24180c1215ebe02ac3dbba80a7a0c4a82e SHA256 5a4f424248d873af9f0a66aca2e3e60c6165288fa649ef44de4d8418232c5ac0 diff --git a/sys-cluster/util-vserver/files/util-vserver-0.30.215-2718.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.215-2718.patch new file mode 100644 index 000000000000..fc9ea6164fba --- /dev/null +++ b/sys-cluster/util-vserver/files/util-vserver-0.30.215-2718.patch @@ -0,0 +1,62 @@ +diff -Nru util-vserver-0.30.215.orig/lib_internal/unify-copy.c util-vserver-0.30.215/lib_internal/unify-copy.c +--- util-vserver-0.30.215.orig/lib_internal/unify-copy.c 2008-03-17 09:59:50.000000000 +0100 ++++ util-vserver-0.30.215/lib_internal/unify-copy.c 2008-06-17 15:38:50.000000000 +0200 +@@ -132,8 +132,8 @@ + buf_size = in_len - offset; + if (buf_size > MMAP_BLOCKSIZE) buf_size = MMAP_BLOCKSIZE; + +- if ((in_buf = mmap(0, buf_size, PROT_READ, MAP_SHARED, in_fd, offset))==0 || +- (out_buf = mmap(0, buf_size, PROT_WRITE, MAP_SHARED, out_fd, offset))==0) { ++ if ((in_buf = mmap(0, buf_size, PROT_READ, MAP_SHARED, in_fd, offset))==MAP_FAILED || ++ (out_buf = mmap(0, buf_size, PROT_WRITE, MAP_SHARED, out_fd, offset))==MAP_FAILED) { + perror("mmap()"); + goto out; + } +diff -Nru util-vserver-0.30.215.orig/src/check-unixfile.c util-vserver-0.30.215/src/check-unixfile.c +--- util-vserver-0.30.215.orig/src/check-unixfile.c 2008-03-17 09:59:45.000000000 +0100 ++++ util-vserver-0.30.215/src/check-unixfile.c 2008-06-17 15:39:11.000000000 +0200 +@@ -73,7 +73,7 @@ + } + else if (l>0) { + data = mmap(0, l, PROT_READ, MAP_PRIVATE, fd, 0); +- if (data==0) { ++ if (data==MAP_FAILED) { + perror("mmap()"); + exit(wrapper_exit_code); + } +diff -Nru util-vserver-0.30.215.orig/src/h2ext.c util-vserver-0.30.215/src/h2ext.c +--- util-vserver-0.30.215.orig/src/h2ext.c 2008-03-17 09:59:45.000000000 +0100 ++++ util-vserver-0.30.215/src/h2ext.c 2008-06-17 15:39:41.000000000 +0200 +@@ -148,7 +148,7 @@ + fd = EopenD(file, O_RDONLY, 0); + Efstat(fd, &st); + mapping = mmap(NULL, MIN(st.st_size, MAX_PEEK_SIZE), PROT_READ, MAP_SHARED, fd, 0); +- if (!mapping) { ++ if (mapping == MAP_FAILED) { + perror("mmap()"); + Eclose(fd); + return -1; +diff -Nru util-vserver-0.30.215.orig/src/testsuite/hashcalc-plain.c util-vserver-0.30.215/src/testsuite/hashcalc-plain.c +--- util-vserver-0.30.215.orig/src/testsuite/hashcalc-plain.c 2008-03-17 09:59:45.000000000 +0100 ++++ util-vserver-0.30.215/src/testsuite/hashcalc-plain.c 2008-06-17 15:40:08.000000000 +0200 +@@ -76,7 +76,7 @@ + void const * buf; + if (buf_size>HASH_BLOCKSIZE) buf_size = HASH_BLOCKSIZE; + +- assert((buf=mmap(0, buf_size, PROT_READ, MAP_SHARED, fd, offset))!=0); ++ assert((buf=mmap(0, buf_size, PROT_READ, MAP_SHARED, fd, offset))!=MAP_FAILED); + offset += buf_size; + assert(ensc_crypto_hashctx_update(&hash_context, buf, buf_size)!=-1); + munmap((void *)(buf), buf_size); +diff -Nru util-vserver-0.30.215.orig/src/vhashify.c util-vserver-0.30.215/src/vhashify.c +--- util-vserver-0.30.215.orig/src/vhashify.c 2008-03-17 09:59:45.000000000 +0100 ++++ util-vserver-0.30.215/src/vhashify.c 2008-06-17 15:40:28.000000000 +0200 +@@ -332,7 +332,7 @@ + buf_size = size-offset; + if (buf_size>HASH_BLOCKSIZE) buf_size = HASH_BLOCKSIZE; + +- if ((buf=mmap(0, buf_size, PROT_READ, MAP_SHARED, fd, offset))==0) { ++ if ((buf=mmap(0, buf_size, PROT_READ, MAP_SHARED, fd, offset))==MAP_FAILED) { + perror("mmap(<hash>)"); + goto out; + } diff --git a/sys-cluster/util-vserver/files/util-vserver-0.30.215-dietmmap.patch b/sys-cluster/util-vserver/files/util-vserver-0.30.215-dietmmap.patch new file mode 100644 index 000000000000..bb6342608c70 --- /dev/null +++ b/sys-cluster/util-vserver/files/util-vserver-0.30.215-dietmmap.patch @@ -0,0 +1,49 @@ +diff -Nru util-vserver-0.30.215.orig/Makefile.in util-vserver-0.30.215/Makefile.in +--- util-vserver-0.30.215.orig/Makefile.in 2008-03-17 10:00:13.000000000 +0100 ++++ util-vserver-0.30.215/Makefile.in 2008-06-18 19:24:54.000000000 +0200 +@@ -1496,7 +1496,7 @@ + $(lib_internal_testsuite_sigbus_gnu_SOURCES) \ + $(src_capchroot_SOURCES) $(src_chain_echo_SOURCES) \ + $(src_chbind_compat_SOURCES) $(src_chcontext_compat_SOURCES) \ +- src/check-unixfile.c $(src_chroot_sh_SOURCES) \ ++ $(src_chroot_sh_SOURCES) \ + $(src_chxid_SOURCES) $(src_exec_cd_SOURCES) \ + $(src_exec_ulimit_SOURCES) $(src_fakerunlevel_SOURCES) \ + $(src_filetime_SOURCES) $(src_h2ext_SOURCES) \ +@@ -1818,7 +1818,7 @@ + ensc_fmt/lib_libvserver_a-% lib/testsuite/cflags \ + lib/testsuite/personality lib/testsuite/fmt \ + src/chcontext-compat src/capchroot src/chain-echo \ +- src/check-unixfile src/chroot-sh src/filetime src/lockfile \ ++ src/chroot-sh src/filetime src/lockfile \ + src/readlink src/secure-mount src/save_ctxinfo src/mask2prefix \ + src/chbind-compat src/exec-cd src/fakerunlevel \ + src/keep-ctx-alive src/exec-ulimit src/vps src/lsxid src/chxid \ +@@ -1828,7 +1828,7 @@ + src/vsched src/vshelper-sync src/vrsetup src/vserver-stat \ + src/vserver-info src/vdlimit src/vdu src/vwait src/ncontext \ + src/nattribute src/naddress src/vdevmap src/vsysctl src/vclone \ +- src/h2ext src/vtag src/vspace src/vmemctrl src/tunctl \ ++ src/vtag src/vspace src/vmemctrl src/tunctl \ + $(am__append_3) $(tests_dietprogs) \ + lib_internal/libinternal-diet.a \ + lib_internal/testsuite/isnumber lib_internal/testsuite/sigbus \ +diff -Nru util-vserver-0.30.215.orig/src/Makefile-files util-vserver-0.30.215/src/Makefile-files +--- util-vserver-0.30.215.orig/src/Makefile-files 2008-03-17 09:59:45.000000000 +0100 ++++ util-vserver-0.30.215/src/Makefile-files 2008-06-18 17:49:42.000000000 +0200 +@@ -38,7 +38,6 @@ + DIETPROGS += src/chcontext-compat \ + src/capchroot \ + src/chain-echo \ +- src/check-unixfile \ + src/chroot-sh \ + src/filetime \ + src/lockfile \ +@@ -81,7 +80,6 @@ + src/vdevmap \ + src/vsysctl \ + src/vclone \ +- src/h2ext \ + src/vtag \ + src/vspace \ + src/vmemctrl \ diff --git a/sys-cluster/util-vserver/util-vserver-0.30.215-r3.ebuild b/sys-cluster/util-vserver/util-vserver-0.30.215-r3.ebuild new file mode 100644 index 000000000000..a30036dd5d74 --- /dev/null +++ b/sys-cluster/util-vserver/util-vserver-0.30.215-r3.ebuild @@ -0,0 +1,146 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/util-vserver-0.30.215-r3.ebuild,v 1.1 2009/03/24 09:26:03 hollow Exp $ + +inherit eutils bash-completion + +DESCRIPTION="Linux-VServer admin utilities" +HOMEPAGE="http://www.nongnu.org/util-vserver/" +SRC_URI="http://ftp.linux-vserver.org/pub/utils/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86" + +IUSE="" + +CDEPEND="dev-libs/beecrypt + net-firewall/iptables + net-misc/vconfig + sys-apps/iproute2 + || ( >=sys-apps/coreutils-6.10-r1 sys-apps/mktemp )" + +DEPEND=">=dev-libs/dietlibc-0.30-r2 + ${CDEPEND}" + +RDEPEND="${CDEPEND}" + +pkg_setup() { + if [[ -z "${VDIRBASE}" ]]; then + einfo + einfo "You can change the default vserver base directory (/vservers)" + einfo "by setting the VDIRBASE environment variable." + fi + + : ${VDIRBASE:=/vservers} + + einfo + einfo "Using \"${VDIRBASE}\" as vserver base directory" + einfo +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # openrc support + epatch "${FILESDIR}"/${P}-openrc.patch + epatch "${FILESDIR}"/${P}-typo.patch + + # linux capability fixes + epatch "${FILESDIR}"/${P}-capget.patch + + # changeset 2718: fix error reporting if mmap() fails + epatch "${FILESDIR}"/${P}-2718.patch + + # avoid a bug in dietlibc - #227793 + use hppa && epatch "${FILESDIR}"/${P}-dietmmap.patch +} + +src_compile() { + econf --with-vrootdir=${VDIRBASE} \ + --with-initscripts=gentoo \ + --localstatedir=/var || die "econf failed!" + emake || die "emake failed!" +} + +src_install() { + make DESTDIR="${D}" install install-distribution \ + || die "make install failed!" + + # keep dirs + keepdir /var/run/vservers + keepdir /var/run/vservers.rev + keepdir /var/run/vshelper + keepdir /var/lock/vservers + keepdir /var/cache/vservers + keepdir "${VDIRBASE}" + keepdir "${VDIRBASE}"/.pkg + + # remove legacy config file + rm -f "${D}"/etc/vservers.conf + + # bash-completion + dobashcompletion "${FILESDIR}"/bash_completion util-vserver + + dodoc README ChangeLog NEWS AUTHORS THANKS util-vserver.spec +} + +pkg_preinst() { + has_version "<${CATEGORY}/${PN}-0.30.211" + old_init_script_warn=$? +} + +pkg_postinst() { + # Create VDIRBASE in postinst, so it is (a) not unmerged and (b) also + # present when merging. + + [ ! -d "${VDIRBASE}" ] && mkdir -p "${VDIRBASE}" &> /dev/null + setattr --barrier "${VDIRBASE}" &> /dev/null + + rm /etc/vservers/.defaults/vdirbase + ln -sf "${VDIRBASE}" /etc/vservers/.defaults/vdirbase + + elog + elog "You have to run the vprocunhide command after every reboot" + elog "in order to setup /proc permissions correctly for vserver" + elog "use. An init script has been installed by this package." + elog "To use it you should add it to a runlevel:" + elog + elog " rc-update add vprocunhide default" + elog + + if [[ $old_init_script_warn = 0 ]] ; then + ewarn "Please make sure, that you remove the old init-script from any" + ewarn "runlevel and remove it from your init.d dir!" + ewarn + ewarn "# rc-update del vservers" + ewarn "# rm -f ${ROOT}etc/init.d/vservers" + ewarn + ewarn "Since util-vserver-0.30.211 all Gentoo specific wrappers" + ewarn "have been merged upstream, and may now have a slightly" + ewarn "different syntax, i.e. you have to update scripts that" + ewarn "depend on these wrappers (vesync, vemerge, vupdateworld" + ewarn "and vdispatch-conf)" + ewarn + ewarn "Additionally the init scripts have changed and now use" + ewarn "upstream scripts as backend. An init script to start" + ewarn "virtual servers in the 'default' group/mark has been" + ewarn "installed by this ebuild:" + ewarn + ewarn " rc-update add vservers.default default" + ewarn + ewarn "To start vservers in other groups/marks, you have to" + ewarn "symlink the default init script the same way you do" + ewarn "with net.* scripts:" + ewarn + ewarn " ln -s /etc/init.d/vservers.default /etc/init.d/vservers.<mark>" + ewarn + fi + + ewarn "You should definitly fix up the barrier of your vserver" + ewarn "base directory by using the following command in a root shell:" + ewarn + ewarn " setattr --barrier ${VDIRBASE}" + ewarn +} |