From 48ca192405e39c8eb428dae1be8fd49be7a95bab Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 14 Jan 2016 23:18:03 +0100 Subject: [PATCH] saving uncommitted changes in /etc prior to emerge run --- init.d/dhcpd | 41 +++++++++++++++++++++---------------- init.d/dhcrelay | 2 +- init.d/dhcrelay6 | 2 +- openldap/schema/dhcp.schema | 28 ++++++++++++++++++++++++- 4 files changed, 52 insertions(+), 21 deletions(-) diff --git a/init.d/dhcpd b/init.d/dhcpd index e17c8a52..a450ae14 100755 --- a/init.d/dhcpd +++ b/init.d/dhcpd @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init5,v 1.6 2015/02/10 00:27:08 polynomial-c Exp $ +# $Id$ extra_commands="configtest" @@ -17,8 +17,23 @@ get_var() { echo ${var:-$2} } +setup_opts() { + DHCPD_CHROOT=${DHCPD_CHROOT%/} + + # Work out our cffile if it's in our DHCPD_OPTS + case " ${DHCPD_OPTS} " in + *" -cf "*) + DHCPD_CONF=" ${DHCPD_OPTS} " + DHCPD_CONF="${DHCPD_CONF##* -cf }" + DHCPD_CONF="${DHCPD_CONF%% *}" + ;; + *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}" + ;; + esac +} + checkconfig() { - set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t + set -- ${DHCPD_OPTS} -chroot "${DHCPD_CHROOT:-/}" -t dhcpd "$@" 1>/dev/null 2>&1 local ret=$? @@ -31,7 +46,7 @@ checkconfig() { } configtest() { - local chroot=${DHCPD_CHROOT%/} + setup_opts ebegin "Checking ${SVCNAME} configuration" checkconfig @@ -39,18 +54,8 @@ configtest() { } start() { - local chroot=${DHCPD_CHROOT%/} - - # Work out our cffile if it's in our DHCPD_OPTS - case " ${DHCPD_OPTS} " in - *" -cf "*) - DHCPD_CONF=" ${DHCPD_OPTS} " - DHCPD_CONF="${DHCPD_CONF##* -cf }" - DHCPD_CONF="${DHCPD_CONF%% *}" - ;; - *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}" - ;; - esac + setup_opts + local chroot="${DHCPD_CHROOT}" if [ -n "${chroot}" ] ; then # the config test want's these to exist @@ -90,7 +95,7 @@ start() { --pidfile "${chroot}/${pidfile}" \ -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \ -user dhcp -group dhcp \ - ${chroot:+-chroot} ${chroot} ${DHCPD_IFACE} + -chroot "${chroot:-/}" ${DHCPD_IFACE} eend $? \ && save_options dhcpd_chroot "${chroot}" \ && save_options pidfile "${pidfile}" @@ -98,7 +103,7 @@ start() { stop() { local chroot="$(get_options dhcpd_chroot)" - [ -z "$chroot" ] && chroot="$(get_options chroot)" + [ -z "${chroot}" ] && chroot="$(get_options chroot)" ebegin "Stopping ${chroot:+chrooted }${SVCNAME}" start-stop-daemon --stop --exec /usr/sbin/dhcpd \ @@ -111,5 +116,5 @@ stop() { fi fi - eend $res + eend ${res} } diff --git a/init.d/dhcrelay b/init.d/dhcrelay index a97d57d7..30685cf4 100755 --- a/init.d/dhcrelay +++ b/init.d/dhcrelay @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init3,v 1.3 2012/11/11 21:42:02 vapier Exp $ +# $Id$ depend() { need net diff --git a/init.d/dhcrelay6 b/init.d/dhcrelay6 index a97d57d7..30685cf4 100755 --- a/init.d/dhcrelay6 +++ b/init.d/dhcrelay6 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init3,v 1.3 2012/11/11 21:42:02 vapier Exp $ +# $Id$ depend() { need net diff --git a/openldap/schema/dhcp.schema b/openldap/schema/dhcp.schema index c5ed6c72..0c24a7a2 100644 --- a/openldap/schema/dhcp.schema +++ b/openldap/schema/dhcp.schema @@ -334,6 +334,18 @@ attributetype ( 2.16.840.1.113719.1.203.4.56 DESC 'Generic attribute that allows coments within any DHCP object' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) +attributetype ( 2.16.840.1.113719.1.203.4.57 + NAME 'dhcpClientId' + EQUALITY caseIgnoreIA5Match + DESC 'client Identifier.' + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 2.16.840.1.113719.1.203.4.58 + NAME 'dhcpRange6' + EQUALITY caseIgnoreIA5Match + DESC 'The starting & ending IP Addresses in the range (inclusive), separated by a hyphen; if the range only contains one address, then just the address can be specified with no hyphen. Each range is defined as a separate value.' + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + # Classes objectclass ( 2.16.840.1.113719.1.203.6.1 @@ -378,7 +390,7 @@ objectclass ( 2.16.840.1.113719.1.203.6.6 DESC 'This represents information about a particular client' SUP top MUST cn - MAY (dhcpLeaseDN $ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption) + MAY (dhcpLeaseDN $ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption $ dhcpClientId) X-NDS_CONTAINMENT ('dhcpService' 'dhcpSubnet' 'dhcpGroup') ) objectclass ( 2.16.840.1.113719.1.203.6.7 @@ -459,4 +471,18 @@ objectclass ( 2.16.840.1.113719.1.203.6.16 MAY ( dhcpServiceDN $dhcpServerDN $ dhcpSharedNetworkDN $ dhcpSubnetDN $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $ dhcpKeyDN $ dhcpZoneDN $ dhcpFailOverPeerDN $ dhcpOption $ dhcpComments) X-NDS_CONTAINMENT ('organization' 'organizationalunit' 'domain') ) +objectclass ( 2.16.840.1.113719.1.203.6.17 + NAME 'dhcpSubnet6' + DESC 'This class defines an IPv6 subnet. This is a container object.' + SUP top + MUST ( cn ) + MAY ( dhcpRange6 $ dhcpPoolDN $ dhcpGroupDN $ dhcpHostDN $ dhcpClassesDN $ dhcpLeasesDN $ dhcpOptionsDN $ dhcpZoneDN $ dhcpKeyDN $ dhcpFailOverPeerDN $ dhcpStatements $ dhcpComments $ dhcpOption $ dhcpPermitList ) X-NDS_CONTAINMENT ('dhcpService' 'dhcpSharedNetwork') ) + +objectclass ( 2.16.840.1.113719.1.203.6.18 + NAME 'dhcpPool6' + DESC 'This stores configuration information about an IPv6 pool.' + SUP top + MUST ( cn $ dhcpRange6 ) + MAY ( dhcpClassesDN $ dhcpPermitList $ dhcpLeasesDN $ dhcpOptionsDN $ dhcpZoneDN $dhcpKeyDN $ dhcpStatements $ dhcpComments $ dhcpOption ) + X-NDS_CONTAINMENT ('dhcpSubnet' 'dhcpSharedNetwork') ) -- 2.39.5