git: 0cb87c12e5ad - main - security/ncrack: fix build on -CURRENT

From: Stefan Eßer <se_at_FreeBSD.org>
Date: Tue, 16 Jul 2024 21:06:42 UTC
The branch main has been updated by se:

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

commit 0cb87c12e5adbe78ac4a7ea2dc0f2599393b1e31
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2024-07-16 20:56:00 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2024-07-16 21:06:14 +0000

    security/ncrack: fix build on -CURRENT
    
    This port seems to have been affected by the recent FORTIFY_SOURCE
    update on -CURRENT. The error message was:
    
    In file included from strlcpy.c:21:
    In file included from ./includes.h:190:
    In file included from ./entropy.h:30:
    In file included from ./buffer.h:28:
    In file included from ./sshbuf.h:29:
    In file included from /usr/local/include/openssl/bn.h:26:
    In file included from /usr/local/include/openssl/crypto.h:25:
    In file included from /usr/include/stdlib.h:73:
    /usr/include/ssp/stdlib.h:41:33: error: static declaration of
                   '_ssh_compat_realpath' follows non-static declaration
       41 | __ssp_redirect_raw_impl(char *, realpath, realpath,
          |                                 ^
    ./openbsd-compat.h:98:7: note: previous declaration is here
       98 | char *realpath(const char *path, char *resolved);
          |       ^
    ./openbsd-compat.h:95:26: note: expanded from macro 'realpath'
       95 | #  define realpath(x, y) _ssh_compat_realpath(x, y)
          |                          ^
    2 errors generated.
---
 security/ncrack/Makefile                                |  2 +-
 security/ncrack/files/patch-opensshlib_openbsd-compat.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/security/ncrack/Makefile b/security/ncrack/Makefile
index def310cdebcc..cedd01d907a4 100644
--- a/security/ncrack/Makefile
+++ b/security/ncrack/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ncrack
 DISTVERSION=	0.7
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	security
 
 MAINTAINER=	se@FreeBSD.org
diff --git a/security/ncrack/files/patch-opensshlib_openbsd-compat.h b/security/ncrack/files/patch-opensshlib_openbsd-compat.h
new file mode 100644
index 000000000000..e6700fa7d161
--- /dev/null
+++ b/security/ncrack/files/patch-opensshlib_openbsd-compat.h
@@ -0,0 +1,11 @@
+--- opensshlib/openbsd-compat.h.orig	2019-08-24 22:25:32 UTC
++++ opensshlib/openbsd-compat.h
+@@ -95,7 +95,7 @@ void *recallocarray(void *, size_t, size_t, size_t);
+ #  define realpath(x, y) _ssh_compat_realpath(x, y)
+ # endif
+ 
+-char *realpath(const char *path, char *resolved);
++static char *realpath(const char *path, char *resolved);
+ #endif
+ 
+ #ifndef HAVE_RRESVPORT_AF