rpms/honeyd/devel README.fedora, NONE, 1.1 farpd.sysconfig, NONE, 1.1 honeyd-1.5c-flags.patch, NONE, 1.1 honeyd-1.5c-gcc.patch, NONE, 1.1 honeyd-1.5c-lt.patch, NONE, 1.1 honeyd-1.5c-pidFile.patch, NONE, 1.1 honeyd-1.5c-withlib.patch, NONE, 1.1 honeyd.conf, NONE, 1.1 honeyd.initscript, NONE, 1.1 honeyd.spec, NONE, 1.1 honeyd.sysconfig, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Peter Vrabec (pvrabec) fedora-extras-commits at redhat.com
Mon Aug 11 16:11:32 UTC 2008


Author: pvrabec

Update of /cvs/extras/rpms/honeyd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4697

Modified Files:
	.cvsignore sources 
Added Files:
	README.fedora farpd.sysconfig honeyd-1.5c-flags.patch 
	honeyd-1.5c-gcc.patch honeyd-1.5c-lt.patch 
	honeyd-1.5c-pidFile.patch honeyd-1.5c-withlib.patch 
	honeyd.conf honeyd.initscript honeyd.spec honeyd.sysconfig 
Log Message:

upload files



--- NEW FILE README.fedora ---
Fedora instalation notes
------------------------

Install package using yum/rpm.

To run honeyd, you must first configure it, configuration file is by default
/etc/honeyd.conf, you'll find a lot of useful info in it and also in man
honeyd. Accordingly to configuration of honeyd, set up farpd in
/etc/sysconfig/farpd and set FARPD_CONF variable to YES. Do the same
with HONEYD_CONF variable in /etc/sysconfig/honeyd. Be sure what you're doing,
since wrong farpd configuration may result in duplicit IP addresses in the
network.

To learn more about honeyd configuration visit its homepage
http://www.honeyd.org

Michal Marciniszyn


--- NEW FILE farpd.sysconfig ---
# Add network answered by farpd and interface on which farpd answers to
# OPTIONS_FARPD and change FARPD_CONF to YES
# Syntax:
# -i <ifname> net

OPTIONS_FARPD="-i eth0 10.0.0.0/8"
FARPD_CONF="NO"

honeyd-1.5c-flags.patch:

--- NEW FILE honeyd-1.5c-flags.patch ---
2008-08-04  Stepan Kasal  <skasal at redhat.com>

Do not throuw away user-set CFLAGS.

diff -up honeyd-1.5c/Makefile.am.atools honeyd-1.5c/Makefile.am
--- honeyd-1.5c/Makefile.am.atools	2007-05-28 08:11:11.000000000 +0200
+++ honeyd-1.5c/Makefile.am	2008-08-04 14:13:48.000000000 +0200
@@ -100,9 +100,6 @@ honeydstats_SOURCES = honeydstats.c hone
 	stats.c stats.h util.c histogram.c histogram.h analyze.c analyze.h \
 	untagging.c untagging.h filter.c filter.h keycount.c keycount.h
 honeydstats_LDADD = @LIBOBJS@ @DNETLIB@ @EVENTLIB@ @ZLIB@
-honeydstats_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
-	@EVENTINC@ @DNETINC@ @ZINC@
-honeydstats_CFLAGS = -O0 -Wall
 
 #
 # Honeyd stats sniffer
@@ -112,19 +109,15 @@ hsniff_SOURCES = hsniff.c hsniff.h taggi
 	stats.c stats.h util.c util.h hooks.c hooks.h interface.c interface.h \
 	pfctl_osfp.c pf_osfp.c pfvar.h osfp.c osfp.h network.c network.h
 hsniff_LDADD = @LIBOBJS@ @PCAPLIB@ @DNETLIB@ @EVENTLIB@ @ZLIB@
-hsniff_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
-	@EVENTINC@ @PCAPINC@ @DNETINC@ @ZINC@
-hsniff_CFLAGS = -O2 -Wall -DPATH_HONEYDDATA="\"$(honeyddatadir)\""
 
 #
 # Honeyd control application
 #
 honeydctl_SOURCES = honeydctl.c
 honeydctl_LDADD = @LIBOBJS@ @EDITLIB@ @LIBCURSES@
-honeydctl_CPPFLAGS = @EDITINC@
-honeydctl_CFLAGS = -O2 -Wall
 
-CFLAGS	= -O2 -Wall -g \
+AM_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
+	$(PYTHONINC) $(EDITINC) $(EVENTINC) $(PCAPINC) $(DNETINC) $(PCREINC) $(ZINC) \
 	-DPATH_HONEYDINCLUDE="\"$(honeydincludedir)\"" \
 	-DPATH_HONEYDDATA="\"$(honeyddatadir)\"" \
 	-DPATH_HONEYDLIB="\"$(honeydlibdir)\"" \
@@ -132,9 +125,6 @@ CFLAGS	= -O2 -Wall -g \
 	-DHONEYD_PLUGINS="$(honeydplugins)" \
 	-DPATH_RRDTOOL="\"$(PATH_RRDTOOL)\""
 
-INCLUDES = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
-	@PYTHONINC@ @EVENTINC@ @PCAPINC@ @DNETINC@ @ZINC@
-
 ########################################################################
 ## Simple subsystems to be used with Honeyd
 ########################################################################
@@ -144,9 +134,6 @@ smtp_SOURCES = subsystems/smtp.c subsyst
 	util.c util.h honeyd_overload.h
 
 smtp_LDADD = @LIBOBJS@ @EVENTLIB@ @DNETLIB@ @PCAPLIB@ @PCRELIB@
