Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcpcd/
Date: Sat, 25 May 2019 08:22:31
Message-Id: 1558772527.80722bc465e525603dbc643f03ac4bf904a4e7f7.zlogene@gentoo
1 commit: 80722bc465e525603dbc643f03ac4bf904a4e7f7
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 25 08:22:07 2019 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Sat May 25 08:22:07 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80722bc4
7
8 net-misc/dhcpcd: Security cleanup
9
10 Bug: https://bugs.gentoo.org/685264
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12 Package-Manager: Portage-2.3.66, Repoman-2.3.11
13
14 net-misc/dhcpcd/dhcpcd-7.1.1-r2.ebuild | 153 ---------------------------------
15 1 file changed, 153 deletions(-)
16
17 diff --git a/net-misc/dhcpcd/dhcpcd-7.1.1-r2.ebuild b/net-misc/dhcpcd/dhcpcd-7.1.1-r2.ebuild
18 deleted file mode 100644
19 index 88f47e8867b..00000000000
20 --- a/net-misc/dhcpcd/dhcpcd-7.1.1-r2.ebuild
21 +++ /dev/null
22 @@ -1,153 +0,0 @@
23 -# Copyright 1999-2019 Gentoo Authors
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -EAPI=6
27 -
28 -inherit systemd toolchain-funcs
29 -
30 -if [[ ${PV} == "9999" ]]; then
31 - inherit git-r3
32 - EGIT_REPO_URI="https://roy.marples.name/git/dhcpcd.git"
33 -else
34 - MY_P="${P/_alpha/-alpha}"
35 - MY_P="${MY_P/_beta/-beta}"
36 - MY_P="${MY_P/_rc/-rc}"
37 - SRC_URI="https://roy.marples.name/downloads/${PN}/${MY_P}.tar.xz"
38 - KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
39 - S="${WORKDIR}/${MY_P}"
40 -fi
41 -
42 -DESCRIPTION="A fully featured, yet light weight RFC2131 compliant DHCP client"
43 -HOMEPAGE="https://roy.marples.name/projects/dhcpcd"
44 -LICENSE="BSD-2"
45 -SLOT="0"
46 -IUSE="elibc_glibc +embedded ipv6 kernel_linux +udev"
47 -
48 -COMMON_DEPEND="udev? ( virtual/udev )"
49 -DEPEND="${COMMON_DEPEND}"
50 -RDEPEND="${COMMON_DEPEND}"
51 -
52 -PATCHES=(
53 - "${FILESDIR}"/${P}-disable_inet6_fix.patch #677508
54 - "${FILESDIR}"/${PN}-7.1.1-overflows.patch
55 -)
56 -
57 -src_configure() {
58 - local dev hooks=() rundir
59 - use udev || dev="--without-dev --without-udev"
60 - hooks=( --with-hook=ntp.conf )
61 - use elibc_glibc && hooks+=( --with-hook=yp.conf )
62 - use kernel_linux && rundir="--rundir=${EPREFIX}/run"
63 - local myeconfargs=(
64 - --prefix="${EPREFIX}"
65 - --libexecdir="${EPREFIX}/lib/dhcpcd"
66 - --dbdir="${EPREFIX}/var/lib/dhcpcd"
67 - --localstatedir="${EPREFIX}/var"
68 - ${rundir}
69 - $(use_enable embedded)
70 - $(use_enable ipv6)
71 - ${dev}
72 - CC="$(tc-getCC)"
73 - ${hooks[@]}
74 - )
75 - econf "${myeconfargs[@]}"
76 -}
77 -
78 -src_install() {
79 - default
80 - keepdir /var/lib/dhcpcd
81 - newinitd "${FILESDIR}"/${PN}.initd ${PN}
82 - systemd_dounit "${FILESDIR}"/${PN}.service
83 -}
84 -
85 -pkg_postinst() {
86 - local dbdir="${EROOT%/}"/var/lib/dhcpcd old_files=()
87 -
88 - local old_old_duid="${EROOT%/}"/var/lib/dhcpcd/dhcpcd.duid
89 - local old_duid="${EROOT%/}"/etc/dhcpcd.duid
90 - local new_duid="${dbdir}"/duid
91 - if [[ -e "${old_old_duid}" ]] ; then
92 - # Upgrade the duid file to the new format if needed
93 - if ! grep -q '..:..:..:..:..:..' "${old_old_duid}"; then
94 - sed -i -e 's/\(..\)/\1:/g; s/:$//g' "${old_old_duid}"
95 - fi
96 -
97 - # Move the duid to /etc, a more sensible location
98 - if [[ ! -e "${old_duid}" ]] ; then
99 - cp -p "${old_old_duid}" "${new_duid}"
100 - fi
101 - old_files+=( "${old_old_duid}" )
102 - fi
103 -
104 - # dhcpcd-7 moves the files out of /etc
105 - if [[ -e "${old_duid}" ]] ; then
106 - if [[ ! -e "${new_duid}" ]] ; then
107 - cp -p "${old_duid}" "${new_duid}"
108 - fi
109 - old_files+=( "${old_duid}" )
110 - fi
111 - local old_secret="${EROOT%/}"/etc/dhcpcd.secret
112 - local new_secret="${dbdir}"/secret
113 - if [[ -e "${old_secret}" ]] ; then
114 - if [[ ! -e "${new_secret}" ]] ; then
115 - cp -p "${old_secret}" "${new_secret}"
116 - fi
117 - old_files+=( "${old_secret}" )
118 - fi
119 -
120 - # dhcpcd-7 renames some files in /var/lib/dhcpcd
121 - local old_rdm="${dbdir}"/dhcpcd-rdm.monotonic
122 - local new_rdm="${dbdir}"/rdm_monotonic
123 - if [[ -e "${old_rdm}" ]] ; then
124 - if [[ ! -e "${new_rdm}" ]] ; then
125 - cp -p "${old_rdm}" "${new_rdm}"
126 - fi
127 - old_files+=( "${old_rdm}" )
128 - fi
129 - local lease=
130 - for lease in "${dbdir}"/dhcpcd-*.lease*; do
131 - [[ -f "${lease}" ]] || continue
132 - old_files+=( "${lease}" )
133 - local new_lease=$(basename "${lease}" | sed -e "s/dhcpcd-//")
134 - [[ -e "${dbdir}/${new_lease}" ]] && continue
135 - cp "${lease}" "${dbdir}/${new_lease}"
136 - done
137 -
138 - # Warn about removing stale files
139 - if [[ -n "${old_files[@]}" ]] ; then
140 - elog
141 - elog "dhcpcd-7 has copied dhcpcd.duid and dhcpcd.secret from"
142 - elog "${EROOT%/}/etc to ${dbdir}"
143 - elog "and copied leases in ${dbdir} to new files with the dhcpcd-"
144 - elog "prefix dropped."
145 - elog
146 - elog "You should remove these files if you don't plan on reverting"
147 - elog "to an older version:"
148 - local old_file=
149 - for old_file in ${old_files[@]}; do
150 - elog " ${old_file}"
151 - done
152 - fi
153 -
154 - if [ -z "${REPLACING_VERSIONS}" ]; then
155 - elog
156 - elog "dhcpcd has zeroconf support active by default."
157 - elog "This means it will always obtain an IP address even if no"
158 - elog "DHCP server can be contacted, which will break any existing"
159 - elog "failover support you may have configured in your net configuration."
160 - elog "This behaviour can be controlled with the noipv4ll configuration"
161 - elog "file option or the -L command line switch."
162 - elog "See the dhcpcd and dhcpcd.conf man pages for more details."
163 -
164 - elog
165 - elog "Dhcpcd has duid enabled by default, and this may cause issues"
166 - elog "with some dhcp servers. For more information, see"
167 - elog "https://bugs.gentoo.org/show_bug.cgi?id=477356"
168 - fi
169 -
170 - if ! has_version net-dns/bind-tools; then
171 - elog
172 - elog "If you activate the lookup-hostname hook to look up your hostname"
173 - elog "using the dns, you need to install net-dns/bind-tools."
174 - fi
175 -}