git: c3fa99245291 - main - net/dante: add missing getsockopt() interposition to fix the build

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Mon, 26 Feb 2024 12:39:09 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c3fa9924529148735c04a0d1c8444b9942e472d3

commit c3fa9924529148735c04a0d1c8444b9942e472d3
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2024-02-26 12:38:22 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2024-02-26 12:38:22 +0000

    net/dante: add missing getsockopt() interposition to fix the build
    
    Discovered with --no-undefined-version being enabled by default in
    newish LLD.  While here, drop CONFLICTS against `net/socks5' which
    was removed from the ports tree back in 2012.
    
    PR:             276938
    Reported by:    pkg-fallout
---
 net/dante/Makefile                         |  2 --
 net/dante/files/patch-dlib_interposition.c | 31 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/net/dante/Makefile b/net/dante/Makefile
index 458dbabda958..8bbb0261a7b6 100644
--- a/net/dante/Makefile
+++ b/net/dante/Makefile
@@ -14,8 +14,6 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 LIB_DEPENDS=	libminiupnpc.so:net/miniupnpc \
 		libsasl2.so:security/cyrus-sasl2
 
-CONFLICTS=	socks5
-
 USES=		libtool localbase
 GNU_CONFIGURE=	yes
 GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
diff --git a/net/dante/files/patch-dlib_interposition.c b/net/dante/files/patch-dlib_interposition.c
new file mode 100644
index 000000000000..cf6b642130d8
--- /dev/null
+++ b/net/dante/files/patch-dlib_interposition.c
@@ -0,0 +1,31 @@
+--- dlib/interposition.c.orig	2020-11-11 16:11:56 UTC
++++ dlib/interposition.c
+@@ -1736,7 +1736,7 @@ getsockopt(s, level, optname, optval, optlen)
+    HAVE_PROT_GETSOCKOPT_4 optval;
+    HAVE_PROT_GETSOCKOPT_5 optlen;
+ {
+-   if (socks_issyscall(s, SYMBOL_GETSOCKNAME))
++   if (socks_issyscall(s, SYMBOL_GETSOCKOPT))
+       return sys_getsockopt(s, level, optname, optval, optlen);
+    return Rgetsockopt(s, level, optname, optval, optlen);
+ }
+@@ -2168,6 +2168,19 @@ _getsockname(s, name, namelen)
+    if (socks_issyscall(s, SYMBOL_GETSOCKNAME))
+       return sys_getsockname(s, name, namelen);
+    return Rgetsockname(s, name, namelen);
++}
++
++HAVE_PROT_GETSOCKOPT_0
++_getsockopt(s, level, optname, optval, optlen)
++   HAVE_PROT_GETSOCKOPT_1 s;
++   HAVE_PROT_GETSOCKOPT_2 level;
++   HAVE_PROT_GETSOCKOPT_3 optname;
++   HAVE_PROT_GETSOCKOPT_4 optval;
++   HAVE_PROT_GETSOCKOPT_5 optlen;
++{
++   if (socks_issyscall(s, SYMBOL_GETSOCKOPT))
++      return sys_getsockopt(s, level, optname, optval, optlen);
++   return Rgetsockopt(s, level, optname, optval, optlen);
+ }
+ 
+ HAVE_PROT_LISTEN_0