-smtp_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
-	@EVENTINC@ @DNETINC@ @PCREINC@
-smtp_CFLAGS = -O2 -Wall
 
 proxy_SOURCES = subsystems/proxy.c subsystems/proxy.h subsystems/proxy_main.c \
 	subsystems/proxy_messages.h subsystems/smtp.c subsystems/smtp.h \
@@ -154,9 +141,6 @@ proxy_SOURCES = subsystems/proxy.c subsy
 	util.c util.h honeyd_overload.h
 
 proxy_LDADD = @LIBOBJS@ @EVENTLIB@ @DNETLIB@ @PCAPLIB@ @PCRELIB@
-proxy_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
-	@EVENTINC@ @DNETINC@ @PCREINC@
-proxy_CFLAGS = -O2 -Wall
 
 ########################################################################
 ##
diff -up honeyd-1.5c/arpd/configure.in.atools honeyd-1.5c/arpd/configure.in
--- honeyd-1.5c/arpd/configure.in.atools	2003-02-09 19:30:33.000000000 +0100
+++ honeyd-1.5c/arpd/configure.in	2008-08-04 16:34:04.000000000 +0200
@@ -150,14 +150,13 @@ dnl Checks for typedefs, structures, and
 AC_C_CONST
 AC_HEADER_TIME
 AC_PROG_GCC_TRADITIONAL
-if test "$GCC" = yes; then
-   CFLAGS="$CFLAGS -Wall"
-fi
 
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
 AC_REPLACE_FUNCS(daemon)
 
+orig_CFLAGS=$CFLAGS
+
 CFLAGS=$DNETINC
 LIBS=$DNETLIB
 
@@ -186,4 +185,6 @@ main(int argc, char **argv)
         AC_DEFINE(HAVE_BROKEN_DNET)
 ], AC_MSG_RESULT(yes))
 
+CFLAGS=$orig_CFLAGS
+
 AC_OUTPUT(Makefile)
diff -up honeyd-1.5c/configure.in.atools honeyd-1.5c/configure.in
--- honeyd-1.5c/configure.in.atools	2007-05-28 08:08:34.000000000 +0200
+++ honeyd-1.5c/configure.in	2008-08-04 14:13:48.000000000 +0200
@@ -93,7 +93,6 @@ if test x"$have_pcap_get_selectable_fd" 
 		[Define if libpcap has pcap_get_selectable_fd])
 fi
 LIB=""
-CFLAGS=""
 
 dnl Checks for (installed) libdnet
 AC_ARG_WITH(libdnet,
@@ -191,10 +190,11 @@ AC_SUBST(EVENTINC)
 AC_SUBST(EVENTLIB)
 
 LIBS=$EVENTLIB
+orig_CFLAGS=$CFLAGS
 CFLAGS=$EVENTINC
 AC_CHECK_LIB(event, event_priority_init,, AC_MSG_ERROR(["libevent is too old - you need to install a newer version.  Check http://www.monkey.org/~provos/libevent/" ]))
 LIBS=""
-CFLAGS=""
+CFLAGS=$orig_CFLAGS
 
 dnl Checks for (installed) libpcre
 AC_ARG_WITH(libpcre,
@@ -343,10 +343,11 @@ AC_SUBST(ZLIB)
 AC_SUBST(ZINC)
 
 LIBS=$ZLIB
+orig_CFLAGS=$CFLAGS
 CFLAGS=$ZINC
 AC_CHECK_LIB(z, deflate,, AC_MSG_ERROR([zlib ismissing - you need to install it]))
 LIBS=""
-CFLAGS=""
+CFLAGS=$orig_CFLAGS
 
 AC_CHECK_LIB(ncurses, tgetstr, [ LIBCURSES="-lncurses" ],,)
 if test -z "$LIBCURSES" ; then
@@ -574,6 +575,7 @@ yes
 	]
 )
 
+orig_CFLAGS=$CFLAGS
 if test -z "$DNETCOMPAT"
 then
 	CFLAGS="$DNETINC"
@@ -619,7 +621,7 @@ main(int argc, char **argv)
         AC_ERROR(you need to install a more recent version of libdnet)
 ], AC_MSG_RESULT(yes))
 
-CFLAGS=""
+CFLAGS=$orig_CFLAGS
 LIBS=""
 
 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [

honeyd-1.5c-gcc.patch:

--- NEW FILE honeyd-1.5c-gcc.patch ---
diff -up honeyd-1.5c/arpd/arpd.c.gcc honeyd-1.5c/arpd/arpd.c
--- honeyd-1.5c/arpd/arpd.c.gcc	2003-02-09 05:20:40.000000000 +0100
+++ honeyd-1.5c/arpd/arpd.c	2008-07-22 17:09:17.000000000 +0200
@@ -7,6 +7,10 @@
  * $Id: arpd.c,v 1.16 2003/02/09 04:20:40 provos Exp $
  */
 
+/*
+ * Modified by Calin Radoni to compile with gcc version 4.0.0 20050519 (RedHat 4.0.0-8)
+ */
+
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
@@ -265,8 +269,8 @@ arpd_send(eth_t *eth, int op,
 	    spa->addr_ip, tha->addr_eth, tpa->addr_ip);
 	
 	if (op == ARP_OP_REQUEST) {
-		syslog(LOG_DEBUG, __FUNCTION__ ": who-has %s tell %s",
-		    addr_ntoa(tpa), addr_ntoa(spa));
+		syslog(LOG_DEBUG, "%s: who-has %s tell %s",
+		    __FUNCTION__, addr_ntoa(tpa), addr_ntoa(spa));
 	} else if (op == ARP_OP_REPLY) {
 		syslog(LOG_INFO, "arp reply %s is-at %s",
 		    addr_ntoa(spa), addr_ntoa(sha));
@@ -282,7 +286,7 @@ arpd_lookup(struct addr *addr)
 	int error;
 
 	if (addr_cmp(addr, &arpd_ifent.intf_addr) == 0) {
-		syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
+		syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__,
 		    addr_ntoa(addr), addr_ntoa(&arpd_ifent.intf_link_addr));
 		return (0);
 	}
@@ -291,10 +295,10 @@ arpd_lookup(struct addr *addr)
 	error = arp_get(arpd_arp, &arpent);
 	
 	if (error == -1) {
-		syslog(LOG_DEBUG, __FUNCTION__ ": no entry for %s",
-		    addr_ntoa(addr));
+		syslog(LOG_DEBUG, "%s: no entry for %s",
+		    __FUNCTION__, addr_ntoa(addr));
 	} else {
-		syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
+		syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__,
 		    addr_ntoa(addr), addr_ntoa(&arpent.arp_ha));
 	}
 	return (error);
