pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/security/honeyd



Module Name:    pkgsrc
Committed By:   nia
Date:           Tue Apr 13 15:42:28 UTC 2021

Modified Files:
        pkgsrc/security/honeyd: Makefile PLIST distinfo
        pkgsrc/security/honeyd/patches: patch-tagging.h
Added Files:
        pkgsrc/security/honeyd/patches: patch-Makefile.in patch-configure
            patch-configure.in patch-honeydstats.c patch-tagging.c patch-ui.c
            patch-untagging.c
Removed Files:
        pkgsrc/security/honeyd/patches: patch-aa patch-ab

Log Message:
honeyd: update to 1.5c, fix build with "new" libevent

i would post a changelog, but loading the honeyd forum fails with this:

SQL ERROR [ mysql4 ]

Table './phpbb2/phpbb3_sessions' is marked as crashed and should be repaired [145]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

This release is from 2007.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 pkgsrc/security/honeyd/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/security/honeyd/PLIST \
    pkgsrc/security/honeyd/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/security/honeyd/patches/patch-Makefile.in \
    pkgsrc/security/honeyd/patches/patch-configure \
    pkgsrc/security/honeyd/patches/patch-configure.in \
    pkgsrc/security/honeyd/patches/patch-honeydstats.c \
    pkgsrc/security/honeyd/patches/patch-tagging.c \
    pkgsrc/security/honeyd/patches/patch-ui.c \
    pkgsrc/security/honeyd/patches/patch-untagging.c
cvs rdiff -u -r1.4 -r0 pkgsrc/security/honeyd/patches/patch-aa
cvs rdiff -u -r1.2 -r0 pkgsrc/security/honeyd/patches/patch-ab
cvs rdiff -u -r1.1 -r1.2 pkgsrc/security/honeyd/patches/patch-tagging.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/security/honeyd/Makefile
diff -u pkgsrc/security/honeyd/Makefile:1.71 pkgsrc/security/honeyd/Makefile:1.72
--- pkgsrc/security/honeyd/Makefile:1.71        Fri Dec  4 20:45:39 2020
+++ pkgsrc/security/honeyd/Makefile     Tue Apr 13 15:42:27 2021
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.71 2020/12/04 20:45:39 nia Exp $
+# $NetBSD: Makefile,v 1.72 2021/04/13 15:42:27 nia Exp $
 #
 
-DISTNAME=      honeyd-1.5b
-PKGREVISION=   50
+DISTNAME=      honeyd-1.5c
 CATEGORIES=    security net
 MASTER_SITES=  http://www.citi.umich.edu/u/provos/honeyd/
 

Index: pkgsrc/security/honeyd/PLIST
diff -u pkgsrc/security/honeyd/PLIST:1.8 pkgsrc/security/honeyd/PLIST:1.9
--- pkgsrc/security/honeyd/PLIST:1.8    Tue Mar 11 14:05:13 2014
+++ pkgsrc/security/honeyd/PLIST        Tue Apr 13 15:42:27 2021
@@ -1,7 +1,8 @@
-@comment $NetBSD: PLIST,v 1.8 2014/03/11 14:05:13 jperkin Exp $
+@comment $NetBSD: PLIST,v 1.9 2021/04/13 15:42:27 nia Exp $
 bin/honeyd
 bin/honeydctl
 bin/honeydstats
+bin/hsniff
 include/honeyd/debug.h
 include/honeyd/hooks.h
 include/honeyd/plugins.h
Index: pkgsrc/security/honeyd/distinfo
diff -u pkgsrc/security/honeyd/distinfo:1.8 pkgsrc/security/honeyd/distinfo:1.9
--- pkgsrc/security/honeyd/distinfo:1.8 Sun Sep 10 01:44:31 2017
+++ pkgsrc/security/honeyd/distinfo     Tue Apr 13 15:42:27 2021
@@ -1,9 +1,14 @@
-$NetBSD: distinfo,v 1.8 2017/09/10 01:44:31 dholland Exp $
+$NetBSD: distinfo,v 1.9 2021/04/13 15:42:27 nia Exp $
 
