public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-ftp/atftp/files/, net-ftp/atftp/
@ 2016-01-14 18:31 David Seifert
  0 siblings, 0 replies; 5+ messages in thread
From: David Seifert @ 2016-01-14 18:31 UTC (permalink / raw
  To: gentoo-commits

commit:     6ffa68b51d52e48b2913c94e2eefbc535ec4b61f
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 14 18:30:43 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Jan 14 18:31:02 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ffa68b5

net-ftp/atftp: Add missing die, format patch for -p1, EAPI=6

Package-Manager: portage-2.2.26

 .../{atftp-0.7-r4.ebuild => atftp-0.7-r5.ebuild}   | 44 +++++++++++-----------
 net-ftp/atftp/files/atftp-0.7-CFLAGS.patch         | 32 ++++++++++++++++
 net-ftp/atftp/files/atftp-0.7-illreply.patch       |  4 +-
 3 files changed, 55 insertions(+), 25 deletions(-)

diff --git a/net-ftp/atftp/atftp-0.7-r4.ebuild b/net-ftp/atftp/atftp-0.7-r5.ebuild
similarity index 62%
rename from net-ftp/atftp/atftp-0.7-r4.ebuild
rename to net-ftp/atftp/atftp-0.7-r5.ebuild
index 44e2e25..3e5bb46 100644
--- a/net-ftp/atftp/atftp-0.7-r4.ebuild
+++ b/net-ftp/atftp/atftp-0.7-r5.ebuild
@@ -2,16 +2,16 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
-inherit eutils flag-o-matic systemd
+EAPI=6
+inherit autotools flag-o-matic systemd
 
 DEBIAN_PV="11"
-DEBIAN_A="${PN}_${PV}-${DEBIAN_PV}.diff.gz"
+DEBIAN_A="${PN}_${PV}-${DEBIAN_PV}.diff"
 
 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}"
+	mirror://debian/pool/main/a/${PN}/${DEBIAN_A}.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -26,26 +26,28 @@ RDEPEND="${DEPEND}
 	!net-ftp/tftp-hpa
 	selinux? ( sec-policy/selinux-tftp )"
 
