From 511cfb41cb272a9ce4ee220c430afe56c6ac9a15 Mon Sep 17 00:00:00 2001 From: ehaupt Date: Fri, 28 Jul 2006 12:53:31 +0000 Subject: - Provide a patch to fix incorrect uses of strncpy - Add an additional master site - Nuke patch-aa - Cleanup - Bump PORTREVISION - Take maintainer-ship Obtained from: OpenBSD --- net-mgmt/cidr/Makefile | 18 +++++++++--------- net-mgmt/cidr/distinfo | 6 +++--- net-mgmt/cidr/files/patch-aa | 29 ----------------------------- net-mgmt/cidr/files/patch-cidr.c | 28 ++++++++++++++++++++++++++++ net-mgmt/cidr/pkg-descr | 11 +++++------ 5 files changed, 45 insertions(+), 47 deletions(-) delete mode 100644 net-mgmt/cidr/files/patch-aa create mode 100644 net-mgmt/cidr/files/patch-cidr.c diff --git a/net-mgmt/cidr/Makefile b/net-mgmt/cidr/Makefile index 5e44cb0..f7184b3 100644 --- a/net-mgmt/cidr/Makefile +++ b/net-mgmt/cidr/Makefile @@ -6,22 +6,22 @@ PORTNAME= cidr PORTVERSION= 2.3.2 +PORTREVISION= 1 CATEGORIES= net-mgmt -MASTER_SITES= http://critical.ch/distfiles/ -MASTER_SITE_SUBDIR= nork -DISTNAME= cidr-current +MASTER_SITES= http://critical.ch/distfiles/ \ + http://energy.critical.ch/distfiles/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= ehaupt@FreeBSD.org COMMENT= RFC 1878 subnet calculator / helper -WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} -ALL_TARGET= cidr - MAN1= cidr.1 PLIST_FILES= bin/cidr +do-build: + ${CC} ${CFLAGS} ${WRKSRC}/${PORTNAME}.c -o ${WRKSRC}/${PORTNAME} + do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/cidr ${PREFIX}/bin/cidr - ${INSTALL_MAN} ${WRKSRC}/cidr.1 ${PREFIX}/man/man1/cidr.1 + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/${MAN1} ${MANPREFIX}/man/man1 .include diff --git a/net-mgmt/cidr/distinfo b/net-mgmt/cidr/distinfo index 9e9c62c..e830a84 100644 --- a/net-mgmt/cidr/distinfo +++ b/net-mgmt/cidr/distinfo @@ -1,3 +1,3 @@ -MD5 (cidr-current.tar.gz) = b349453a0196fddd3ffa0af5fbbacf54 -SHA256 (cidr-current.tar.gz) = e2ea8dd2d79c39140d12d71e515014b086b275286c36c50a1df277401fc147fe -SIZE (cidr-current.tar.gz) = 17675 +MD5 (cidr-2.3.2.tar.gz) = b349453a0196fddd3ffa0af5fbbacf54 +SHA256 (cidr-2.3.2.tar.gz) = e2ea8dd2d79c39140d12d71e515014b086b275286c36c50a1df277401fc147fe +SIZE (cidr-2.3.2.tar.gz) = 17675 diff --git a/net-mgmt/cidr/files/patch-aa b/net-mgmt/cidr/files/patch-aa deleted file mode 100644 index 5434f36..0000000 --- a/net-mgmt/cidr/files/patch-aa +++ /dev/null @@ -1,29 +0,0 @@ ---- Makefile.orig Fri Jul 20 11:11:34 2001 -+++ Makefile Sat May 18 04:21:47 2002 -@@ -1,9 +1,8 @@ - VERSION=2.3.2 - RELEASE=1 - --CC=gcc - STRIP=strip --CCFLAGS=-Wall -+CCFLAGS= $(CFLAGS) - - SOL7FLAGS=-lsocket -lnsl - SOL8FLAGS=-lresolv -lnsl -@@ -13,15 +12,12 @@ - - all : - $(CC) $(CCFLAGS) cidr.c -o cidr -- $(STRIP) cidr - - solaris8: - $(CC) $(CCFLAGS) $(SOL8FLAGS) cidr.c -o cidr -- $(STRIP) cidr - - solaris7: - $(CC) $(CCFLAGS) $(SOL7FLAGS) cidr.c -o cidr -- $(STRIP) cidr - - clean: - rm -f cidr cidr.o \ diff --git a/net-mgmt/cidr/files/patch-cidr.c b/net-mgmt/cidr/files/patch-cidr.c new file mode 100644 index 0000000..22d83fa --- /dev/null +++ b/net-mgmt/cidr/files/patch-cidr.c @@ -0,0 +1,28 @@ +--- cidr.c.orig Fri Jul 28 14:36:39 2006 ++++ cidr.c Fri Jul 28 14:39:28 2006 +@@ -140,14 +140,14 @@ + } + } + +- strncpy(ip[2],argv[1],18); ++ strlcpy(ip[2],argv[1],19); + + holdaddress=strtok(ip[2],sep); + if(holdaddress==NULL) + invalid(1); + + +- strncpy(ip[0],holdaddress,strlen(holdaddress)); ++ strlcpy(ip[0],holdaddress,strlen(holdaddress)+1); + if(ip[0]==NULL) + invalid(1); + +@@ -156,7 +156,7 @@ + invalid(1); + + +- strncpy(ip[1],holdprefix,strlen(holdprefix)); ++ strlcpy(ip[1],holdprefix,strlen(holdprefix)+1); + if(ip[1]==NULL) + invalid(1); + diff --git a/net-mgmt/cidr/pkg-descr b/net-mgmt/cidr/pkg-descr index 486dc31..0cb0f5e 100644 --- a/net-mgmt/cidr/pkg-descr +++ b/net-mgmt/cidr/pkg-descr @@ -1,6 +1,5 @@ -cidr is a tiny command-line tool for determining network and broadcast -addresses a la RFC 1878. It takes an IP address and netmask and -outputs the network address, broadcast address, and total number of -addresses for the corresponding subnet. The IP can be in binary, -decimal, hex, or dotted quad. The mask can be in binary, decimal, hex, -dotted quad, or prefix. +cidr is a tiny command-line tool for determining network and broadcast addresses +a la RFC 1878. It takes an IP address and netmask and outputs the network +address, broadcast address, and total number of addresses for the corresponding +subnet. The IP can be in binary, decimal, hex, or dotted quad. The mask can be +in binary, decimal, hex, dotted quad, or prefix. -- cgit v1.1