-SHA1 (honeyd-1.5b.tar.gz) = a6cef01ddb0b649442ac60e2a08b226b1634e3f9
-RMD160 (honeyd-1.5b.tar.gz) = 40ebe7d3a2915b5145c5a2eef04b9d1de18fbb09
-SHA512 (honeyd-1.5b.tar.gz) = 13f32d12431afca3bbce40df86ef8830f78281736c83fafadfba3f76e7ee0069285534ee31ecd6ba45006245de5175abb2307a9e2842a22b458f7343a946efa2
-Size (honeyd-1.5b.tar.gz) = 881787 bytes
-SHA1 (patch-aa) = b69d986bd1a5c1847f4f5467216730da020c8686
-SHA1 (patch-ab) = 6f789cae31cc9b38ae68c2d9250dcab67e1a0146
-SHA1 (patch-tagging.h) = 69c19ce9948594010a2db3701453c5ff5d085577
+SHA1 (honeyd-1.5c.tar.gz) = 342cc53e8d23c84ecb91c7b66c6e93e7ed2a992a
+RMD160 (honeyd-1.5c.tar.gz) = 2316c4fb6b74b0ece4429d392c478fcd7516b6a7
+SHA512 (honeyd-1.5c.tar.gz) = b359d915957528f24f043510ea528e1b581c4badccb04e6ad6fc5b1811fb710fa908695dbb8e35089c002b89fd2a31ce1b2c4f491cb926185901198959c70d16
+Size (honeyd-1.5c.tar.gz) = 915465 bytes
+SHA1 (patch-Makefile.in) = 760dc52d634218c10f9c5a136b1f6cc6989f2f98
+SHA1 (patch-configure) = 4528b172fb712b16f831a20d572b8439c3d4aee4
+SHA1 (patch-configure.in) = 94614c411372bf57cba29adb41385651b66efacd
+SHA1 (patch-honeydstats.c) = d6428554d195f743bd469bc0dc89dd512ecc15c2
+SHA1 (patch-tagging.c) = f231b671269696c565da23e00f493b2314197a40
+SHA1 (patch-tagging.h) = e3e180f483960830744ae06da67e3dd53601ada0
+SHA1 (patch-ui.c) = 971c36b35ac66a09a5e59ff8b2e11b4e496b8a45
+SHA1 (patch-untagging.c) = fbbaa1f971f2d82aaf603505bdc6c5a6b663d078

Index: pkgsrc/security/honeyd/patches/patch-tagging.h
diff -u pkgsrc/security/honeyd/patches/patch-tagging.h:1.1 pkgsrc/security/honeyd/patches/patch-tagging.h:1.2
--- pkgsrc/security/honeyd/patches/patch-tagging.h:1.1  Sun Sep 10 01:44:32 2017
+++ pkgsrc/security/honeyd/patches/patch-tagging.h      Tue Apr 13 15:42:27 2021
@@ -1,16 +1,15 @@
-$NetBSD: patch-tagging.h,v 1.1 2017/09/10 01:44:32 dholland Exp $
+$NetBSD: patch-tagging.h,v 1.2 2021/04/13 15:42:27 nia Exp $
 
-Work around namespace conflict from libevent.
+Use libevent2 API. from FreeBSD Ports.
 
---- tagging.h~ 2006-08-19 07:10:41.000000000 +0000
+--- tagging.h.orig     2007-05-28 06:12:52.000000000 +0000
 +++ tagging.h
-@@ -33,6 +33,9 @@
- #ifndef _TAGGING_
- #define _TAGGING_
+@@ -86,7 +86,7 @@ void addr_marshal(struct evbuffer *, str
+ void tag_marshal(struct evbuffer *evbuf, uint8_t tag, void *data,
+     uint16_t len);
  
-+/* work around namespace conflict from libevent */
-+#undef encode_int
-+
- void tagging_init(void);
+-void encode_int(struct evbuffer *evbuf, uint32_t number);
++void encode__int(struct evbuffer *evbuf, uint32_t number);
+ 
+ void tag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer);
  
- #define SHINGLE_MIN   32

Added files:

