From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A99311382C5 for ; Mon, 25 Jan 2021 18:28:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D58F7E09CE; Mon, 25 Jan 2021 18:28:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A6FD2E09CE for ; Mon, 25 Jan 2021 18:28:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 687DF341088 for ; Mon, 25 Jan 2021 18:28:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C6B464C for ; Mon, 25 Jan 2021 18:28:16 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1611599293.20d6a21ff3e24e24a52cafaa640344d7dfaf59a3.floppym@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/iputils/files/, net-misc/iputils/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/iputils/files/iputils-20200821-fclose.patch net-misc/iputils/files/iputils-20200821-install-sbindir.patch net-misc/iputils/iputils-20200821-r1.ebuild net-misc/iputils/iputils-20200821-r2.ebuild X-VCS-Directories: net-misc/iputils/files/ net-misc/iputils/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 20d6a21ff3e24e24a52cafaa640344d7dfaf59a3 X-VCS-Branch: master Date: Mon, 25 Jan 2021 18:28:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 145d5cb6-4fc6-4b2c-8569-71828aeb4d91 X-Archives-Hash: 5cdd8ed1f1f2ad724dac46f812b6d411 commit: 20d6a21ff3e24e24a52cafaa640344d7dfaf59a3 Author: Mike Gilbert gentoo org> AuthorDate: Mon Jan 25 18:27:17 2021 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Mon Jan 25 18:28:13 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20d6a21f net-misc/iputils: backport tftpd fixes Closes: https://bugs.gentoo.org/738872 Signed-off-by: Mike Gilbert gentoo.org> .../iputils/files/iputils-20200821-fclose.patch | 45 ++++++++++++++++++++++ .../files/iputils-20200821-install-sbindir.patch | 29 ++++++++++++++ ...200821-r1.ebuild => iputils-20200821-r2.ebuild} | 2 + 3 files changed, 76 insertions(+) diff --git a/net-misc/iputils/files/iputils-20200821-fclose.patch b/net-misc/iputils/files/iputils-20200821-fclose.patch new file mode 100644 index 00000000000..cc370f0a556 --- /dev/null +++ b/net-misc/iputils/files/iputils-20200821-fclose.patch @@ -0,0 +1,45 @@ +From e1c3d09b412ad0d022178344b8cbf748dc60f17f Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Sun, 24 Jan 2021 23:29:27 -0500 +Subject: [PATCH] tftpd: recvfile: avoid closing the file twice + +The close_stream function calls fclose, so don't call it again. + +This resolves an abort in glibc: + + Message: Process 1038079 (tftpd) of user 65534 dumped core. + + Stack trace of thread 1038079: + #0 0x00007f5f650ed204 raise (libc.so.6 + 0x39204) + #1 0x00007f5f650d6547 abort (libc.so.6 + 0x22547) + #2 0x00007f5f6512f25f n/a (libc.so.6 + 0x7b25f) + #3 0x00007f5f651372fa n/a (libc.so.6 + 0x832fa) + #4 0x00007f5f65138dc2 n/a (libc.so.6 + 0x84dc2) + #5 0x00007f5f65124b2f fclose (libc.so.6 + 0x70b2f) + #6 0x000055571a50de73 recvfile (tftpd + 0x2e73) + #7 0x000055571a50e064 tftp (tftpd + 0x3064) + #8 0x000055571a50e387 tftpd_inetd (tftpd + 0x3387) + #9 0x000055571a50e50f main (tftpd + 0x350f) + #10 0x00007f5f650d7e6d __libc_start_main (libc.so.6 + 0x23e6d) + #11 0x000055571a50d3ca _start (tftpd + 0x23ca) + +Fixes: 5d6be65 ("tftpd: remove global variables by using a run state struct") + +Reviewed-by: Petr Vorel +Signed-off-by: Mike Gilbert +--- + tftpd/tftpd.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c +index 42998f9b..a09d32ba 100644 +--- a/tftpd/tftpd.c ++++ b/tftpd/tftpd.c +@@ -387,7 +387,6 @@ void recvfile(struct run_state *ctl, struct formats *pf) + write_behind(ctl->file, pf->f_convert); + if (close_stream(ctl->file)) + syslog(LOG_ERR, "tftpd: write error: %s\n", strerror(errno)); +- fclose(ctl->file); /* close data file */ + + ap->th_opcode = htons((uint16_t)ACK); /* send the "final" ack */ + ap->th_block = htons(block); diff --git a/net-misc/iputils/files/iputils-20200821-install-sbindir.patch b/net-misc/iputils/files/iputils-20200821-install-sbindir.patch new file mode 100644 index 00000000000..cb1575841cc --- /dev/null +++ b/net-misc/iputils/files/iputils-20200821-install-sbindir.patch @@ -0,0 +1,29 @@ +From 8d1420f3019cd1caccf2ffa15a5873f0c61ab529 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Sun, 24 Jan 2021 22:39:03 -0500 +Subject: [PATCH] tftpd: install into sbindir + +The xinet.d config expects the daemon to live in sbindir. + +Closes: https://github.com/iputils/iputils/pull/310 + +Reviewed-by: Petr Vorel +Signed-off-by: Mike Gilbert +--- + tftpd/meson.build | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tftpd/meson.build b/tftpd/meson.build +index 6e508a24..b4cf6812 100644 +--- a/tftpd/meson.build ++++ b/tftpd/meson.build +@@ -3,7 +3,8 @@ inc = include_directories('..') + executable('tftpd', ['tftpd.c', 'tftpsubs.c', git_version_h], + include_directories : inc, + link_with : [libcommon], +- install: true) ++ install: true, ++ install_dir: sbindir) + + subs = configuration_data() + subs.set('sbindir', sbindir) diff --git a/net-misc/iputils/iputils-20200821-r1.ebuild b/net-misc/iputils/iputils-20200821-r2.ebuild similarity index 97% rename from net-misc/iputils/iputils-20200821-r1.ebuild rename to net-misc/iputils/iputils-20200821-r2.ebuild index 3b1245c1082..a7ac2b0d2a9 100644 --- a/net-misc/iputils/iputils-20200821-r1.ebuild +++ b/net-misc/iputils/iputils-20200821-r2.ebuild @@ -63,6 +63,8 @@ fi PATCHES=( "${FILESDIR}/iputils-20200821-getrandom-fallback.patch" + "${FILESDIR}/iputils-20200821-fclose.patch" + "${FILESDIR}/iputils-20200821-install-sbindir.patch" ) src_prepare() {