Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2023 08:52:31 GMT
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: ffba4d2517e8 - main - security/0d1n: fix build
Message-ID:  <202302240852.31O8qVHT061318@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by fuz:

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

commit ffba4d2517e856df64248f66fed326a1742a1e3c
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-02-20 12:46:34 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-02-24 08:50:04 +0000

    security/0d1n: fix build
    
     - convert static REINPLACE_CMD to patch files as per policy
     - remove remaining <alloca.h> uses
     - patch getopt_long use on targets where char is unsigned
     - work around missing __GNUC_PREREQ macro
     - fix other missing includes
     - update pkg-plist to what the maintainer intended to pack
     - patch /opt/0d1n to ${DATADIR} in the relevant files
     - note that project is dual licensed (upstream has since
       removed the GPLv3 license)
     - define LICENSE_FILE_{GPLv3,BSD3CLAUSE}
    
    PR:             269717
    Fixes:          88dd085ff7851bb2906039d97a81857fe6d8b2e3
    Approved by:    portmgr (build fix blanket)
    Approved by:    flo (mentor)
    Differential Revision: https://reviews.freebsd.org/D38725
---
 security/0d1n/Makefile                             | 22 +++++++++--------
 .../files/patch-0d1n__viewer_lib_krypton_krypton.c | 14 +++++++++++
 .../patch-0d1n__viewer_lib_krypton_src_ktypes.h    | 14 +++++++++++
 security/0d1n/files/patch-src_0d1n.c               | 12 ++++++++++
 security/0d1n/files/patch-src_headers_file__ops.h  | 10 ++++++++
 security/0d1n/files/patch-src_headers_results.h    | 10 ++++++++
 security/0d1n/files/patch-src_headers_spider.h     | 10 ++++++++
 security/0d1n/files/patch-src_mem__ops.c           | 11 +++++++++
 security/0d1n/files/patch-src_opt__extract.c       | 11 +++++++++
 security/0d1n/files/patch-src_strsec.c             | 15 ++++++++++++
 security/0d1n/pkg-plist                            | 28 ++++++++++++++++++++++
 11 files changed, 147 insertions(+), 10 deletions(-)

diff --git a/security/0d1n/Makefile b/security/0d1n/Makefile
index b5b5234c5e10..a592919d7817 100644
--- a/security/0d1n/Makefile
+++ b/security/0d1n/Makefile
@@ -1,14 +1,16 @@
 PORTNAME=	0d1n
-PORTVERSION=	3.8
+DISTVERSION=	3.8
+PORTREVISION=	1
 CATEGORIES=	security
 
 MAINTAINER=	zackj901@yandex.com
 COMMENT=	Open source web HTTP fuzzing tool and bruteforcer
 WWW=		https://github.com/CoolerVoid/0d1n
 
-LICENSE=	GPLv3
-
-BROKEN=		fails to build
+LICENSE=	BSD3CLAUSE GPLv3
+LICENSE_COMB=	dual
+LICENSE_FILE_BSD3CLAUSE=	${WRKSRC}/LICENSE
+LICENSE_FILE_GPLv3=	${WRKSRC}/LICENSE.txt
 
 LIB_DEPENDS=	libcurl.so:ftp/curl
 
@@ -16,14 +18,14 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	CoolerVoid
 GH_TAGNAME=	OdinV38
 
-PLIST_FILES=	bin/0d1n
-PORTDOCS=	README.txt
-
 OPTIONS_DEFINE=	DOCS
 
