diff --git a/security/expiretable/Makefile b/security/expiretable/Makefile index 8b45159aff94..01bf8fe88aa4 100644 --- a/security/expiretable/Makefile +++ b/security/expiretable/Makefile @@ -1,14 +1,14 @@ # Created by: Cristiano Deana PORTNAME= expiretable PORTVERSION= 0.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= http://expiretable.fnord.se/ MAINTAINER= cris@gufi.org COMMENT= Utility to remove entries from the pf(4) table based on their age USE_RC_SUBR= expiretable .include diff --git a/security/expiretable/files/patch-Makefile b/security/expiretable/files/patch-Makefile index 0706126107b4..c6923d4b732b 100644 --- a/security/expiretable/files/patch-Makefile +++ b/security/expiretable/files/patch-Makefile @@ -1,13 +1,13 @@ ---- Makefile.orig 2006-01-11 11:09:05.000000000 -0200 -+++ Makefile 2014-03-27 15:31:34.000000000 -0300 -@@ -21,8 +21,8 @@ +--- Makefile.orig 2006-01-11 13:09:05 UTC ++++ Makefile +@@ -21,8 +21,8 @@ MAN=expiretable.1 all: ${TARGET} install: ${TARGET} - ${INSTALL} -g bin -o root -m 755 ${TARGET} ${INSTALL_BIN} - ${INSTALL} -g bin -o root -m 644 ${MAN} ${INSTALL_MAN} + ${INSTALL} -s -m 755 ${TARGET} ${DESTDIR}${INSTALL_BIN} + ${INSTALL} -m 644 ${MAN} ${DESTDIR}${INSTALL_MAN} clean: rm -f ${TARGET} diff --git a/security/expiretable/files/patch-expiretable b/security/expiretable/files/patch-expiretable.c similarity index 64% rename from security/expiretable/files/patch-expiretable rename to security/expiretable/files/patch-expiretable.c index 9083b0d12b14..e2a86b4e7ce3 100644 --- a/security/expiretable/files/patch-expiretable +++ b/security/expiretable/files/patch-expiretable.c @@ -1,10 +1,10 @@ ---- expiretable.c.orig 2013-01-23 11:56:08.000000000 +0100 -+++ expiretable.c 2013-01-23 11:56:26.000000000 +0100 -@@ -290,6 +290,7 @@ +--- expiretable.c.orig 2006-01-18 22:47:01 UTC ++++ expiretable.c +@@ -290,6 +290,7 @@ main(int argc, char *const *argv) { for (i = 0; i < astats_count; i++) { if (astats[i].pfras_tzero <= min_timestamp) { del_addrs_list[del_addrs_count] = astats[i].pfras_a; + del_addrs_list[del_addrs_count].pfra_fback = 0; del_addrs_count++; } } diff --git a/security/expiretable/files/patch-ioctl__helpers.c b/security/expiretable/files/patch-ioctl__helpers.c new file mode 100644 index 000000000000..077ebe5ca6b7 --- /dev/null +++ b/security/expiretable/files/patch-ioctl__helpers.c @@ -0,0 +1,49 @@ +--- ioctl_helpers.c.orig 2021-04-19 18:12:17 UTC ++++ ioctl_helpers.c +@@ -160,46 +160,3 @@ radix_get_tstats(int dev, struct pfr_tstats **tstats, + *tstats = (struct pfr_tstats *)pt.pfrio_buffer; + return pt.pfrio_size; + } +- +- +-int +-get_states(int dev, struct pf_state **states) { +- struct pfioc_states ps; +- caddr_t inbuf, newinbuf; +- size_t len = 0; +- +- inbuf = newinbuf = NULL; +- memset(&ps, 0, sizeof(struct pfioc_states)); +- *states = NULL; +- for (;;) { +- ps.ps_len = len; +- if (len) { +- newinbuf = realloc(inbuf, len); +- if (newinbuf == NULL) { +- if (inbuf != NULL) { +- free(inbuf); +- inbuf = newinbuf = NULL; +- return (-1); +- } +- } +- ps.ps_buf = inbuf = newinbuf; +- } +- if (ioctl(dev, DIOCGETSTATES, &ps) < 0) { +- if (inbuf != NULL) { +- free(inbuf); +- inbuf = newinbuf = NULL; +- } +- return (-1); +- } +- if (ps.ps_len + sizeof(struct pfioc_states) < len) +- break; /* We have states! */ +- if (ps.ps_len == 0) +- return (0); /* No states available */ +- if (len == 0) +- len = ps.ps_len; +- len *= 2; +- } +- +- *states = ps.ps_states; +- return ps.ps_len / sizeof(struct pf_state); +-} diff --git a/security/expiretable/files/patch-ioctl__helpers.h b/security/expiretable/files/patch-ioctl__helpers.h new file mode 100644 index 000000000000..1179a82ec9c0 --- /dev/null +++ b/security/expiretable/files/patch-ioctl__helpers.h @@ -0,0 +1,9 @@ +--- ioctl_helpers.h.orig 2021-04-19 18:12:20 UTC ++++ ioctl_helpers.h +@@ -31,6 +31,5 @@ int radix_get_tstats(int dev, struct pfr_tstats **tsta + int radix_get_tables(int dev, struct pfr_table **tables, const struct pfr_table *filter, int flags); + int radix_get_addrs(int dev, const struct pfr_table *table, struct pfr_addr **addrs, int flags); + int radix_del_addrs(int dev, const struct pfr_table *table, struct pfr_addr *addrs, int addr_count, int flags); +-int get_states(int dev, struct pf_state **states); + + #endif /*_IOCTL_HELPERS_H_*/