Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/sudo/
Date: Tue, 27 Jul 2021 20:43:34
Message-Id: 1627418603.d903d731216d3d60797fcff7ee77dc58e62282d8.polynomial-c@gentoo
1 commit: d903d731216d3d60797fcff7ee77dc58e62282d8
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 27 20:00:04 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 27 20:43:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d903d731
7
8 app-admin/sudo: Bump to version 1.9.7_p2
9
10 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
11
12 app-admin/sudo/Manifest | 1 +
13 app-admin/sudo/sudo-1.9.7_p2.ebuild | 255 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 256 insertions(+)
15
16 diff --git a/app-admin/sudo/Manifest b/app-admin/sudo/Manifest
17 index f3f27e8a2ed..b71eb655d33 100644
18 --- a/app-admin/sudo/Manifest
19 +++ b/app-admin/sudo/Manifest
20 @@ -1,2 +1,3 @@
21 DIST sudo-1.9.6p1.tar.gz 4119888 BLAKE2B 02bdb551c46cff11ac56e64937c64e6a29ccd8e0af34ea2f6b33c223bee8f7ad958d0fc3d7ef8ef12bf5bc82565769b923ff112a3f3d6bf6999fa4f6ea55e38e SHA512 632dfe72f04ce9a7a5a7236fcd5c09ce4535e695ced49d24dd848e3a7b1bea7380df44188b9e475af4271069539b5a5816948a98fbb0649ebebaba8b4c4b7745
22 DIST sudo-1.9.7p1.tar.gz 4197591 BLAKE2B fff3eab8b4de6276135229c5fe12e7eced98af988b7686600e6a63b8615f6357ab2c5f95ef6f1872534476c4398a28c4f468ffc316e0cff7d4b32e6068aa97d4 SHA512 bc85d9de1566de24883375edd1c4cd24b1f24437bb16d181bfa3c9c94cead220c69ad00d6727560ca195765ced970e95d69b9ce01dbea448de39afac9a902fb4
23 +DIST sudo-1.9.7p2.tar.gz 4200036 BLAKE2B b977c423670e5e34e84f3b009d5fe5f0379a0027e828fb903aa7ff1b11581572e8d5452a3666d963df3edfe1b83ffe16fbf8bddbf07881284f4507c8138859ad SHA512 39184127122014d0d1d194d455644191009835ffdcc0efda3a99028fe346ca3ff6b15341016f85029556e9f1f9deeaf83b52160effc47d1a5713affb36b99386
24
25 diff --git a/app-admin/sudo/sudo-1.9.7_p2.ebuild b/app-admin/sudo/sudo-1.9.7_p2.ebuild
26 new file mode 100644
27 index 00000000000..82fffc77e5e
28 --- /dev/null
29 +++ b/app-admin/sudo/sudo-1.9.7_p2.ebuild
30 @@ -0,0 +1,255 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit pam multilib libtool systemd tmpfiles toolchain-funcs
37 +
38 +MY_P="${P/_/}"
39 +MY_P="${MY_P/beta/b}"
40 +
41 +DESCRIPTION="Allows users or groups to run commands as other users"
42 +HOMEPAGE="https://www.sudo.ws/"
43 +if [[ ${PV} == "9999" ]] ; then
44 + inherit mercurial
45 + EHG_REPO_URI="https://www.sudo.ws/repos/sudo"
46 +else
47 + uri_prefix=
48 + case ${P} in
49 + *_beta*|*_rc*) uri_prefix=beta/ ;;
50 + esac
51 +
52 + SRC_URI="https://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
53 + ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
54 + if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
55 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~sparc-solaris"
56 + fi
57 +fi
58 +
59 +# Basic license is ISC-style as-is, some files are released under
60 +# 3-clause BSD license
61 +LICENSE="ISC BSD"
62 +SLOT="0"
63 +IUSE="gcrypt ldap nls offensive pam sasl +secure-path selinux +sendmail skey ssl sssd"
64 +
65 +DEPEND="
66 + sys-libs/zlib:=
67 + virtual/libcrypt:=
68 + gcrypt? ( dev-libs/libgcrypt:= )
69 + ldap? (
70 + >=net-nds/openldap-2.1.30-r1
71 + sasl? (
72 + dev-libs/cyrus-sasl
73 + net-nds/openldap[sasl]
74 + )
75 + )
76 + pam? ( sys-libs/pam )
77 + sasl? ( dev-libs/cyrus-sasl )
78 + skey? ( >=sys-auth/skey-1.1.5-r1 )
79 + ssl? ( dev-libs/openssl:0= )
80 + sssd? ( sys-auth/sssd[sudo] )
81 +"
82 +RDEPEND="
83 + ${DEPEND}
84 + >=app-misc/editor-wrapper-3
85 + virtual/editor
86 + ldap? ( dev-lang/perl )
87 + pam? ( sys-auth/pambase )
88 + selinux? ( sec-policy/selinux-sudo )
89 + sendmail? ( virtual/mta )
90 +"
91 +BDEPEND="
92 + sys-devel/bison
93 + virtual/pkgconfig
94 +"
95 +
96 +S="${WORKDIR}/${MY_P}"
97 +
98 +REQUIRED_USE="
99 + ?? ( pam skey )
100 + ?? ( gcrypt ssl )
101 +"
102 +
103 +MAKEOPTS+=" SAMPLES="
104 +
105 +src_prepare() {
106 + default
107 + elibtoolize
108 +}
109 +
110 +set_secure_path() {
111 + # first extract the default ROOTPATH from build env
112 + SECURE_PATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env;
113 + echo "${ROOTPATH}")
114 + case "${SECURE_PATH}" in
115 + */usr/sbin*) ;;
116 + *) SECURE_PATH=$(unset PATH;
117 + . "${EPREFIX}"/etc/profile.env; echo "${PATH}")
118 + ;;
119 + esac
120 + if [[ -z ${SECURE_PATH} ]] ; then
121 + ewarn " Failed to detect SECURE_PATH, please report this"
122 + fi
123 +
124 + # then remove duplicate path entries
125 + cleanpath() {
126 + local newpath thisp IFS=:
127 + for thisp in $1 ; do
128 + if [[ :${newpath}: != *:${thisp}:* ]] ; then
129 + newpath+=:${thisp}
130 + else
131 + einfo " Duplicate entry ${thisp} removed..."
132 + fi
133 + done
134 + SECURE_PATH=${newpath#:}
135 + }
136 + cleanpath /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin${SECURE_PATH:+:${SECURE_PATH}}
137 +
138 + # finally, strip gcc paths #136027
139 + rmpath() {
140 + local e newpath thisp IFS=:
141 + for thisp in ${SECURE_PATH} ; do
142 + for e ; do [[ ${thisp} == ${e} ]] && continue 2 ; done
143 + newpath+=:${thisp}
144 + done
145 + SECURE_PATH=${newpath#:}
146 + }
147 + rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
148 +}
149 +
150 +src_configure() {
151 + local SECURE_PATH
152 + set_secure_path
153 + tc-export PKG_CONFIG #767712
154 +
155 + # audit: somebody got to explain me how I can test this before I
156 + # enable it.. - Diego
157 + # plugindir: autoconf code is crappy and does not delay evaluation
158 + # until `make` time, so we have to use a full path here rather than
159 + # basing off other values.
160 + myeconfargs=(
161 + # requires some python eclass
162 + --disable-python
163 + --enable-tmpfiles.d="${EPREFIX}"/usr/lib/tmpfiles.d
164 + --enable-zlib=system
165 + --with-editor="${EPREFIX}"/usr/libexec/editor
166 + --with-env-editor
167 + --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo
168 + --with-rundir="${EPREFIX}"/run/sudo
169 + --with-vardir="${EPREFIX}"/var/db/sudo
170 + --without-linux-audit
171 + --without-opie
172 + $(use_enable gcrypt)
173 + $(use_enable nls)
174 + $(use_enable sasl)
175 + $(use_enable ssl openssl)
176 + $(use_with ldap)
177 + $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo)
178 + $(use_with offensive insults)
179 + $(use_with offensive all-insults)
180 + $(use_with pam)
181 + $(use_with pam pam-login)
182 + $(use_with secure-path secure-path "${SECURE_PATH}")
183 + $(use_with selinux)
184 + $(use_with sendmail)
185 + $(use_with skey)
186 + $(use_with sssd)
187 + )
188 +
189 + econf "${myeconfargs[@]}"
190 +}
191 +
192 +src_install() {
193 + default
194 +
195 + if use ldap ; then
196 + dodoc README.LDAP
197 +
198 + cat <<-EOF > "${T}"/ldap.conf.sudo
199 + # See ldap.conf(5) and README.LDAP for details
200 + # This file should only be readable by root
201 +
202 + # supported directives: host, port, ssl, ldap_version
203 + # uri, binddn, bindpw, sudoers_base, sudoers_debug
204 + # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key}
205 + EOF
206 +
207 + if use sasl ; then
208 + cat <<-EOF >> "${T}"/ldap.conf.sudo
209 +
210 + # SASL directives: use_sasl, sasl_mech, sasl_auth_id
211 + # sasl_secprops, rootuse_sasl, rootsasl_auth_id, krb5_ccname
212 + EOF
213 + fi
214 +
215 + insinto /etc
216 + doins "${T}"/ldap.conf.sudo
217 + fperms 0440 /etc/ldap.conf.sudo
218 +
219 + insinto /etc/openldap/schema
220 + newins doc/schema.OpenLDAP sudo.schema
221 + fi
222 +
223 + if use pam; then
224 + pamd_mimic system-auth sudo auth account session
225 + pamd_mimic system-auth sudo-i auth account session
226 + fi
227 +
228 + keepdir /var/db/sudo/lectured
229 + fperms 0700 /var/db/sudo/lectured
230 + fperms 0711 /var/db/sudo #652958
231 +
232 + # Don't install into /run as that is a tmpfs most of the time
233 + # (bug #504854)
234 + rm -rf "${ED}"/run || die
235 +
236 + find "${ED}" -type f -name "*.la" -delete || die #697812
237 +}
238 +
239 +pkg_postinst() {
240 + tmpfiles_process sudo.conf
241 +
242 + #652958
243 + local sudo_db="${EROOT}/var/db/sudo"
244 + if [[ "$(stat -c %a "${sudo_db}")" -ne 711 ]] ; then
245 + chmod 711 "${sudo_db}" || die
246 + fi
247 +
248 + if use ldap ; then
249 + ewarn
250 + ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
251 + ewarn
252 + if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
253 + ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
254 + ewarn "configured in /etc/nsswitch.conf."
255 + ewarn
256 + ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
257 + ewarn " sudoers: ldap files"
258 + ewarn
259 + fi
260 + fi
261 + if use prefix ; then
262 + ewarn
263 + ewarn "To use sudo, you need to change file ownership and permissions"
264 + ewarn "with root privileges, as follows:"
265 + ewarn
266 + ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
267 + ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
268 + ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
269 + ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
270 + ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
271 + ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
272 + ewarn
273 + fi
274 +
275 + elog "To use the -A (askpass) option, you need to install a compatible"
276 + elog "password program from the following list. Starred packages will"
277 + elog "automatically register for the use with sudo (but will not force"
278 + elog "the -A option):"
279 + elog ""
280 + elog " [*] net-misc/ssh-askpass-fullscreen"
281 + elog " net-misc/x11-ssh-askpass"
282 + elog ""
283 + elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
284 + elog "variable to the program you want to use."
285 +}