Skip to content

Commit

Permalink
Fix implicit setproctitle, also this is libbsd so libbsd is a runtime
Browse files Browse the repository at this point in the history
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 <sigsegv@radiotube.org>
  • Loading branch information
leakingmemory committed Dec 13, 2022
1 parent 711c02c commit 8c4e7c2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
12 changes: 11 additions & 1 deletion net-vpn/vtun/files/vtun-3.0.3-includes.patch
Expand Up @@ -20,14 +20,24 @@
#include "linkfd.h"
--- a/lib.h
+++ b/lib.h
@@ -26,6 +26,7 @@
@@ -26,6 +26,8 @@
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
+#include <unistd.h> /* read(), write() */
+#include <bsd/unistd.h> /* setproctitle(), see man libbsd(7) */

#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
@@ -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 @@
Expand Down
24 changes: 23 additions & 1 deletion net-vpn/vtun/files/vtun-3.0.4-includes.patch
Expand Up @@ -20,14 +20,24 @@
#include "linkfd.h"
--- a/lib.h
+++ b/lib.h
@@ -26,6 +26,7 @@
@@ -26,6 +26,8 @@
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
+#include <unistd.h> /* read(), write() */
+#include <bsd/unistd.h> /* setproctitle(), see man libbsd(7) */

#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
@@ -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 @@
Expand All @@ -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 <unistd.h>
#include <fcntl.h>
#include <stdlib.h>

3 changes: 2 additions & 1 deletion net-vpn/vtun/vtun-3.0.3-r2.ebuild
Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion net-vpn/vtun/vtun-3.0.4.ebuild
Expand Up @@ -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"

Expand Down

0 comments on commit 8c4e7c2

Please sign in to comment.