svn commit: r345117 - in head/net-mgmt/arpwatch: . files
Dmitry Marakasov
amdmi3 at FreeBSD.org
Wed Feb 19 16:59:25 UTC 2014
Author: amdmi3
Date: Wed Feb 19 16:59:22 2014
New Revision: 345117
URL: http://svnweb.freebsd.org/changeset/ports/345117
QAT: https://qat.redports.org/buildarchive/r345117/
Log:
- Update instructions in pkg-message: seems like oui.txt file format has changed and massagevendor script won't work with it out of box
- While here, fix patches naming
Added:
head/net-mgmt/arpwatch/files/patch-Makefile.in
- copied unchanged from r345107, head/net-mgmt/arpwatch/files/patch-ab
head/net-mgmt/arpwatch/files/patch-arpsnmp.8
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-ak
head/net-mgmt/arpwatch/files/patch-arpsnmp.c
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-ai
head/net-mgmt/arpwatch/files/patch-arpwatch.8
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-aj
head/net-mgmt/arpwatch/files/patch-arpwatch.c
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-ag
head/net-mgmt/arpwatch/files/patch-configure
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-ae
head/net-mgmt/arpwatch/files/patch-db.c
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-al
head/net-mgmt/arpwatch/files/patch-dns.c
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-am
head/net-mgmt/arpwatch/files/patch-report.c
- copied unchanged from r345102, head/net-mgmt/arpwatch/files/patch-ah
Deleted:
head/net-mgmt/arpwatch/files/patch-ab
head/net-mgmt/arpwatch/files/patch-ae
head/net-mgmt/arpwatch/files/patch-ag
head/net-mgmt/arpwatch/files/patch-ah
head/net-mgmt/arpwatch/files/patch-ai
head/net-mgmt/arpwatch/files/patch-aj
head/net-mgmt/arpwatch/files/patch-ak
head/net-mgmt/arpwatch/files/patch-al
head/net-mgmt/arpwatch/files/patch-am
Modified:
head/net-mgmt/arpwatch/Makefile
head/net-mgmt/arpwatch/files/pkg-message.in
Modified: head/net-mgmt/arpwatch/Makefile
==============================================================================
Copied: head/net-mgmt/arpwatch/files/patch-Makefile.in (from r345107, head/net-mgmt/arpwatch/files/patch-ab)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-Makefile.in Wed Feb 19 16:59:22 2014 (r345117, copy of r345107, head/net-mgmt/arpwatch/files/patch-ab)
@@ -0,0 +1,31 @@
+--- Makefile.in.orig Thu Jun 15 02:39:55 2000
++++ Makefile.in Tue Nov 14 15:28:00 2006
+@@ -31,7 +31,7 @@
+ # Pathname of directory to install the man page
+ MANDEST = @mandir@
+ # Pathname of directory to install database file
+-ARPDIR = $(prefix)/arpwatch
++ARPDIR ?= $(prefix)/arpwatch
+
+ # VPATH
+ srcdir = @srcdir@
+@@ -45,7 +45,7 @@
+ PROG = arpwatch
+ CCOPT = @V_CCOPT@
+ INCLS = -I. @V_INCLS@
+-DEFS = -DDEBUG @DEFS@ -DARPDIR=\"$(ARPDIR)\" -DPATH_SENDMAIL=\"$(SENDMAIL)\"
++DEFS = @DEFS@ -DARPDIR=\"$(ARPDIR)\" -DPATH_SENDMAIL=\"$(SENDMAIL)\"
+
+ # Standard CFLAGS
+ CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
+@@ -110,8 +110,8 @@
+ $(CC) $(CFLAGS) -o $@ zap.o intoa.o -lutil
+
+ install: force
+- $(INSTALL) -m 555 -o bin -g bin arpwatch $(DESTDIR)$(BINDEST)
+- $(INSTALL) -m 555 -o bin -g bin arpsnmp $(DESTDIR)$(BINDEST)
++ $(INSTALL) -s -m 555 -o $(BINOWN) -g $(BINGRP) arpwatch $(DESTDIR)$(BINDEST)
++ $(INSTALL) -s -m 555 -o $(BINOWN) -g $(BINGRP) arpsnmp $(DESTDIR)$(BINDEST)
+
+ install-man: force
+ $(INSTALL) -m 444 -o bin -g bin $(srcdir)/arpwatch.8 \
Copied: head/net-mgmt/arpwatch/files/patch-arpsnmp.8 (from r345102, head/net-mgmt/arpwatch/files/patch-ak)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-arpsnmp.8 Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-ak)
@@ -0,0 +1,34 @@
+--- arpsnmp.8.orig Sun Sep 17 16:34:48 2000
++++ arpsnmp.8 Fri Jul 7 10:07:53 2006
+@@ -30,6 +30,9 @@
+ ] [
+ .B -f
+ .I datafile
++] [
++.B -m
++.I email
+ ]
+ .I file
+ [
+@@ -55,6 +58,12 @@
+ The default is
+ .IR arp.dat .
+ .LP
++The
++.B -m
++flag specifies the address that will receive the emails.
++The default is
++.IR root .
++.LP
+ Note that an empty
+ .I arp.dat
+ file must be created before the first time you run
+@@ -69,7 +78,7 @@
+ .na
+ .nh
+ .nf
+-/usr/operator/arpwatch - default directory
++/usr/local/arpwatch - default directory
+ arp.dat - ethernet/ip address database
+ ethercodes.dat - vendor ethernet block list
+ .ad
Copied: head/net-mgmt/arpwatch/files/patch-arpsnmp.c (from r345102, head/net-mgmt/arpwatch/files/patch-ai)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-arpsnmp.c Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-ai)
@@ -0,0 +1,39 @@
+--- arpsnmp.c.orig Mon Jan 18 01:47:40 1999
++++ arpsnmp.c Thu Feb 22 22:47:29 2001
+@@ -68,6 +68,8 @@
+
+ char *prog;
+
++char *Watcher;
++
+ extern int optind;
+ extern int opterr;
+ extern char *optarg;
+@@ -90,7 +92,7 @@
+ }
+
+ opterr = 0;
+- while ((op = getopt(argc, argv, "df:")) != EOF)
++ while ((op = getopt(argc, argv, "df:m:")) != EOF)
+ switch (op) {
+
+ case 'd':
+@@ -105,6 +107,10 @@
+ arpfile = optarg;
+ break;
+
++ case 'm':
++ Watcher = optarg;
++ break;
++
+ default:
+ usage();
+ }
+@@ -184,6 +190,6 @@
+
+ (void)fprintf(stderr, "Version %s\n", version);
+ (void)fprintf(stderr,
+- "usage: %s [-d] [-f datafile] file [...]\n", prog);
++ "usage: %s [-d] [-f datafile] [-m email] file [...]\n", prog);
+ exit(1);
+ }
Copied: head/net-mgmt/arpwatch/files/patch-arpwatch.8 (from r345102, head/net-mgmt/arpwatch/files/patch-aj)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-arpwatch.8 Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-aj)
@@ -0,0 +1,34 @@
+--- arpwatch.8.orig Sun Oct 8 16:31:28 2000
++++ arpwatch.8 Fri Jul 7 10:03:53 2006
+@@ -38,6 +38,9 @@
+ .br
+ .ti +8
+ [
++.B -m
++.I email
++] [
+ .B -n
+ .IR net [/ width
+ ]] [
+@@ -71,6 +74,12 @@
+ flag is used to override the default interface.
+ .LP
+ The
++.B -m
++flag specifies the address that will receive the emails.
++The default is
++.IR root .
++.LP
++The
+ .B -n
+ flag specifies additional local networks. This can be useful to
+ avoid "bogon" warnings when there is more than one network running
+@@ -152,7 +161,7 @@
+ .na
+ .nh
+ .nf
+-/usr/operator/arpwatch - default directory
++/usr/local/arpwatch - default directory
+ arp.dat - ethernet/ip address database
+ ethercodes.dat - vendor ethernet block list
+ .ad
Copied: head/net-mgmt/arpwatch/files/patch-arpwatch.c (from r345102, head/net-mgmt/arpwatch/files/patch-ag)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-arpwatch.c Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-ag)
@@ -0,0 +1,47 @@
+--- arpwatch.c.orig Thu Jan 22 17:18:20 2004
++++ arpwatch.c Thu Jul 20 12:30:08 2006
+@@ -107,6 +107,8 @@
+
+ char *prog;
+
++char *Watcher = NULL;
++
+ int can_checkpoint;
+ int swapped;
+ int nobogons;
+@@ -170,7 +172,7 @@
+ interface = NULL;
+ rfilename = NULL;
+ pd = NULL;
+- while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF)
++ while ((op = getopt(argc, argv, "df:i:m:n:Nr:")) != EOF)
+ switch (op) {
+
+ case 'd':
+@@ -202,6 +204,10 @@
+ rfilename = optarg;
+ break;
+
++ case 'm':
++ Watcher = optarg;
++ break;
++
+ default:
+ usage();
+ }
+@@ -321,7 +327,6 @@
+
+ (void)setsignal(SIGINT, die);
+ (void)setsignal(SIGTERM, die);
+- (void)setsignal(SIGHUP, die);
+ if (rfilename == NULL) {
+ (void)setsignal(SIGQUIT, checkpoint);
+ (void)setsignal(SIGALRM, checkpoint);
+@@ -751,6 +756,6 @@
+
+ (void)fprintf(stderr, "Version %s\n", version);
+ (void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"
+- " [-n net[/width]] [-r file]\n", prog);
++ " [-m email] [-n net[/width]] [-r file]\n", prog);
+ exit(1);
+ }
Copied: head/net-mgmt/arpwatch/files/patch-configure (from r345102, head/net-mgmt/arpwatch/files/patch-ae)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-configure Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-ae)
@@ -0,0 +1,20 @@
+--- configure.orig Wed Jun 21 16:32:38 2006
++++ configure Fri Jul 7 09:57:50 2006
+@@ -1419,7 +1419,7 @@
+ withval="$with_gcc"
+
+ fi;
+- V_CCOPT="-O"
++# V_CCOPT="-O"
+ V_INCLS=""
+ if test "${srcdir}" != "." ; then
+ V_INCLS="-I\$\(srcdir\)"
+@@ -5299,7 +5299,7 @@
+ fi
+ V_CCOPT="$V_CCOPT -Wall"
+ if test "$ac_cv_lbl_gcc_vers" -gt 1 ; then
+- V_CCOPT="$V_CCOPT -Wmissing-prototypes -Wstrict-prototypes"
++# V_CCOPT="$V_CCOPT -Wmissing-prototypes -Wstrict-prototypes"
+ fi
+ fi
+ else
Copied: head/net-mgmt/arpwatch/files/patch-db.c (from r345102, head/net-mgmt/arpwatch/files/patch-al)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-db.c Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-al)
@@ -0,0 +1,20 @@
+--- db.c.orig Sat Sep 30 19:39:58 2000
++++ db.c Tue Apr 13 17:42:20 2004
+@@ -283,7 +283,7 @@
+ BCOPY(e, ep->e, 6);
+ if (h == NULL && !initializing)
+ h = getsname(a);
+- if (h != NULL && !isdigit((int)*h))
++ if (h != NULL)
+ strcpy(ep->h, h);
+ ep->t = t;
+ return (ep);
+@@ -301,7 +301,7 @@
+ return;
+ ep = ap->elist[0];
+ h = getsname(ap->a);
+- if (!isdigit((int)*h) && strcmp(h, ep->h) != 0) {
++ if (h != NULL && strcmp(h, ep->h) != 0) {
+ syslog(LOG_INFO, "hostname changed %s %s %s -> %s",
+ intoa(ap->a), e2str(ep->e), ep->h, h);
+ strcpy(ep->h, h);
Copied: head/net-mgmt/arpwatch/files/patch-dns.c (from r345102, head/net-mgmt/arpwatch/files/patch-am)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-dns.c Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-am)
@@ -0,0 +1,33 @@
+--- dns.c.orig Fri Oct 13 21:50:52 2000
++++ dns.c Tue Apr 13 17:35:07 2004
+@@ -137,7 +137,7 @@
+ return (0);
+ }
+
+-/* Return the cannonical name of the host */
++/* Return the canonical name of the host (NULL if not found) */
+ char *
+ gethname(u_int32_t a)
+ {
+@@ -150,18 +150,18 @@
+ hp = gethostbyaddr((char *)&a, sizeof(a), AF_INET);
+ _res.options = options;
+ if (hp == NULL)
+- return (intoa(a));
++ return NULL;
+ return (hp->h_name);
+ }
+
+-/* Return the simple name of the host */
++/* Return the simple name of the host (NULL if not found) */
+ char *
+ getsname(register u_int32_t a)
+ {
+ register char *s, *cp;
+
+ s = gethname(a);
+- if (!isdigit((int)*s)) {
++ if (s != NULL) {
+ cp = strchr(s, '.');
+ if (cp != NULL)
+ *cp = '\0';
Copied: head/net-mgmt/arpwatch/files/patch-report.c (from r345102, head/net-mgmt/arpwatch/files/patch-ah)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-report.c Wed Feb 19 16:59:22 2014 (r345117, copy of r345102, head/net-mgmt/arpwatch/files/patch-ah)
@@ -0,0 +1,64 @@
+--- report.c.orig Sat Sep 30 19:41:10 2000
++++ report.c Tue Apr 13 17:47:16 2004
+@@ -45,6 +45,8 @@
+
+ #include <ctype.h>
+ #include <errno.h>
++#include <fcntl.h>
++#include <paths.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -70,6 +72,8 @@
+
+ #define PLURAL(n) ((n) == 1 || (n) == -1 ? "" : "s")
+
++extern char *Watcher;
++
+ static int cdepth; /* number of outstanding children */
+
+ static char *fmtdate(time_t);
+@@ -240,7 +244,7 @@
+ register FILE *f;
+ char tempfile[64], cpu[64], os[64];
+ char *fmt = "%20s: %s\n";
+- char *watcher = WATCHER;
++ char *watcher = Watcher ? Watcher : WATCHER;
+ char *watchee = WATCHEE;
+ char *sendmail = PATH_SENDMAIL;
+ char *unknown = "<unknown>";
+@@ -303,7 +307,7 @@
+ (void)fprintf(f, "From: %s\n", watchee);
+ (void)fprintf(f, "To: %s\n", watcher);
+ hn = gethname(a);
+- if (!isdigit(*hn))
++ if (hn != NULL)
+ (void)fprintf(f, "Subject: %s (%s)\n", title, hn);
+ else {
+ (void)fprintf(f, "Subject: %s\n", title);
+@@ -344,6 +348,25 @@
+ exit(1);
+ }
+ /* XXX Need to freopen()? */
++
++ /*
++ * Open /dev/null as stdout and stderr so that sendmail 8.12.1 (and
++ * above ?) won't complain about missing file descriptors.
++ */
++ if ((fd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
++ syslog(LOG_ERR, "Cannot open %s: %m", _PATH_DEVNULL);
++ exit(1);
++ }
++ if (dup2(fd, STDOUT_FILENO) == -1) {
++ syslog(LOG_ERR, "Cannot dup2 %s to stdout: %m", _PATH_DEVNULL);
++ exit(1);
++ }
++ if (dup2(fd, STDERR_FILENO) == -1) {
++ syslog(LOG_ERR, "Cannot dup2 %s to stderr: %m", _PATH_DEVNULL);
++ exit(1);
++ }
++ close(fd);
++
+ /* Always Deliver interactively (pause when child depth gets large) */
+ execl(sendmail, "sendmail", "-odi", watcher, NULL);
+ syslog(LOG_ERR, "execl: %s: %m", sendmail);
Modified: head/net-mgmt/arpwatch/files/pkg-message.in
==============================================================================
--- head/net-mgmt/arpwatch/files/pkg-message.in Wed Feb 19 16:51:27 2014 (r345116)
+++ head/net-mgmt/arpwatch/files/pkg-message.in Wed Feb 19 16:59:22 2014 (r345117)
@@ -3,7 +3,7 @@
You can update the ethercodes.dat file executing the following steps
cd %%PREFIX%%/arpwatch
-fetch http://standards.ieee.org/regauth/oui/oui.txt
+fetch http://standards.ieee.org/regauth/oui/oui.txt -o- | cut -b 3- > oui.txt
./massagevendor oui.txt > ethercodes.dat
rm oui.txt
More information about the svn-ports-all
mailing list