summaryrefslogtreecommitdiff
path: root/dns/dnrd
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2004-07-28 20:53:08 +0000
committerPav Lucistnik <pav@FreeBSD.org>2004-07-28 20:53:08 +0000
commit48f158c02832a6842a2f2f6d4871db2e2f8a7330 (patch)
tree16c39740579e2a91cc110aaa8d1be3362788b2c8 /dns/dnrd
parentSoX buffer overflows when handling .WAV files (diff)
- Update to 2.14
- Add rc script PR: ports/69669 (based on) Submitted by: Natanael Copa <mlists@tanael.org>
Notes
Notes: svn path=/head/; revision=114964
Diffstat (limited to 'dns/dnrd')
-rw-r--r--dns/dnrd/Makefile26
-rw-r--r--dns/dnrd/distinfo4
-rw-r--r--dns/dnrd/files/dnrd.sh35
-rw-r--r--dns/dnrd/files/patch-Makefile46
-rw-r--r--dns/dnrd/files/patch-args.c10
-rw-r--r--dns/dnrd/files/patch-common.h10
-rw-r--r--dns/dnrd/files/patch-configure12
-rw-r--r--dns/dnrd/files/patch-dns.c4
-rw-r--r--dns/dnrd/files/patch-main.c94
-rw-r--r--dns/dnrd/files/patch-master.c11
-rw-r--r--dns/dnrd/files/patch-query.h4
-rw-r--r--dns/dnrd/files/patch-src-domnode.c10
-rw-r--r--dns/dnrd/files/patch-src-relay.c16
-rw-r--r--dns/dnrd/files/patch-tcp.c11
-rw-r--r--dns/dnrd/files/patch-udp.c29
-rw-r--r--dns/dnrd/pkg-descr23
-rw-r--r--dns/dnrd/pkg-plist11
17 files changed, 108 insertions, 248 deletions
diff --git a/dns/dnrd/Makefile b/dns/dnrd/Makefile
index 32bd9f980697..8de7028285db 100644
--- a/dns/dnrd/Makefile
+++ b/dns/dnrd/Makefile
@@ -6,30 +6,28 @@
#
PORTNAME= dnrd
-PORTVERSION= 2.10
-PORTREVISION= 2
+PORTVERSION= 2.14
CATEGORIES= dns
-MASTER_SITES= http://users.zoominternet.net/~garsh/dnrd/archive/ \
- http://www.netsw.org/net/ip/infoservice/dns/dnrd/
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= dnrd
MAINTAINER= ports@FreeBSD.org
COMMENT= A proxy DNS daemon
-WRKSRC= ${WRKDIR}/${DISTNAME}/src
-
USE_GMAKE= yes
USE_REINPLACE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ENV= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS}
MAN8= dnrd.8
-PLIST_FILES= sbin/dnrd
post-patch:
-.for F in main.c master.c
- ${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/$F
-.endfor
- ${REINPLACE_CMD} \
- -e "s,cc,${CC},g" \
- -e "s,-lc_r,${PTHREAD_LIBS},g" \
- ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -e 's|/etc/dnrd|${PREFIX}/etc/dnrd|g' ${WRKSRC}/doc/dnrd.8 \
+ ${WRKSRC}/doc/master.sample ${WRKSRC}/doc/README-master ${WRKSRC}/src/common.h \
+ ${WRKSRC}/src/master.c ${WRKSRC}/src/main.c
+
+post-install:
+ ${INSTALL_SCRIPT} ${FILESDIR}/dnrd.sh ${PREFIX}/etc/rc.d/dnrd.sh
.include <bsd.port.mk>
diff --git a/dns/dnrd/distinfo b/dns/dnrd/distinfo
index d1ce6a0f00d9..125d77499c36 100644
--- a/dns/dnrd/distinfo
+++ b/dns/dnrd/distinfo
@@ -1,2 +1,2 @@
-MD5 (dnrd-2.10.tar.gz) = fce2a94ec8a8c93e1bda1851813b41e2
-SIZE (dnrd-2.10.tar.gz) = 41810
+MD5 (dnrd-2.14.tar.gz) = f0645955944a16594b50549abdc2d1c0
+SIZE (dnrd-2.14.tar.gz) = 139548
diff --git a/dns/dnrd/files/dnrd.sh b/dns/dnrd/files/dnrd.sh
new file mode 100644
index 000000000000..6abd3601a059
--- /dev/null
+++ b/dns/dnrd/files/dnrd.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+#
+#
+# PROVIDE: dnrd
+# REQUIRE: DAEMON NETWORKING SERVERS
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable dnrd:
+#
+# dnrd_enable="YES"
+#
+
+# override these variables in /etc/rc.conf
+dnrd_enable=${dnrd_enable-"NO"}
+
+. /etc/rc.subr
+
+name=dnrd
+rcvar=$(set_rcvar)
+
+command=/usr/local/sbin/${name}
+pidfile=/var/run/${name}.pid
+
+load_rc_config ${name}
+
+case $1 in
+ "stop")
+ echo "Stopping dnrd."
+ ${command} -k
+ ;;
+ *)
+ run_rc_command "$1"
+ ;;
+esac
+
diff --git a/dns/dnrd/files/patch-Makefile b/dns/dnrd/files/patch-Makefile
deleted file mode 100644
index 5fc2b32ec17b..000000000000
--- a/dns/dnrd/files/patch-Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
---- Makefile Tue Nov 2 19:47:10 1999
-+++ Makefile.new Sat Mar 10 14:28:13 2001
-@@ -1,13 +1,13 @@
--CC = gcc
--COPT = -O2
-+CC = cc
-+COPT =
- CDEF = -D_REENTRANT
--CWARN = -Wall -Werror
--CDBG = -ggdb
--CFLAGS = ${CWARN} ${COPT} ${CDEF} ${CDBG}
-+CWARN = -Wall
-+CDBG =
-+CFLAGS += ${CWARN} ${COPT} ${CDEF} ${CDBG}
- LDFLAGS =
--LIBS = -lpthread
--INSTDIR = /usr/local/sbin
--MANDIR = /usr/local/man/man8
-+LIBS = -lc_r
-+INSTDIR = ${PREFIX}/sbin
-+MANDIR = ${PREFIX}/man/man8
- SHELL = /bin/sh
-
- all: dnrd
-@@ -17,17 +17,16 @@
- rm -f dnrd core tags ID *.o *.d *~ *.bak
-
- install: dnrd
-- strip dnrd
-- install -m 0751 -o root -g root -s dnrd ${INSTDIR}
-- install -m 0644 -o root -g root -s ../doc/dnrd.8 ${MANDIR}
-+ install -m 0755 -s -o root -g wheel -s -c dnrd ${INSTDIR}
-+ install -m 0544 -o root -g wheel -c ../doc/dnrd.8 ${MANDIR}
-
- sources = args.c cache.c common.c dns.c lib.c main.c master.c \
- query.c relay.c sig.c tcp.c udp.c
-
--include $(sources:.c=.d)
-+#include $(sources:.c=.d)
-
- dnrd: $(sources:.c=.o)
-- $(CC) $(LDFLAGS) $(LIBS) $^ -o $@
-+ $(CC) $(LDFLAGS) $(LIBS) *.o -o $@
-
- %.d: %.c
- @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
diff --git a/dns/dnrd/files/patch-args.c b/dns/dnrd/files/patch-args.c
deleted file mode 100644
index 83b672347fa6..000000000000
--- a/dns/dnrd/files/patch-args.c
+++ /dev/null
@@ -1,10 +0,0 @@
---- args.c.orig Sat Jan 6 14:54:15 2001
-+++ args.c Sat Jan 6 14:54:57 2001
-@@ -25,6 +25,7 @@
- #include <stdarg.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#include <unistd.h>
- #if defined(__GNU_LIBRARY__)
- # include <getopt.h>
- #endif
diff --git a/dns/dnrd/files/patch-common.h b/dns/dnrd/files/patch-common.h
deleted file mode 100644
index 9e29c415be18..000000000000
--- a/dns/dnrd/files/patch-common.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- common.h.orig Sat Jan 6 14:52:53 2001
-+++ common.h Sat Jan 6 14:53:00 2001
-@@ -23,6 +23,7 @@
- #ifndef _DNRD_COMMON_H_
- #define _DNRD_COMMON_H_
-
-+#include <sys/types.h>
- #include <netinet/in.h>
- #include <syslog.h>
- #include <semaphore.h>
diff --git a/dns/dnrd/files/patch-configure b/dns/dnrd/files/patch-configure
new file mode 100644
index 000000000000..34d46b5a37f6
--- /dev/null
+++ b/dns/dnrd/files/patch-configure
@@ -0,0 +1,12 @@
+--- configure.orig Wed Jul 21 09:52:13 2004
++++ configure Wed Jul 28 22:34:54 2004
+@@ -4170,8 +4170,7 @@
+
+ case $host_os in
+ netbsd*|bsdi*) ;;
+- freebsd4*) THREAD_CFLAGS="-pthread" ;;
+- freebsd*) THREAD_LIBS="-lc_r" ;;
++ freebsd*) THREAD_CFLAGS="${PTHREAD_CFLAGS}" THREAD_LIBS="${PTHREAD_LIBS}" ;;
+ linux*|openbsd*) THREAD_LIBS="-lpthread" ;;
+ esac
+
diff --git a/dns/dnrd/files/patch-dns.c b/dns/dnrd/files/patch-dns.c
index 5ea94c468580..79360e8ad9d9 100644
--- a/dns/dnrd/files/patch-dns.c
+++ b/dns/dnrd/files/patch-dns.c
@@ -1,5 +1,5 @@
---- dns.c Thu Jan 4 10:37:21 2001
-+++ dns.c.new Sat Mar 10 14:29:38 2001
+--- src/dns.c Thu Jan 4 10:37:21 2001
++++ src/dns.c.new Sat Mar 10 14:29:38 2001
@@ -27,6 +27,7 @@
#include <ctype.h>
diff --git a/dns/dnrd/files/patch-main.c b/dns/dnrd/files/patch-main.c
deleted file mode 100644
index e5a2f673f3e5..000000000000
--- a/dns/dnrd/files/patch-main.c
+++ /dev/null
@@ -1,94 +0,0 @@
---- main.c.orig Fri Jan 5 01:40:42 2001
-+++ main.c Sat Jan 3 16:39:25 2004
-@@ -18,6 +18,7 @@
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-+#include <sys/types.h>
- #include "relay.h"
- #include "cache.h"
- #include "common.h"
-@@ -26,7 +27,6 @@
- #include "master.h"
- #include <stdio.h>
- #include <stdlib.h>
--#include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
-@@ -82,6 +82,10 @@
- /*
- * Parse the command line.
- */
-+ memset(&recv_addr, 0, sizeof(recv_addr));
-+ recv_addr.sin_family = AF_INET;
-+ recv_addr.sin_port = htons(53);
-+
- parse_args(argc, argv);
-
- openlog(progname, LOG_PID, LOG_DAEMON);
-@@ -170,20 +174,20 @@
- * Change our root and current working directories to /etc/dnrd.
- * Also, so some sanity checking on that directory first.
- */
-- dirp = opendir("/etc/dnrd");
-+ dirp = opendir("%%PREFIX%%/etc/dnrd");
- if (!dirp) {
-- log_msg(LOG_ERR, "The directory /etc/dnrd must be created before "
-+ log_msg(LOG_ERR, "The directory %%PREFIX%%/etc/dnrd must be created before "
- "dnrd will run");
- }
-
-- rslt = stat("/etc/dnrd", &st);
-+ rslt = stat("%%PREFIX%%/etc/dnrd", &st);
- if (st.st_uid != 0) {
-- log_msg(LOG_ERR, "The /etc/dnrd directory must be owned by root");
-+ log_msg(LOG_ERR, "The %%PREFIX%%/dnrd directory must be owned by root");
- cleanexit(-1);
- }
- if ((st.st_mode & (S_IWGRP | S_IWOTH)) != 0) {
- log_msg(LOG_ERR,
-- "The /etc/dnrd directory should only be user writable");
-+ "The %%PREFIX%%/etc/dnrd directory should only be user writable");
- cleanexit(-1);
- }
-
-@@ -198,31 +202,31 @@
-
- if (rslt) continue;
- if (S_ISDIR(st.st_mode)) {
-- log_msg(LOG_ERR, "The /etc/dnrd directory must not contain "
-+ log_msg(LOG_ERR, "The %%PREFIX%%/etc/dnrd directory must not contain "
- "subdirectories");
- cleanexit(-1);
- }
- if ((st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH|S_IWGRP|S_IWOTH)) != 0) {
-- log_msg(LOG_ERR, "A file in /etc/dnrd has either execute "
-+ log_msg(LOG_ERR, "A file in %%PREFIX%%/etc/dnrd has either execute "
- "permissions or non-user write permission. Please do a "
- "\"chmod a-x,go-w\" on all files in this directory");
- cleanexit(-1);
- }
- if (st.st_uid != 0) {
-- log_msg(LOG_ERR, "All files in /etc/dnrd must be owned by root");
-+ log_msg(LOG_ERR, "All files in %%PREFIX%%/etc/dnrd must be owned by root");
- cleanexit(-1);
- }
- }
- closedir(dirp);
-
-- if (chdir("/etc/dnrd")) {
-+ if (chdir("%%PREFIX%%/etc/dnrd")) {
- log_msg(LOG_ERR, "couldn't chdir to %s, %s",
-- "/etc/dnrd", strerror(errno));
-+ "%%PREFIX%%/etc/dnrd", strerror(errno));
- cleanexit(-1);
- }
-- if (chroot("/etc/dnrd")) {
-+ if (chroot("%%PREFIX%%/etc/dnrd")) {
- log_msg(LOG_ERR, "couldn't chroot to %s, %s",
-- "/etc/dnrd", strerror(errno));
-+ "%%PREFIX%%/etc/dnrd", strerror(errno));
- cleanexit(-1);
- }
-
diff --git a/dns/dnrd/files/patch-master.c b/dns/dnrd/files/patch-master.c
deleted file mode 100644
index 16377f1155fa..000000000000
--- a/dns/dnrd/files/patch-master.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- master.c.orig Sat Jan 6 15:07:32 2001
-+++ master.c Sat Jan 6 15:06:54 2001
-@@ -37,7 +37,7 @@
- #include "master.h"
- #include "lib.h"
-
--#define MASTER_CONFIG "/etc/dnrd/master"
-+#define MASTER_CONFIG "%%PREFIX%%/etc/dnrd/master"
- #define PACKET_ASSEMBLYSIZE 600
-
-
diff --git a/dns/dnrd/files/patch-query.h b/dns/dnrd/files/patch-query.h
index 31e22ce092bd..ebc5cd6ba907 100644
--- a/dns/dnrd/files/patch-query.h
+++ b/dns/dnrd/files/patch-query.h
@@ -1,5 +1,5 @@
---- query.h.orig Sat Jan 6 14:56:49 2001
-+++ query.h Sat Jan 6 14:56:59 2001
+--- src/query.h.orig Sat Jan 6 14:56:49 2001
++++ src/query.h Sat Jan 6 14:56:59 2001
@@ -25,6 +25,7 @@
#ifndef _DNSR_QUERY_H_
#define _DNSR_QUERY_H_
diff --git a/dns/dnrd/files/patch-src-domnode.c b/dns/dnrd/files/patch-src-domnode.c
new file mode 100644
index 000000000000..d5e42424a676
--- /dev/null
+++ b/dns/dnrd/files/patch-src-domnode.c
@@ -0,0 +1,10 @@
+--- src/domnode.c.orig Mon Jul 19 13:17:21 2004
++++ src/domnode.c Wed Jul 28 22:28:52 2004
+@@ -26,6 +26,7 @@
+
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
diff --git a/dns/dnrd/files/patch-src-relay.c b/dns/dnrd/files/patch-src-relay.c
new file mode 100644
index 000000000000..27ca6de60a61
--- /dev/null
+++ b/dns/dnrd/files/patch-src-relay.c
@@ -0,0 +1,16 @@
+--- src/relay.c.orig Mon Jul 19 13:17:21 2004
++++ src/relay.c Wed Jul 28 22:27:44 2004
+@@ -19,12 +19,12 @@
+ */
+
+ #include <stdio.h>
++#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <errno.h>
+ #include <sys/time.h>
+-#include <sys/types.h>
+ #include <unistd.h>
+ #include <string.h>
+
diff --git a/dns/dnrd/files/patch-tcp.c b/dns/dnrd/files/patch-tcp.c
deleted file mode 100644
index 60aaa68ffbcd..000000000000
--- a/dns/dnrd/files/patch-tcp.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- tcp.c.orig Sat Jan 6 14:53:45 2001
-+++ tcp.c Sat Jan 6 14:53:51 2001
-@@ -23,7 +23,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <signal.h>
--#include <wait.h>
-+#include <sys/wait.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/fcntl.h>
diff --git a/dns/dnrd/files/patch-udp.c b/dns/dnrd/files/patch-udp.c
deleted file mode 100644
index df1a41db4f30..000000000000
--- a/dns/dnrd/files/patch-udp.c
+++ /dev/null
@@ -1,29 +0,0 @@
---- udp.c.orig Sat Jan 3 16:39:53 2004
-+++ udp.c Sat Jan 3 16:40:36 2004
-@@ -74,7 +74,7 @@
-
- /* Read in the message */
- addr_len = sizeof(struct sockaddr_in);
-- len = recvfrom(isock, msg, sizeof(msg), 0,
-+ len = recvfrom(isock, msg, maxsize, 0,
- (struct sockaddr *)&from_addr, &addr_len);
- if (len < 0) {
- log_debug("recvfrom error %s", strerror(errno));
-@@ -172,7 +172,7 @@
- inet_ntoa(dns_srv[k].addr.sin_addr));
- return (-1);
- }
-- else if (rc == len) {
-+ else if (rc > len) {
- log_msg(LOG_NOTICE, "packet too large: %s",
- inet_ntoa(dns_srv[k].addr.sin_addr));
- return (0);
-@@ -202,7 +202,7 @@
- struct sockaddr_in from_addr;
- unsigned addr_len;
-
-- len = dnsrecv(srvidx, msg, sizeof(msg));
-+ len = dnsrecv(srvidx, msg, maxsize);
- if (opt_debug) {
- char buf[80];
- sprintf_cname(&msg[12], buf, 80);
diff --git a/dns/dnrd/pkg-descr b/dns/dnrd/pkg-descr
index f8088fb3657f..420bf72f2a43 100644
--- a/dns/dnrd/pkg-descr
+++ b/dns/dnrd/pkg-descr
@@ -1,21 +1,10 @@
-DNRD is a proxy name server. To clients on your home network,
-it looks just like a name server. In reality, it forwards every
-DNS query to the "real" DNS server, and forwards responses back
-to the client.
+DNRD is a proxy DNS daemon. It supports several forward servers for
+redundancy and/or load-balancing. DNS queries for specific domains can
+be forwarded to a specific group of DNS servers (with redundancy and
+load balancing) for that domain. It is useful for VPNs and also good
+support for offline and dialup sites.
-So, why would you want to use it? DNRD was designed for home
-networks where you might want to dial into more than one ISP
-(ie, your home ISP and a dialup connection to your office). The
-problem with multiple dialups is that you need to change
-/etc/resolv.conf for each one. With DNRD, this is no longer
-necessary.
-
-Your dialup machine will run DNRD (with appropriate options for
-forwarding messages to the desired DNS servers). All other
-machines on the home network, including the dialup machine
-itself, will use the dialup machine as its DNS server.
-
-WWW: http://users.zoominternet.net/~garsh/dnrd/
+WWW: http://dnrd.sourceforge.net
- George Reid
greid@ukug.uk.freebsd.org
diff --git a/dns/dnrd/pkg-plist b/dns/dnrd/pkg-plist
new file mode 100644
index 000000000000..13d26d4353f7
--- /dev/null
+++ b/dns/dnrd/pkg-plist
@@ -0,0 +1,11 @@
+etc/rc.d/dnrd.sh
+sbin/dnrd
+share/doc/dnrd/AUTHORS
+share/doc/dnrd/COPYING
+share/doc/dnrd/ChangeLog
+share/doc/dnrd/NEWS
+share/doc/dnrd/README
+share/doc/dnrd/README-cache
+share/doc/dnrd/README-master
+share/doc/dnrd/master.sample
+@dirrm share/doc/dnrd