@@ -423,7 +427,7 @@ arpd_recv_cb(u_char *u, const struct pca
 		if ((req = SPLAY_FIND(tree, &arpd_reqs, &tmp)) != NULL) {
 			addr_pack(&src.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS,
 			    ethip->ar_sha, ETH_ADDR_LEN);
-			syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
+			syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__,
 			    addr_ntoa(&req->pa), addr_ntoa(&src.arp_ha));
 			
 			/* This address is claimed */

honeyd-1.5c-lt.patch:

--- NEW FILE honeyd-1.5c-lt.patch ---
2008-08-07  Stepan Kasal  <skasal at redhat.com>

Prevent collisions of fdpass.lo and fdpass.o (and likewise for
atomicio.*o).
Use the standard Automake primary LTLIBRARIES for libhoneyd.so for
that.
Plus some more cleanup of unnecessary Automake *dir variables.

diff -up honeyd-1.5c/Makefile.am.lt honeyd-1.5c/Makefile.am
--- honeyd-1.5c/Makefile.am.lt	2008-08-07 13:18:26.000000000 +0200
+++ honeyd-1.5c/Makefile.am	2008-08-07 13:29:32.000000000 +0200
@@ -22,35 +22,18 @@ AUTOMAKE_OPTIONS = foreign no-dependenci
 
 ## Preload library
 ## This is how it should work but libtool is so broken
-#pkglib_LTLIBRARIES = libhoneyd.la 
-#libhoneyd_la_SOURCES = honeyd_overload.c atomicio.c fdpass.c fdpass.h
-#libhoneyd_la_LDFLAGS = -module -export-dynamic -avoid-version
-
-## Bad hack with help from marius at monkey.org to actually get this 
-## working on Linux
-LIBHONEYDFILES= honeyd_overload.lo atomicio.lo fdpass.lo
-libhoneyd.so: $(LIBHONEYDFILES)
-	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libtmp$@.la \
-		-rpath $(libdir)/honeyd $(LIBHONEYDFILES) $(LIBS) $(LDFLAGS) \
-		-module -avoid-version -nostdlib @LIBDL@
-	rm -f libtmp$@.la tmp$@.so* $@
-	cp .libs/libtmp$@.so $@ || cp .libs/libtmp$@ $@
-	rm -f .libs/libtmp$@.*
-
-libhoneyddir = $(libdir)/honeyd
-libhoneyd_DATA = libhoneyd.so
-
+##   "Who says that?" --kasal
+pkglib_LTLIBRARIES = libhoneyd.la 
+libhoneyd_la_SOURCES = honeyd_overload.c atomicio.c fdpass.c fdpass.h
+libhoneyd_la_LDFLAGS = -module -export-dynamic -avoid-version
+## A hack to prevent collision of *.lo with *.o; for details, see
+## http://www.gnu.org/software/automake/manual/html_node/Libtool-Issues.html
+libhoneyd_la_CFLAGS = $(AM_CFLAGS)
 
 # Configuration files for Honeyd
-honeyddatadir = $(datadir)/honeyd
-honeydlibdir = $(libdir)/honeyd
-honeydincludedir = $(includedir)/honeyd
-honeyddata_DATA = README nmap.assoc xprobe2.conf nmap.prints config.sample \
+dist_pkgdata_DATA = README nmap.assoc xprobe2.conf nmap.prints config.sample \
 		config.ethernet pf.os
 
-honeydplugins = @PLUGINS@
-honeydpluginsdeclare = @PLUGINSDECLARE@
-
 ########################################################################
 ##
 ## Honeyd itself. It uses plugins, so we need to install a few header
@@ -60,7 +43,7 @@ honeydpluginsdeclare = @PLUGINSDECLARE@
 ########################################################################
 
 bin_PROGRAMS = honeyd honeydctl honeydstats hsniff
-honeyddata_PROGRAMS = $(SMTP_BIN) $(PROXY_BIN)
+pkgdata_PROGRAMS = $(SMTP_BIN) $(PROXY_BIN)
 EXTRA_PROGRAMS = smtp proxy
 
 # Install the header files in a separate subdirectory. Note that
@@ -68,7 +51,7 @@ EXTRA_PROGRAMS = smtp proxy
 # use that directory as an -I include directive with #include <honeyd/foo.h>.
 # pkgincludedir includes the additional honeyd directory since that's
 # where the headers are actually installed.
-pkgincludedir = $(honeydincludedir)
+##pkgincludedir = $(honeydincludedir)
 pkginclude_HEADERS = hooks.h plugins.h plugins_config.h debug.h
 
 honeyd_SOURCES	= honeyd.c command.c parse.y lex.l config.c personality.c \
@@ -118,11 +101,11 @@ honeydctl_LDADD = @LIBOBJS@ @EDITLIB@ @L
 
 AM_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
 	$(PYTHONINC) $(EDITINC) $(EVENTINC) $(PCAPINC) $(DNETINC) $(PCREINC) $(ZINC) \
-	-DPATH_HONEYDINCLUDE="\"$(honeydincludedir)\"" \
-	-DPATH_HONEYDDATA="\"$(honeyddatadir)\"" \
-	-DPATH_HONEYDLIB="\"$(honeydlibdir)\"" \
-	-DHONEYD_PLUGINS_DECLARE="$(honeydpluginsdeclare)" \
-	-DHONEYD_PLUGINS="$(honeydplugins)" \
+	-DPATH_HONEYDINCLUDE="\"$(pkgincludedir)\"" \
+	-DPATH_HONEYDDATA="\"$(pkgdatadir)\"" \
+	-DPATH_HONEYDLIB="\"$(pkglibdir)\"" \
+	-DHONEYD_PLUGINS_DECLARE="$(PLUGINSDECLARE)" \
+	-DHONEYD_PLUGINS="$(PLUGINS)" \
 	-DPATH_RRDTOOL="\"$(PATH_RRDTOOL)\""
 
 ########################################################################
@@ -149,9 +132,9 @@ proxy_LDADD = @LIBOBJS@ @EVENTLIB@ @DNET
 ##
 ########################################################################
 
-man_MANS = honeyd.8 honeydctl.1
+dist_man_MANS = honeyd.8 honeydctl.1
 
-WEBDIR_FILES = webserver/htmltmpl.py \
+nobase_dist_pkgdata_DATA = webserver/htmltmpl.py \
 	webserver/htdocs/images/logo.gif webserver/htdocs/images/edit.gif \
 	webserver/htdocs/images/delete.gif webserver/htdocs/images/add.gif \
 	webserver/htdocs/images/arrow_down.gif \
@@ -197,8 +180,8 @@ PYTHON_FILES = pypcap/CHANGES pypcap/pca
 	dpkt/dpkt/ethernet.py dpkt/dpkt/pim.py dpkt/tests/test-perf.py \
 	dpkt/tests/test-perf2.py
 
-EXTRA_DIST = $(man_MANS) $(WEBDIR_FILES) $(PYTHON_FILES)		  \
-	acconfig.h $(honeyddata_DATA) LICENSE sha1.c			  \
+EXTRA_DIST = $(PYTHON_FILES)		  \
+	acconfig.h LICENSE sha1.c			  \
 	compat/sys/tree.h compat/sys/queue.h compat/err.h compat/sha1.h	  \
 	compat/libdnet/dnet.h compat/getopt.h				  \
 	scripts/web.sh scripts/router-telnet.pl scripts/test.sh		  \
@@ -214,14 +197,6 @@ EXTRA_DIST = $(man_MANS) $(WEBDIR_FILES)
 	pydataprocessing.c pydataprocessing.h \
 	pydatahoneyd.c pydatahoneyd.h
 
-install-data-local:
-	$(mkdir_p) "$(DESTDIR)$(honeyddatadir)"
-	(cd $(top_srcdir) && tar -cf - $(top_srcdir)/webserver) | \
-	(cd $(DESTDIR)$(honeyddatadir) && tar -xf -)
-	find $(DESTDIR)$(honeyddatadir)/webserver -type f | xargs chmod a+r
-	find $(DESTDIR)$(honeyddatadir)/webserver -type d | xargs chmod a+xr
-
-CLEANFILES = *.so
 DISTCLEANFILES = *~
 
 LEX_OUTPUT_ROOT = lex.hyd
diff -up honeyd-1.5c/configure.in.lt honeyd-1.5c/configure.in
--- honeyd-1.5c/configure.in.lt	2008-08-07 13:18:26.000000000 +0200
+++ honeyd-1.5c/configure.in	2008-08-07 13:18:26.000000000 +0200
@@ -7,9 +7,9 @@ AC_CANONICAL_HOST
 
 AM_INIT_AUTOMAKE(honeyd, 1.5c)
 AM_CONFIG_HEADER(config.h)
-AM_MAINTAINER_MODE
 
-AM_PROG_LIBTOOL
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
 
 dnl Initialize prefix.
 if test "$prefix" = "NONE"; then

honeyd-1.5c-pidFile.patch:

--- NEW FILE honeyd-1.5c-pidFile.patch ---
diff -up honeyd-1.5c/arpd/arpd.c.pidFile honeyd-1.5c/arpd/arpd.c
--- honeyd-1.5c/arpd/arpd.c.pidFile	2008-07-25 15:20:19.000000000 +0200
+++ honeyd-1.5c/arpd/arpd.c	2008-07-25 15:20:31.000000000 +0200
@@ -37,7 +37,7 @@
 #define ARPD_MAX_ACTIVE		600
 #define ARPD_MAX_INACTIVE	300
 
-#define PIDFILE			"/var/run/arpd.pid"
+#define PIDFILE			"/var/run/farpd.pid"
 
 struct arp_req {
 	struct addr		pa;

honeyd-1.5c-withlib.patch:

--- NEW FILE honeyd-1.5c-withlib.patch ---
2008-08-04  Stepan Kasal  <skasal at redhat.com>

* arpd/configure.in:
* configure.in:
The whole implementation of --with-lib* options is borked.
Hack it, so that it works at least for us.  :-)

diff -up honeyd-1.5c/arpd/configure.in.withlib honeyd-1.5c/arpd/configure.in
--- honeyd-1.5c/arpd/configure.in.withlib	2008-08-04 14:13:48.000000000 +0200
+++ honeyd-1.5c/arpd/configure.in	2008-08-04 16:43:47.000000000 +0200
@@ -53,48 +53,42 @@ AC_SUBST(DNETINC)
 AC_SUBST(DNETLIB)
 
 dnl Checks for libevent
-AC_MSG_CHECKING(for libevent)
 AC_ARG_WITH(libevent,
 [  --with-libevent=DIR     use libevent in DIR],
-[ case "$withval" in
+[ AC_MSG_CHECKING(for libevent)
+  case "$withval" in
   yes|no)
      AC_MSG_RESULT(no)
      ;;
   *)
      AC_MSG_RESULT($withval)
-     if test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
+     if test -f $withval/include/event.h -a -f $withval/lib/libevent.so; then
         owd=`pwd`
         if cd $withval; then withval=`pwd`; cd $owd; fi
         EVENTINC="-I$withval/include"
         EVENTLIB="-L$withval/lib -levent"
-     elif test -f $withval/event.h -a -f $withval/libevent.a; then
+     elif test -f $withval/event.h -a -f $withval/libevent.so; then
         owd=`pwd`
         if cd $withval; then withval=`pwd`; cd $owd; fi
         EVENTINC="-I$withval"
         EVENTLIB="-L$withval -levent"
      else
-        AC_ERROR(event.h or libevent.a not found in $withval)
+        AC_ERROR(event.h or libevent.so not found in $withval)
      fi
      ;;
   esac ],
-[ if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.a;
-then
-     EVENTINC="-I${prefix}/include"
-     EVENTLIB="-L${prefix}/lib -levent"
-  else
-     AC_MSG_RESULT(no)
-     AC_ERROR(libevent not found)
-  fi
-  AC_MSG_RESULT(yes) ]
-)
+[AC_CHECK_LIB([event], [event_init],
+   [EVENTLIB=-levent],
+   [AC_ERROR(libevent not found)])
+])
 AC_SUBST(EVENTINC)
 AC_SUBST(EVENTLIB)
 
 dnl Checks for libpcap
