diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2009-07-28 07:30:43 +0800 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2009-07-28 07:30:43 +0800 |
commit | 6f0c01bc51c820380334ac61519dfcccdae49dd7 (patch) | |
tree | 9f932d40f51d1abbeb8adc01978aee94cd8822c3 /net/isc-dhcp31-server | |
parent | f6d49f749037539b0590bfa26243dc1672375c8b (diff) | |
download | freebsd-ports-gnome-6f0c01bc51c820380334ac61519dfcccdae49dd7.tar.gz freebsd-ports-gnome-6f0c01bc51c820380334ac61519dfcccdae49dd7.tar.zst freebsd-ports-gnome-6f0c01bc51c820380334ac61519dfcccdae49dd7.zip |
Update to 3.1.2p1
add jail support
add a checkconfig function to rcNG script to aid restarting
PR: ports/136890
Approved by: itetcu@ (mentor)
Diffstat (limited to 'net/isc-dhcp31-server')
-rw-r--r-- | net/isc-dhcp31-server/Makefile | 29 | ||||
-rw-r--r-- | net/isc-dhcp31-server/distinfo | 6 | ||||
-rw-r--r-- | net/isc-dhcp31-server/files/isc-dhcpd.in | 15 | ||||
-rw-r--r-- | net/isc-dhcp31-server/files/patch-server::dhcpd.c | 51 |
4 files changed, 50 insertions, 51 deletions
diff --git a/net/isc-dhcp31-server/Makefile b/net/isc-dhcp31-server/Makefile index 46d7a1fc0b01..a0aad6a84e14 100644 --- a/net/isc-dhcp31-server/Makefile +++ b/net/isc-dhcp31-server/Makefile @@ -7,20 +7,18 @@ # PORTNAME= dhcp -PORTVERSION= 3.1.1 +PORTVERSION= 3.1.2p1 PORTREVISION= ${DHCP_PORTREVISION} CATEGORIES= net MASTER_SITES= ${MASTER_SITE_ISC} MASTER_SITE_SUBDIR= dhcp dhcp/dhcp-3.1-history PKGNAMEPREFIX= isc- PKGNAMESUFFIX= 31-${SUBSYS} -DISTNAME= ${PORTNAME}-${RELEASE}${VERSION}${PATCHLEVEL} +DISTNAME= ${PORTNAME}-${PORTVERSION} MAINTAINER= jpaetzel@FreeBSD.org COMMENT?= The ISC Dynamic Host Configuration Protocol server -BROKEN= Not yet integrated and tested - PORTREVISION_SERVER= 0 PORTREVISION_CLIENT= 0 PORTREVISION_RELAY= 0 @@ -85,29 +83,6 @@ PKGDEINSTALL= ${PKGINSTALL} PKGMESSAGE= ${WRKDIR}/pkg-message PLIST= ${.CURDIR}/pkg-plist -# Local variables -# - -# for instance, possible versions are: -# 1.2.r3.4 (or 1.2.b3.4), 1.2.r3 (or 1.2.b3), 1.2.3, 1.2 -# which have to become: -# 1.2rc3pl4 (or 1.2beta3pl4), 1.2rc3 (or 1.2beta3), 1.2.3, 1.2 -# so, the magic things are: -VERSION= -PATCHLEVEL= -.if ${PORTVERSION:R:E:M[br]*} != "" -RELEASE= ${PORTVERSION:R:R} -VERSION= ${PORTVERSION:R:E:S/b/beta/:S/r/rc/} -PATCHLEVEL= pl${PORTVERSION:E} -.elif ${PORTVERSION:E:M[br]*} != "" -RELEASE= ${PORTVERSION:R} -VERSION= ${PORTVERSION:E:S/b/beta/:S/r/rc/} -#.elif ${PORTVERSION:R:E} != "" -#RELEASE= ${PORTVERSION:R} -#PATCHLEVEL= pl${PORTVERSION:E} -.else -RELEASE= ${PORTVERSION} -.endif PATCH_SUBDIRS= common minires dst omapip .if ${SUBSYS} == server || ${SUBSYS} == devel diff --git a/net/isc-dhcp31-server/distinfo b/net/isc-dhcp31-server/distinfo index d2e77a5735b6..1739445a8b4c 100644 --- a/net/isc-dhcp31-server/distinfo +++ b/net/isc-dhcp31-server/distinfo @@ -1,3 +1,3 @@ -MD5 (dhcp-3.1.1.tar.gz) = fcc19330a9c3a0efb5620409214652a9 -SHA256 (dhcp-3.1.1.tar.gz) = 129024c7545e3e8d37e75cd5d534b50c53955592c4935189a57916e216355f6d -SIZE (dhcp-3.1.1.tar.gz) = 798228 +MD5 (dhcp-3.1.2p1.tar.gz) = 787b2924a1965f0d8558521b36dca73d +SHA256 (dhcp-3.1.2p1.tar.gz) = e0cb405e0fef0ecebec7aaed294032a06178ff28be87498596e6069ccda4341e +SIZE (dhcp-3.1.2p1.tar.gz) = 792355 diff --git a/net/isc-dhcp31-server/files/isc-dhcpd.in b/net/isc-dhcp31-server/files/isc-dhcpd.in index b07255550367..b01705589f8f 100644 --- a/net/isc-dhcp31-server/files/isc-dhcpd.in +++ b/net/isc-dhcp31-server/files/isc-dhcpd.in @@ -700,6 +700,20 @@ dhcpd_uninstall () fi } +dhcpd_checkconfig () +{ + local rc_flags_mod + setup_flags + rc_flags_mod="$rc_flags" + # Eliminate '-q' flag if it is present + case "$rc_flags" in + "-q") rc_flags_mod=`echo "$(rc_flags)" | sed -Ee 's/(^-q|-q|-q$)'//` ;; + esac + if ! ${command} -t -q ${rc_flags_mod}; then + err 1 "`${command} -t ${rc_flags_mod}` Configuration file sanity check failed" + fi +} + rcvar=${name}_enable load_rc_config ${name} @@ -718,6 +732,7 @@ pidfile=${_dhcpd_pidfile} required_files=${dhcpd_conf} start_precmd=${name}_precmd stop_postcmd=${name}_postcmd +restart_precmd="dhcpd_checkconfig" install_cmd=dhcpd_install uninstall_cmd=dhcpd_uninstall extra_commands="install uninstall" diff --git a/net/isc-dhcp31-server/files/patch-server::dhcpd.c b/net/isc-dhcp31-server/files/patch-server::dhcpd.c index c45ed9214792..24feeeaff4ee 100644 --- a/net/isc-dhcp31-server/files/patch-server::dhcpd.c +++ b/net/isc-dhcp31-server/files/patch-server::dhcpd.c @@ -1,5 +1,5 @@ ---- server/dhcpd.c.orig Thu Jun 10 19:59:52 2004 -+++ server/dhcpd.c Fri Jun 25 15:49:09 2004 +--- server/dhcpd.c.orig 2009-07-18 12:17:49.000000000 +0000 ++++ server/dhcpd.c 2009-07-18 12:16:17.000000000 +0000 @@ -47,6 +47,22 @@ #include "version.h" #include <omapip/omapip_p.h> @@ -22,8 +22,8 @@ + static void usage PROTO ((void)); - TIME cur_time; -@@ -195,6 +211,35 @@ + struct iaddr server_identifier; +@@ -193,6 +209,46 @@ omapi_object_dereference (&listener, MDL); } @@ -42,14 +42,25 @@ +#endif /* PARANOIA */ + +#if defined (JAIL) -+static void setup_jail (char *chroot_dir, char *hostname, u_int32_t ip_number) ++#if !defined(JAIL_API_VERSION) ++#define JAIL_API_VERSION 0 ++#endif ++static void setup_jail (char *chroot_dir, char *hostname, struct in_addr ip_addr) +{ + struct jail j; + -+ j.version = 0; ++ memset(&j, 0, sizeof(j)); ++ j.version = JAIL_API_VERSION; + j.path = chroot_dir; + j.hostname = hostname; -+ j.ip_number = ip_number; ++#if JAIL_API_VERSION == 0 ++ j.ip_number = ntoh1(ip_addr.s_addr); ++#elif JAIL_API_VERSION ==2 ++ j.ip4s = 1; ++ j.ip4 = &ip_addr; ++#else ++#error Unsupported jail API ++#endif + + if (jail (&j) < 0) + log_fatal ("jail(%s, %s): %m", chroot_dir, hostname); @@ -59,7 +70,7 @@ int main (argc, argv, envp) int argc; char **argv, **envp; -@@ -227,6 +272,25 @@ +@@ -225,6 +281,25 @@ char *traceinfile = (char *)0; char *traceoutfile = (char *)0; #endif @@ -78,14 +89,14 @@ +#endif /* PARANOIA || JAIL */ +#if defined (JAIL) + char *set_jail = 0; -+ u_int32_t jail_ip_address = 0; /* Good as long as it's IPv4 ... */ ++ struct in_addr jail_ip_address; + int no_dhcpd_jail = 0; + char *s2; +#endif /* JAIL */ - /* Make sure we have stdin, stdout and stderr. */ - status = open ("/dev/null", O_RDWR); -@@ -289,6 +353,39 @@ + /* Make sure that file descriptors 0 (stdin), 1, (stdout), and + 2 (stderr) are open. To do this, we assume that when we +@@ -290,6 +365,38 @@ if (++i == argc) usage (); server = argv [i]; @@ -119,13 +130,12 @@ + usage (); + if (inet_pton (AF_INET, argv[i], &jail_ip_address) < 0) + log_fatal ("invalid ip address: %s", argv[i]); -+ jail_ip_address = ntohl (jail_ip_address); + no_dhcpd_jail = 1; +#endif /* JAIL */ } else if (!strcmp (argv [i], "-cf")) { if (++i == argc) usage (); -@@ -366,6 +463,28 @@ +@@ -367,6 +474,27 @@ if (!no_dhcpd_pid && (s = getenv ("PATH_DHCPD_PID"))) { path_dhcpd_pid = s; } @@ -148,13 +158,12 @@ + set_jail = s; + if (inet_pton (AF_INET, s2, &jail_ip_address) < 0) + log_fatal ("invalid ip address: %s", s2); -+ jail_ip_address = ntohl (jail_ip_address); + } +#endif /* JAIL */ if (!quiet) { log_info ("%s %s", message, DHCP_VERSION); -@@ -388,6 +507,57 @@ +@@ -393,6 +521,57 @@ trace_seed_stop, MDL); #endif @@ -212,7 +221,7 @@ /* Default to the DHCP/BOOTP port. */ if (!local_port) { -@@ -462,6 +632,9 @@ +@@ -467,6 +646,9 @@ #endif /* Initialize icmp support... */ @@ -222,7 +231,7 @@ if (!cftest && !lftest) icmp_startup (1, lease_pinged); -@@ -491,6 +664,14 @@ +@@ -496,6 +678,14 @@ postconf_initialization (quiet); @@ -237,7 +246,7 @@ /* test option should cause an early exit */ if (cftest && !lftest) exit(0); -@@ -533,7 +714,22 @@ +@@ -538,7 +728,22 @@ else if (pid) exit (0); } @@ -259,8 +268,8 @@ + /* Read previous pid file. */ if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) { - status = read (i, pbuf, (sizeof pbuf) - 1); -@@ -877,8 +1073,24 @@ + status = read(i, pbuf, (sizeof pbuf) - 1); +@@ -877,8 +1082,24 @@ log_info (copyright); log_info (arr); |