summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2012-07-08 17:42:00 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2012-07-08 17:42:00 +0000
commit5232a50c9cab7a79d2e1955ef3a629b21c46ddfe (patch)
tree5024041b243475a7568809f7cf595f22b3fe558d /net-ftp/netkit-tftp
parentalpha/ia64/m68k/s390/sh/sparc stable wrt #420919 (diff)
downloadgentoo-2-5232a50c9cab7a79d2e1955ef3a629b21c46ddfe.tar.gz
gentoo-2-5232a50c9cab7a79d2e1955ef3a629b21c46ddfe.tar.bz2
gentoo-2-5232a50c9cab7a79d2e1955ef3a629b21c46ddfe.zip
Add a patch to fix the overflow reported in bug #425184. Probably still worth of last riting though.
(Portage version: 2.2.0_alpha116/cvs/Linux x86_64)
Diffstat (limited to 'net-ftp/netkit-tftp')
-rw-r--r--net-ftp/netkit-tftp/ChangeLog12
-rw-r--r--net-ftp/netkit-tftp/files/netkit-tftp-0.17-overflow.patch55
-rw-r--r--net-ftp/netkit-tftp/netkit-tftp-0.17-r8.ebuild58
3 files changed, 122 insertions, 3 deletions
diff --git a/net-ftp/netkit-tftp/ChangeLog b/net-ftp/netkit-tftp/ChangeLog
index 5c93a8bf0dd2..da59722cd6ef 100644
--- a/net-ftp/netkit-tftp/ChangeLog
+++ b/net-ftp/netkit-tftp/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-ftp/netkit-tftp
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/ChangeLog,v 1.24 2011/04/06 05:25:34 ulm Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/ChangeLog,v 1.25 2012/07/08 17:42:00 flameeyes Exp $
+
+*netkit-tftp-0.17-r8 (08 Jul 2012)
+
+ 08 Jul 2012; Diego E. Pettenò <flameeyes@gentoo.org>
+ +files/netkit-tftp-0.17-overflow.patch, +netkit-tftp-0.17-r8.ebuild:
+ Add a patch to fix the overflow reported in bug #425184. Probably still worth
+ of last riting though.
06 Apr 2011; Ulrich Mueller <ulm@gentoo.org> netkit-tftp-0.17-r7.ebuild:
Add blocker against atftp too.
@@ -130,4 +137,3 @@
18 Feb 2002; F.Meyndert <m0rpheus@gentoo.org> netkit-tftp-0.17.ebuild,
New ebuild for netkit-tftp, ftp client and server.
-
diff --git a/net-ftp/netkit-tftp/files/netkit-tftp-0.17-overflow.patch b/net-ftp/netkit-tftp/files/netkit-tftp-0.17-overflow.patch
new file mode 100644
index 000000000000..64925a244ed9
--- /dev/null
+++ b/net-ftp/netkit-tftp/files/netkit-tftp-0.17-overflow.patch
@@ -0,0 +1,55 @@
+Index: netkit-tftp-0.17/tftp/tftp.c
+===================================================================
+--- netkit-tftp-0.17.orig/tftp/tftp.c
++++ netkit-tftp-0.17/tftp/tftp.c
+@@ -56,6 +56,7 @@ char tftp_rcsid[] =
+ #include <setjmp.h>
+ #include <unistd.h>
+ #include <string.h>
++#include <stddef.h>
+
+ #include "tftpsubs.h"
+
+@@ -78,7 +79,7 @@ static sigjmp_buf timeoutbuf;
+
+
+ static int makerequest(int request, char *name,
+- struct tftphdr *tp, char *mode);
++ char *hdr, char *mode);
+ static void nak(int errnor);
+ static void tpacket(const char *s, struct tftphdr *tp, int n);
+ static void startclock(void);
+@@ -126,7 +127,7 @@ sendfile(int fd, char *name, char *mode)
+ mysignal(SIGALRM, timer);
+ do {
+ if (firsttrip) {
+- size = makerequest(WRQ, name, dp, mode) - 4;
++ size = makerequest(WRQ, name, (char*)dp, mode) - 4;
+ }
+ else {
+ /* size = read(fd, dp->th_data, SEGSIZE); */
+@@ -238,7 +239,7 @@ recvfile(int fd, char *name, char *mode)
+ mysignal(SIGALRM, timer);
+ do {
+ if (firsttrip) {
+- size = makerequest(RRQ, name, ap, mode);
++ size = makerequest(RRQ, name, ackbuf, mode);
+ firsttrip = 0;
+ } else {
+ ap->th_opcode = htons((u_short)ACK);
+@@ -320,12 +321,13 @@ abort:
+ }
+
+ int
+-makerequest(int request, char *name, struct tftphdr *tp, char *mode)
++makerequest(int request, char *name, char *hdr, char *mode)
+ {
+ register char *cp;
++ struct tftphdr *tp = (struct tftphdr*)hdr;
+
+ tp->th_opcode = htons((u_short)request);
+- cp = tp->th_stuff;
++ cp = hdr + offsetof(struct tftphdr, th_stuff);
+ strcpy(cp, name);
+ cp += strlen(name);
+ *cp++ = '\0';
diff --git a/net-ftp/netkit-tftp/netkit-tftp-0.17-r8.ebuild b/net-ftp/netkit-tftp/netkit-tftp-0.17-r8.ebuild
new file mode 100644
index 000000000000..df3f2330f63b
--- /dev/null
+++ b/net-ftp/netkit-tftp/netkit-tftp-0.17-r8.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/netkit-tftp-0.17-r8.ebuild,v 1.1 2012/07/08 17:42:00 flameeyes Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="the tftp server included in netkit"
+HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND="virtual/inetd"
+RDEPEND="!net-ftp/atftp
+ !net-ftp/tftp-hpa
+ ${DEPEND}"
+
+src_prepare() {
+ # Change default man directory
+ sed -i \
+ -e 's:MANDIR="$PREFIX/man":MANDIR="$PREFIX/share/man":' \
+ -e 's:^LDFLAGS=::' \
+ configure
+
+ # don't prestrip binaries
+ find . -name Makefile -print0 | xargs -0 sed -i -e 's:install -s:install:'
+
+ # Solve QA warning by including string.h
+ epatch "${FILESDIR}"/memset.patch
+ epatch "${FILESDIR}"/${P}-tftp-connect-segfault.patch
+ epatch "${FILESDIR}"/${P}-tftp-manpage-typo.patch
+ epatch "${FILESDIR}"/${P}-tftp-fix-put-zero-size.diff
+ epatch "${FILESDIR}"/${P}-tftpd-put-fixes.patch
+ epatch "${FILESDIR}"/${P}-socket-reopen-on-errors.patch
+ epatch "${FILESDIR}"/${P}-overflow.patch
+}
+
+src_configure() {
+ ./configure \
+ --prefix=/usr \
+ --installroot="${D}" \
+ --with-c-compiler="$(tc-getCC)" \
+ || die
+}
+
+src_install() {
+ dodir /usr/bin /usr/sbin /usr/share/man/man{1,8}
+ emake install || die
+ rm -f "${D}"/usr/share/man/man8/tftpd.8 #214734, collision with iputils
+ insinto /etc/xinetd.d
+ doins "${FILESDIR}"/{tftp-dgram,tftp-stream}
+ dodoc BUGS ChangeLog README
+}