-AC_MSG_CHECKING(for libpcap)
 AC_ARG_WITH(libpcap,
 [  --with-libpcap=DIR      use libpcap in DIR],
-[ case "$withval" in
+[ AC_MSG_CHECKING(for libpcap)
+  case "$withval" in
   yes|no)
      AC_MSG_RESULT(no)
      ;;
@@ -122,11 +116,10 @@ AC_ARG_WITH(libpcap,
      ;;
   esac ],
 [ if test -f ${prefix}/include/pcap.h; then
-     PCAPINC="-I${prefix}/include"
      if test -f ${prefix}/lib/libwpcap.a; then
         PCAPLIB="-L${prefix}/lib -lwpcap"
      else
-        PCAPLIB="-L${prefix}/lib -lpcap"
+        PCAPLIB=-lpcap
      fi
   elif test -f /usr/include/pcap/pcap.h; then
      PCAPINC="-I/usr/include/pcap"
diff -up honeyd-1.5c/configure.in.withlib honeyd-1.5c/configure.in
--- honeyd-1.5c/configure.in.withlib	2008-08-04 14:13:48.000000000 +0200
+++ honeyd-1.5c/configure.in	2008-08-06 12:04:29.000000000 +0200
@@ -15,6 +15,12 @@ dnl Initialize prefix.
 if test "$prefix" = "NONE"; then
    prefix="/usr/local"
 fi
+if test "$exec_prefix" = "NONE"; then
+   exec_prefix=$prefix
+fi
+# Compute libdir:
+eval exp_libdir="\"$libdir\""
+eval exp_libdir="\"$exp_libdir\""
 
 disable_kqueue=no
 disable_poll=no
@@ -66,8 +72,7 @@ AC_ARG_WITH(libpcap,
      ;;
   esac ],
 [ if test -f ${prefix}/include/pcap.h; then
-     PCAPINC="-I${prefix}/include"
-     PCAPLIB="-L${prefix}/lib -lpcap"
+     PCAPLIB=-lpcap
   elif test -f /usr/include/pcap/pcap.h; then
      PCAPINC="-I/usr/include/pcap"
      PCAPLIB="-lpcap"
@@ -173,8 +178,7 @@ AC_ARG_WITH(libevent,
      ;;
   esac ],
 [ if test -f ${prefix}/include/event.h; then
-     EVENTINC="-I${prefix}/include"
-     EVENTLIB="-L${prefix}/lib -levent"
+     EVENTLIB=-levent
   elif test -f /usr/include/event/event.h; then
      EVENTINC="-I/usr/include/event"
      EVENTLIB="-levent"
@@ -259,8 +263,7 @@ AC_ARG_WITH(libedit,
      ;;
   esac ],
 [ if test -f ${prefix}/include/histedit.h; then
-     EDITINC="-I${prefix}/include"
-     EDITLIB="-L${prefix}/lib -ledit"
+     EDITLIB=-ledit
   elif test -f /usr/include/edit/histedit.h; then
      EDITINC="-I/usr/include/edit"
      EDITLIB="-ledit"
@@ -299,8 +302,7 @@ AC_ARG_WITH(libreadline,
      ;;
   esac ],
 [ if test -f ${prefix}/include/readline/readline.h; then
-     EDITINC="-I${prefix}/include"
-     EDITLIB="-L${prefix}/lib -lreadline"
+     EDITLIB=-lreadline
   elif test -f /usr/include/readline/readline.h; then
      EDITLIB="-lreadline"
   else
@@ -397,7 +399,7 @@ if test x"$DO_PYTHON" = xdefine ; then
     AC_MSG_CHECKING(for Python linkage)
     py_prefix=`$PATH_PYTHON -c 'import sys; print sys.prefix'`
     py_ver=`$PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
-    py_libdir="${py_prefix}/lib/python${py_ver}"
+    py_libdir="${libdir}/python${py_ver}"
     PYTHONINC="-I${py_prefix}/include/python${py_ver}"
     py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
     py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
@@ -421,8 +423,6 @@ if test x"$DO_PYTHON" = xdefine ; then
     else
         AC_MSG_RESULT(no - regression tests will not run)
     fi
-
-    # run these tests only if the dnet python module is available
     if test x"$py_dnet" = xok; then
       AC_MSG_CHECKING(for Python pcap module)
       py_pcap=`$PATH_PYTHON -c 'import pcap; print "ok"' 2>/dev/null`
@@ -708,19 +708,10 @@ if test "$HAVEMETHOD" = "no"; then
     LIBS="$LIBDL $LIBS"
 
     dnl ugly, ugly hack		     
-    LIBCGUESS=`echo /lib/libc.so.*`
-    USRLIBCGUESS=`echo /usr/lib/libc.so*`
-    
-    if test "$USRLIBCGUESS" = "/usr/lib/libc.so.*"; then
-       USRLIBCGUESS=""
-    fi
-    
-    if test "$LIBCGUESS" = "/lib/libc.so.*"; then
-       LIBCGUESS=""
-    fi
-    
-    for TESTLIB in libc.so `echo $USRLIBCGUESS` `echo $LIBCGUESS`
+    for TESTLIB in libc.so `echo /usr/lib64/libc.so.* /lib64/libc.so.* \
+				/usr/lib/libc.so.* /lib/libc.so.*`
     do
+	test $TESTLIB = libc.so || test -f $TESTLIB || continue
         AC_MSG_CHECKING(if we can access libc with $TESTLIB)
         AC_TRY_RUN(
         #include <dlfcn.h>


--- NEW FILE honeyd.conf ---
           ###      Honeyd Configuration File    ###
           ###   Sample Network Template Ver 0.7 ###
                
             # Last Updated: 19 December, 2003 #

#####################################################################
###                                                               ###
### This sample network configuration template builds a virtual   ###
### network step-by-step. The network we simulate has multiple    ###
### hops, two entry points, a GRE tunnel to a remote location     ###
### and integrates external physical hosts to the virtual network.### 
### The template builds the network in the accompanying paper:    ###
### "Simulating Networks with Honeyd". The latest version of the  ###
### paper is available at:                                        ###
### www.paladion.net/papers/simulating_networks_with_honeyd.pdf   ###
###                                                               ###
###                                                               ###
### Authors:    Roshen Chandran, Sangita Pakala                   ###
###	        Paladion Networks [http://www.paladion.net]       ###
###                                                               ###
### Thanks to:  Niels Provos, Lance Spitzner, Ed Balas,           ###
###             Laurent Oudot                                     ###
#####################################################################


#####################################################################
### Start by creating an entry router for the network. Then add   ###
### some IP addresses that are directly reachable from the router.###
### Then add a new router connected to the first, and the IPs     ###
### directly reachable from that. This is the essential strategy  ###
### of building a virtual network.                                ###
###                                                               ###
### On the desktops in the LAN, point the default gateway to the  ###
### entry router, or add a route to the virtual network via the   ###
### entry router. Run arpd to respond to requests for 10.0.0.0/24 ###
### network.                                                      ###
###                                                               ###
#####################################################################


### To create the router at the entry point, use the 
### route entry command and specify the IP address of 
### the router and the network reachable through it.

route entry 10.0.0.100 network 10.0.0.0/16

 
### To specify the IP addresses directly reachable from 
### a router, use the route link configuration. In the 
### example below, we specify that the 10.0.1.0/24 
### network is directly reachable from the 10.0.0.100 router.

route 10.0.0.100 link 10.0.1.0/24


### Add a new router connected to an existing router 
### in the network by using the route add net 
### directive. Specify the network range that can be 
### reached by the new router and the IP address of the 
### new router. In the example below, we add  
### 10.0.1.100 as a new router that serves the 
### 10.1.0.0/16 network and connected to the first 
### router 10.0.0.100

route 10.0.0.100 add net 10.1.0.0/16 10.0.1.100


### Specify the range of IP addresses that are directly 
### reachable from the new router with the route link 
### configuration. Here, we indicate that 10.1.0.0/16 
### is directly accessible from the router 10.0.1.100 we 
### newly added

route 10.0.1.100 link 10.1.0.0/16



#####################################################################
### Here we add another router connected to 10.0.1.100            ###
### that can reach the 10.1.1.0/24 network. The new               ###
### router takes the IP 10.1.0.100. Additionally, we              ### 
### also specify the network characteristics of that              ### 
### link using the latency, loss and bandwidth keywords.          ###
#####################################################################

route 10.0.1.100 add net 10.1.1.0/24 10.1.0.100 latency 50ms loss 0.1 bandwidth 1Mbps


### With the route link configuration, we next 
### specify that the 10.1.1.0/24 network is directly 
### accessible from the 10.1.0.100 router.

route 10.1.0.100 link 10.1.1.0/24



#####################################################################
### External physical machines can be integrated into the         ### 
### virtual network topology of the honeynet. The bind            ###
### to interface configuration is used to attach external         ### 
### machines into the network. In our example here,               ###
### the external machine at 10.1.1.53 is integrated               ###
### into the virtual network through eth0.                        ###
#####################################################################

bind 10.1.1.53 to eth0



#####################################################################
### Multiple entry points may be defined in Honeyd for the        ###
### virtual network by using additional route entry               ###
### configurations. Here we add 10.0.0.200 as a new entry         ###
### router and then define an entire network behind it.           ###
#####################################################################

route entry 10.0.0.200 network 10.2.0.0/16
route 10.0.0.200 link 10.2.0.0/24
route 10.0.0.200 add net 10.2.1.0/24 10.2.0.100
route 10.2.0.100 link 10.2.1.0/24



#####################################################################
### We can setup GRE tunnels to other networks located across     ###
### a WAN or the Internet by using the tunnel keyword. For        ###
### simplicity we first create a dedicated router 172.20.254.1    ###
### for the GRE tunneling. The 10.3.2.0/24 network containing     ###
### honeypots is directly connected to this virtual router.       ###
###                                                               ###
### To setup a tunnel to the 10.3.1.0/24 network located          ###
### across the WAN, we setup a tunnel with 172.20.254.1 and       ### 
### 172.30.254.1 as the points of termination. The destination    ###
### router should know how to decapsulate the GRE packets and     ###
### route them to the 10.3.1.0/24 network. The source and         ###
### destination are specified after the tunnel keyword of the     ###
### route add net configuration line as follows.                  ###
#####################################################################

### Here're the configuration lines for setting up a GRE tunnel
### Ensure that the remote router is setup for terminating the
### tunnel. In the commented lines below, 172.30.254.1 is the 
### remote router that terminates the tunnel. To setup your 
### GRE tunnel, please use the appropriate IP addresses for your
### network and uncomment the lines.

#route entry 172.20.254.1 network 10.3.2.0/24
#route 172.20.254.1 link 10.3.2.0/24
#route 172.20.254.1 add net 10.3.1.0/24 tunnel 172.20.254.1 172.30.254.1



#####################################################################
### IP addresses are assigned to virtual hosts that we            ###
### want to simulate within Honeyd with the bind                  ### 
### configuration. Here, we bind the honeypot IPs                 ###
### to a template called windows that we have defined.            ###
#####################################################################

### Windows NT4 web server
create windows
set windows personality "Microsoft Windows NT 4.0 Server SP5-SP6"
add windows tcp port 80 open
add windows tcp port 139 open
add windows tcp port 137 open
add windows udp port 137 open
add windows udp port 135 open
set windows default tcp action reset
set windows default udp action reset

bind 10.0.1.51 windows
bind 10.0.1.52 windows
bind 10.1.0.51 windows
bind 10.1.0.52 windows
bind 10.1.1.51 windows
bind 10.1.1.52 windows
bind 10.2.0.51 windows
bind 10.2.0.52 windows
bind 10.2.1.51 windows
bind 10.2.1.52 windows
bind 10.3.2.51 windows
bind 10.3.2.52 windows



#####################################################################
### The routers we have created in the virtual network            ###
### also need to be bound to templates to model their             ###
### behavior. We have created a template called router            ###
### and bound the router IP addresses to that template.           ###
#####################################################################

### Cisco Router
create router
set router personality "Cisco IOS 11.3 - 12.0(11)"
set router default tcp action reset
set router default udp action reset
add router tcp port 23 open
set router uid 32767 gid 32767
set router uptime 1327650

bind 10.0.0.100 router
bind 10.0.1.100 router
bind 10.1.0.100 router
bind 10.0.0.200 router
bind 10.2.0.100 router
bind 172.20.254.1 router



--- NEW FILE honeyd.initscript ---
#!/bin/bash
#
# chkconfig: - 50 50
# description: honeyd daemon
#
# processname: /usr/sbin/honeyd
# config: /etc/honeyd/honeyd.conf
# pidfile: /var/run/honeyd.pid

# source function library
. /etc/init.d/functions

if [ -e /etc/sysconfig/honeyd ]; then
  . /etc/sysconfig/honeyd
else
   OPTIONS_HONEYD="-f /etc/honeyd.conf -l /var/log/honeyd.log -i eth0"
fi

if [ -e /etc/sysconfig/farpd ]; then
  . /etc/sysconfig/farpd
else
   OPTIONS_FARPD=""
fi


RETVAL=0
PID_FILE=/var/run/honeyd.pid
prog="honeyd"
prog2="farpd"
HONEYD_PATH="/usr/bin/$prog"
FARPD_PATH="/usr/sbin/$prog2"

start() {
        [ -x $HONEYD_PATH ] || exit 5
        [ -x $FARPD_PATH ] || exit 5
        [ "x$HONEYD_CONF" == "xYES" ] || exit 6
        [ "x$FARPD_CONF" == "xYES" ] || exit 6
        echo -n $"Starting $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                daemon $HONEYD_PATH $OPTIONS_HONEYD
                RETVAL=$RETVAL+$?
        fi;
        echo -n $"Starting $prog2: "
        if [ $UID -ne 0 ]; then
                RETVAL=$RETVAL+1
                failure
        else
                daemon $FARPD_PATH $OPTIONS_FARPD
                RETVAL=$RETVAL+$?
        fi;
        RETVAL=$((RETVAL))
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/honeyd
        echo 
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                killproc $HONEYD_PATH
                RETVAL=$?
        fi;

        echo -n $"Stopping $prog2: "
        if [ $UID -ne 0 ]; then
                RET=1
                failure
        else
                killproc $FARPD_PATH
                RET=$?
        fi;
        RETVAL=$((RETVAL+RET))
        [ $RET -eq 0 ] && rm -f /var/lock/subsys/honeyd

        echo
        return $RETVAL
}

restart(){
    stop
    start
}

reload(){
        echo -n $"Reloading $prog: "
        killproc $HONEYD_PATH -HUP
        RETVAL=$?
        echo -n $"Reloading $prog2: "
        killproc $FARPD_PATH -HUP
        RETVAL=$RETVAL+$?
        echo
        RETVAL=$((RETVAL))
        return $RETVAL
}


case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart,reload)
    restart
    ;;
  status)
        status honeyd
        RETVAL=$?
        status farpd
        RETVAL=$RETVAL+$?
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|restart|reload}"
    RETVAL=2
esac

RETVAL=$((RETVAL))

exit $RETVAL


--- NEW FILE honeyd.spec ---
Summary: Honeypot daemon
Name: honeyd
Version: 1.5c
Release: 5%{?dist}
License: GPLv2+ and BSD
Group: Applications/Internet
URL: http://www.honeyd.org/
Source0: http://www.citi.umich.edu/u/provos/honeyd/honeyd-%{version}.tar.gz
Source1: http://www.citi.umich.edu/u/provos/honeyd/arpd-0.2.tar.gz
Source2: honeyd.initscript
Source3: honeyd.conf
Source4: honeyd.sysconfig
Source5: farpd.sysconfig
Source6: README.fedora
Patch1: honeyd-1.5c-gcc.patch
Patch2: honeyd-1.5c-pidFile.patch
Patch3: honeyd-1.5c-flags.patch
Patch4: honeyd-1.5c-withlib.patch
Patch5: honeyd-1.5c-lt.patch
Requires: perl-SNMP_Session
BuildRequires: readline-devel, zlib-devel
BuildRequires: python-devel, pcre-devel
BuildRequires: libpcap-devel, libdnet-devel, libevent-devel
BuildRequires: autoconf, automake, libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
Honeyd is a small daemon that creates virtual hosts on a network.
The hosts can be configured to run arbitrary services, and their
TCP personality can be adapted so that they appear to be running
certain versions of operating systems. Honeyd enables a single
host to claim multiple addresses on a LAN for network simulation.

%prep
%setup -q -a 1
cp -p %{SOURCE6}  ./
%patch1 -p1 -b .gcc
%patch2 -p1 -b .pidFile
%patch3 -p1 -b .flags
%patch4 -p1 -b .withlib
%patch5 -p1 -b .lt

sed -i 's,arpd,farpd,' arpd/arpd.8

%build
autoreconf -i
(cd arpd && autoreconf -i)
%configure
make %{?_smp_mflags}
cd arpd
%configure
make %{?_smp_mflags}


%install
rm -rf %{buildroot}
install -d %{buildroot}%{_datadir}/honeyd
make install DESTDIR=%{buildroot}
cp -aRf scripts %{buildroot}/%{_datadir}/%{name}/
install -d -m 755 %{buildroot}%{_initrddir}
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
install -p -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/honeyd
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/honeyd.conf
install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/honeyd
install -p -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/farpd


#create fake arpd
cd arpd
make install DESTDIR=%{buildroot}
mv %{buildroot}/%{_sbindir}/arpd %{buildroot}/%{_sbindir}/farpd
mv %{buildroot}/%{_mandir}/man8/arpd.8 %{buildroot}/%{_mandir}/man8/farpd.8

#remove devel part 
rm -rf %{buildroot}/%{_includedir}
rm -rf %{buildroot}/%{_libdir}

#clean stuff
chmod 755 %{buildroot}/%{_datadir}/honeyd/scripts/snmp/fake-snmp.pl
chmod 755 %{buildroot}/%{_datadir}/honeyd/scripts/snmp/buildSNMPConfig.pl
rm -rf %{buildroot}/%{_datadir}/honeyd/scripts/test.sh

%clean
rm -rf %{buildroot}

%post
/sbin/chkconfig --add honeyd

%preun
if [ $1 = 0 ]; then
        service honeyd stop >/dev/null 2>&1 ||:
        /sbin/chkconfig --del honeyd
fi

%files
%defattr(-, root, root, 0755)
%doc LICENSE README config.sample nmap.prints README.fedora
%config(noreplace) %{_sysconfdir}/honeyd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/honeyd
%config(noreplace) %{_sysconfdir}/sysconfig/farpd
%{_initrddir}/honeyd
%{_bindir}/hsniff
%{_bindir}/honeydstats
%{_bindir}/honeyd
%{_bindir}/honeydctl
%{_sbindir}/farpd
%{_datadir}/honeyd/
%{_mandir}/man1/honeydctl.1*
%{_mandir}/man8/honeyd.8*
%{_mandir}/man8/farpd.8*

%changelog
* Wed Aug  6 2008 Stepan Kasal <skasal at redhat.com> 1.5c-5
- add lt.patch: removes a hack which circumvented libtool and prevents
  collission of fdpass.lo with fdpass.o

* Wed Aug  6 2008 Stepan Kasal <skasal at redhat.com> 1.5c-4
- autoconfigury fixes

* Sat Aug 02 2008 Peter Vrabec <pvrabec at redhat.com> 1.5c-3
- adjust package to fedora standards

* Fri Jul 25 2008 Peter Vrabec <pvrabec at redhat.com> 1.5c-2
- fix sysconfig file 
- fix requires
- change pid and man file of farpd

* Mon Jul 21 2008 Peter Vrabec <pvrabec at redhat.com> 1.5c-1
- initial package build




--- NEW FILE honeyd.sysconfig ---
# change honeyd options if you want, more about them in the man honeyd(8).
# change HONEYD_CONF to YES to make honeyd initscript work...

OPTIONS_HONEYD="-f /etc/honeyd.conf -i eth0 -l /var/log/honeyd.log"
HONEYD_CONF="NO"



Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/honeyd/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	10 Aug 2008 01:13:32 -0000	1.1
+++ .cvsignore	11 Aug 2008 16:11:01 -0000	1.2
@@ -0,0 +1,2 @@
+arpd-0.2.tar.gz
+honeyd-1.5c.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/honeyd/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	10 Aug 2008 01:13:32 -0000	1.1
+++ sources	11 Aug 2008 16:11:01 -0000	1.2
@@ -0,0 +1,2 @@
+e2911fa9de1b92ef50deda1489ae944d  arpd-0.2.tar.gz
+9887b44333e380a2205f64fa245cb727  honeyd-1.5c.tar.gz




More information about the fedora-extras-commits mailing list