summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klausmann <klausman@gentoo.org>2011-03-26 09:05:43 +0000
committerTobias Klausmann <klausman@gentoo.org>2011-03-26 09:05:43 +0000
commit7a55a3c4e5403dd04e87c2964a0f93d2879d0453 (patch)
treec817e53337144ea6796ef1476f307878da1b69ed /net-ftp/atftp
parentDisable global survey by default in example conf file wrt #360483 by robbat2 (diff)
downloadhistorical-7a55a3c4e5403dd04e87c2964a0f93d2879d0453.tar.gz
historical-7a55a3c4e5403dd04e87c2964a0f93d2879d0453.tar.bz2
historical-7a55a3c4e5403dd04e87c2964a0f93d2879d0453.zip
Integrate patches from bugs 321705, 322601 and 323883
Package-Manager: portage-2.1.9.44/cvs/Linux x86_64
Diffstat (limited to 'net-ftp/atftp')
-rw-r--r--net-ftp/atftp/ChangeLog9
-rw-r--r--net-ftp/atftp/Manifest12
-rw-r--r--net-ftp/atftp/atftp-0.7-r2.ebuild67
-rw-r--r--net-ftp/atftp/files/atftp-0.7-blockno.patch136
-rw-r--r--net-ftp/atftp/files/atftp-0.7-illreply.patch12
-rw-r--r--net-ftp/atftp/files/atftp-0.7-spaced_filename.patch96
6 files changed, 327 insertions, 5 deletions
diff --git a/net-ftp/atftp/ChangeLog b/net-ftp/atftp/ChangeLog
index 12c5d3e20495..3310eb357b7d 100644
--- a/net-ftp/atftp/ChangeLog
+++ b/net-ftp/atftp/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-ftp/atftp
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-ftp/atftp/ChangeLog,v 1.24 2011/03/22 20:56:27 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/atftp/ChangeLog,v 1.25 2011/03/26 09:05:43 klausman Exp $
+
+*atftp-0.7-r2 (26 Mar 2011)
+
+ 26 Mar 2011; Tobias Klausmann <klausman@gentoo.org> +atftp-0.7-r2.ebuild,
+ +files/atftp-0.7-blockno.patch, +files/atftp-0.7-illreply.patch,
+ +files/atftp-0.7-spaced_filename.patch:
+ Integrate patches from bugs 321705, 322601 and 323883
22 Mar 2011; Ulrich Mueller <ulm@gentoo.org> atftp-0.7-r1.ebuild:
Drop PROVIDE=virtual/tftp and update blocker, bug 359125.
diff --git a/net-ftp/atftp/Manifest b/net-ftp/atftp/Manifest
index 081132de1555..6f3d51b70eeb 100644
--- a/net-ftp/atftp/Manifest
+++ b/net-ftp/atftp/Manifest
@@ -1,21 +1,25 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
+AUX atftp-0.7-blockno.patch 5686 RMD160 1ca48d473ce1a8dc2f9690e7b29ae2d68990c2eb SHA1 85c73268e7bb11925275fa05b35df97f0106d1f2 SHA256 f77661c92a66b95773a81f895e982ae65acbbef84c75b1ab8021e4dfb1bb64d1
AUX atftp-0.7-glibc24.patch 778 RMD160 753a813c7ac9cbf7a28f4d7af98f11c986d008b4 SHA1 b34c7b216b5ec5ecdb55e42e4ac2f47b26bc09f9 SHA256 d2bec90943b330db84cd6af089a67e476f45271d9f33095ef3fc281c83eb7ed5
+AUX atftp-0.7-illreply.patch 362 RMD160 f5b17d9a577d331640143682b3ba66b800af34be SHA1 4034963f5f492af6d13538adf1c1b0a3df69081a SHA256 db1bbc6c40ccfa12ea6e283f35368cfdb47c05c5ad54dd26a9ff9693807e78d5
AUX atftp-0.7-password.patch 3906 RMD160 c637ec04fe4940fd84d27787ab6174d14daae5ff SHA1 f5fc938e0ff7762999f1d446b73ebb344c2ed71b SHA256 e56637318c9baa9e85525dc92c6be170713529af834a5bb6871238d374c0a365
AUX atftp-0.7-pcre.patch 661 RMD160 28f934bf041339487998f3d49f505f6ced10f409 SHA1 a1cd8f0387691336fe924f1b6302b95b2d6d19df SHA256 53cb989038e1c5520104c837cb086ffbb20afb6555f42782f78fd05bcea9f304
+AUX atftp-0.7-spaced_filename.patch 2395 RMD160 3dc796286d20d03ef6a6774433be8aa38d35b32e SHA1 bd42961c630e6aefc3fc146bfa59fcf406e3411e SHA256 0d93d85295d5e5ad79783b7e45e8c7f5ee061956adf1f160f5647fcb418bdac7
AUX atftp-0.7-tests.patch 582 RMD160 104c31709aeead26d9d7e8c1e61f316911b3c72e SHA1 d562036b5cc429437585d33b0a31a91de513c42d SHA256 00e04546214265b0e9d03a0f8182837909825fef111e53a7b23d9e6a382a9d54
AUX atftp.confd 105 RMD160 9c0b9cc23e749e95dc1b19375860e15e14d3004c SHA1 f8e2d6b120ff3302334c01d35a0ed2fc5c6dd742 SHA256 a2dc012a0ecd94f27950901b18a54ecc744630da4c7cd8939b3f11be07685645
AUX atftp.init 437 RMD160 83808c852164b4d368da5c9da95474dbbcd1e651 SHA1 8f8d7fac163aabec794acb12bd59162547aeb8ee SHA256 4970eb720ab838c1855b33b2437e0f8f44356e9b6f5a7225c99e2a29d6311b34
DIST atftp-0.7.tar.gz 202234 RMD160 06bd2ba663a87fabb79e1536275ad23f60c68636 SHA1 83726e552ca10a164f1a7b344b0c51ca33423fe9 SHA256 9c548c44d3cfdf259118d9fd4e468e1fe4567456dbff8ff59838c5f70ef62ea3
DIST atftp_0.7-11.diff.gz 26055 RMD160 b078ce6715faec118b9524be67b9ed1fa6bb9fc2 SHA1 76d8cae2c0744298649c66cafa24afd977ef9643 SHA256 77accd1f5b5d4759fe9572f7a917c629e35692e484ac4dc6fd4415fe745036ff
EBUILD atftp-0.7-r1.ebuild 1766 RMD160 3da2965adebcc9e65f5a2edb1823923e7c1384b2 SHA1 4f5d8278651af8f5e4ee3e702a5c63474cd2c355 SHA256 1c130177633a5c86bc6aec612c39c8c46ea37e51949301c6e7e3c86c4f34929f
-MISC ChangeLog 4348 RMD160 17b48c2404f1b2953f3046ce654ba8b6b41a11cc SHA1 618ac5be5f0cbd04c8f2fe38143056c6e5f6e996 SHA256 f537220b1f11769aec3878c17289ea03ee4687540755b2171828489ae63e6348
+EBUILD atftp-0.7-r2.ebuild 1908 RMD160 506f2d5289a1777c4e86edbc1d7a84d59c62ef34 SHA1 4fa66a6c3e25d70c1d882e367c81f1690599bf5c SHA256 fa9ae4cce051982950f484a71af1ec9f2c71ca5d6488626104e0288a4f180c61
+MISC ChangeLog 4624 RMD160 6596fb3289e6d6db5acb473e6977ab16a706037f SHA1 619fbd17a414b53edbbd32d7e1b4478e6fa97988 SHA256 ed200da38ffed36d06c86d267a15eabf82cb6d72666d02d94bbfa5bc0b5d733c
MISC metadata.xml 231 RMD160 c13056229989c3d4f448a7c7abcff3f4ee7ce13c SHA1 2d63dfb700b223f8f37c078692a81b2237896bce SHA256 4595c2615fd7c9095517949b1a920d4457f92801eb9d46307b18aafe58ec2a8a
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iEYEARECAAYFAk2JDRwACgkQOeoy/oIi7uy65ACgw579xHI7/mdY/ayVO5o5/qz1
-u5MAoLEGsE0IO/LljwyEcqHV/YXUKt2L
-=5IZv
+iEYEARECAAYFAk2NrHIACgkQA+4Doc5dVOh/FwCfdnVNkH01XFgKVcUKzIhIeZDi
+M8MAniNnrMDa9yyk1kjaFvu3tmDhzR5H
+=4mIZ
-----END PGP SIGNATURE-----
diff --git a/net-ftp/atftp/atftp-0.7-r2.ebuild b/net-ftp/atftp/atftp-0.7-r2.ebuild
new file mode 100644
index 000000000000..c364e9d92ff4
--- /dev/null
+++ b/net-ftp/atftp/atftp-0.7-r2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/atftp/atftp-0.7-r2.ebuild,v 1.1 2011/03/26 09:05:42 klausman Exp $
+
+inherit eutils flag-o-matic
+
+DEBIAN_PV="11"
+DEBIAN_A="${PN}_${PV}-${DEBIAN_PV}.diff.gz"
+
+DESCRIPTION="Advanced TFTP implementation client/server"
+HOMEPAGE="ftp://ftp.mamalinux.com/pub/atftp/"
+SRC_URI="ftp://ftp.mamalinux.com/pub/atftp/${P}.tar.gz
+ mirror://debian/pool/main/a/${PN}/${DEBIAN_A}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~s390"
+IUSE="selinux tcpd readline pcre"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+ selinux? ( sec-policy/selinux-tftpd )
+ readline? ( sys-libs/readline )
+ pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}
+ !net-ftp/netkit-tftp
+ !net-ftp/tftp-hpa"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cd "${S}"
+ epatch "${DISTDIR}"/${DEBIAN_A}
+ epatch "${FILESDIR}"/${P}-pcre.patch
+ epatch "${FILESDIR}"/${P}-password.patch
+ epatch "${FILESDIR}"/${P}-tests.patch
+ epatch "${FILESDIR}"/${P}-glibc24.patch
+ epatch "${FILESDIR}"/${P}-blockno.patch
+ epatch "${FILESDIR}"/${P}-spaced_filename.patch
+ epatch "${FILESDIR}"/${P}-illreply.patch
+ # remove upstream's broken CFLAGS
+ sed -i.orig -e \
+ '/^CFLAGS="-g -Wall -D_REENTRANT"/s,".*","",g' \
+ "${S}"/configure
+}
+
+src_compile() {
+ append-flags -D_REENTRANT -DRATE_CONTROL
+ econf \
+ $(use_enable tcpd libwrap) \
+ $(use_enable readline libreadline) \
+ $(use_enable pcre libpcre) \
+ --enable-mtftp \
+ || die "./configure failed"
+ emake CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "Installation failed"
+ newinitd "${FILESDIR}"/atftp.init atftp
+ newconfd "${FILESDIR}"/atftp.confd atftp
+
+ dodoc README* BUGS FAQ Changelog INSTALL TODO
+ dodoc "${S}"/docs/*
+
+ docinto test
+ cd "${S}"/test
+ dodoc load.sh mtftp.conf pcre_pattern.txt test.sh test_suite.txt
+}
diff --git a/net-ftp/atftp/files/atftp-0.7-blockno.patch b/net-ftp/atftp/files/atftp-0.7-blockno.patch
new file mode 100644
index 000000000000..6a3184f98bec
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7-blockno.patch
@@ -0,0 +1,136 @@
+--- atftp-0.7/tftp_file.c~ 2010-05-27 13:05:12.000000000 -0500
++++ atftp-0.7/tftp_file.c 2010-05-27 12:50:05.000000000 -0500
+@@ -133,19 +133,21 @@
+ int mcast_sockfd = 0;
+ struct sockaddr_in sa_mcast;
+ struct ip_mreq mreq;
+ struct hostent *host;
+ int master_client = 0;
+ unsigned int file_bitmap[NB_BLOCK];
+ int prev_bitmap_hole = -1; /* the previous hole found in the bitmap */
+ char string[MAXLEN];
++ int rx_block_number;
+
+ int prev_block_number = 0; /* needed to support netascii convertion */
+ int temp = 0;
++ size_t ignore;
+
+ data->file_size = 0;
+ tftp_cancel = 0;
+ from.sin_addr.s_addr = 0;
+
+ memset(&sa_mcast, 0, sizeof(struct sockaddr_in));
+ memset(&file_bitmap, 0, sizeof(file_bitmap));
+
+@@ -300,17 +302,17 @@
+ {
+ connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+ connected = 1;
+ }
+ state = S_OACK_RECEIVED;
+ break;
+ case GET_ERROR:
+ fprintf(stderr, "tftp: error received from server <");
+- fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
++ ignore = fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
+ fprintf(stderr, ">\n");
+ state = S_ABORT;
+ break;
+ case GET_DATA:
+ number_of_timeout = 0;
+ /* if the socket if not connected, connect it */
+ if (!connected)
+ {
+@@ -513,21 +515,24 @@
+ state = S_WAIT_PACKET;
+ break;
+ case S_DATA_RECEIVED:
+ if ((multicast && master_client) || (!multicast))
+ timeout_state = S_SEND_ACK;
+ else
+ timeout_state = S_WAIT_PACKET;
+
+- block_number = ntohs(tftphdr->th_block);
++ rx_block_number = ntohs(tftphdr->th_block);
+ if (data->trace)
+ fprintf(stderr, "received DATA <block: %d, size: %d>\n",
+ ntohs(tftphdr->th_block), data_size - 4);
+
++ if ((uint16_t)rx_block_number == (uint16_t)(block_number+1))
++ ++block_number;
++
+ if (tftp_file_write(fp, tftphdr->th_data, data->data_buffer_size - 4, block_number,
+ data_size - 4, convert, &prev_block_number, &temp)
+ != data_size - 4)
+ {
+
+ fprintf(stderr, "tftp: error writing to file %s\n",
+ data->local_file);
+ tftp_send_error(sockfd, &sa, ENOSPACE, data->data_buffer,
+@@ -613,19 +618,21 @@
+ int connected; /* 1 when sockfd is connected */
+ struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer;
+ FILE *fp; /* the local file pointer */
+ int number_of_timeout = 0;
+ struct stat file_stat;
+ int convert = 0; /* if true, do netascii convertion */
+ char string[MAXLEN];
+
++ int ack_block_number;
+ int prev_block_number = 0; /* needed to support netascii convertion */
+ int prev_file_pos = 0;
+ int temp = 0;
++ size_t ignore;
+
+ data->file_size = 0;
+ tftp_cancel = 0;
+ from.sin_addr.s_addr = 0;
+
+ /* make sure the socket is not connected */
+ sa.sin_family = AF_UNSPEC;
+ connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+@@ -759,20 +766,23 @@
+ case GET_ACK:
+ number_of_timeout = 0;
+ /* if the socket if not connected, connect it */
+ if (!connected)
+ {
+ //connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+ connected = 1;
+ }
+- block_number = ntohs(tftphdr->th_block);
++ ack_block_number = ntohs(tftphdr->th_block);
++ if ((uint16_t)(block_number+1) == ack_block_number)
++ ++block_number;
+ if (data->trace)
+ fprintf(stderr, "received ACK <block: %d>\n",
+- block_number);
++ ack_block_number);
++
+ if ((last_block != -1) && (block_number > last_block))
+ {
+ state = S_END;
+ break;
+ }
+ state = S_SEND_DATA;
+ break;
+ case GET_OACK:
+@@ -782,17 +792,17 @@
+ {
+ //connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+ connected = 1;
+ }
+ state = S_OACK_RECEIVED;
+ break;
+ case GET_ERROR:
+ fprintf(stderr, "tftp: error received from server <");
+- fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
++ ignore = fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
+ fprintf(stderr, ">\n");
+ state = S_ABORT;
+ break;
+ case GET_DISCARD:
+ /* consider discarded packet as timeout to make sure when don't lock up
+ if routing is broken */
+ number_of_timeout++;
+ fprintf(stderr, "tftp: packet discard <%s:%d>.\n",
diff --git a/net-ftp/atftp/files/atftp-0.7-illreply.patch b/net-ftp/atftp/files/atftp-0.7-illreply.patch
new file mode 100644
index 000000000000..e18bbd99c9e9
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7-illreply.patch
@@ -0,0 +1,12 @@
+*** tftp_def.old.c 2009-02-28 17:56:12.000000000 +0100
+--- tftp_def.c 2009-02-28 17:57:02.000000000 +0100
+***************
+*** 141,146 ****
+--- 141,147 ----
+ */
+ inline char *Strncpy(char *to, const char *from, size_t size)
+ {
++ if (size <= 0) { *to = '\000'; return to; }
+ to[size-1] = '\000';
+ return strncpy(to, from, size - 1);
+ }
diff --git a/net-ftp/atftp/files/atftp-0.7-spaced_filename.patch b/net-ftp/atftp/files/atftp-0.7-spaced_filename.patch
new file mode 100644
index 000000000000..da96d9f6b820
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7-spaced_filename.patch
@@ -0,0 +1,96 @@
+--- atftp-0.7/tftp.c~ 2010-06-03 08:51:14.000000000 -0500
++++ atftp-0.7/tftp.c 2010-06-03 09:40:56.000000000 -0500
+@@ -18,16 +18,17 @@
+ #include "config.h"
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
+ #include <string.h>
++#include <stdarg.h>
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <netdb.h>
+
+ #include <signal.h>
+@@ -344,16 +345,41 @@
+
+ /* If no names matched, then return NULL. */
+ return NULL;
+ }
+ # endif
+ #endif
+
+ /*
++ * set argc/argv from variadic string arguments
++*/
++void make_arg_vector(int *argc, char***argv, ...)
++{
++ char **p;
++ char *s;
++ va_list argp;
++
++ // how many args?
++ *argc = 0;
++ va_start(argp, argv);
++ while ( (s=va_arg(argp, char*)) )
++ ++*argc;
++
++ // allocate storage
++ *argv = malloc(*argc * sizeof (char*));
++
++ // store args
++ p = *argv;
++ va_start(argp, argv);
++ while ( (s=va_arg(argp, char*)) )
++ *p++ = s;
++}
++
++/*
+ * Split a string into args.
+ */
+ void make_arg(char *string, int *argc, char ***argv)
+ {
+ static char *tmp = NULL;
+ size_t argz_len;
+
+ /* split the string to an argz vector */
+@@ -1142,30 +1168,26 @@
+ argv[optind+1]);
+ make_arg(string, &ac, &av);
+ process_cmd(ac, av);
+ }
+
+ if (!interactive)
+ {
+ if (action == PUT)
+- snprintf(string, sizeof(string), "put %s %s", local_file,
+- remote_file);
++ make_arg_vector(&ac,&av,"put",local_file,remote_file,NULL);
+ else if (action == GET)
+- snprintf(string, sizeof(string), "get %s %s", remote_file,
+- local_file);
++ make_arg_vector(&ac,&av,"get",remote_file,local_file,NULL);
+ else if (action == MGET)
+- snprintf(string, sizeof(string), "mget %s %s", remote_file,
+- local_file);
++ make_arg_vector(&ac,&av,"mget",remote_file,local_file,NULL);
+ else
+ {
+ fprintf(stderr, "No action specified in batch mode!\n");
+ exit(ERR);
+ }
+- make_arg(string, &ac, &av);
+ if (process_cmd(ac, av) == ERR)
+ exit(ERR);
+ }
+ return OK;
+ }
+
+ void tftp_usage(void)
+ {