Gentoo Archives: gentoo-commits

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