Updated my isc-dhcp 4.1.1 update to 4.2.3-P1. Tested on amd64/i386. More so with v6.
Looking for any testing and feedback. Index: Makefile =================================================================== RCS file: /home/cvs/ports/net/isc-dhcp/Makefile,v retrieving revision 1.23 diff -u -p -r1.23 Makefile --- Makefile 16 Nov 2011 00:10:31 -0000 1.23 +++ Makefile 23 Dec 2011 19:30:57 -0000 @@ -4,47 +4,42 @@ COMMENT-main= ISC DHCP Server COMMENT-client= ISC DHCP Client COMMENT-omapi= ISC DHCP OMAPI -VERSION= 3.1.3 -REVISION= 0 +VERSION= 4.2.3-P1 DISTNAME= isc-dhcp-${VERSION} -PKGNAME= isc-dhcp-${VERSION} +PKGNAME= isc-dhcp-${VERSION:S/-P/./} +PKGNAME-main= isc-dhcp-server-${VERSION:S/-P/./} +PKGNAME-client= isc-dhcp-client-${VERSION:S/-P/./} +PKGNAME-omapi= isc-dhcp-omapi-${VERSION:S/-P/./} CATEGORIES= net DISTFILES= dhcp-${VERSION}.tar.gz WRKDIST= ${WRKDIR}/dhcp-${VERSION} -PKGNAME-main= isc-dhcp-server-${VERSION} -PKGNAME-client= isc-dhcp-client-${VERSION} -PKGNAME-omapi= isc-dhcp-omapi-${VERSION} +MASTER_SITES= ${MASTER_SITE_ISC:=dhcp/${VERSION}/} \ + ${MASTER_SITE_ISC:=dhcp/} -MASTER_SITES= ${MASTER_SITE_ISC:=dhcp/} \ - ${MASTER_SITE_ISC:=dhcp/dhcp-3.0-history/} - -HOMEPAGE= http://www.isc.org/products/DHCP/ +HOMEPAGE= http://www.isc.org/software/dhcp/ MAINTAINER= Jakob Schlyter <ja...@openbsd.org> +# ISC PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes WANTLIB= c -USE_GROFF = Yes -NO_REGRESS= Yes MULTI_PACKAGES= -main -omapi -client -CONFIGURE_STYLE= simple - -EXAMPLEDIR= share/examples/isc-dhcp +USE_GROFF= Yes +CONFIGURE_STYLE= gnu +CONFIGURE_ARGS+= --enable-early-chroot \ + --enable-paranoia \ -do-configure: - cd ${WRKSRC} && ./configure \ - --copts "${CONFIGURE_ARGS} -DPARANOIA -DEARLY_CHROOT ${CFLAGS}" +NO_REGRESS= Yes -post-extract: - @sed s,y0y0y0,${PREFIX}, < ${FILESDIR}/site.conf > ${WRKSRC}/site.conf +EXAMPLEDIR= share/examples/isc-dhcp post-install: ${INSTALL_DATA_DIR} ${PREFIX}/${EXAMPLEDIR} Index: distinfo =================================================================== RCS file: /home/cvs/ports/net/isc-dhcp/distinfo,v retrieving revision 1.14 diff -u -p -r1.14 distinfo --- distinfo 22 Oct 2009 21:13:29 -0000 1.14 +++ distinfo 24 Dec 2011 12:27:42 -0000 @@ -1,5 +1,5 @@ -MD5 (dhcp-3.1.3.tar.gz) = buiviyg8lbO0216Itt2aJg== -RMD160 (dhcp-3.1.3.tar.gz) = IzfRzCnnvorJc9i/7GMzZ903wSo= -SHA1 (dhcp-3.1.3.tar.gz) = kv6lA2w4qEDy+US2zR2QsY+VC3w= -SHA256 (dhcp-3.1.3.tar.gz) = yzYyR6iXvq9XCMmNOoDbqO3Y9jnWvR9K2mxaZLpR4tQ= -SIZE (dhcp-3.1.3.tar.gz) = 804097 +MD5 (dhcp-4.2.3-P1.tar.gz) = BFmfFVelyv0Q13RSZ6aMiw== +RMD160 (dhcp-4.2.3-P1.tar.gz) = /BXcBYnWmMfR+MjfBF8LOWswwo4= +SHA1 (dhcp-4.2.3-P1.tar.gz) = y0tljPnZZ0+tfuEdBhk1aXhMYaI= +SHA256 (dhcp-4.2.3-P1.tar.gz) = SGBiXgfCkHaNUTuaImDmVa5LrUzFxMj16q60+cv6lq8= +SIZE (dhcp-4.2.3-P1.tar.gz) = 9525670 Index: files/site.conf =================================================================== RCS file: /home/cvs/ports/net/isc-dhcp/files/site.conf,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 site.conf --- files/site.conf 24 Jun 2002 20:50:03 -0000 1.1.1.1 +++ files/site.conf 6 Sep 2010 01:50:32 -0000 @@ -1,11 +0,0 @@ -# $OpenBSD: site.conf,v 1.1.1.1 2002/06/24 20:50:03 jakob Exp $ -# -# ISC DHCP site.conf to locate things in y0y0y0 - -USERBINDIR=y0y0y0/bin -BINDIR=y0y0y0/sbin -CLIENTBINDIR=y0y0y0/sbin -ADMMANDIR=y0y0y0/man/cat8 -FFMANDIR=y0y0y0/man/cat5 -LIBMANDIR=y0y0y0/man/cat3 -USRMANDIR=y0y0y0/man/cat1 Index: patches/patch-Makefile_conf =================================================================== RCS file: patches/patch-Makefile_conf diff -N patches/patch-Makefile_conf --- patches/patch-Makefile_conf 24 Sep 2007 06:17:19 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -$OpenBSD: patch-Makefile_conf,v 1.2 2007/09/24 06:17:19 jakob Exp $ ---- Makefile.conf.orig Thu Jun 16 21:39:35 2005 -+++ Makefile.conf Fri Jul 13 09:25:09 2007 -@@ -199,6 +199,7 @@ MINORVERSION=MinorVersion - ##--openbsd-- - #CF = cf/openbsd.h - #SCRIPT=openbsd -+INSTALL = install -c -m 555 -s - ##--openbsd-- - - ## FreeBSD Index: patches/patch-common_socket_c =================================================================== RCS file: patches/patch-common_socket_c diff -N patches/patch-common_socket_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-common_socket_c 23 Dec 2011 19:14:49 -0000 @@ -0,0 +1,19 @@ +$OpenBSD$ +--- common/socket.c.orig Mon Jun 27 12:18:20 2011 ++++ common/socket.c Fri Dec 23 14:14:40 2011 +@@ -717,6 +717,7 @@ ssize_t send_packet6(struct interface_info *interface, + /* + * Set the target address we're sending to. + */ ++ to->sin6_scope_id = if_nametoindex(interface->name); + m.msg_name = to; + m.msg_namelen = sizeof(*to); + +@@ -747,7 +748,6 @@ ssize_t send_packet6(struct interface_info *interface, + pktinfo = (struct in6_pktinfo *)CMSG_DATA(cmsg); + memset(pktinfo, 0, sizeof(*pktinfo)); + pktinfo->ipi6_ifindex = if_nametoindex(interface->name); +- m.msg_controllen = cmsg->cmsg_len; + + result = sendmsg(interface->wfdesc, &m, 0); + if (result < 0) { Index: patches/patch-paranoia =================================================================== RCS file: patches/patch-paranoia diff -N patches/patch-paranoia --- patches/patch-paranoia 12 Oct 2006 08:00:19 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,168 +0,0 @@ ---- server/dhcpd.c Thu Jun 21 22:12:58 2001 -+++ server/dhcpd.c Wed Oct 17 08:23:00 2001 -@@ -56,6 +56,16 @@ - #include "version.h" - #include <omapip/omapip_p.h> - -+#if defined (PARANOIA) -+# include <sys/types.h> -+# include <unistd.h> -+# include <pwd.h> -+/* get around the ISC declaration of group */ -+# define group real_group -+# include <grp.h> -+# undef group -+#endif /* PARANOIA */ -+ - static void usage PROTO ((void)); - - TIME cur_time; -@@ -204,6 +214,22 @@ - omapi_object_dereference (&listener, MDL); - } - -+#if defined (PARANOIA) -+/* to be used in one of two possible scenarios */ -+static void setup_chroot (char *chroot_dir) { -+ if (geteuid()) -+ log_fatal ("you must be root to use chroot"); -+ -+ if (chroot(chroot_dir)) { -+ log_fatal ("chroot(\"%s\"): %m", chroot_dir); -+ } -+ if (chdir ("/")) { -+ /* probably permission denied */ -+ log_fatal ("chdir(\"/\"): %m"); -+ } -+} -+#endif /* PARANOIA */ -+ - int main (argc, argv, envp) - int argc; - char **argv, **envp; -@@ -236,6 +262,14 @@ - char *traceinfile = (char *)0; - char *traceoutfile = (char *)0; - #endif -+#if defined (PARANOIA) -+ char *set_user = 0; -+ char *set_group = 0; -+ char *set_chroot = 0; -+ -+ uid_t set_uid = 0; -+ gid_t set_gid = 0; -+#endif /* PARANOIA */ - - /* Make sure we have stdin, stdout and stderr. */ - status = open ("/dev/null", O_RDWR); -@@ -298,6 +332,20 @@ - if (++i == argc) - usage (); - server = argv [i]; -+#if defined (PARANOIA) -+ } else if (!strcmp (argv [i], "-user")) { -+ if (++i == argc) -+ usage (); -+ set_user = argv [i]; -+ } else if (!strcmp (argv [i], "-group")) { -+ if (++i == argc) -+ usage (); -+ set_group = argv [i]; -+ } else if (!strcmp (argv [i], "-chroot")) { -+ if (++i == argc) -+ usage (); -+ set_chroot = argv [i]; -+#endif /* PARANOIA */ - } else if (!strcmp (argv [i], "-cf")) { - if (++i == argc) - usage (); -@@ -397,6 +445,44 @@ - trace_seed_stop, MDL); - #endif - -+#if defined (PARANOIA) -+ /* get user and group info if those options were given */ -+ if (set_user) { -+ struct passwd *tmp_pwd; -+ -+ if (geteuid()) -+ log_fatal ("you must be root to set user"); -+ -+ if (!(tmp_pwd = getpwnam(set_user))) -+ log_fatal ("no such user: %s", set_user); -+ -+ set_uid = tmp_pwd->pw_uid; -+ -+ /* use the user's group as the default gid */ -+ if (!set_group) -+ set_gid = tmp_pwd->pw_gid; -+ } -+ -+ if (set_group) { -+/* get around the ISC declaration of group */ -+#define group real_group -+ struct group *tmp_grp; -+ -+ if (geteuid()) -+ log_fatal ("you must be root to set group"); -+ -+ if (!(tmp_grp = getgrnam(set_group))) -+ log_fatal ("no such group: %s", set_group); -+ -+ set_gid = tmp_grp->gr_gid; -+#undef group -+ } -+ -+# if defined (EARLY_CHROOT) -+ if (set_chroot) setup_chroot (set_chroot); -+# endif /* EARLY_CHROOT */ -+#endif /* PARANOIA */ -+ - /* Default to the DHCP/BOOTP port. */ - if (!local_port) - { -@@ -500,6 +586,10 @@ - - postconf_initialization (quiet); - -+#if defined (PARANOIA) && !defined (EARLY_CHROOT) -+ if (set_chroot) setup_chroot (set_chroot); -+#endif /* PARANOIA && !EARLY_CHROOT */ -+ - /* test option should cause an early exit */ - if (cftest && !lftest) - exit(0); -@@ -543,6 +633,22 @@ - exit (0); - } - -+#if defined (PARANOIA) -+ /* change uid to the specified one */ -+ -+ if (set_gid) { -+ if (setgroups (0, (void *)0)) -+ log_fatal ("setgroups: %m"); -+ if (setgid (set_gid)) -+ log_fatal ("setgid(%d): %m", (int) set_gid); -+ } -+ -+ if (set_uid) { -+ if (setuid (set_uid)) -+ log_fatal ("setuid(%d): %m", (int) set_uid); -+ } -+#endif /* PARANOIA */ -+ - /* Read previous pid file. */ - if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) { - status = read (i, pbuf, (sizeof pbuf) - 1); -@@ -888,6 +994,10 @@ - - log_fatal ("Usage: dhcpd [-p <UDP port #>] [-d] [-f]%s%s%s%s", - "\n [-cf config-file] [-lf lease-file]", -+#if defined (PARANOIA) -+ /* meld into the following string */ -+ "\n [-user user] [-group group] [-chroot dir]" -+#endif /* PARANOIA */ - #if defined (TRACING) - "\n [-tf trace-output-file]", - "\n [-play trace-input-file]", Index: patches/patch-paranoia_perms =================================================================== RCS file: patches/patch-paranoia_perms diff -N patches/patch-paranoia_perms --- patches/patch-paranoia_perms 12 Oct 2006 08:00:19 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ ---- server/dhcpd.c 2003-11-05 14:08:09.000000000 -0800 -+++ server/dhcpd.c 2003-11-05 14:15:32.000000000 -0800 -@@ -602,6 +602,12 @@ - if (lftest) - exit (0); - -+#if defined (PARANOIA) -+ /* Set proper permissions... */ -+ if (lchown (path_dhcpd_db, set_uid, set_gid)) -+ log_fatal ("lchown(%s, %d, %d): %m", path_dhcpd_db, (int) set_uid, (int) set_gid); -+#endif /* PARANOIA */ -+ - /* Discover all the network interfaces and initialize them. */ - discover_interfaces (DISCOVER_SERVER); - Index: patches/patch-server_dhcpd_c =================================================================== RCS file: patches/patch-server_dhcpd_c diff -N patches/patch-server_dhcpd_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-server_dhcpd_c 23 Dec 2011 19:14:46 -0000 @@ -0,0 +1,16 @@ +$OpenBSD$ +--- server/dhcpd.c.orig Thu Apr 21 10:08:15 2011 ++++ server/dhcpd.c Fri Dec 23 14:14:41 2011 +@@ -705,6 +705,12 @@ main(int argc, char **argv) { + if (lftest) + exit (0); + ++#if defined (PARANOIA) ++ /* Set proper permissions... */ ++ if (lchown (path_dhcpd_db, set_uid, set_gid)) ++ log_fatal ("lchown(%s, %d, %d): %m", path_dhcpd_db, (int) set_uid, (int) set_gid); ++#endif /* PARANOIA */ ++ + /* Discover all the network interfaces and initialize them. */ + discover_interfaces(DISCOVER_SERVER); + Index: pkg/PLIST-client =================================================================== RCS file: /home/cvs/ports/net/isc-dhcp/pkg/PLIST-client,v retrieving revision 1.3 diff -u -p -r1.3 PLIST-client --- pkg/PLIST-client 22 Oct 2009 21:13:29 -0000 1.3 +++ pkg/PLIST-client 29 Jan 2011 04:48:43 -0000 @@ -1,10 +1,9 @@ @comment $OpenBSD: PLIST-client,v 1.3 2009/10/22 21:13:29 jakob Exp $ @conflict isc-dhcp-* +@man man/man5/dhclient.conf.5 +@man man/man5/dhclient.leases.5 +@man man/man8/dhclient-script.8 +@man man/man8/dhclient.8 @bin sbin/dhclient -sbin/dhclient-script share/examples/isc-dhcp/ share/examples/isc-dhcp/dhclient.conf -@man man/cat5/dhclient.conf.5 -@man man/cat5/dhclient.leases.5 -@man man/cat8/dhclient-script.8 -@man man/cat8/dhclient.8 Index: pkg/PLIST-main =================================================================== RCS file: /home/cvs/ports/net/isc-dhcp/pkg/PLIST-main,v retrieving revision 1.3 diff -u -p -r1.3 PLIST-main --- pkg/PLIST-main 22 Oct 2009 21:13:29 -0000 1.3 +++ pkg/PLIST-main 6 Sep 2010 01:50:32 -0000 @@ -1,12 +1,12 @@ @comment $OpenBSD: PLIST-main,v 1.3 2009/10/22 21:13:29 jakob Exp $ @conflict isc-dhcp-* @pkgpath net/isc-dhcp -man/cat5/dhcp-eval.5 -man/cat5/dhcp-options.5 -man/cat5/dhcpd.conf.5 -man/cat5/dhcpd.leases.5 -man/cat8/dhcpd.8 -man/cat8/dhcrelay.8 +@man man/man5/dhcp-eval.5 +@man man/man5/dhcp-options.5 +@man man/man5/dhcpd.conf.5 +@man man/man5/dhcpd.leases.5 +@man man/man8/dhcpd.8 +@man man/man8/dhcrelay.8 @bin sbin/dhcpd @bin sbin/dhcrelay share/examples/isc-dhcp/ Index: pkg/PLIST-omapi =================================================================== RCS file: /home/cvs/ports/net/isc-dhcp/pkg/PLIST-omapi,v retrieving revision 1.3 diff -u -p -r1.3 PLIST-omapi --- pkg/PLIST-omapi 22 Oct 2009 21:13:29 -0000 1.3 +++ pkg/PLIST-omapi 29 Jan 2011 04:48:43 -0000 @@ -1,21 +1,23 @@ @comment $OpenBSD: PLIST-omapi,v 1.3 2009/10/22 21:13:29 jakob Exp $ @conflict isc-dhcp-* @bin bin/omshell -include/dhcpctl.h +include/dhcpctl/ +include/dhcpctl/dhcpctl.h include/isc-dhcp/ -include/isc-dhcp/boolean.h include/isc-dhcp/dst.h -include/isc-dhcp/int.h -include/isc-dhcp/lang.h -include/isc-dhcp/list.h -include/isc-dhcp/result.h -include/isc-dhcp/types.h include/omapip/ include/omapip/alloc.h include/omapip/buffer.h +include/omapip/convert.h +include/omapip/hash.h +include/omapip/isclib.h include/omapip/omapip.h +include/omapip/omapip_p.h +include/omapip/result.h +include/omapip/trace.h lib/libdhcpctl.a +lib/libdst.a lib/libomapi.a -@man man/cat1/omshell.1 -@man man/cat3/dhcpctl.3 -@man man/cat3/omapi.3 +@man man/man1/omshell.1 +@man man/man3/dhcpctl.3 +@man man/man3/omapi.3 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.