-post-patch:
-	@${REINPLACE_CMD}  -e  '/^#include <alloca\.h>/d' \
-	${WRKSRC}/src/headers/spider.h ${WRKSRC}/src/headers/results.h
+pre-configure:
+	${REINPLACE_CMD} -e 's,/opt/0d1n,${DATADIR},g' \
+		${WRKSRC}/src/headers/file_ops.h \
+		${WRKSRC}/src/file_ops.c \
+		${WRKSRC}/src/opt_extract.c \
+		${WRKSRC}/src/results.c
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
diff --git a/security/0d1n/files/patch-0d1n__viewer_lib_krypton_krypton.c b/security/0d1n/files/patch-0d1n__viewer_lib_krypton_krypton.c
new file mode 100644
index 000000000000..614998607019
--- /dev/null
+++ b/security/0d1n/files/patch-0d1n__viewer_lib_krypton_krypton.c
@@ -0,0 +1,14 @@
+--- 0d1n_viewer/lib/krypton/krypton.c.orig	2023-02-20 12:36:21 UTC
++++ 0d1n_viewer/lib/krypton/krypton.c
+@@ -112,11 +112,6 @@ typedef struct {
+ #define NS_INTERNAL
+ #endif
+ 
+-/* C99 and later requires alloca.h. */
+-#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199900L
+-#include <alloca.h>
+-#endif
+-
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
diff --git a/security/0d1n/files/patch-0d1n__viewer_lib_krypton_src_ktypes.h b/security/0d1n/files/patch-0d1n__viewer_lib_krypton_src_ktypes.h
new file mode 100644
index 000000000000..4f7527461d5f
--- /dev/null
+++ b/security/0d1n/files/patch-0d1n__viewer_lib_krypton_src_ktypes.h
@@ -0,0 +1,14 @@
+--- 0d1n_viewer/lib/krypton/src/ktypes.h.orig	2023-02-20 12:36:40 UTC
++++ 0d1n_viewer/lib/krypton/src/ktypes.h
+@@ -18,11 +18,6 @@
+ #define NS_INTERNAL
+ #endif
+ 
+-/* C99 and later requires alloca.h. */
+-#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199900L
+-#include <alloca.h>
+-#endif
+-
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
diff --git a/security/0d1n/files/patch-src_0d1n.c b/security/0d1n/files/patch-src_0d1n.c
new file mode 100644
index 000000000000..1ebac768a042
--- /dev/null
+++ b/security/0d1n/files/patch-src_0d1n.c
@@ -0,0 +1,12 @@
+--- src/0d1n.c.orig	2023-02-20 12:38:21 UTC
++++ src/0d1n.c
+@@ -62,8 +62,7 @@ main (int argc, char ** argv)
+ /* remove comment to test the patch
+ */
+ #ifdef __GNUC__
+-#  if __GNUC_PREREQ(10,0)
+-
++#  if __GNUC__ >= 10
+ 	scan_gcc_new();
+ #  else
+ 	scan_gcc_old();
diff --git a/security/0d1n/files/patch-src_headers_file__ops.h b/security/0d1n/files/patch-src_headers_file__ops.h
new file mode 100644
index 000000000000..d21f5b088ddc
--- /dev/null
+++ b/security/0d1n/files/patch-src_headers_file__ops.h
@@ -0,0 +1,10 @@
+--- src/headers/file_ops.h.orig	2023-02-20 12:35:55 UTC
++++ src/headers/file_ops.h
+@@ -12,7 +12,6 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <errno.h>
+-#include <alloca.h>
+ #include "opt_extract.h"
+ 
+ void end_datatable(char * path);
diff --git a/security/0d1n/files/patch-src_headers_results.h b/security/0d1n/files/patch-src_headers_results.h
new file mode 100644
index 000000000000..6f0d7a8b9825
--- /dev/null
+++ b/security/0d1n/files/patch-src_headers_results.h
@@ -0,0 +1,10 @@
+--- src/headers/results.h.orig	2023-02-20 12:35:39 UTC
++++ src/headers/results.h
+@@ -4,7 +4,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdbool.h>
+-#include <alloca.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <time.h>
diff --git a/security/0d1n/files/patch-src_headers_spider.h b/security/0d1n/files/patch-src_headers_spider.h
new file mode 100644
index 000000000000..7a9907e410c4
--- /dev/null
+++ b/security/0d1n/files/patch-src_headers_spider.h
@@ -0,0 +1,10 @@
+--- src/headers/spider.h.orig	2023-02-20 12:36:07 UTC
++++ src/headers/spider.h
+@@ -4,7 +4,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdbool.h>
+-#include <alloca.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <time.h>
diff --git a/security/0d1n/files/patch-src_mem__ops.c b/security/0d1n/files/patch-src_mem__ops.c
new file mode 100644
index 000000000000..6eaea0440ca3
--- /dev/null
+++ b/security/0d1n/files/patch-src_mem__ops.c
@@ -0,0 +1,11 @@
+--- src/mem_ops.c.orig	2023-02-20 12:57:16 UTC
++++ src/mem_ops.c
+@@ -17,7 +17,7 @@ static void *
+ xmalloc_fatal(size_t size) 
+ {
+ 
+-	DEBUG("\n Memory FAILURE...\n size dbg: %lu\n",size);
++	DEBUG("\n Memory FAILURE...\n size dbg: %zu\n",size);
+ 
+ 	exit(0);
+ }
diff --git a/security/0d1n/files/patch-src_opt__extract.c b/security/0d1n/files/patch-src_opt__extract.c
new file mode 100644
index 000000000000..e43d43eeda5f
--- /dev/null
+++ b/security/0d1n/files/patch-src_opt__extract.c
@@ -0,0 +1,11 @@
+--- src/opt_extract.c.orig	2023-02-20 12:39:15 UTC
++++ src/opt_extract.c
+@@ -164,7 +164,7 @@ void 
+ parser_opts (int argc, char **argv)
+ {
+ 
+-	char c;
++	int c;
+ 
+ 	static struct option long_options[] =
+ 	{
diff --git a/security/0d1n/files/patch-src_strsec.c b/security/0d1n/files/patch-src_strsec.c
new file mode 100644
index 000000000000..45dd79f5b0cf
--- /dev/null
+++ b/security/0d1n/files/patch-src_strsec.c
@@ -0,0 +1,15 @@
+--- src/strsec.c.orig	2023-02-20 12:39:57 UTC
++++ src/strsec.c
+@@ -16,11 +16,11 @@
+  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
++#include "strsec.h"
+ 
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
+     !defined(__bsdi__) && !defined(__APPLE__)
+ 
+-#include "strsec.h"
+ /*
+  * Copy src to string dst of size siz.  At most siz-1 characters
+  * will be copied.  Always NUL terminates (unless siz == 0).
diff --git a/security/0d1n/pkg-plist b/security/0d1n/pkg-plist
new file mode 100644
index 000000000000..98dc72b15278
--- /dev/null
+++ b/security/0d1n/pkg-plist
@@ -0,0 +1,28 @@
+bin/0d1n
+%%DATADIR%%/payloads/crlfinjection.txt
+%%DATADIR%%/payloads/dir_brute.txt
+%%DATADIR%%/payloads/find_responses.txt
+%%DATADIR%%/payloads/js_inject.txt
+%%DATADIR%%/payloads/ldap_injection.txt
+%%DATADIR%%/payloads/list.txt
+%%DATADIR%%/payloads/openredirect.txt
+%%DATADIR%%/payloads/passive_sqli.txt
+%%DATADIR%%/payloads/password_brute.txt
+%%DATADIR%%/payloads/path_traversal.txt
+%%DATADIR%%/payloads/path_traversal_win32.txt
+%%DATADIR%%/payloads/proxy.txt
+%%DATADIR%%/payloads/proxy_list.txt
+%%DATADIR%%/payloads/sqli.txt
+%%DATADIR%%/payloads/useragents.txt
+%%DATADIR%%/payloads/wordlist.txt
+%%DATADIR%%/payloads/xml_attack.txt
+%%DATADIR%%/payloads/xml_attacks.txt
+%%DATADIR%%/payloads/xpath_injection.txt
+%%DATADIR%%/payloads/xss.txt
+%%DATADIR%%/payloads/xss_robertux.txt
+%%DATADIR%%/payloads/xxe_fuzz.txt
+%%DATADIR%%/templates/hammer1.conf
+%%DATADIR%%/templates/hammer2.conf
+%%DATADIR%%/templates/template.conf
+%%PORTDOCS%%%%DOCSDIR%%/README.txt
+@dir %%DATADIR%%/view/response_sources



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302240852.31O8qVHT061318>