git: 88dd085ff785 - main - security/0d1n: Update to 3.8

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Thu, 29 Dec 2022 06:28:32 UTC
The branch main has been updated by lwhsu:

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

commit 88dd085ff7851bb2906039d97a81857fe6d8b2e3
Author:     Zack Wylde <zackj901@yandex.com>
AuthorDate: 2022-12-29 06:27:24 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2022-12-29 06:28:12 +0000

    security/0d1n: Update to 3.8
    
    PR:             268423
---
 security/0d1n/Makefile             | 12 ++++++--
 security/0d1n/distinfo             |  6 ++--
 security/0d1n/files/patch-Makefile | 61 +++++++++++++++++++++++++++-----------
 3 files changed, 56 insertions(+), 23 deletions(-)

diff --git a/security/0d1n/Makefile b/security/0d1n/Makefile
index b58cd43907ee..38311ba7bc3e 100644
--- a/security/0d1n/Makefile
+++ b/security/0d1n/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	0d1n
-PORTVERSION=	2.3
+PORTVERSION=	3.8
 CATEGORIES=	security
 
 MAINTAINER=	zackj901@yandex.com
@@ -12,6 +12,7 @@ LIB_DEPENDS=	libcurl.so:ftp/curl
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	CoolerVoid
+GH_TAGNAME=	OdinV38
 
 PLIST_FILES=	bin/0d1n
 PORTDOCS=	README.txt
@@ -19,11 +20,16 @@ PORTDOCS=	README.txt
 OPTIONS_DEFINE=	DOCS
 
 post-patch:
-	@${REINPLACE_CMD} -e '/^#include <alloca\.h>/d' \
-		${WRKSRC}/get_csrf_token.h ${WRKSRC}/spider.h
+	@${REINPLACE_CMD}  -e  '/^#include <alloca\.h>/d' \
+	${WRKSRC}/src/headers/spider.h ${WRKSRC}/src/headers/results.h
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+	${MKDIR} 	    ${STAGEDIR}${DATADIR}/view
+	${MKDIR} 	    ${STAGEDIR}${DATADIR}/view/response_sources
+	${MKDIR} 	    ${STAGEDIR}${DATADIR}/payloads
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} templates  ${STAGEDIR}${DATADIR})
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} payloads   ${STAGEDIR}${DATADIR})
 
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/security/0d1n/distinfo b/security/0d1n/distinfo
index 48fa71e7735e..9f15eaa88177 100644
--- a/security/0d1n/distinfo
+++ b/security/0d1n/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1488890485
-SHA256 (CoolerVoid-0d1n-2.3_GH0.tar.gz) = 7fe26f0268fe63ec0352502ae590a7a5e258248f253649661dc782ca7edd52ae
-SIZE (CoolerVoid-0d1n-2.3_GH0.tar.gz) = 3866302
+TIMESTAMP = 1671242917
+SHA256 (CoolerVoid-0d1n-3.8-OdinV38_GH0.tar.gz) = d392250b27c6870cbd219de52c89e3f2e3ed50ec2d309a1b8721774f63591665
+SIZE (CoolerVoid-0d1n-3.8-OdinV38_GH0.tar.gz) = 4350113
diff --git a/security/0d1n/files/patch-Makefile b/security/0d1n/files/patch-Makefile
index 60a82fbd4ce7..087b1fa5ee5b 100644
--- a/security/0d1n/files/patch-Makefile
+++ b/security/0d1n/files/patch-Makefile
@@ -1,25 +1,52 @@
---- Makefile.orig	2017-01-14 22:53:30 UTC
+--- Makefile.orig	2022-07-10 02:56:04 UTC
 +++ Makefile
-@@ -1,17 +1,9 @@
+@@ -1,42 +1,14 @@
 -CC=gcc
--CFLAGS=-W -Wall -Wextra -O2 -fstack-protector-all
--DFLAGS=-D_FORTIFY_SOURCE=2
+-CFLAGS=-W -Wall -Wextra -Wformat-security -Wno-maybe-uninitialized -O2
+-HARDENING=-fstack-protector-all -pie -fPIE
++CC?=gcc
++CFLAGS+=-W -Wall -Wextra  -fstack-protector-all
++DFLAGS=-D_FORTIFY_SOURCE=2 -I /usr/local/include -I src/headers
++LDFLAGS=-Wl,-z,relro,-z,now,-L,/usr/local/lib,-lcurl,-lpthread
+ DIR=src/
+ DIROUT=bin/
+ DIR_HEADERS=src/headers/
 -UNAME_S := $(shell uname -s)
 -ifeq ($(UNAME_S),Darwin)
--	LDFLAGS=-Wl,-lcurl
+-	LDFLAGS=-Wl,-lcurl, -lpthread
 -else
--	LDFLAGS=-Wl,-z,relro,-z,now -lcurl
+-	LDFLAGS=-Wl,-z,relro,-z,now -lcurl -lpthread
 -endif
--
--#LDFLAGS=-lcurl
--
-+CC?=cc
-+CFLAGS+=-W -Wall -Wextra -fstack-protector-all
-+DFLAGS=-D_FORTIFY_SOURCE=2 -I /usr/local/include
-+LDFLAGS=-Wl,-z,relro,-z,now,-L,/usr/local/lib,-lcurl
  
--0d1n: 0d1n.c 
-+all: 0d1n.c
- 	$(CC) $(CFLAGS) $(DFLAGS) -c *.c
- 	$(CC) -o 0d1n *.o $(LDFLAGS)
  
++all:   $(DIR)0d1n.c 
++	$(CC) $(CFLAGS) $(DFLAGS) -c $(DIR)*.c 
++	$(CC)  -o 0d1n *.o  $(LDFLAGS)
+ 
+-0d1n: $(DIR)0d1n.c 
+-	$(CC) $(CFLAGS) $(HARDENING) -c $(DIR)*.c -I$(DIR_HEADERS)
+-	$(CC) $(HARDENING)  -o $(DIROUT)0d1n *.o  $(LDFLAGS)
+ 
+-clean:
+-	rm -f *.o 0d1n
+-
+-PREFIX=/usr/local
+-install:
+-	make
+-	mkdir -p $(DESTDIR)$(PREFIX)/bin
+-	install -m 0755 bin/0d1n $(DESTDIR)$(PREFIX)/bin
+-	mkdir /opt/0d1n
+-	mkdir /opt/0d1n/view/
+-	mkdir /opt/0d1n/view/response_sources
+-	mkdir /opt/0d1n/payloads
+-	cp -rf templates /opt/0d1n/
+-	cp -rf tables /opt/0d1n/view/
+-	cp -rf payloads /opt/0d1n/
+-	chmod 0755 -R /opt/0d1n
+-	chown ${USER} -R /opt/0d1n
+-	chown ${USER} $(DESTDIR)$(PREFIX)/bin/0d1n
+-
+-uninstall:
+-	rm $(DESTDIR)$(PREFIX)/bin/0d1n
+-	rm -rf /opt/0d1n
+-	rm -f *.o 0d1n