+PATCHES=(
+	"${WORKDIR}/${DEBIAN_A}"
+	"${FILESDIR}/${P}-pcre.patch"
+	"${FILESDIR}/${P}-password.patch"
+	"${FILESDIR}/${P}-tests.patch"
+	"${FILESDIR}/${P}-glibc24.patch"
+	"${FILESDIR}/${P}-blockno.patch"
+	"${FILESDIR}/${P}-spaced_filename.patch"
+	"${FILESDIR}/${P}-illreply.patch"
+	"${FILESDIR}/${P}-CFLAGS.patch"
+)
+
 src_prepare() {
+	append-cppflags -D_REENTRANT -DRATE_CONTROL
 	# fix #561720 by restoring pre-GCC5 inline semantics
 	append-cflags -std=gnu89
 
-	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 || die
+	default
+	eautoreconf
 }
 
 src_configure() {
-	append-flags -D_REENTRANT -DRATE_CONTROL
 	econf \
 		$(use_enable tcpd libwrap) \
 		$(use_enable readline libreadline) \
@@ -53,12 +55,8 @@ src_configure() {
 		--enable-mtftp
 }
 
-src_compile() {
-	emake CFLAGS="${CFLAGS}"
-}
-
 src_install() {
-	emake install DESTDIR="${D}"
+	default
 
 	newinitd "${FILESDIR}"/atftp.init atftp
 	newconfd "${FILESDIR}"/atftp.confd atftp
@@ -70,6 +68,6 @@ src_install() {
 	dodoc "${S}"/docs/*
 
 	docinto test
-	cd "${S}"/test
+	cd "${S}"/test || die
 	dodoc load.sh mtftp.conf pcre_pattern.txt test.sh test_suite.txt
 }

diff --git a/net-ftp/atftp/files/atftp-0.7-CFLAGS.patch b/net-ftp/atftp/files/atftp-0.7-CFLAGS.patch
new file mode 100644
index 0000000..566c179
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7-CFLAGS.patch
@@ -0,0 +1,32 @@
+--- atftp-0.7/configure.ac
++++ atftp-0.7/configure.ac
+@@ -66,29 +66,6 @@
+ dnl Check for AIX
+ AC_AIX
+ 
+-CFLAGS="-g -Wall -D_REENTRANT"
+-
+-if test x$debug = xtrue; then
+-   CFLAGS="$CFLAGS -O0 -DDEBUG"
+-else
+-  if test -n "$auto_cflags"; then
+-    if test -n "$GCC"; then
+-      CFLAGS="$CFLAGS -g -O2 -Wall -Wno-implicit"
+-    else
+-      case "$host_os" in
+-        *hpux*)  CFLAGS="$CFLAGS +O3"
+-	  ;;
+-        *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000"
+-	  ;;
+-        *)       CFLAGS="$CFLAGS -O2"
+-	  ;;
+-      esac
+-    fi
+-  else
+-    CFLAGS="$CFLAGS -O2"
+-  fi
+-fi
+-
+ AC_PROG_MAKE_SET
+ AC_PROG_INSTALL
+ 

diff --git a/net-ftp/atftp/files/atftp-0.7-illreply.patch b/net-ftp/atftp/files/atftp-0.7-illreply.patch
index e18bbd9..0f1cacd 100644
--- a/net-ftp/atftp/files/atftp-0.7-illreply.patch
+++ b/net-ftp/atftp/files/atftp-0.7-illreply.patch
@@ -1,5 +1,5 @@
-*** tftp_def.old.c      2009-02-28 17:56:12.000000000 +0100
---- tftp_def.c  2009-02-28 17:57:02.000000000 +0100
+*** atftp-0.7/tftp_def.old.c      2009-02-28 17:56:12.000000000 +0100
+--- atftp-0.7/tftp_def.c  2009-02-28 17:57:02.000000000 +0100
 ***************
 *** 141,146 ****
 --- 141,147 ----


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-ftp/atftp/files/, net-ftp/atftp/
@ 2020-03-07 17:59 Tobias Klausmann
  0 siblings, 0 replies; 5+ messages in thread
From: Tobias Klausmann @ 2020-03-07 17:59 UTC (permalink / raw
  To: gentoo-commits

commit:     d63ef8dcc42e605b3807d8c99a58fac0b4cd8331
Author:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  7 17:57:51 2020 +0000
Commit:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Sat Mar  7 17:58:58 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d63ef8dc

net-ftp/atftp: remove vulnerable 0.7-r6 and associated files

Package-Manager: Portage-2.3.92, Repoman-2.3.20
Signed-off-by: Tobias Klausmann <klausman <AT> gentoo.org>

 net-ftp/atftp/Manifest                             |   2 -
 net-ftp/atftp/atftp-0.7-r6.ebuild                  |  78 ------------
 net-ftp/atftp/files/atftp-0.7-CFLAGS.patch         |  32 -----
 net-ftp/atftp/files/atftp-0.7-blockno.patch        | 136 ---------------------
 net-ftp/atftp/files/atftp-0.7-glibc24.patch        |  22 ----
 net-ftp/atftp/files/atftp-0.7-illreply.patch       |  12 --
 net-ftp/atftp/files/atftp-0.7-password.patch       |  94 --------------
 net-ftp/atftp/files/atftp-0.7-pcre.patch           |  14 ---
 .../atftp/files/atftp-0.7-spaced_filename.patch    |  96 ---------------
 net-ftp/atftp/files/atftp-0.7-tests.patch          |  23 ----
 10 files changed, 509 deletions(-)

diff --git a/net-ftp/atftp/Manifest b/net-ftp/atftp/Manifest
index 37c22b68977..eccbf7737c8 100644
--- a/net-ftp/atftp/Manifest
+++ b/net-ftp/atftp/Manifest
@@ -1,3 +1 @@
 DIST atftp-0.7.2.tar.gz 248038 BLAKE2B 3ca44624bf989009c2ebd0ae97927b0784e3c617a79a1bd00212a72a185302cf84f51c8bcda2012981d67cfed4d241b70f8719e78155207608f07a2227e6c437 SHA512 d602bb69451175a36e619abcff412ab1f6d0e7baf8c3f9a2b32081530fbc5816157404b80d42a8b6caa89cc83675b5cbeefcd57a5d98b8f5b43c6254b20ef28b
-DIST atftp-0.7.dfsg.tar.gz 187992 BLAKE2B 8196c333ea8042879196ca9f9c656b4d60a332ed1d64a5738870e1d4fd5f108716da6769bf52759626ad3efce11946b5d6285ac9fbe46cb63e6e2d051fc7aeb3 SHA512 40d231c0bc0478fedb3eff9b4c540c62dd9bd6c40d9738e2db1813797a5d48e201720d43a48970ce250f1bb5b15460bb9b3d631c06f96c1a74775ecfb6d13f82
-DIST atftp_0.7-11.diff.gz 26055 BLAKE2B c9be58836b5a7e3943dd28dd4661abab5e86b1941c9a2b58786eebe702ab515cf1bc08bf44c8ab4157584a437e861e24eb0c833c1fa1bc774f7f8a2134b6cd27 SHA512 28747f8f3ef2fc3b122361f682fe26ba93acf09b190f61efb3cfcbb6bdeef78cfe1348aeaf1699003a7e02586579be670d85b65baad1b1165a4bec9a9279adb5

diff --git a/net-ftp/atftp/atftp-0.7-r6.ebuild b/net-ftp/atftp/atftp-0.7-r6.ebuild
deleted file mode 100644
index 64badd5fa1e..00000000000
--- a/net-ftp/atftp/atftp-0.7-r6.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit autotools flag-o-matic systemd
-
-DEBIAN_PV="11"
-DEBIAN_A="${PN}_${PV}-${DEBIAN_PV}.diff"
-
-DESCRIPTION="Advanced TFTP implementation client/server"
-HOMEPAGE="https://sourceforge.net/projects/atftp/"
-SRC_URI="mirror://sourceforge/${PN}/${P}.dfsg.tar.gz
-	mirror://debian/pool/main/a/${PN}/${DEBIAN_A}.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 arm ppc ppc64 ~s390 sparc x86"
-IUSE="selinux tcpd readline pcre"
-
-DEPEND="tcpd? ( sys-apps/tcp-wrappers )
-	readline? ( sys-libs/readline:0= )
-	pcre? ( dev-libs/libpcre )"
-RDEPEND="${DEPEND}
-	!net-ftp/netkit-tftp
-	!net-ftp/tftp-hpa
-	!net-ftp/uftpd
-	selinux? ( sec-policy/selinux-tftp )"
-
-PATCHES=(
-	"${WORKDIR}/${DEBIAN_A}"
-	"${FILESDIR}/${P}-pcre.patch"
-	"${FILESDIR}/${P}-password.patch"
-	"${FILESDIR}/${P}-tests.patch"
-	"${FILESDIR}/${P}-glibc24.patch"
-	"${FILESDIR}/${P}-blockno.patch"
-	"${FILESDIR}/${P}-spaced_filename.patch"
-	"${FILESDIR}/${P}-illreply.patch"
-	"${FILESDIR}/${P}-CFLAGS.patch"
-)
-
-src_unpack() {
-	default
-	mv atftp-0.7.dfsg atftp-0.7 || die
-}
-
-src_prepare() {
-	append-cppflags -D_REENTRANT -DRATE_CONTROL
-	# fix #561720 by restoring pre-GCC5 inline semantics
-	append-cflags -std=gnu89
-
-	default
-	eautoreconf
-}
-
-src_configure() {
-	econf \
-		$(use_enable tcpd libwrap) \
-		$(use_enable readline libreadline) \
-		$(use_enable pcre libpcre) \
-		--enable-mtftp
-}
-
-src_install() {
-	default
-
-	newinitd "${FILESDIR}"/atftp.init atftp
-	newconfd "${FILESDIR}"/atftp.confd atftp
-
-	systemd_dounit "${FILESDIR}"/atftp.service
-	systemd_install_serviced "${FILESDIR}"/atftp.service.conf
-
-	dodoc README* BUGS FAQ Changelog INSTALL TODO
-	dodoc "${S}"/docs/*
-
-	docinto test
-	cd "${S}"/test || die
-	dodoc load.sh mtftp.conf pcre_pattern.txt test.sh test_suite.txt
-}

diff --git a/net-ftp/atftp/files/atftp-0.7-CFLAGS.patch b/net-ftp/atftp/files/atftp-0.7-CFLAGS.patch
deleted file mode 100644
index 566c1791c59..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-CFLAGS.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- atftp-0.7/configure.ac
-+++ atftp-0.7/configure.ac
-@@ -66,29 +66,6 @@
- dnl Check for AIX
- AC_AIX
- 
--CFLAGS="-g -Wall -D_REENTRANT"
--
--if test x$debug = xtrue; then
--   CFLAGS="$CFLAGS -O0 -DDEBUG"
--else
--  if test -n "$auto_cflags"; then
--    if test -n "$GCC"; then
--      CFLAGS="$CFLAGS -g -O2 -Wall -Wno-implicit"
--    else
--      case "$host_os" in
--        *hpux*)  CFLAGS="$CFLAGS +O3"
--	  ;;
--        *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000"
--	  ;;
--        *)       CFLAGS="$CFLAGS -O2"
--	  ;;
--      esac
--    fi
--  else
--    CFLAGS="$CFLAGS -O2"
--  fi
--fi
--
- AC_PROG_MAKE_SET
- AC_PROG_INSTALL
- 

diff --git a/net-ftp/atftp/files/atftp-0.7-blockno.patch b/net-ftp/atftp/files/atftp-0.7-blockno.patch
deleted file mode 100644
index 6a3184f98be..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-blockno.patch
+++ /dev/null
@@ -1,136 +0,0 @@
---- 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-glibc24.patch b/net-ftp/atftp/files/atftp-0.7-glibc24.patch
deleted file mode 100644
index 195aec69b02..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-glibc24.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- atftp-0.7/stats.c.org
-+++ atftp-0.7/stats.c
-@@ -18,6 +18,7 @@
- 
- #include <limits.h>
- #include <string.h>
-+#include <unistd.h>
- #include "tftp_def.h"
- #include "stats.h"
- #include "logger.h"
-@@ -157,8 +158,9 @@
- 
-      logger(LOG_INFO, "  Load measurements:");
-+	  long sc_clk_tck = sysconf(_SC_CLK_TCK);
-      logger(LOG_INFO, "   User: %8.3fs  Sys:%8.3fs",
--            (double)(s_stats.tms.tms_utime) / CLK_TCK,
--            (double)(s_stats.tms.tms_stime) / CLK_TCK);
-+            (double)(s_stats.tms.tms_utime) / sc_clk_tck,
-+            (double)(s_stats.tms.tms_stime) / sc_clk_tck);
-      logger(LOG_INFO, "   Total:%8.3fs  CPU:%8.3f%%", 
-             (double)(tmp.tv_sec + tmp.tv_usec * 1e-6),
-             (double)(s_stats.tms.tms_utime + s_stats.tms.tms_stime) /

diff --git a/net-ftp/atftp/files/atftp-0.7-illreply.patch b/net-ftp/atftp/files/atftp-0.7-illreply.patch
deleted file mode 100644
index 0f1cacd9b95..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-illreply.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-*** atftp-0.7/tftp_def.old.c      2009-02-28 17:56:12.000000000 +0100
---- atftp-0.7/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-password.patch b/net-ftp/atftp/files/atftp-0.7-password.patch
deleted file mode 100644
index 26b59085dde..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-password.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-diff -Naur atftp-0.7.orig/tftp.c atftp-0.7/tftp.c
---- atftp-0.7.orig/tftp.c	2004-03-15 18:55:56.000000000 -0500
-+++ atftp-0.7/tftp.c	2005-08-29 21:40:06.000000000 -0400
-@@ -525,6 +525,10 @@
-                fprintf(stderr, "  multicast: enabled\n");
-           else
-                fprintf(stderr, "  multicast: disabled\n");
-+          if (data.tftp_options[OPT_PASSWORD].specified)
-+               fprintf(stderr, "   password: enabled\n");
-+          else
-+               fprintf(stderr, "   password: disabled\n");
-           return ERR;
-      }
-      /* if disabling an option */
-@@ -971,6 +975,7 @@
-           { "put", 0, NULL, 'p'},
-           { "local-file", 1, NULL, 'l'},
-           { "remote-file", 1, NULL, 'r'},
-+          { "password", 1, NULL, 'P'},
-           { "tftp-timeout", 1, NULL, 'T'},
-           { "mode", 1, NULL, 'M'},
-           { "option", 1, NULL, 'O'},
-@@ -993,7 +998,7 @@
-      };
- 
-      /* Support old argument until 0.8 */
--     while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:sm",
-+     while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:smP:",
-                              options, &option_index)) != EOF)
-      {
-           switch (c)
-@@ -1028,6 +1033,11 @@
-                else
-                     action = PUT;
-                break;
-+          case 'P':
-+               snprintf(string, sizeof(string), "option password %s", optarg);
-+               make_arg(string, &ac, &av);
-+               process_cmd(ac, av);
-+               break;
-           case 'l':
-                interactive = 0;
-                Strncpy(local_file, optarg, MAXLEN);
-@@ -1169,6 +1179,7 @@
-              "  -p, --put                : put file\n"
-              "  -l, --local-file <file>  : local file name\n"
-              "  -r, --remote-file <file> : remote file name\n"
-+             "  -P, --password <password>: specify password (Linksys ext.)\n"
-              "  --tftp-timeout <value>   : delay before retransmission, client side\n"
- #if 0
-              "  t, --timeout <value>      : delay before retransmission, "
-diff -Naur atftp-0.7.orig/tftp_def.c atftp-0.7/tftp_def.c
---- atftp-0.7.orig/tftp_def.c	2004-02-12 22:16:09.000000000 -0500
-+++ atftp-0.7/tftp_def.c	2005-08-29 21:36:57.000000000 -0400
-@@ -37,6 +37,7 @@
-      { "timeout", "5", 0, 1 },  /* 2348, 2349, 2090.  */
-      { "blksize", "512", 0, 1 }, /* This is the default option */
-      { "multicast", "", 0, 1 }, /* structure */
-+     { "password", "", 0, 1},   /* password */
-      { "", "", 0, 0}
- };
- 
-diff -Naur atftp-0.7.orig/tftp_def.h atftp-0.7/tftp_def.h
---- atftp-0.7.orig/tftp_def.h	2004-02-12 22:16:09.000000000 -0500
-+++ atftp-0.7/tftp_def.h	2005-08-29 20:16:27.000000000 -0400
-@@ -40,6 +40,7 @@
- #define OPT_TIMEOUT   3
- #define OPT_BLKSIZE   4
- #define OPT_MULTICAST 5
-+#define OPT_PASSWORD  6
- #define OPT_NUMBER    7
- 
- #define OPT_SIZE     12
-diff -Naur atftp-0.7.orig/tftp_io.c atftp-0.7/tftp_io.c
---- atftp-0.7.orig/tftp_io.c	2004-02-18 20:30:00.000000000 -0500
-+++ atftp-0.7/tftp_io.c	2005-08-29 22:05:11.000000000 -0400
-@@ -70,10 +70,13 @@
-                break;
-           if (tftp_options[i].enabled && tftp_options[i].specified)
-           {
--               Strncpy(data_buffer + buf_index, tftp_options[i].option,
--                       data_buffer_size - buf_index);
--               buf_index += strlen(tftp_options[i].option);
--               buf_index++;    
-+               if (i != OPT_PASSWORD)
-+               {
-+                   Strncpy(data_buffer + buf_index, tftp_options[i].option,
-+                           data_buffer_size - buf_index);
-+                   buf_index += strlen(tftp_options[i].option);
-+                   buf_index++;    
-+               }
-                Strncpy(data_buffer + buf_index, tftp_options[i].value,
-                        data_buffer_size - buf_index);
-                buf_index += strlen(tftp_options[i].value);

diff --git a/net-ftp/atftp/files/atftp-0.7-pcre.patch b/net-ftp/atftp/files/atftp-0.7-pcre.patch
deleted file mode 100644
index 1f24b67471e..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-pcre.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- atftp-0.7/tftpd_pcre.c~	2005-10-17 23:14:52.000000000 +0200
-+++ atftp-0.7/tftpd_pcre.c	2005-10-17 23:14:52.000000000 +0200
-@@ -211,9 +211,9 @@
-                chp++; /* point to value indicating substring */
-                rc = pcre_get_substring(str, ovector, matches, *chp - 0x30, &tmpstr);
-                /* found string */
--               if (rc > 0)
-+               if (rc > 0 && outchp - outstr + rc+1 < outsize)
-                {
--                    Strncpy(outchp, tmpstr, rc);
-+                    Strncpy(outchp, tmpstr, rc+1);
-                     outchp += rc;
-                     pcre_free_substring(tmpstr);
-                     continue;

diff --git a/net-ftp/atftp/files/atftp-0.7-spaced_filename.patch b/net-ftp/atftp/files/atftp-0.7-spaced_filename.patch
deleted file mode 100644
index da96d9f6b82..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-spaced_filename.patch
+++ /dev/null
@@ -1,96 +0,0 @@
---- 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)
- {

diff --git a/net-ftp/atftp/files/atftp-0.7-tests.patch b/net-ftp/atftp/files/atftp-0.7-tests.patch
deleted file mode 100644
index 9e087950e65..00000000000
--- a/net-ftp/atftp/files/atftp-0.7-tests.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -Naur atftp-0.7.orig/test/test.sh atftp-0.7/test/test.sh
---- atftp-0.7.orig/test/test.sh	2003-04-28 21:59:51.000000000 -0400
-+++ atftp-0.7/test/test.sh	2005-10-26 22:42:15.000000000 -0400
-@@ -151,7 +151,7 @@
- test_blocksize 1428
- test_blocksize 16000
- test_blocksize 64000
--test_blocksize 65465
-+test_blocksize 65464
- 
- #
- # testing fot tsize
-@@ -162,9 +162,9 @@
- TSIZE=`grep "OACK <tsize:" out | sed -e "s/[^0-9]//g"`
- if [ "$TSIZE" != "2048" ]; then
-     echo "ERROR (server report $TSIZE bytes but it should be 2048)"
-+    ERROR=1
- else
-     echo "OK"
--    ERROR=1
- fi
- 
- #


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-ftp/atftp/files/, net-ftp/atftp/
@ 2021-01-22 12:31 Tobias Klausmann
  0 siblings, 0 replies; 5+ messages in thread
From: Tobias Klausmann @ 2021-01-22 12:31 UTC (permalink / raw
  To: gentoo-commits

commit:     151740dee902b137e326f997a3e8486242b70b71
Author:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 12:30:34 2021 +0000
Commit:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 12:30:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=151740de

net-ftp/atftp: Add patch that reduces # of seeks

Bug: https://bugs.gentoo.org/713672
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Tobias Klausmann <klausman <AT> gentoo.org>

 net-ftp/atftp/atftp-0.7.2-r3.ebuild               | 69 +++++++++++++++++++++++
 net-ftp/atftp/files/atftp-0.7.2-fewer_seeks.patch | 38 +++++++++++++
 2 files changed, 107 insertions(+)

diff --git a/net-ftp/atftp/atftp-0.7.2-r3.ebuild b/net-ftp/atftp/atftp-0.7.2-r3.ebuild
new file mode 100644
index 00000000000..0b2c1e633f9
--- /dev/null
+++ b/net-ftp/atftp/atftp-0.7.2-r3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools flag-o-matic systemd
+
+DESCRIPTION="Advanced TFTP implementation client/server"
+HOMEPAGE="https://sourceforge.net/projects/atftp/"
+SRC_URI="mirror://sourceforge/atftp/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="selinux tcpd readline pcre"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+	readline? ( sys-libs/readline:0= )
+	pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}
+	!net-ftp/tftp-hpa
+	!net-ftp/uftpd
+	selinux? ( sec-policy/selinux-tftp )"
+BDEPEND=""
+
+PATCHES=(
+	"${FILESDIR}/${P}-CFLAGS.patch"
+	"${FILESDIR}/${P}-cve-2020-6097.patch"
+	"${FILESDIR}/${P}-fewer_seeks.patch"
+)
+
+src_prepare() {
+	append-cppflags -D_REENTRANT -DRATE_CONTROL
+	# fix #561720 by restoring pre-GCC5 inline semantics
+	append-cflags -std=gnu89
+
+	default
+	eautoreconf
+}
+
+src_configure() {
+	econf \
+		$(use_enable tcpd libwrap) \
+		$(use_enable readline libreadline) \
+		$(use_enable pcre libpcre) \
+		--enable-mtftp
+}
+
+src_test() {
+	cd "${S}"/test || die
+	# Try to run the tests
+	./test.sh || die
+}
+
+src_install() {
+	default
+
+	newinitd "${FILESDIR}"/atftp.init atftp
+	newconfd "${FILESDIR}"/atftp.confd atftp
+
+	systemd_dounit "${FILESDIR}"/atftp.service
+	systemd_install_serviced "${FILESDIR}"/atftp.service.conf
+
+	dodoc README* BUGS FAQ Changelog INSTALL TODO
+	dodoc "${S}"/docs/*
+
+	docinto test
+	cd "${S}"/test || die
+	dodoc load.sh mtftp.conf pcre_pattern.txt test.sh test_suite.txt
+}

diff --git a/net-ftp/atftp/files/atftp-0.7.2-fewer_seeks.patch b/net-ftp/atftp/files/atftp-0.7.2-fewer_seeks.patch
new file mode 100644
index 00000000000..78926b94b9f
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7.2-fewer_seeks.patch
@@ -0,0 +1,38 @@
+<F28>diff -U8 atftp-0.7.2/tftp_io.c /var/tmp/portage/net-ftp/atftp-0.7.2-r1/work/atftp-0.7.2/tftp_io.c
+--- atftp-0.7.2/tftp_io.c	2019-04-14 17:38:55.000000000 -0500
++++ /var/tmp/portage/net-ftp/atftp-0.7.2-r1/work/atftp-0.7.2/tftp_io.c	2020-03-16 12:55:22.371820662 -0500
+@@ -439,26 +439,32 @@
+ }
+ 
+ /*
+  * Write to file and do netascii conversion if needed
+  */
+ int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, long block_number, int data_size,
+                     int convert, long *prev_block_number, int *temp)
+ {
++     static long filepos;
+      int bytes_written;
+      int c;
+      char prevchar = *temp;
+ 
+      if (!convert)
+      {
+ 	  /* Simple case, just seek and write */
+-          if (fseek(fp, (block_number - 1) * data_buffer_size, SEEK_SET) != 0)
+-	      return 0;
++          long position = (block_number - 1)*data_buffer_size;
++          if (position != filepos)
++               if (fseek(fp, position, SEEK_SET) != 0)
++                    return 0;
++               else
++                    filepos = position;
+ 	  bytes_written = fwrite(data_buffer, 1, data_size, fp);
++          filepos += bytes_written;
+      }
+      else if (block_number != *prev_block_number)
+      {
+ 	  /* 
+ 	   * Same principle than for reading, but simpler since when client
+            * send same block twice there is no need to rewrite it to the
+            * file
+ 	   */


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-ftp/atftp/files/, net-ftp/atftp/
@ 2021-09-14 20:15 Tobias Klausmann
  0 siblings, 0 replies; 5+ messages in thread
From: Tobias Klausmann @ 2021-09-14 20:15 UTC (permalink / raw
  To: gentoo-commits

commit:     3434fdb7c1eba3721771dece9523b70d9775bbe1
Author:     Martin Dummer <martin.dummer <AT> gmx <DOT> net>
AuthorDate: Mon Sep 13 23:27:44 2021 +0000
Commit:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Tue Sep 14 20:15:04 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3434fdb7

net-ftp/atftp: version bump to 0.7.5

Version 0.7.5 (Bugfix, Security Fix Release)

fix many bugs, fix denial-of-service buffer overflow CVE-2021-41054
new feature: add an option to prevent the Sorcerer's Apprentice Syndrome

Closes: https://bugs.gentoo.org/813079
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Martin Dummer <martin.dummer <AT> gmx.net>
Signed-off-by: Tobias Klausmann <klausman <AT> gentoo.org>

 net-ftp/atftp/Manifest                       |  1 +
 net-ftp/atftp/atftp-0.7.5.ebuild             | 66 ++++++++++++++++++++++++++++
 net-ftp/atftp/files/atftp-0.7.5-CFLAGS.patch | 32 ++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/net-ftp/atftp/Manifest b/net-ftp/atftp/Manifest
index 787aa4f6ca3..1002d6b53aa 100644
--- a/net-ftp/atftp/Manifest
+++ b/net-ftp/atftp/Manifest
@@ -1 +1,2 @@
 DIST atftp-0.7.4.tar.gz 249699 BLAKE2B 8aa30df1cc92982b0e718cd9bcc68cf397e29f6abb795cf9fdfd0b9942d9a7dd16beafb24d69d7339f9ab4cbda16404eadf40096a8dfdb684fbc7ec1c7f81c9f SHA512 f9ff9b72b7d1d659d4ca00d990c28b9da8dea0228e66610ee2d17a3959fcd142998a7539f8ea68effdfe830d2f5e68c154a2911afb9cad52acd24a6a642d76a4
+DIST atftp-0.7.5.tar.gz 253626 BLAKE2B aa0a0311d29fd52b77f8ae021407221f815a39fe85cabac36ee18dce8918a5b0accda455e2df5fecf34f09e93e583bfbc86162b60a7237bd6d34b0c658ec2970 SHA512 457101136e59f7a1657ce591e9ea678ab9091a59219d41b6c522fad4a3555c5cbcb8c9e0c3267fd871940d99b5f8673ab4ce5ec9737dee52f017e5c80a4e59d7

diff --git a/net-ftp/atftp/atftp-0.7.5.ebuild b/net-ftp/atftp/atftp-0.7.5.ebuild
new file mode 100644
index 00000000000..001bba2e825
--- /dev/null
+++ b/net-ftp/atftp/atftp-0.7.5.ebuild
@@ -0,0 +1,66 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools flag-o-matic systemd
+
+DESCRIPTION="Advanced TFTP implementation client/server"
+HOMEPAGE="https://sourceforge.net/projects/atftp/"
+SRC_URI="mirror://sourceforge/atftp/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="selinux tcpd readline pcre"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+	readline? ( sys-libs/readline:0= )
+	pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}
+	!net-ftp/tftp-hpa
+	!net-ftp/uftpd
+	selinux? ( sec-policy/selinux-tftp )"
+BDEPEND=""
+
+PATCHES=(
+	"${FILESDIR}/${P}-CFLAGS.patch"
+)
+
+src_prepare() {
+	append-cppflags -D_REENTRANT -DRATE_CONTROL
+	# fix #561720 by restoring pre-GCC5 inline semantics
+	append-cflags -std=gnu89
+
+	default
+	eautoreconf
+}
+
+src_configure() {
+	econf \
+		$(use_enable tcpd libwrap) \
+		$(use_enable readline libreadline) \
+		$(use_enable pcre libpcre) \
+		--enable-mtftp
+}
+
+src_test() {
+	cd "${S}"/test || die
+	TEMPDIR=. ./test.sh || die
+}
+
+src_install() {
+	default
+
+	newinitd "${FILESDIR}"/atftp.init atftp
+	newconfd "${FILESDIR}"/atftp.confd atftp
+
+	systemd_dounit "${FILESDIR}"/atftp.service
+	systemd_install_serviced "${FILESDIR}"/atftp.service.conf
+
+	dodoc README* BUGS FAQ Changelog INSTALL TODO
+	dodoc "${S}"/docs/*
+
+	docinto test
+	cd "${S}"/test || die
+	dodoc load.sh mtftp.conf pcre_pattern.txt test.sh test_suite.txt
+}

diff --git a/net-ftp/atftp/files/atftp-0.7.5-CFLAGS.patch b/net-ftp/atftp/files/atftp-0.7.5-CFLAGS.patch
new file mode 100644
index 00000000000..4f68d97f800
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7.5-CFLAGS.patch
@@ -0,0 +1,32 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,29 +69,6 @@
+ dnl Check for AIX
+ AC_AIX
+ 
+-CFLAGS="$CFLAGS -g -Wall -D_REENTRANT"
+-
+-if test x$debug = xtrue; then
+-   CFLAGS="$CFLAGS -O0 -DDEBUG"
+-else
+-  if test -n "$auto_cflags"; then
+-    if test -n "$GCC"; then
+-      CFLAGS="$CFLAGS -g -O2 -Wall -Wno-implicit"
+-    else
+-      case "$host_os" in
+-        *hpux*)  CFLAGS="$CFLAGS +O3"
+-	  ;;
+-        *ultrix* | *osf*) CFLAGS="$CFLAGS -O -Olimit 2000"
+-	  ;;
+-        *)       CFLAGS="$CFLAGS -O2"
+-	  ;;
+-      esac
+-    fi
+-  else
+-    CFLAGS="$CFLAGS -O2"
+-  fi
+-fi
+-
+ case "$CC" in
+ 	gcc*|clang*) CFLAGS="$CFLAGS -std=gnu89"
+ 	;;


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-ftp/atftp/files/, net-ftp/atftp/
@ 2022-10-02 18:13 Florian Schmaus
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Schmaus @ 2022-10-02 18:13 UTC (permalink / raw
  To: gentoo-commits

commit:     26e98ee46c47a1304a9e39010b32b7a846191ed9
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  2 18:00:00 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Sun Oct  2 18:11:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26e98ee4

net-ftp/atftp: update EAPI 7 -> 8, drop BDEPEND, add fix for test.sh

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-ftp/atftp/atftp-0.8.0.ebuild                       |  7 ++++---
 .../files/atftp-0.8.0-test-sh-declare-local.patch      | 18 ++++++++++++++++++
 net-ftp/atftp/files/atftp-fix-test.patch               | 12 +++++++++---
 3 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/net-ftp/atftp/atftp-0.8.0.ebuild b/net-ftp/atftp/atftp-0.8.0.ebuild
index 7f0f4082403c..aab4115beae9 100644
--- a/net-ftp/atftp/atftp-0.8.0.ebuild
+++ b/net-ftp/atftp/atftp-0.8.0.ebuild
@@ -1,7 +1,8 @@
 # Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
+
 inherit autotools flag-o-matic systemd
 
 DESCRIPTION="Advanced TFTP implementation client/server"
@@ -20,11 +21,11 @@ RDEPEND="${DEPEND}
 	!net-ftp/tftp-hpa
 	!net-ftp/uftpd
 	selinux? ( sec-policy/selinux-tftp )"
-BDEPEND="${DEPEND}"
 
 PATCHES=(
 	"${FILESDIR}/${PN}-0.7.5-CFLAGS.patch"
-	"${FILESDIR}/atftp-fix-test.patch"
+	"${FILESDIR}/${PN}-0.8.0-test-sh-declare-local.patch" # https://sourceforge.net/p/atftp/bugs/12/
+	"${FILESDIR}/${PN}-fix-test.patch" # https://sourceforge.net/p/atftp/bugs/11/
 )
 
 src_prepare() {

diff --git a/net-ftp/atftp/files/atftp-0.8.0-test-sh-declare-local.patch b/net-ftp/atftp/files/atftp-0.8.0-test-sh-declare-local.patch
new file mode 100644
index 000000000000..de63fc03a626
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.8.0-test-sh-declare-local.patch
@@ -0,0 +1,18 @@
+From a718243fe78fe9002b4145a158e02801e907399b Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Sun, 2 Oct 2022 19:47:47 +0200
+Subject: [PATCH 1/2] Declare variable D as local in stop_and_clean
+
+This also fixes tests in Gentoo, where src_test() has already declare
+a variable D, containing the path of the temporary install
+directory (aka. DESTDIR).
+--- a/test/test.sh
++++ b/test/test.sh
+@@ -576,6 +576,7 @@ stop_and_clean(){
+     ## +3 is for "Test tsize option ..." and "Test PCRE mapped download ... "
+     ## +2 for diskspace tests:
+     local M=$(grep "/tmp/" "$TDIR"/multicast*.log | wc -l)
++    local D
+     $INTERACTIVE && D=2
+     cat <<EOF
+ Expected:

diff --git a/net-ftp/atftp/files/atftp-fix-test.patch b/net-ftp/atftp/files/atftp-fix-test.patch
index 67845c244a2e..1b2eba57c49f 100644
--- a/net-ftp/atftp/files/atftp-fix-test.patch
+++ b/net-ftp/atftp/files/atftp-fix-test.patch
@@ -1,11 +1,17 @@
+From f7ccbf188cd682f7210a2253187e460f0fe5d647 Mon Sep 17 00:00:00 2001
+From: Martin Dummer <martin.dummer@gmx.net>
+Date: Sun, 2 Oct 2022 19:49:44 +0200
+Subject: [PATCH 2/2] test.sh: redirect stderr to /dev/null when counting lines
+
+To avoid counting stderr lines, redirect the output to /dev/null.
 --- a/test/test.sh
 +++ b/test/test.sh
-@@ -575,7 +575,7 @@
+@@ -575,7 +575,7 @@ stop_and_clean(){
      echo
      ## +3 is for "Test tsize option ..." and "Test PCRE mapped download ... "
      ## +2 for diskspace tests:
 -    local M=$(grep "/tmp/" "$TDIR"/multicast*.log | wc -l)
-+    local M=$(grep "/tmp/" "$TDIR"/multicast*.log 2>/dev/null | wc -l)
++    local M=$(grep "/tmp/" "$TDIR"/multicast*.log 2> /dev/null | wc -l)
+     local D
      $INTERACTIVE && D=2
      cat <<EOF
- Expected:


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-02 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-14 18:31 [gentoo-commits] repo/gentoo:master commit in: net-ftp/atftp/files/, net-ftp/atftp/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2020-03-07 17:59 Tobias Klausmann
2021-01-22 12:31 Tobias Klausmann
2021-09-14 20:15 Tobias Klausmann
2022-10-02 18:13 Florian Schmaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox