From 8c4e7c2908bf6a42ad56453e4b253b37b63b23a9 Mon Sep 17 00:00:00 2001 From: Jan-Espen Oversand Date: Tue, 13 Dec 2022 19:31:51 +0100 Subject: [PATCH] Fix implicit setproctitle, also this is libbsd so libbsd is a runtime depencency. Also fix implicit getpt, grantpt, ptsname, by enabling nonstandard (_GNU_SOURCE) gnu extensions and extra open/posix (_XOPEN_SOURCE). Bug: https://bugs.gentoo.org/875443 Signed-off-by: Jan-Espen Oversand --- net-vpn/vtun/files/vtun-3.0.3-includes.patch | 12 +++++++++- net-vpn/vtun/files/vtun-3.0.4-includes.patch | 24 +++++++++++++++++++- net-vpn/vtun/vtun-3.0.3-r2.ebuild | 3 ++- net-vpn/vtun/vtun-3.0.4.ebuild | 3 ++- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/net-vpn/vtun/files/vtun-3.0.3-includes.patch b/net-vpn/vtun/files/vtun-3.0.3-includes.patch index 46ff5eca90a45..517ddf3cbb9c2 100644 --- a/net-vpn/vtun/files/vtun-3.0.3-includes.patch +++ b/net-vpn/vtun/files/vtun-3.0.3-includes.patch @@ -20,14 +20,24 @@ #include "linkfd.h" --- a/lib.h +++ b/lib.h -@@ -26,6 +26,7 @@ +@@ -26,6 +26,8 @@ #include #include #include +#include /* read(), write() */ ++#include /* setproctitle(), see man libbsd(7) */ #ifdef HAVE_LIBUTIL_H #include +@@ -35,7 +37,7 @@ + void init_title(int argc,char *argv[],char *env[], char *name); + void set_title(const char *ftm, ...); + #else +- #define init_title( a... ) ++ #define init_title(argc, argv, env, name) setproctitle_init(argc, argv, env) + #define set_title setproctitle + #endif /* HAVE_SETPROC_TITLE */ + --- a/vtun.h +++ b/vtun.h @@ -232,5 +232,9 @@ diff --git a/net-vpn/vtun/files/vtun-3.0.4-includes.patch b/net-vpn/vtun/files/vtun-3.0.4-includes.patch index d17e4acbc5c4e..06546c6bd815f 100644 --- a/net-vpn/vtun/files/vtun-3.0.4-includes.patch +++ b/net-vpn/vtun/files/vtun-3.0.4-includes.patch @@ -20,14 +20,24 @@ #include "linkfd.h" --- a/lib.h +++ b/lib.h -@@ -26,6 +26,7 @@ +@@ -26,6 +26,8 @@ #include #include #include +#include /* read(), write() */ ++#include /* setproctitle(), see man libbsd(7) */ #ifdef HAVE_LIBUTIL_H #include +@@ -35,7 +37,7 @@ + void init_title(int argc,char *argv[],char *env[], char *name); + void set_title(const char *ftm, ...); + #else +- #define init_title( a... ) ++ #define init_title(argc, argv, env, name) setproctitle_init(argc, argv, env) + #define set_title setproctitle + #endif /* HAVE_SETPROC_TITLE */ + --- a/lock.c +++ b/lock.c @@ -32,6 +32,7 @@ @@ -48,3 +58,15 @@ #include "vtun.h" #include "linkfd.h" +--- a/generic/pty_dev.c ++++ b/generic/pty_dev.c +@@ -22,6 +22,8 @@ + + #include "config.h" + ++#define _GNU_SOURCE // getpt, grantpt ++#define _XOPEN_SOURCE // unlockpt + #include + #include + #include + diff --git a/net-vpn/vtun/vtun-3.0.3-r2.ebuild b/net-vpn/vtun/vtun-3.0.3-r2.ebuild index 2152bb74e3cef..24c70ece3616b 100644 --- a/net-vpn/vtun/vtun-3.0.3-r2.ebuild +++ b/net-vpn/vtun/vtun-3.0.3-r2.ebuild @@ -18,7 +18,8 @@ RDEPEND=" lzo? ( dev-libs/lzo:2 ) socks5? ( net-proxy/dante ) ssl? ( dev-libs/openssl:0= ) - zlib? ( sys-libs/zlib )" + zlib? ( sys-libs/zlib ) + dev-libs/libbsd" DEPEND="${RDEPEND}" BDEPEND="sys-devel/bison" diff --git a/net-vpn/vtun/vtun-3.0.4.ebuild b/net-vpn/vtun/vtun-3.0.4.ebuild index a1c1e76bb4710..800d5d0feb11e 100644 --- a/net-vpn/vtun/vtun-3.0.4.ebuild +++ b/net-vpn/vtun/vtun-3.0.4.ebuild @@ -18,7 +18,8 @@ RDEPEND=" lzo? ( dev-libs/lzo:2 ) socks5? ( net-proxy/dante ) ssl? ( dev-libs/openssl:0= ) - zlib? ( sys-libs/zlib )" + zlib? ( sys-libs/zlib ) + dev-libs/libbsd" DEPEND="${RDEPEND}" BDEPEND="sys-devel/bison"