update to LaBrea-2.4

PR:		53267
Submitted by:	Nick Rogness <nick@rogness.net>
This commit is contained in:
Yen-Ming Lee
2003-06-14 03:53:27 +00:00
parent 45cd4d0fd1
commit 3eb9ccd2ab
4 changed files with 113 additions and 35 deletions

View File

@@ -6,29 +6,26 @@
##
PORTNAME= LaBrea
PORTVERSION= 2.3
PORTVERSION= 2.4
CATEGORIES= security
MASTER_SITES= http://freebsd.rogness.net/ports/labrea/
DISTNAME= LaBrea${PORTVERSION:S/./_/g}
DISTNAME= ${PORTNAME}${PORTVERSION:S/./_/g}
EXTRACT_SUFX= .tgz
MAINTAINER= nick@rogness.net
COMMENT= Defense mechanism against CodeRed
COMMENT= Security tarpit defense tool
BUILD_DEPENDS= ${LOCALBASE}/lib/libnet.a:${PORTSDIR}/net/libnet
WRKSRC= ${WRKDIR}/LaBrea
USE_REINPLACE= yes
MAKE_ARGS= CC="${CC}" OPTFLAGS="${CFLAGS}"
ALL_TARGET= ${PORTNAME}
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/doc/LaBrea
${INSTALL_MAN} ${WRKSRC}/LaBrea.README ${PREFIX}/share/doc/LaBrea
${MKDIR} ${DOCSDIR}
${INSTALL_MAN} ${WRKSRC}/LaBrea.README ${DOCSDIR}
@echo "******************************************"
@echo "You will need to read the LaBrea.README in"
@echo "${PREFIX}/share/doc/LaBrea"
@echo "${DOCSDIR}"
@echo "Before your run this!!"
@echo "******************************************"
@echo .

View File

@@ -1 +1 @@
MD5 (LaBrea2_3.tgz) = ca73a56d99a4bc50917ff56f04fdbc9b
MD5 (LaBrea2_4.tgz) = 75dda18a9ad6f1e9195da2ac1e57888d

View File

@@ -0,0 +1,52 @@
--- Data.c.orig Tue Feb 11 01:04:04 2003
+++ Data.c Sat Jun 14 11:39:04 2003
@@ -22,3 +22,6 @@
+#ifndef CONFIG_PATH
+#define COFNIG_PATH "/etc"
+#endif
#ifdef OLDSTYLE
#ifdef WIN32
char HardExcludeName[] = "LaBreaHardExclude.cfg";
@@ -30,14 +33,14 @@
char IgnorePortName[] = "LaBreaIgnorePort.cfg";
char IgnorePortNotFound[] = "LaBreaIgnorePort.cfg not found - nothing to ignore";
#else
-char HardExcludeName[] = "/etc/LaBreaHardExclude";
-char HardExcludeNotFound[] = "/etc/LaBreaHardExclude not found - no hard exclusions";
-char IgnoreName[] = "/etc/LaBreaIgnoreIP";
-char IgnoreNotFound[] = "/etc/LaBreaIgnoreIP not found - nothing to ignore";
-char ExcludeName[] = "/etc/LaBreaExclude";
-char ExcludeNotFound[] = "/etc/LaBreaExclude not found - no hard exclusions";
-char IgnorePortName[] = "/etc/LaBreaIgnorePort";
-char IgnorePortNotFound[] = "/etc/LaBreaIgnorePort not found - nothing to ignore";
+char HardExcludeName[] = CONFIG_PATH"/LaBreaHardExclude";
+char HardExcludeNotFound[] = CONFIG_PATH"/LaBreaHardExclude not found - no hard exclusions";
+char IgnoreName[] = CONFIG_PATH"/LaBreaIgnoreIP";
+char IgnoreNotFound[] = CONFIG_PATH"/LaBreaIgnoreIP not found - nothing to ignore";
+char ExcludeName[] = CONFIG_PATH"/LaBreaExclude";
+char ExcludeNotFound[] = CONFIG_PATH"/LaBreaExclude not found - no hard exclusions";
+char IgnorePortName[] = CONFIG_PATH"/LaBreaIgnorePort";
+char IgnorePortNotFound[] = CONFIG_PATH"/LaBreaIgnorePort not found - nothing to ignore";
#endif /* WIN32 */
char format3[] = "Exclude: %i.%i.%i.%i\n";
char format4[] = "HardExclude: %i.%i.%i.%i\n";
@@ -46,8 +49,8 @@
char ConfigName[] = "LaBrea.cfg";
char ConfigNotFound[] = "LaBrea.cfg not found";
#else
-char ConfigName[] = "/etc/LaBreaConfig";
-char ConfigNotFound[] = "/etc/LaBreaConfig not found";
+char ConfigName[] = CONFIG_PATH"/LaBreaConfig";
+char ConfigNotFound[] = CONFIG_PATH"/LaBreaConfig not found";
#endif /* WIN32 */
#endif /* OLDSTYLE */
@@ -127,7 +130,7 @@
char err17[] = "Invalid or missing interface!\n";
char getoptstr[] = "HXPoOdTRqr:i:t:lvVxs?hzap:bE:I:Dfj";
#else
-char strRandFileName[] = "/etc/LaBreaRandom";
+char strRandFileName[] = CONFIG_PATH"/LaBreaRandom";
char err18[] = "User specified netmask: %s\nUser specified network number: %s\n";
char getoptstr[] = "HXPoOdTRqF:r:i:t:lvVxsn:m:?hzap:bfj";
#endif

