summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2008-05-16 11:30:30 +0000
committerPeter Volkov <pva@gentoo.org>2008-05-16 11:30:30 +0000
commitd519f7874c18b18dec883cc83abe9893478c1067 (patch)
treebe10b6913680395077c778fe9f79ff30381d36a4 /net-ftp/netkit-tftp
parentStable on ppc64; bug #222151 (diff)
downloadhistorical-d519f7874c18b18dec883cc83abe9893478c1067.tar.gz
historical-d519f7874c18b18dec883cc83abe9893478c1067.tar.bz2
historical-d519f7874c18b18dec883cc83abe9893478c1067.zip
Fixed WRQ handling in tftpd, backported changes from debian and now we reopen socket on all errors. Removed old.
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'net-ftp/netkit-tftp')
-rw-r--r--net-ftp/netkit-tftp/ChangeLog11
-rw-r--r--net-ftp/netkit-tftp/Manifest16
-rw-r--r--net-ftp/netkit-tftp/files/netkit-tftp-0.17-socket-reopen-on-errors.patch86
-rw-r--r--net-ftp/netkit-tftp/files/netkit-tftp-0.17-tftpd-put-fixes.patch35
-rw-r--r--net-ftp/netkit-tftp/netkit-tftp-0.17-r7.ebuild (renamed from net-ftp/netkit-tftp/netkit-tftp-0.17-r5.ebuild)42
5 files changed, 159 insertions, 31 deletions
diff --git a/net-ftp/netkit-tftp/ChangeLog b/net-ftp/netkit-tftp/ChangeLog
index 99e9d844ded4..b392c8e0a4b9 100644
--- a/net-ftp/netkit-tftp/ChangeLog
+++ b/net-ftp/netkit-tftp/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-ftp/netkit-tftp
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/ChangeLog,v 1.14 2008/03/29 02:33:27 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/ChangeLog,v 1.15 2008/05/16 11:30:29 pva Exp $
+
+*netkit-tftp-0.17-r7 (16 May 2008)
+
+ 16 May 2008; Peter Volkov <pva@gentoo.org>
+ +files/netkit-tftp-0.17-socket-reopen-on-errors.patch,
+ +files/netkit-tftp-0.17-tftpd-put-fixes.patch,
+ -netkit-tftp-0.17-r5.ebuild, +netkit-tftp-0.17-r7.ebuild:
+ Fixed WRQ handling in tftpd, backported changes from debian and now we
+ reopen socket on all errors. Removed old.
*netkit-tftp-0.17-r6 (29 Mar 2008)
diff --git a/net-ftp/netkit-tftp/Manifest b/net-ftp/netkit-tftp/Manifest
index 24ed635a3394..779166375030 100644
--- a/net-ftp/netkit-tftp/Manifest
+++ b/net-ftp/netkit-tftp/Manifest
@@ -1,21 +1,13 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX memset.patch 280 RMD160 e7de5f8e41574e7dc649ee38bb5f7365fc0be4b6 SHA1 fe8c0cbd49f8ddb27b37ec24bd4be3be0abab064 SHA256 9b04964776efc6b321fe9b388dda6206101d681911b80ea20135593d47b948b8
+AUX netkit-tftp-0.17-socket-reopen-on-errors.patch 2006 RMD160 3d0ae71ae22e0761d52ed7a2e22a4fd18259eb82 SHA1 0ab64e736def78690a949bf6dd3a2ffd4818b699 SHA256 e4f9a1427d86a242da5ae6cd67a527d2b937168bdc404c676483357109c8297e
AUX netkit-tftp-0.17-tftp-connect-segfault.patch 785 RMD160 e1e6daf991f55b8454c58f207d479dbbaeb76f57 SHA1 4b54bbf87cbcfb3a8ad47762086150aa77a0a3a3 SHA256 8ec005824a299cc106b420d012d9f5492093eaf9237c7dba692baffcb081458e
AUX netkit-tftp-0.17-tftp-fix-put-zero-size.diff 314 RMD160 4ed269cdf6cde97152da6d37eec1b91b3df363aa SHA1 6bfcd34858e78f0a1370c66323f9d26cb2907b7d SHA256 1e216083f0cdb592f927a5a33cec5b3ae1ae6fdc803d20c738b904a1aac7a32e
AUX netkit-tftp-0.17-tftp-manpage-typo.patch 473 RMD160 43f7599b55c4a4e1493268ea03b4a44813ad5bf1 SHA1 2b26c24664e27024075a74d6e32a28ace1150cb9 SHA256 c7134c4458000f42aa3e3293ff8027a8126fdcdf8cb110673d2051b8f6ba12b4
+AUX netkit-tftp-0.17-tftpd-put-fixes.patch 1050 RMD160 4d61969cde547a75c0645a19fe532ffcaebef7cf SHA1 3af9510a4302ab81ae4c8c841f6b60b8f4afcef0 SHA256 7c790a5a908e914fa8fb7180fce82622fc84666fcd4803eb424a38d665f79509
AUX tftp-dgram 246 RMD160 adfcba66b4db0afbb6372ff701ec8da310963f77 SHA1 e0afb619d6e4b2665be04ed2016836668a619ffd SHA256 b79af85531e4e300da30731ed0b761d0325ad091c6ae7e9c75bf67806b9e1009
AUX tftp-stream 246 RMD160 b1075084b89ac25cbcebdaa69152f42a032c57a5 SHA1 2378f5976cfae1c63e3ac96d6df417165dab8d17 SHA256 861a2d955c1d84d7268c3348ef53c33f44ce73453eda96c36b3750bba6f1f836
DIST netkit-tftp-0.17.tar.gz 23620 RMD160 18fa9eaa4e31ec9579a8ba8a486a2f0da0b22747 SHA1 d3d661d6462f1989a69b37acba4006be5ae112bc SHA256 3a43c0010d4e61f412563fd83769d4667d8b8e82903526d21cb9205fe55ad14d
-EBUILD netkit-tftp-0.17-r5.ebuild 1503 RMD160 d4678adc779576f6ea767d9e0f52e14647c351a1 SHA1 7c9fc8de6debf59966aac7a1a899c896ecbbe576 SHA256 3a775cd91624e26e68dc522fec919384ab08baeb52c3694e176a0887424946ad
EBUILD netkit-tftp-0.17-r6.ebuild 1484 RMD160 121276fcc6dcca2ba625cf76a24009bb7dcbcb60 SHA1 0d1432e1fc4ddade9acd1415c5bee95dfe9399b5 SHA256 c40658e331c43419632025142062570559b9122cb0582fce9f04330a1752148a
-MISC ChangeLog 3546 RMD160 dfc78db16e30fb50bb5ca20ab83e08caeb7bea55 SHA1 37095b33608d6dcf372730ddcf9da982cc38d4af SHA256 283032456e8625ee3cb2a135b3fb5c30bbc31eada885f9a7a613ae8b3f71a167
+EBUILD netkit-tftp-0.17-r7.ebuild 1624 RMD160 ac19f5c215cd4ebbc6709478d9a26495074cbb20 SHA1 db7ee734f85df675175ba7d059aef941fe52cef7 SHA256 cb32405ab002b5d113ec18183f20f018ad564a38aa83a7e1e982c60149ab2d61
+MISC ChangeLog 3908 RMD160 8ae18a827c87154f505aa3e0807fdea732d12096 SHA1 7a307ca2bd97d1106454382ca880f7b273d75deb SHA256 966fc84387c1db6882051e6588efb1cb6e5a5019643e5413d02102c870eb0826
MISC metadata.xml 799 RMD160 8f94b4bf878b4bc1c81977707abe311e34b21780 SHA1 14a84369d0cbb5deca5b938f13c6c6fa7c1b5623 SHA256 6fc447069710464408b1e3c22512a9ec36f59f9226bae0918e36267780e6ef4a
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.7 (GNU/Linux)
-
-iD8DBQFH7atCj9hvisErhMIRAhW6AJ9HdiwhCfrLD3hHpcRBRTppTbEt9gCeK6tQ
-GOGj7v4SrgHp5Ox6qQsgOgU=
-=j5r4
------END PGP SIGNATURE-----
diff --git a/net-ftp/netkit-tftp/files/netkit-tftp-0.17-socket-reopen-on-errors.patch b/net-ftp/netkit-tftp/files/netkit-tftp-0.17-socket-reopen-on-errors.patch
new file mode 100644
index 000000000000..58b6c710b97e
--- /dev/null
+++ b/net-ftp/netkit-tftp/files/netkit-tftp-0.17-socket-reopen-on-errors.patch
@@ -0,0 +1,86 @@
+Always reopen socket after a get/put in tftp.
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=130292
+
+--- tftp/main.c 2008-05-16 09:56:18 +0000
++++ tftp/main.c 2008-05-16 10:48:23 +0000
+@@ -69,7 +69,7 @@
+ #define TIMEOUT 5 /* secs between rexmt's */
+
+ struct sockaddr_in s_inn;
+-int f;
++int f = -1;
+ int trace;
+ int verbose;
+ int rexmtval = TIMEOUT;
+@@ -151,17 +151,11 @@
+ static struct cmd *getcmd(const char *name);
+ static char *tail(char *filename);
+
+-int
+-main(int argc, char *argv[])
+-{
++void initsock() {
+ struct sockaddr_in s_in;
+- int top;
+
+- sp = getservbyname("tftp", "udp");
+- if (sp == 0) {
+- fprintf(stderr, "tftp: udp/tftp: unknown service\n");
+- exit(1);
+- }
++ if (f >= 0)
++ close(f);
+ f = socket(AF_INET, SOCK_DGRAM, 0);
+ if (f < 0) {
+ perror("tftp: socket");
+@@ -173,6 +167,19 @@
+ perror("tftp: bind");
+ exit(1);
+ }
++}
++
++int
++main(int argc, char *argv[])
++{
++ int top;
++
++ sp = getservbyname("tftp", "udp");
++ if (sp == 0) {
++ fprintf(stderr, "tftp: udp/tftp: unknown service\n");
++ exit(1);
++ }
++ initsock();
+ strcpy(mode, "netascii");
+ mysignal(SIGINT, intr);
+ if (argc > 1) {
+
+--- tftp/tftp.c 2008-05-16 09:56:18 +0000
++++ tftp/tftp.c 2008-05-16 10:41:30 +0000
+@@ -204,6 +204,7 @@
+ block++;
+ } while (1);
+ abort:
++ initsock();
+ fclose(file);
+ stopclock();
+ if (amount > 0)
+@@ -307,6 +308,7 @@
+ amount += size;
+ } while (size == SEGSIZE);
+ abort: /* ok to ack, since user */
++ initsock();
+ ap->th_opcode = htons((u_short)ACK); /* has seen err msg */
+ ap->th_block = htons((u_short)block);
+ (void) sendto(f, ackbuf, 4, 0, (struct sockaddr *)&s_inn, sizeof(s_inn));
+
+--- tftp/tftpsubs.h 2008-05-16 09:56:18 +0000
++++ tftp/tftpsubs.h 2008-05-16 10:50:03 +0000
+@@ -1,6 +1,7 @@
+ #define PKTSIZE SEGSIZE+4 /* should be moved to tftp.h */
+
+ int synchnet(int);
++void initsock(void);
+ struct tftphdr *r_init(void);
+ struct tftphdr *w_init(void);
+ int readit(FILE *file, struct tftphdr **dpp, int convert);
+
diff --git a/net-ftp/netkit-tftp/files/netkit-tftp-0.17-tftpd-put-fixes.patch b/net-ftp/netkit-tftp/files/netkit-tftp-0.17-tftpd-put-fixes.patch
new file mode 100644
index 000000000000..c548a1611c85
--- /dev/null
+++ b/net-ftp/netkit-tftp/files/netkit-tftp-0.17-tftpd-put-fixes.patch
@@ -0,0 +1,35 @@
+=== modified file 'tftpd/tftpd.c'
+--- tftpd/tftpd.c 2008-05-16 09:56:18 +0000
++++ tftpd/tftpd.c 2008-05-16 10:09:38 +0000
+@@ -340,7 +340,8 @@
+ return(EACCESS);
+ }
+ }
+- if (stat(filename, &stbuf) < 0)
++ /* stat doesn't work with mode == WRQ as file don't exist */
++ if (stat(filename, &stbuf) < 0 && mode == RRQ)
+ return (errno == ENOENT ? ENOTFOUND : EACCESS);
+ #if 0
+ /*
+@@ -359,14 +360,18 @@
+ return (EACCESS);
+ }
+ #endif
++ /* Actually this checks are useless as we use filesystem permisions.
++ * Thus if we can't read (RRQ) or write (WRQ) to the file, open() will
++ * fail and set errno appropriately (ideas from debian patch).
+ if (mode == RRQ) {
+ if ((stbuf.st_mode & S_IROTH) == 0)
+ return (EACCESS);
+ } else {
+ if ((stbuf.st_mode & S_IWOTH) == 0)
+ return (EACCESS);
+- }
+- fd = open(filename, mode == RRQ ? O_RDONLY : O_WRONLY|O_TRUNC);
++ } */
++
++ fd = open(filename, mode == RRQ ? O_RDONLY : O_WRONLY|O_TRUNC|O_CREAT|O_EXCL, 0600);
+ if (fd < 0)
+ return (errno + 100);
+ file = fdopen(fd, (mode == RRQ)? "r":"w");
+
diff --git a/net-ftp/netkit-tftp/netkit-tftp-0.17-r5.ebuild b/net-ftp/netkit-tftp/netkit-tftp-0.17-r7.ebuild
index 09e329daca80..522684c772c0 100644
--- a/net-ftp/netkit-tftp/netkit-tftp-0.17-r5.ebuild
+++ b/net-ftp/netkit-tftp/netkit-tftp-0.17-r7.ebuild
@@ -1,52 +1,58 @@
# Copyright 1999-2008 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-r5.ebuild,v 1.5 2008/03/23 22:51:54 ranger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/netkit-tftp/netkit-tftp-0.17-r7.ebuild,v 1.1 2008/05/16 11:30:29 pva Exp $
inherit eutils toolchain-funcs
DESCRIPTION="the tftp server included in netkit"
-SRC_URI="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-tftp-0.17.tar.gz"
HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/"
+SRC_URI="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-tftp-0.17.tar.gz"
-KEYWORDS="amd64 ~mips ppc ppc64 sparc x86"
-IUSE=""
LICENSE="BSD"
SLOT="0"
+KEYWORDS="~amd64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
DEPEND="!virtual/tftp
- virtual/inetd"
+ virtual/inetd"
PROVIDE="virtual/tftp"
src_unpack() {
- unpack $A
+ unpack ${A}
cd "${S}"
# Change default man directory
- sed -i -e 's:MANDIR="$PREFIX/man":MANDIR="$PREFIX/share/man":' \
- -e 's:^LDFLAGS=::' configure
+ sed -i \
+ -e 's:MANDIR="$PREFIX/man":MANDIR="$PREFIX/share/man":' \
+ -e 's:^LDFLAGS=::' \
+ configure
# don't prestrip binaries
- find -name Makefile -exec sed -i -e 's,install -s,install,' \{\} \;
+ 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
}
src_compile() {
- ./configure --prefix=/usr --installroot="${D}" \
- --with-c-compiler="$(tc-getCC)" || die
+ ./configure \
+ --prefix=/usr \
+ --installroot="${D}" \
+ --with-c-compiler="$(tc-getCC)" \
+ || die
emake || die
}
src_install() {
- dodir /usr/bin /usr/sbin
- doman tftp/tftp.1 tftpd/tftpd.8
- make install || die
-
- dodoc "${FILESDIR}"/{tftp-dgram,tftp-stream} BUGS ChangeLog README
- einfo "Take a look at /usr/share/doc/${PF}/tftp-* files"
- einfo "for sample xinetd configuration files."
+ 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
}