summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2011-05-02 10:11:34 +0000
committeradam <adam@pkgsrc.org>2011-05-02 10:11:34 +0000
commit8abbd9ff5f0769bd419c5348bcbd474dcb39d407 (patch)
tree100086250e1e8bca1deb31cda63400a78276a990
parent2b628cb55f653ab26e63058157d666dfe63514d1 (diff)
downloadpkgsrc-8abbd9ff5f0769bd419c5348bcbd474dcb39d407.tar.gz
Changes rev.1:
* Re-open log file on SIGHUP. * Install knockd man page into section 8 instead of section 1.
-rw-r--r--net/knock/Makefile5
-rw-r--r--net/knock/PLIST4
-rw-r--r--net/knock/distinfo7
-rw-r--r--net/knock/patches/patch-Makefile.in (renamed from net/knock/patches/patch-ab)6
-rw-r--r--net/knock/patches/patch-doc_knockd.1.in12
-rw-r--r--net/knock/patches/patch-src_knockd.c (renamed from net/knock/patches/patch-aa)38
6 files changed, 55 insertions, 17 deletions
diff --git a/net/knock/Makefile b/net/knock/Makefile
index 97e068baa59..bca3409deda 100644
--- a/net/knock/Makefile
+++ b/net/knock/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2011/03/02 11:02:20 adam Exp $
+# $NetBSD: Makefile,v 1.5 2011/05/02 10:11:34 adam Exp $
DISTNAME= knock-0.5
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= http://www.zeroflux.org/proj/knock/files/
@@ -21,7 +22,7 @@ BUILD_DEFS+= VARBASE
EGDIR= ${PREFIX}/share/examples/knock
CONF_FILES= ${EGDIR}/knockd.conf ${PKG_SYSCONFDIR}/knockd.conf
-INSTALLATION_DIRS= sbin ${EGDIR}
+INSTALLATION_DIRS= bin sbin ${PKGMANDIR}/man1 ${PKGMANDIR}/man8 ${EGDIR}
SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
diff --git a/net/knock/PLIST b/net/knock/PLIST
index 1b5e731952c..6f567b46cb2 100644
--- a/net/knock/PLIST
+++ b/net/knock/PLIST
@@ -1,6 +1,6 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
+@comment $NetBSD: PLIST,v 1.2 2011/05/02 10:11:34 adam Exp $
bin/knock
man/man1/knock.1
-man/man1/knockd.1
+man/man8/knockd.8
sbin/knockd
share/examples/knock/knockd.conf
diff --git a/net/knock/distinfo b/net/knock/distinfo
index 223e10c5820..596155e22f1 100644
--- a/net/knock/distinfo
+++ b/net/knock/distinfo
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
+$NetBSD: distinfo,v 1.2 2011/05/02 10:11:34 adam Exp $
SHA1 (knock-0.5.tar.gz) = 26f3b2f2d698bc6978390ef6e93c628361605059
RMD160 (knock-0.5.tar.gz) = 089ea289a51478a89945c46469b378c3b33fff6d
Size (knock-0.5.tar.gz) = 83990 bytes
-SHA1 (patch-aa) = 3defe3f7982e6d79f4daecd7b5039a48ab9aec1d
-SHA1 (patch-ab) = daaa6370019a55937d72fdf1d8f09747a4b38de9
+SHA1 (patch-Makefile.in) = c42b1ec9ef1eb91402a078fd6a93938d197eebce
+SHA1 (patch-doc_knockd.1.in) = 88a7f4a1fd632c4928820858da71f7e39d3b1f43
+SHA1 (patch-src_knockd.c) = b8602ac54f6e05dabe6054907712a4269f87ee12
diff --git a/net/knock/patches/patch-ab b/net/knock/patches/patch-Makefile.in
index 153c1c0e906..dac4ac2a92d 100644
--- a/net/knock/patches/patch-ab
+++ b/net/knock/patches/patch-Makefile.in
@@ -1,4 +1,6 @@
-$NetBSD: patch-ab,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
+$NetBSD: patch-Makefile.in,v 1.1 2011/05/02 10:11:34 adam Exp $
+
+Fix installation.
--- Makefile.in.orig 2010-11-30 10:30:02.000000000 +0000
+++ Makefile.in
@@ -21,7 +23,7 @@ $NetBSD: patch-ab,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
- $(INSTALL) -D -m0644 knockd.conf $(DESTDIR)/etc/knockd.conf
+ ${BSD_INSTALL_PROGRAM} knockd $(DESTDIR)$(SBINDIR)/knockd
+ ${BSD_INSTALL_PROGRAM} knock $(DESTDIR)$(BINDIR)/knock
-+ ${BSD_INSTALL_MAN} $(MANSRC)knockd.1 $(DESTDIR)$(MANDIR)/man1/knockd.1
++ ${BSD_INSTALL_MAN} $(MANSRC)knockd.1 $(DESTDIR)$(MANDIR)/man8/knockd.8
+ ${BSD_INSTALL_MAN} $(MANSRC)knock.1 $(DESTDIR)$(MANDIR)/man1/knock.1
+ ${BSD_INSTALL_DATA} knockd.conf $(DESTDIR)$(DATADIR)/examples/knock/knockd.conf
diff --git a/net/knock/patches/patch-doc_knockd.1.in b/net/knock/patches/patch-doc_knockd.1.in
new file mode 100644
index 00000000000..1af3df87c4c
--- /dev/null
+++ b/net/knock/patches/patch-doc_knockd.1.in
@@ -0,0 +1,12 @@
+$NetBSD: patch-doc_knockd.1.in,v 1.1 2011/05/02 10:11:34 adam Exp $
+
+Change section to 8.
+
+--- doc/knockd.1.in.orig 2011-05-02 10:05:38.000000000 +0000
++++ doc/knockd.1.in
+@@ -1,4 +1,4 @@
+-.TH knockd 1 "June 26, 2005" "knockd #VERSION#" ""
++.TH knockd 8 "June 26, 2005" "knockd #VERSION#" ""
+ .SH NAME
+ knockd \- port-knock server
+ .SH SYNOPSIS
diff --git a/net/knock/patches/patch-aa b/net/knock/patches/patch-src_knockd.c
index 20e5632b5b3..ce5f2c3af6d 100644
--- a/net/knock/patches/patch-aa
+++ b/net/knock/patches/patch-src_knockd.c
@@ -1,4 +1,7 @@
-$NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
+$NetBSD: patch-src_knockd.c,v 1.1 2011/05/02 10:11:34 adam Exp $
+
+Use correct network structures.
+Re-open log file on SIGHUP.
--- src/knockd.c.orig 2005-06-27 05:11:34.000000000 +0000
+++ src/knockd.c
@@ -38,7 +41,26 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
if(strlen(pcapErr)) {
fprintf(stderr, "could not open %s: %s\n", o_int, pcapErr);
}
-@@ -1161,8 +1163,8 @@ int exec_cmd(char* command, char* name){
+@@ -371,7 +373,18 @@ void read_cfg(int signum)
+ }
+ list_free(doors);
+
++ if(logfd) {
++ fclose(logfd);
++ logfd = NULL;
++ }
+ parseconfig(o_cfg);
++ if(strlen(o_logfile)) {
++ /* open the log file */
++ logfd = fopen(o_logfile, "a");
++ if(logfd == NULL) {
++ perror("warning: cannot open logfile");
++ }
++ }
+ return;
+ }
+
+@@ -1161,8 +1174,8 @@ int exec_cmd(char* command, char* name){
void sniff(u_char* arg, const struct pcap_pkthdr* hdr, const u_char* packet)
{
/* packet structs */
@@ -49,7 +71,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
struct tcphdr* tcp = NULL;
struct udphdr* udp = NULL;
char proto[8];
-@@ -1179,23 +1181,23 @@ void sniff(u_char* arg, const struct pca
+@@ -1179,23 +1192,23 @@ void sniff(u_char* arg, const struct pca
knocker_t *attempt = NULL;
if(lltype == DLT_EN10MB) {
@@ -80,7 +102,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
/* we don't do ICMP */
return;
}
-@@ -1207,23 +1209,23 @@ void sniff(u_char* arg, const struct pca
+@@ -1207,23 +1220,23 @@ void sniff(u_char* arg, const struct pca
fprintf(stderr, "error: could not understand IP address: %s\n", myip);
return;
}
@@ -113,7 +135,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
}
/* get the date/time */
-@@ -1234,10 +1236,10 @@ void sniff(u_char* arg, const struct pca
+@@ -1234,10 +1247,10 @@ void sniff(u_char* arg, const struct pca
pkt_tm->tm_sec);
/* convert IPs from binary to string */
@@ -126,7 +148,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
strncpy(dstIP, inet_ntoa(inaddr), sizeof(dstIP)-1);
dstIP[sizeof(dstIP)-1] = '\0';
-@@ -1297,69 +1299,69 @@ void sniff(u_char* arg, const struct pca
+@@ -1297,69 +1310,69 @@ void sniff(u_char* arg, const struct pca
/* if tcp, check the flags to ignore the packets we don't want
* (don't even use it to cancel sequences)
*/
@@ -210,7 +232,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
dport == attempt->door->sequence[attempt->stage]) {
/* level up! */
attempt->stage++;
-@@ -1451,34 +1453,34 @@ void sniff(u_char* arg, const struct pca
+@@ -1451,34 +1464,34 @@ void sniff(u_char* arg, const struct pca
for(lp = doors; lp; lp = lp->next) {
opendoor_t *door = (opendoor_t*)lp->data;
/* if we're working with TCP, try to match the flags */
@@ -259,7 +281,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2010/11/30 12:35:12 adam Exp $
struct hostent *he;
/* create a new entry */
attempt = (knocker_t*)malloc(sizeof(knocker_t));
-@@ -1490,7 +1492,7 @@ void sniff(u_char* arg, const struct pca
+@@ -1490,7 +1503,7 @@ void sniff(u_char* arg, const struct pca
strcpy(attempt->src, srcIP);
/* try a reverse lookup if enabled */
if (o_lookup) {