PSARC 2015/160 ISC libomapi, libdst, and libdhcpctl
20411483 Need dynamic library support for ISC DHCP component
21379777 header files missing in userland isc-dhcp package manifest
--- a/components/isc-dhcp/Makefile Wed Jan 11 11:03:56 2017 -0800
+++ b/components/isc-dhcp/Makefile Fri Jan 13 13:04:10 2017 -0800
@@ -18,7 +18,7 @@
#
# CDDL HEADER END
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk
@@ -41,30 +41,48 @@
include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk
+include $(WS_MAKE_RULES)/lint-libraries.mk
+
+# Enable ASLR for this component
+ASLR_MODE = $(ASLR_ENABLE)
+
+LINT_FLAGS += -I$(BUILD_DIR_32)/includes \
+ -I$(BUILD_DIR_64)/includes -I$(SOURCE_DIR)/includes -I.
COMPONENT_PRE_CONFIGURE_ACTION = \
($(CLONEY) $(SOURCE_DIR) $(@D))
+# Some patches need configure script re-creation.
+COMPONENT_PREP_ACTION +=(cd $(@D); autoreconf -vfi);
+
CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)/inet
-CONFIGURE_OPTIONS += --sbindir=$(USRLIBDIR)/inet
-CONFIGURE_OPTIONS += --bindir=$(USRSBINDIR)
+CONFIGURE_OPTIONS.32 += --sbindir=$(USRLIBDIR)/inet
+CONFIGURE_OPTIONS.32 += --bindir=$(USRSBINDIR)
+CONFIGURE_OPTIONS.64 += --sbindir=$(USRLIBDIR)/inet/$(MACH64)
+CONFIGURE_OPTIONS.64 += --bindir=$(USRSBINDIR)/$(MACH64)
CONFIGURE_OPTIONS += --enable-use-sockets
CONFIGURE_OPTIONS += --enable-ipv4-pktinfo
+CONFIGURE_OPTIONS += --with-pic
# Disable message in omapip/errwarn.c.
CPPFLAGS += -DNOMINUM
CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
-build: $(BUILD_32)
+CFLAGS += -g -fPIC
+CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
-install: build $(INSTALL_32) $(PROTO_DIR)/dhcpd.leases
+configure: $(CONFIGURE_32_and_64)
+build: $(BUILD_32_and_64)
-test: build
+install: $(INSTALL_32_and_64) $(PROTO_DIR)/dhcpd.leases
+
+test: $(TEST_32_and_64) #build
@cd $(BUILD_DIR_32); $(MAKE) check
+ @cd $(BUILD_DIR_64); $(MAKE) check
-$(PROTO_DIR)/dhcpd.leases: $(INSTALL_32)
+$(PROTO_DIR)/dhcpd.leases: #$(INSTALL_32_and_64)
$(TOUCH) [email protected]
REQUIRED_PACKAGES += shell/ksh93
--- a/components/isc-dhcp/dhcp.p5m Wed Jan 11 11:03:56 2017 -0800
+++ b/components/isc-dhcp/dhcp.p5m Fri Jan 13 13:04:10 2017 -0800
@@ -18,7 +18,7 @@
#
# CDDL HEADER END
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
#
<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
set name=pkg.fmri \
@@ -32,7 +32,7 @@
set name=info.classification value=org.opensolaris.category.2008:System/Services
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
-set name=org.opensolaris.arc-caseid value=PSARC/2011/043
+set name=org.opensolaris.arc-caseid value=PSARC/2011/043 value=PSARC/2015/160
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
#
dir path=etc
@@ -52,6 +52,26 @@
path=lib/svc/manifest/network/dhcp/isc-dhcp-server.xml group=sys mode=0444
dir path=lib/svc/method
file Solaris/isc-dhcp.sh path=lib/svc/method/isc-dhcp mode=0555
+file path=usr/include/dhcpctl/dhcpctl.h
+file path=usr/include/isc-dhcp/boolean.h
+file path=usr/include/isc-dhcp/commandline.h
+file path=usr/include/isc-dhcp/dst.h
+file path=usr/include/isc-dhcp/formatcheck.h
+file path=usr/include/isc-dhcp/int.h
+file path=usr/include/isc-dhcp/lang.h
+file path=usr/include/isc-dhcp/list.h
+file path=usr/include/isc-dhcp/mem.h
+file path=usr/include/isc-dhcp/print.h
+file path=usr/include/isc-dhcp/result.h
+file path=usr/include/isc-dhcp/string.h
+file path=usr/include/isc-dhcp/types.h
+file path=usr/include/omapip/alloc.h
+file path=usr/include/omapip/buffer.h
+file path=usr/include/omapip/convert.h
+file path=usr/include/omapip/hash.h
+file path=usr/include/omapip/omapip.h
+file path=usr/include/omapip/omapip_p.h
+file path=usr/include/omapip/trace.h
dir path=usr
dir path=usr/lib
dir path=usr/lib/help
@@ -64,12 +84,34 @@
dir path=usr/lib/inet
file path=usr/lib/inet/dhcpd
file path=usr/lib/inet/dhcrelay
+link path=usr/lib/libdhcpctl.so target=libdhcpctl.so.1
+file path=usr/lib/libdhcpctl.so.1
+link path=usr/lib/libdst.so target=libdst.so.1
+file path=usr/lib/libdst.so.1
+link path=usr/lib/libomapi.so target=libomapi.so.1
+file path=usr/lib/libomapi.so.1
+file path=usr/lib/llib-ldhcpctl
+file path=usr/lib/llib-ldhcpctl.ln
+file path=usr/lib/llib-ldst
+file path=usr/lib/llib-ldst.ln
+file path=usr/lib/llib-lomapi
+file path=usr/lib/llib-lomapi.ln
+link path=usr/lib/$(MACH64)/libdhcpctl.so target=libdhcpctl.so.1
+file path=usr/lib/$(MACH64)/libdhcpctl.so.1
+link path=usr/lib/$(MACH64)/libdst.so target=libdst.so.1
+file path=usr/lib/$(MACH64)/libdst.so.1
+link path=usr/lib/$(MACH64)/libomapi.so target=libomapi.so.1
+file path=usr/lib/$(MACH64)/libomapi.so.1
+file path=usr/lib/$(MACH64)/llib-ldhcpctl.ln
+file path=usr/lib/$(MACH64)/llib-ldst.ln
+file path=usr/lib/$(MACH64)/llib-lomapi.ln
dir path=usr/sbin
-file path=usr/sbin/omshell
+file usr/sbin/omshell path=usr/sbin/$(MACH32)/omshell
dir path=usr/share
dir path=usr/share/man
dir path=usr/share/man/man1
file path=usr/share/man/man1/omshell.1
+file path=usr/share/man/man3/omapi.3
dir path=usr/share/man/man5
file path=usr/share/man/man5/dhcp-eval.5
file path=usr/share/man/man5/dhcp-options.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/llib-ldhcpctl Fri Jan 13 13:04:10 2017 -0800
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <sys/time.h>
+#include <dhcpctl/dhcpctl.h>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/llib-ldst Fri Jan 13 13:04:10 2017 -0800
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <config.h>
+#include <isc-dhcp/dst.h>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/llib-lomapi Fri Jan 13 13:04:10 2017 -0800
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include <config.h>
+#include <omapip/omapip.h>
+#include <omapip/trace.h>
+#include <isc-dhcp/result.h>
+#include <isc-dhcp/boolean.h>
+#include <isc-dhcp/lang.h>
+#include <isc-dhcp/list.h>
+#include <isc-dhcp/types.h>
+#include <isc-dhcp/int.h>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/isc-dhcp/patches/005-dhcp-dynamiclibraries.patch Fri Jan 13 13:04:10 2017 -0800
@@ -0,0 +1,154 @@
+# HG changeset patch
+# User Praveen Kumar Muthuswamy <[email protected]>
+# Date 1428520414 25200
+# Wed Apr 08 12:13:34 2015 -0700
+# Node ID 045f212982ea4578a9dafb925ad62cf366802dc6
+# Parent 6470d3cc3ce1677a8283cdf15257c2b8c0ab43c9
+/*
+ * This patch file (dhcp-dynamiclibraries.patch) was developed in-house to
+ * allow isc-dhcp to build and package shared objects for libomapi, libdhcpctl,
+ * and libdst. Upstream (ISC) has been made aware of this requirement and the
+ * the patch through a service ticket and they are actively working on
+ * developing the patch.
+ */
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+--- a/client/Makefile.am
++++ b/client/Makefile.am
[email protected]@ -5,7 +5,7 @@
+ scripts/netbsd scripts/nextstep scripts/openbsd \
+ scripts/solaris scripts/openwrt
+ dhclient_LDADD = ../common/libdhcp.a ../minires/libres.a \
+- ../omapip/libomapi.a ../dst/libdst.a
++ ../omapip/libomapi.la ../dst/libdst.la
+ man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
+ EXTRA_DIST = $(man_MANS)
+
+diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
+--- a/common/tests/Makefile.am
++++ b/common/tests/Makefile.am
[email protected]@ -13,7 +13,7 @@
+ alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
+ alloc_unittest_LDADD = $(ATF_LDFLAGS)
+ alloc_unittest_LDADD += ../libdhcp.a \
+- ../../omapip/libomapi.a ../../dst/libdst.a ../../minires/libres.a
++ ../../omapip/libomapi.la ../../dst/libdst.la ../../minires/libres.a
+
+ check: $(ATF_TESTS)
+ atf-run | atf-report
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
[email protected]@ -37,7 +37,7 @@
+ # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+ AC_USE_SYSTEM_EXTENSIONS
+
+-AC_PROG_RANLIB
++AC_PROG_LIBTOOL
+ AC_CONFIG_HEADERS([includes/config.h])
+
+ # we sometimes need to know byte order for building packets
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
[email protected]@ -1,15 +1,16 @@
+ bin_PROGRAMS = omshell
+-lib_LIBRARIES = libdhcpctl.a
++lib_LTLIBRARIES = libdhcpctl.la
++libdhcpctl_la_LDFLAGS = -version-info 1
+ noinst_PROGRAMS = cltest
+ man_MANS = omshell.1 dhcpctl.3
+ EXTRA_DIST = $(man_MANS)
+
+ omshell_SOURCES = omshell.c
+-omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../minires/libres.a \
+- ../omapip/libomapi.a ../dst/libdst.a
++omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../minires/libres.a \
++ ../omapip/libomapi.la ../dst/libdst.la
+
+-libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
++libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c
+
+ cltest_SOURCES = cltest.c
+-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../minires/libres.a \
+- ../omapip/libomapi.a ../dst/libdst.a
++cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../minires/libres.a \
++ ../omapip/libomapi.la ../dst/libdst.la
+diff --git a/dst/Makefile.am b/dst/Makefile.am
+--- a/dst/Makefile.am
++++ b/dst/Makefile.am
[email protected]@ -1,8 +1,9 @@
+ AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
+
+-lib_LIBRARIES = libdst.a
++lib_LTLIBRARIES = libdst.la
++libdst_la_LDFLAGS = -version-info 1
+
+-libdst_a_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
++libdst_la_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
+ base64.c prandom.c
+
+ EXTRA_DIST = dst_internal.h md5.h md5_locl.h
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
[email protected]@ -1,7 +1,8 @@
+-lib_LIBRARIES = libomapi.a
++lib_LTLIBRARIES = libomapi.la
++libomapi_la_LDFLAGS = -version-info 1
+ noinst_PROGRAMS = svtest
+
+-libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
++libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
+ errwarn.c listener.c dispatch.c generic.c support.c \
+ handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ array.c trace.c mrtrace.c toisc.c iscprint.c
[email protected]@ -9,5 +10,5 @@
+ EXTRA_DIST = $(man_MANS)
+
+ svtest_SOURCES = test.c
+-svtest_LDADD = libomapi.a ../dst/libdst.a
++svtest_LDADD = libomapi.la ../dst/libdst.la
+
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
[email protected]@ -2,7 +2,7 @@
+
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dst/libdst.a ../minires/libres.a
++dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la ../dst/libdst.la ../minires/libres.a
+ man_MANS = dhcrelay.8
+ EXTRA_DIST = $(man_MANS)
+
+diff --git a/server/Makefile.am b/server/Makefile.am
+--- a/server/Makefile.am
++++ b/server/Makefile.am
[email protected]@ -13,9 +13,9 @@
+ dhcpv6.c mdb6.c
+
+ # libomapi.a this is here twice to handle circular library dependencies :(
+-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../dst/libdst.a \
+- ../dhcpctl/libdhcpctl.a ../minires/libres.a \
+- ../omapip/libomapi.a
++dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la ../dst/libdst.la \
++ ../dhcpctl/libdhcpctl.la ../minires/libres.a \
++ ../omapip/libomapi.la
+
+ man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
+diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
+--- a/server/tests/Makefile.am
++++ b/server/tests/Makefile.am
[email protected]@ -17,8 +17,8 @@
+ ../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \
+ ../dhcpd.c
+
+-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
+- $(top_builddir)/dhcpctl/libdhcpctl.a $(top_builddir)/dst/libdst.a \
++DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \
++ $(top_builddir)/dhcpctl/libdhcpctl.la $(top_builddir)/dst/libdst.la \
+ $(top_builddir)/minires/libres.a
+
+ ATF_TESTS =