Index: pkgsrc/security/honeyd/patches/patch-Makefile.in
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-Makefile.in:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-Makefile.in    Tue Apr 13 15:42:27 2021
@@ -0,0 +1,74 @@
+$NetBSD: patch-Makefile.in,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+- Install example configs to share/examples
+- Don't force optimization flags
+
+--- Makefile.in.orig   2007-05-28 06:15:43.000000000 +0000
++++ Makefile.in
+@@ -182,7 +182,7 @@ AUTOMAKE = @AUTOMAKE@
+ AWK = @AWK@
+ CC = @CC@
+ CCDEPMODE = @CCDEPMODE@
+-CFLAGS = -O2 -Wall -g \
++CFLAGS += -Wall \
+       -DPATH_HONEYDINCLUDE="\"$(honeydincludedir)\"" \
+       -DPATH_HONEYDDATA="\"$(honeyddatadir)\"" \
+       -DPATH_HONEYDLIB="\"$(honeydlibdir)\"" \
+@@ -344,10 +344,10 @@ libhoneyddir = $(libdir)/honeyd
+ libhoneyd_DATA = libhoneyd.so
+ 
+ # Configuration files for Honeyd
+-honeyddatadir = $(datadir)/honeyd
++honeyddatadir = $(datadir)/examples/honeyd
+ honeydlibdir = $(libdir)/honeyd
+ honeydincludedir = $(includedir)/honeyd
+-honeyddata_DATA = README nmap.assoc xprobe2.conf nmap.prints config.sample \
++honeyddata_DATA = nmap.assoc xprobe2.conf nmap.prints config.sample \
+               config.ethernet pf.os
+ 
+ honeydplugins = @PLUGINS@
+@@ -387,7 +387,7 @@ honeydstats_LDADD = @LIBOBJS@ @DNETLIB@ 
+ honeydstats_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
+       @EVENTINC@ @DNETINC@ @ZINC@
+ 
+-honeydstats_CFLAGS = -O0 -Wall
++honeydstats_CFLAGS = -Wall
+ 
+ #
+ # Honeyd stats sniffer
+@@ -400,7 +400,7 @@ hsniff_LDADD = @LIBOBJS@ @PCAPLIB@ @DNET
+ hsniff_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
+       @EVENTINC@ @PCAPINC@ @DNETINC@ @ZINC@
+ 
+-hsniff_CFLAGS = -O2 -Wall -DPATH_HONEYDDATA="\"$(honeyddatadir)\""
++hsniff_CFLAGS = -Wall -DPATH_HONEYDDATA="\"$(honeyddatadir)\""
+ 
+ #
+ # Honeyd control application
+@@ -408,7 +408,7 @@ hsniff_CFLAGS = -O2 -Wall -DPATH_HONEYDD
+ honeydctl_SOURCES = honeydctl.c
+ honeydctl_LDADD = @LIBOBJS@ @EDITLIB@ @LIBCURSES@
+ honeydctl_CPPFLAGS = @EDITINC@
+-honeydctl_CFLAGS = -O2 -Wall
++honeydctl_CFLAGS = -Wall
+ INCLUDES = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
+       @PYTHONINC@ @EVENTINC@ @PCAPINC@ @DNETINC@ @ZINC@
+ 
+@@ -423,7 +423,7 @@ smtp_LDADD = @LIBOBJS@ @EVENTLIB@ @DNETL
+ smtp_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
+       @EVENTINC@ @DNETINC@ @PCREINC@
+ 
+-smtp_CFLAGS = -O2 -Wall
++smtp_CFLAGS = -Wall
+ proxy_SOURCES = subsystems/proxy.c subsystems/proxy.h subsystems/proxy_main.c \
+       subsystems/proxy_messages.h subsystems/smtp.c subsystems/smtp.h \
+       subsystems/smtp_messages.h atomicio.c \
+@@ -433,7 +433,7 @@ proxy_LDADD = @LIBOBJS@ @EVENTLIB@ @DNET
+ proxy_CPPFLAGS = -I$(top_srcdir)/@DNETCOMPAT@ -I$(top_srcdir)/compat \
+       @EVENTINC@ @DNETINC@ @PCREINC@
+ 
+-proxy_CFLAGS = -O2 -Wall
++proxy_CFLAGS = -Wall
+ 
+ ########################################################################
+ ########################################################################
Index: pkgsrc/security/honeyd/patches/patch-configure
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-configure:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-configure      Tue Apr 13 15:42:27 2021
@@ -0,0 +1,41 @@
+$NetBSD: patch-configure,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+Shell portability.
+
+--- configure.orig     2007-05-28 06:15:44.000000000 +0000
++++ configure
+@@ -19855,14 +19855,14 @@ libevent, we can only use select on pcap
+     disable_poll=yes
+ esac
+ 
+-if test x"$disable_kqueue" == x"yes"; then
++if test x"$disable_kqueue" = x"yes"; then
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define DISABLE_KQUEUE 1
+ _ACEOF
+ 
+ fi
+-if test x"$disable_poll" == x"yes"; then
++if test x"$disable_poll" = x"yes"; then
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define DISABLE_POLL 1
+@@ -21408,7 +21408,7 @@ if test $ac_cv_lib_pcap_pcap_get_selecta
+   have_pcap_get_selectable_fd="yes"
+ fi
+ 
+-if test x"$have_pcap_get_selectable_fd" == x"yes"; then
++if test x"$have_pcap_get_selectable_fd" = x"yes"; then
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_PCAP_GET_SELECTABLE_FD 1
+@@ -22355,7 +22355,7 @@ fi
+ 
+ if test x"$PATH_PYTHON" != x -a x"$DO_PYTHON" = xdefine ; then
+    pv_gv=`$PATH_PYTHON -c 'import sys; print sys.version[:3] > "2.3.0"'`
+-   if test "$pv_gv" == "False" ; then
++   if test "$pv_gv" = "False" ; then
+       # Extract the first word of "python2.4", so it can be a program name with args.
+ set dummy python2.4; ac_word=$2
+ { echo "$as_me:$LINENO: checking for $ac_word" >&5
Index: pkgsrc/security/honeyd/patches/patch-configure.in
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-configure.in:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-configure.in   Tue Apr 13 15:42:27 2021
@@ -0,0 +1,37 @@
+$NetBSD: patch-configure.in,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+Shell portability.
+
+--- configure.in.orig  2007-05-28 06:08:34.000000000 +0000
++++ configure.in
+@@ -27,10 +27,10 @@ libevent, we can only use select on pcap
+     disable_poll=yes
+ esac
+ 
+-if test x"$disable_kqueue" == x"yes"; then
++if test x"$disable_kqueue" = x"yes"; then
+   AC_DEFINE(DISABLE_KQUEUE, 1, [Define kqueue should be disabled for libevent])
+ fi
+-if test x"$disable_poll" == x"yes"; then
++if test x"$disable_poll" = x"yes"; then
+   AC_DEFINE(DISABLE_POLL, 1, [Define poll should be disabled for libevent])
+ fi
+ 
+@@ -88,7 +88,7 @@ CLFAGS=$PCAPINC
+ have_pcap_get_selectable_fd="no"
+ AC_CHECK_LIB([pcap], [pcap_get_selectable_fd],
+       [have_pcap_get_selectable_fd="yes"],,)
+-if test x"$have_pcap_get_selectable_fd" == x"yes"; then
++if test x"$have_pcap_get_selectable_fd" = x"yes"; then
+       AC_DEFINE(HAVE_PCAP_GET_SELECTABLE_FD, 1,       
+               [Define if libpcap has pcap_get_selectable_fd])
+ fi
+@@ -374,7 +374,7 @@ AC_ARG_WITH(python,
+ AC_PATH_PROG(PATH_PYTHON, python)
+ if test x"$PATH_PYTHON" != x -a x"$DO_PYTHON" = xdefine ; then
+    pv_gv=`$PATH_PYTHON -c 'import sys; print sys.version[[:3]] > "2.3.0"'`
+-   if test "$pv_gv" == "False" ; then
++   if test "$pv_gv" = "False" ; then
+       AC_PATH_PROG(PATH_PYTHON24, python2.4)
+       if test x"$PATH_PYTHON24" != x ; then
+         PATH_PYTHON=$PATH_PYTHON24
Index: pkgsrc/security/honeyd/patches/patch-honeydstats.c
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-honeydstats.c:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-honeydstats.c  Tue Apr 13 15:42:27 2021
@@ -0,0 +1,60 @@
+$NetBSD: patch-honeydstats.c,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+Use libevent2 API. from FreeBSD Ports.
+
+--- honeydstats.c.orig 2007-05-28 06:12:52.000000000 +0000
++++ honeydstats.c
+@@ -330,30 +330,43 @@ signature_process(struct evbuffer *evbuf
+ static int
+ signature_length(struct evbuffer *evbuf)
+ {
+-      struct evbuffer tmp;
++      struct evbuffer *tmp;
+       uint32_t length, tlen;
+ 
+-      tmp = *evbuf;
+-
++      tmp = evbuffer_new();
++      tmp = evbuffer_add_reference(tmp, evbuffer_pullup(evbuf, -1),
++                                   evbuffer_get_length(evbuf), NULL, NULL);
+       /* name */
+-      if (tag_peek_length(&tmp, &tlen) == -1 || EVBUFFER_LENGTH(&tmp) < tlen)
++      if (tag_peek_length(tmp, &tlen) == -1 || EVBUFFER_LENGTH(tmp) < tlen) {
++              evbuffer_free(tmp);
+               return (-1);
++      }
++
++      if (evbuffer_drain(tmp, tlen) == -1) {
++              evbuffer_free(tmp);
++              return (-1);
++      }
+               
+       length = tlen;
+-      tmp.buffer += tlen;
+-      tmp.off -= tlen;
+ 
+       /* signature */
+-      if (tag_peek_length(&tmp, &tlen) == -1 || EVBUFFER_LENGTH(&tmp) < tlen)
++      if (tag_peek_length(tmp, &tlen) == -1 || EVBUFFER_LENGTH(tmp) < tlen) {
++              evbuffer_free(tmp);
+               return (-1);
++      }
+               
++      if (evbuffer_drain(tmp, tlen) == -1) {
++              evbuffer_free(tmp);
++              return (-1);
++      }
++
+       length += tlen;
+-      tmp.buffer += tlen;
+-      tmp.off -= tlen;
+ 
+       /* data */
+-      if (tag_peek_length(&tmp, &tlen) == -1 || EVBUFFER_LENGTH(&tmp) < tlen)
++      if (tag_peek_length(tmp, &tlen) == -1 || EVBUFFER_LENGTH(tmp) < tlen) {
++              evbuffer_free(tmp);
+               return (-1);
++      }
+               
+       length += tlen;
+ 
Index: pkgsrc/security/honeyd/patches/patch-tagging.c
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-tagging.c:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-tagging.c      Tue Apr 13 15:42:27 2021
@@ -0,0 +1,48 @@
+$NetBSD: patch-tagging.c,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+Use libevent2 API. from FreeBSD Ports.
+
+--- tagging.c.orig     2007-05-28 06:12:52.000000000 +0000
++++ tagging.c
+@@ -73,7 +73,7 @@ tagging_init()
+  */
+ 
+ void
+-encode_int(struct evbuffer *evbuf, uint32_t number)
++encode__int(struct evbuffer *evbuf, uint32_t number)
+ {
+       int off = 1, nibbles = 0;
+       uint8_t data[5];
+@@ -108,7 +108,7 @@ void
+ tag_marshal(struct evbuffer *evbuf, uint8_t tag, void *data, uint16_t len)
+ {
+       evbuffer_add(evbuf, &tag, sizeof(tag));
+-      encode_int(evbuf, len);
++      encode__int(evbuf, len);
+       evbuffer_add(evbuf, data, len);
+ }
+ 
+@@ -117,10 +117,10 @@ void
+ tag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer)
+ {
+       evbuffer_drain(_buf, EVBUFFER_LENGTH(_buf));
+-      encode_int(_buf, integer);
++      encode__int(_buf, integer);
+ 
+       evbuffer_add(evbuf, &tag, sizeof(tag));
+-      encode_int(evbuf, EVBUFFER_LENGTH(_buf));
++      encode__int(evbuf, EVBUFFER_LENGTH(_buf));
+       evbuffer_add_buffer(evbuf, _buf);
+ }
+ 
+@@ -135,8 +135,8 @@ tag_marshal_timeval(struct evbuffer *evb
+ {
+       evbuffer_drain(_buf, EVBUFFER_LENGTH(_buf));
+ 
+-      encode_int(_buf, tv->tv_sec);
+-      encode_int(_buf, tv->tv_usec);
++      encode__int(_buf, tv->tv_sec);
++      encode__int(_buf, tv->tv_usec);
+ 
+       tag_marshal(evbuf, tag, EVBUFFER_DATA(_buf),
+           EVBUFFER_LENGTH(_buf));
Index: pkgsrc/security/honeyd/patches/patch-ui.c
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-ui.c:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-ui.c   Tue Apr 13 15:42:27 2021
@@ -0,0 +1,52 @@
+$NetBSD: patch-ui.c,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+Use libevent2 API. from FreeBSD Ports.
+
+--- ui.c.orig  2007-05-28 06:12:52.000000000 +0000
++++ ui.c
+@@ -246,7 +246,8 @@ ui_writer(int fd, short what, void *arg)
+       struct evbuffer *buffer = client->outbuf;
+       int n;
+ 
+-      n = write(fd, buffer->buffer, buffer->off);
++      n = write(fd, evbuffer_pullup(buffer, -1),
++                evbuffer_get_length(buffer));
+       if (n == -1) {
+               if (errno == EINTR || errno == EAGAIN)
+                       goto schedule;
+@@ -260,7 +261,7 @@ ui_writer(int fd, short what, void *arg)
+       evbuffer_drain(buffer, n);
+ 
+  schedule:
+-      if (buffer->off)
++      if (evbuffer_get_length(buffer))
+               event_add(&client->ev_write, NULL);
+ }
+ 
+@@ -277,8 +278,8 @@ ui_handler(int fd, short what, void *arg
+               return;
+       }
+ 
+-      n = mybuf->off;
+-      p = mybuf->buffer;
++      n = evbuffer_get_length (mybuf);
++      p = evbuffer_pullup (mybuf, -1);
+       consumed = 0;
+       while (n--) {
+               consumed++;
+@@ -289,11 +290,12 @@ ui_handler(int fd, short what, void *arg
+                */
+               if (*p == '\n') {
+                       *p = '\0';
+-                      ui_handle_command(client->outbuf, mybuf->buffer);
++                      ui_handle_command(client->outbuf,
++                                        evbuffer_pullup(mybuf, -1));
+ 
+                       evbuffer_drain(mybuf, consumed);
+-                      n = mybuf->off;
+-                      p = mybuf->buffer;
++                      n = evbuffer_get_length (mybuf);
++                      p = evbuffer_pullup (mybuf, -1);
+                       consumed = 0;
+                       continue;
+               }
Index: pkgsrc/security/honeyd/patches/patch-untagging.c
diff -u /dev/null pkgsrc/security/honeyd/patches/patch-untagging.c:1.1
--- /dev/null   Tue Apr 13 15:42:28 2021
+++ pkgsrc/security/honeyd/patches/patch-untagging.c    Tue Apr 13 15:42:27 2021
@@ -0,0 +1,51 @@
+$NetBSD: patch-untagging.c,v 1.1 2021/04/13 15:42:27 nia Exp $
+
+Use libevent2 API. from FreeBSD Ports.
+
+--- untagging.c.orig   2007-05-28 06:12:52.000000000 +0000
++++ untagging.c
+@@ -114,22 +114,29 @@ tag_peek(struct evbuffer *evbuf, uint8_t
+ int
+ tag_peek_length(struct evbuffer *evbuf, uint32_t *plength)
+ {
+-      struct evbuffer tmp;
++      struct evbuffer *tmp;
+       int res;
+ 
+       if (EVBUFFER_LENGTH(evbuf) < 2)
+               return (-1);
+ 
+-      tmp = *evbuf;
+-      tmp.buffer += 1;
+-      tmp.off -= 1;
++      tmp = evbuffer_new ();
++      evbuffer_add_reference (tmp, evbuffer_pullup(evbuf, -1),
++                              evbuffer_get_length(evbuf), NULL, NULL);
++      if (evbuffer_drain(tmp, 1) == -1) {
++              evbuffer_free (tmp);
++              return (-1);
++      }
+ 
+-      res = decode_int_internal(plength, &tmp, 0);
+-      if (res == -1)
++      res = decode_int_internal(plength, tmp, 0);
++      if (res == -1) {
++              evbuffer_free (tmp);
+               return (-1);
++      }
+ 
+       *plength += res + 1;
+ 
++      evbuffer_free (tmp);
+       return (0);
+ }
+ 
+@@ -438,7 +445,7 @@ tagging_int_test(void)
+       for (i = 0; i < TEST_MAX_INT; i++) {
+               int oldlen, newlen;
+               oldlen = EVBUFFER_LENGTH(tmp);
+-              encode_int(tmp, integers[i]);
++              encode__int(tmp, integers[i]);
+               newlen = EVBUFFER_LENGTH(tmp);
+               fprintf(stderr, "\t\tencoded 0x%08x with %d bytes\n",
+                   integers[i], newlen - oldlen);



Home | Main Index | Thread Index | Old Index