commit:     c9ac47f26ac2f21c5e42f9143c1276379884cc97
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 08:42:50 2022 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 08:43:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9ac47f2

net-misc/telnet-bsd: fix bug 713790

Bug: https://bugs.gentoo.org/713790
Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>

 .../telnet-bsd/files/telnet-bsd-1.2-musl.patch     | 42 +++++++++++++++++++
 net-misc/telnet-bsd/telnet-bsd-1.2-r3.ebuild       | 49 ++++++++++++++++++++++
 2 files changed, 91 insertions(+)

diff --git a/net-misc/telnet-bsd/files/telnet-bsd-1.2-musl.patch 
b/net-misc/telnet-bsd/files/telnet-bsd-1.2-musl.patch
new file mode 100644
index 000000000000..0194015968a7
--- /dev/null
+++ b/net-misc/telnet-bsd/files/telnet-bsd-1.2-musl.patch
@@ -0,0 +1,42 @@
+diff --git a/telnet/misc-proto.h b/telnet/misc-proto.h
+index 5845751..777a700 100644
+--- a/telnet/misc-proto.h
++++ b/telnet/misc-proto.h
+@@ -63,7 +63,7 @@
+ #ifndef       __MISC_PROTO__
+ #define       __MISC_PROTO__
+ 
+-#include <sys/cdefs.h>
++#define       __P(protos) protos /* full-blown ANSI C */
+ 
+ void auth_encrypt_init __P((char *, char *, char *, int));
+ void auth_encrypt_user __P((char *));
+diff --git a/telnet/ring.h b/telnet/ring.h
+index 9ef8fb8..65762b2 100644
+--- a/telnet/ring.h
++++ b/telnet/ring.h
+@@ -28,8 +28,8 @@
+  *
+  */
+ 
+-#include <sys/cdefs.h>
+ #include <sys/types.h>
++#define       __P(protos) protos /* full-blown ANSI C */
+ #define P __P
+ 
+ /*
+diff --git a/telnetd/sys_term.c b/telnetd/sys_term.c
+index 31897d8..3c43f8f 100644
+--- a/telnetd/sys_term.c
++++ b/telnetd/sys_term.c
+@@ -838,8 +838,10 @@ cleanup (int sig)
+    * receive another signal while we're in that function. */
+   sigfillset(&sigset);
+   sigprocmask(SIG_SETMASK, &sigset, &sigset);
++#if defined(logwtmp)
+   if (logout (p))
+     logwtmp (p, "", "");
++#endif
+   sigprocmask(SIG_SETMASK, &sigset, NULL);
+ #ifdef PARANOID_TTYS
+   /*

diff --git a/net-misc/telnet-bsd/telnet-bsd-1.2-r3.ebuild 
b/net-misc/telnet-bsd/telnet-bsd-1.2-r3.ebuild
new file mode 100644
index 000000000000..65a05099bf70
--- /dev/null
+++ b/net-misc/telnet-bsd/telnet-bsd-1.2-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Telnet and telnetd ported from OpenBSD with IPv6 support"
+HOMEPAGE="ftp://ftp.suse.com/pub/people/kukuk/ipv6/";
+SRC_URI="https://dev.gentoo.org/~mschiff/distfiles/${P}.tar.bz2";
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ppc ppc64 ~s390 sparc x86 
~amd64-linux ~x86-linux ~x64-macos"
+IUSE="nls xinetd"
+
+RDEPEND="
+       sys-libs/ncurses:=
+       !net-misc/netkit-telnetd
+"
+RDEPEND="${DEPEND}
+       xinetd? ( sys-apps/xinetd   )
+       !net-misc/netkit-telnetd
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-fbsd.patch
+       "${FILESDIR}"/${PN}-1.2-format-security.patch
+       "${FILESDIR}"/${P}-musl.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_compile() {
+       emake LIBS="$("$(tc-getPKG_CONFIG)" --libs ncurses)"
+}
+
+src_install() {
+       default
+
+       if use xinetd ; then
+               insinto /etc/xinetd.d
+               newins "${FILESDIR}"/telnetd.xinetd telnetd
+       fi
+}

Reply via email to