View File

@@ -1,24 +1,53 @@
--- Makefile Tue Oct 2 12:00:00 2001
+++ Makefile.new Wed Dec 19 03:03:27 2001
@@ -5,12 +5,17 @@
#OPTFLAGS = -g
CC = gcc
CFLAGS = -Wall `libnet-config --defines` $(OPTFLAGS) $(INCLUDES)
-LDLIBS = `libnet-config --libs` -lpcap
-INCLUDES = -I/usr/include/pcap
+LOCALBASE=/usr/local
+PREFIX=/usr/local
+LDLIBS = `libnet-config --libs` -L$(LOCALBASE)/lib -lpcap
+INCLUDES = -I$(LOCALBASE)/include
-LaBrea: LaBrea.o
+LaBrea: LaBrea.c
-LaBrea.o: LaBrea.c
+#LaBrea.o: LaBrea.c
clean:
rm -f *.o core LaBrea
+
+install:
+ @install -c -g wheel -o root -m 755 LaBrea $(PREFIX)/bin
*** Makefile Wed Feb 20 09:27:56 2002
--- Makefile.new Wed Jun 11 18:10:47 2003
***************
*** 4,17 ****
-mcpu=i686 -fexpensive-optimizations -fomit-frame-pointer
#OPTFLAGS = -g
CC = gcc
! CFLAGS = -Wall `libnet-config --defines` $(OPTFLAGS) $(INCLUDES)
LDLIBS = `libnet-config --libs` -lpcap
! LDFLAGS = -s
! INCLUDES = -I/usr/include/pcap
!
! LaBrea: LaBrea.o CleanExit.o FixArrays.o GoDaemon.o \
! PacketHandler.o ServiceTimer.o ToggleLogging.o
LaBrea.o: LaBrea.c labrea.h defines.h
CleanExit.o: CleanExit.c labrea.h defines.h
FixArrays.o: FixArrays.c labrea.h defines.h
--- 4,17 ----
-mcpu=i686 -fexpensive-optimizations -fomit-frame-pointer
#OPTFLAGS = -g
CC = gcc
! CFLAGS = -Wall `libnet-config --defines` -DCONFIG_PATH=\"/usr/local/etc\" $(OPTFLAGS) $(INCLUDES)
LDLIBS = `libnet-config --libs` -lpcap
! LDFLAGS = -s -L/usr/local/lib
! INCLUDES = -I/usr/include/pcap -I/usr/local/include
! FILES = LaBrea.o CleanExit.o FixArrays.o GoDaemon.o PacketHandler.o ServiceTimer.o ToggleLogging.o
+ LaBrea: $(FILES)
+
LaBrea.o: LaBrea.c labrea.h defines.h
CleanExit.o: CleanExit.c labrea.h defines.h
FixArrays.o: FixArrays.c labrea.h defines.h
***************
*** 20,26 ****
ServiceTimer.o: ServiceTimer.c labrea.h defines.h
ToggleLogging.o: ToggleLogging.c labrea.h defines.h
clean:
rm -f *.o core LaBrea
-
--- 20,29 ----
ServiceTimer.o: ServiceTimer.c labrea.h defines.h
ToggleLogging.o: ToggleLogging.c labrea.h defines.h
+ install:
+ $(CC) -o LaBrea $(FILES) $(LDFLAGS) $(LDLIBS)
+ $(INSTALL) -c -o root -g wheel LaBrea /usr/local/bin
+
clean:
rm -f *.o core LaBrea