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, 30 May 2017 15:22:11
Message-Id: 1496157710.dbe78e330b43f591c2d9697ee92095d219bc2e3f.polynomial-c@gentoo
1 commit: dbe78e330b43f591c2d9697ee92095d219bc2e3f
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 30 15:21:50 2017 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue May 30 15:21:50 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbe78e33
7
8 app-admin/sudo: Security cleanup.
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 app-admin/sudo/Manifest | 3 -
13 app-admin/sudo/sudo-1.8.18_p1.ebuild | 201 --------------------------------
14 app-admin/sudo/sudo-1.8.19_p2.ebuild | 201 --------------------------------
15 app-admin/sudo/sudo-1.8.20.ebuild | 216 -----------------------------------
16 4 files changed, 621 deletions(-)
17
18 diff --git a/app-admin/sudo/Manifest b/app-admin/sudo/Manifest
19 index 1f9157f79d9..93e7808824c 100644
20 --- a/app-admin/sudo/Manifest
21 +++ b/app-admin/sudo/Manifest
22 @@ -1,4 +1 @@
23 -DIST sudo-1.8.18p1.tar.gz 2822109 SHA256 e5a0471c721281a693025bbde33ebd9d3db43245d83ab8516bbfc23980379434 SHA512 8dceeb5024c4f94fcc15e75fa2fd164af5e0597734f95df43207738b3258c4d396e102faf2b6811e399f1cdbdbf617b87e5bfcc1e591ea6722f45d81d1098fe5 WHIRLPOOL 094c1232517706a6da4a0548f7ab5c0c7b9e12f8ce584db97d0c4793a38c4044538637f2834b9f3104326bd5b4b826d08ab79b1dc2c5b950de7d7f558685ef7b
24 -DIST sudo-1.8.19p2.tar.gz 2861855 SHA256 237e18e67c2ad59ecacfa4b7707198b09fcf84914621585a9bc670dcc31a52e0 SHA512 21c83403e7ff219a273b2c4873be0d858997558ca150bc8239379a9dfcc587fdd7c0c49cdf4cdc27dfd6dd45f9f089fa034b58bfcee07dceb4a481542251b3fc WHIRLPOOL 550ed115ea711d6ba9aa698cd988295b74327dd770d79b6852f9f3f00a1c0420bbdcce5cc7c49467e0cf8a57fc79dbcfc73edaf3ad697e06ba9fd48919fece0b
25 -DIST sudo-1.8.20.tar.gz 2930046 SHA256 9e97b8da859c6cc1b5b8c31db93002b750eae16af1bbda9140f8dd85b970e0e0 SHA512 c8cf640cd75fff88cf7c8b3a54a9a16771a9f24129b5c5787657c24336848c31abb8d8b9bafc7bfceb8f0b1f72112e15f9862b8fc337c1072eea05860f417dee WHIRLPOOL f2e409b18bee01780c21b9d97cdf65a34f763b5f9e380116f77b0d5ab3ddf6f46a80210b1c361e585fb2882ae17433817db7782e9b315b14ea1d7b53bfb0ab2a
26 DIST sudo-1.8.20p1.tar.gz 2930394 SHA256 9e980eb23a60dd11f0f452e672e705d7a386882bc230c6e8483050e03182db1d SHA512 b7d4c07a550da917029e31d15e734d9462f3565ee43eb5f6fd19463b54a2fa3f444381f0999d6d1ba643b65832056dd9177dad4452fa9f87f2542c223b13f258 WHIRLPOOL 7e652f70782d7c5240fa23198d16d94171510d7eb52df56ee667a3da17c26643257d4304c3bfdb94a77831b904ac1c4d4027f2d1140764ddcd130159a3c3a3d3
27
28 diff --git a/app-admin/sudo/sudo-1.8.18_p1.ebuild b/app-admin/sudo/sudo-1.8.18_p1.ebuild
29 deleted file mode 100644
30 index f01c3b37c7c..00000000000
31 --- a/app-admin/sudo/sudo-1.8.18_p1.ebuild
32 +++ /dev/null
33 @@ -1,201 +0,0 @@
34 -# Copyright 1999-2017 Gentoo Foundation
35 -# Distributed under the terms of the GNU General Public License v2
36 -
37 -EAPI=6
38 -
39 -inherit eutils pam multilib libtool
40 -
41 -MY_P=${P/_/}
42 -MY_P=${MY_P/beta/b}
43 -
44 -uri_prefix=
45 -case ${P} in
46 -*_beta*|*_rc*) uri_prefix=beta/ ;;
47 -esac
48 -
49 -DESCRIPTION="Allows users or groups to run commands as other users"
50 -HOMEPAGE="http://www.sudo.ws/"
51 -SRC_URI="http://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
52 - ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
53 -
54 -# Basic license is ISC-style as-is, some files are released under
55 -# 3-clause BSD license
56 -LICENSE="ISC BSD"
57 -SLOT="0"
58 -if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
59 - KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~sparc-solaris"
60 -fi
61 -IUSE="ldap nls pam offensive selinux skey +sendmail"
62 -
63 -DEPEND="pam? ( virtual/pam )
64 - skey? ( >=sys-auth/skey-1.1.5-r1 )
65 - ldap? (
66 - >=net-nds/openldap-2.1.30-r1
67 - dev-libs/cyrus-sasl
68 - )
69 - sys-libs/zlib"
70 -RDEPEND="${DEPEND}
71 - selinux? ( sec-policy/selinux-sudo )
72 - ldap? ( dev-lang/perl )
73 - pam? ( sys-auth/pambase )
74 - >=app-misc/editor-wrapper-3
75 - virtual/editor
76 - sendmail? ( virtual/mta )"
77 -DEPEND="${DEPEND}
78 - sys-devel/bison"
79 -
80 -S=${WORKDIR}/${MY_P}
81 -
82 -REQUIRED_USE="pam? ( !skey ) skey? ( !pam )"
83 -
84 -MAKEOPTS+=" SAMPLES="
85 -
86 -src_prepare() {
87 - default
88 - elibtoolize
89 -}
90 -
91 -set_rootpath() {
92 - # FIXME: secure_path is a compile time setting. using ROOTPATH
93 - # is not perfect, env-update may invalidate this, but until it
94 - # is available as a sudoers setting this will have to do.
95 - einfo "Setting secure_path ..."
96 -
97 - # first extract the default ROOTPATH from build env
98 - ROOTPATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}")
99 - if [[ -z ${ROOTPATH} ]] ; then
100 - ewarn " Failed to find ROOTPATH, please report this"
101 - fi
102 -
103 - # then remove duplicate path entries
104 - cleanpath() {
105 - local newpath thisp IFS=:
106 - for thisp in $1 ; do
107 - if [[ :${newpath}: != *:${thisp}:* ]] ; then
108 - newpath+=:$thisp
109 - else
110 - einfo " Duplicate entry ${thisp} removed..."
111 - fi
112 - done
113 - ROOTPATH=${newpath#:}
114 - }
115 - cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}}
116 -
117 - # finally, strip gcc paths #136027
118 - rmpath() {
119 - local e newpath thisp IFS=:
120 - for thisp in ${ROOTPATH} ; do
121 - for e ; do [[ $thisp == $e ]] && continue 2 ; done
122 - newpath+=:$thisp
123 - done
124 - ROOTPATH=${newpath#:}
125 - }
126 - rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
127 -
128 - einfo "... done"
129 -}
130 -
131 -src_configure() {
132 - local ROOTPATH
133 - set_rootpath
134 -
135 - # audit: somebody got to explain me how I can test this before I
136 - # enable it.. - Diego
137 - # plugindir: autoconf code is crappy and does not delay evaluation
138 - # until `make` time, so we have to use a full path here rather than
139 - # basing off other values.
140 - econf \
141 - --enable-zlib=system \
142 - --with-secure-path="${ROOTPATH}" \
143 - --with-editor="${EPREFIX}"/usr/libexec/editor \
144 - --with-env-editor \
145 - $(use_with offensive insults) \
146 - $(use_with offensive all-insults) \
147 - $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
148 - $(use_with ldap) \
149 - $(use_enable nls) \
150 - $(use_with pam) \
151 - $(use_with skey) \
152 - $(use_with selinux) \
153 - $(use_with sendmail) \
154 - --without-opie \
155 - --without-linux-audit \
156 - --with-rundir="${EPREFIX}"/var/run/sudo \
157 - --with-vardir="${EPREFIX}"/var/db/sudo \
158 - --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo \
159 - --docdir="${EPREFIX}"/usr/share/doc/${PF}
160 -}
161 -
162 -src_install() {
163 - default
164 -
165 - if use ldap ; then
166 - dodoc README.LDAP
167 - dosbin plugins/sudoers/sudoers2ldif
168 -
169 - cat <<-EOF > "${T}"/ldap.conf.sudo
170 - # See ldap.conf(5) and README.LDAP for details
171 - # This file should only be readable by root
172 -
173 - # supported directives: host, port, ssl, ldap_version
174 - # uri, binddn, bindpw, sudoers_base, sudoers_debug
175 - # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key}
176 - EOF
177 -
178 - insinto /etc
179 - doins "${T}"/ldap.conf.sudo
180 - fperms 0440 /etc/ldap.conf.sudo
181 -
182 - insinto /etc/openldap/schema
183 - newins doc/schema.OpenLDAP sudo.schema
184 - fi
185 -
186 - pamd_mimic system-auth sudo auth account session
187 -
188 - keepdir /var/db/sudo
189 - fperms 0700 /var/db/sudo
190 -
191 - # Don't install into /var/run as that is a tmpfs most of the time
192 - # (bug #504854)
193 - rm -rf "${D}"/var/run
194 -}
195 -
196 -pkg_postinst() {
197 - if use ldap ; then
198 - ewarn
199 - ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
200 - ewarn
201 - if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
202 - ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
203 - ewarn "configured in /etc/nsswitch.conf."
204 - ewarn
205 - ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
206 - ewarn " sudoers: ldap files"
207 - ewarn
208 - fi
209 - fi
210 - if use prefix ; then
211 - ewarn
212 - ewarn "To use sudo, you need to change file ownership and permissions"
213 - ewarn "with root privileges, as follows:"
214 - ewarn
215 - ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
216 - ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
217 - ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
218 - ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
219 - ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
220 - ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
221 - ewarn
222 - fi
223 -
224 - elog "To use the -A (askpass) option, you need to install a compatible"
225 - elog "password program from the following list. Starred packages will"
226 - elog "automatically register for the use with sudo (but will not force"
227 - elog "the -A option):"
228 - elog ""
229 - elog " [*] net-misc/ssh-askpass-fullscreen"
230 - elog " net-misc/x11-ssh-askpass"
231 - elog ""
232 - elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
233 - elog "variable to the program you want to use."
234 -}
235
236 diff --git a/app-admin/sudo/sudo-1.8.19_p2.ebuild b/app-admin/sudo/sudo-1.8.19_p2.ebuild
237 deleted file mode 100644
238 index 5103d4888ee..00000000000
239 --- a/app-admin/sudo/sudo-1.8.19_p2.ebuild
240 +++ /dev/null
241 @@ -1,201 +0,0 @@
242 -# Copyright 1999-2017 Gentoo Foundation
243 -# Distributed under the terms of the GNU General Public License v2
244 -
245 -EAPI=6
246 -
247 -inherit eutils pam multilib libtool
248 -
249 -MY_P=${P/_/}
250 -MY_P=${MY_P/beta/b}
251 -
252 -uri_prefix=
253 -case ${P} in
254 -*_beta*|*_rc*) uri_prefix=beta/ ;;
255 -esac
256 -
257 -DESCRIPTION="Allows users or groups to run commands as other users"
258 -HOMEPAGE="http://www.sudo.ws/"
259 -SRC_URI="http://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
260 - ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
261 -
262 -# Basic license is ISC-style as-is, some files are released under
263 -# 3-clause BSD license
264 -LICENSE="ISC BSD"
265 -SLOT="0"
266 -if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
267 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~sparc-solaris"
268 -fi
269 -IUSE="ldap nls pam offensive selinux skey +sendmail"
270 -
271 -DEPEND="pam? ( virtual/pam )
272 - skey? ( >=sys-auth/skey-1.1.5-r1 )
273 - ldap? (
274 - >=net-nds/openldap-2.1.30-r1
275 - dev-libs/cyrus-sasl
276 - )
277 - sys-libs/zlib"
278 -RDEPEND="${DEPEND}
279 - selinux? ( sec-policy/selinux-sudo )
280 - ldap? ( dev-lang/perl )
281 - pam? ( sys-auth/pambase )
282 - >=app-misc/editor-wrapper-3
283 - virtual/editor
284 - sendmail? ( virtual/mta )"
285 -DEPEND="${DEPEND}
286 - sys-devel/bison"
287 -
288 -S=${WORKDIR}/${MY_P}
289 -
290 -REQUIRED_USE="pam? ( !skey ) skey? ( !pam )"
291 -
292 -MAKEOPTS+=" SAMPLES="
293 -
294 -src_prepare() {
295 - default
296 - elibtoolize
297 -}
298 -
299 -set_rootpath() {
300 - # FIXME: secure_path is a compile time setting. using ROOTPATH
301 - # is not perfect, env-update may invalidate this, but until it
302 - # is available as a sudoers setting this will have to do.
303 - einfo "Setting secure_path ..."
304 -
305 - # first extract the default ROOTPATH from build env
306 - ROOTPATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}")
307 - if [[ -z ${ROOTPATH} ]] ; then
308 - ewarn " Failed to find ROOTPATH, please report this"
309 - fi
310 -
311 - # then remove duplicate path entries
312 - cleanpath() {
313 - local newpath thisp IFS=:
314 - for thisp in $1 ; do
315 - if [[ :${newpath}: != *:${thisp}:* ]] ; then
316 - newpath+=:$thisp
317 - else
318 - einfo " Duplicate entry ${thisp} removed..."
319 - fi
320 - done
321 - ROOTPATH=${newpath#:}
322 - }
323 - cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}}
324 -
325 - # finally, strip gcc paths #136027
326 - rmpath() {
327 - local e newpath thisp IFS=:
328 - for thisp in ${ROOTPATH} ; do
329 - for e ; do [[ $thisp == $e ]] && continue 2 ; done
330 - newpath+=:$thisp
331 - done
332 - ROOTPATH=${newpath#:}
333 - }
334 - rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
335 -
336 - einfo "... done"
337 -}
338 -
339 -src_configure() {
340 - local ROOTPATH
341 - set_rootpath
342 -
343 - # audit: somebody got to explain me how I can test this before I
344 - # enable it.. - Diego
345 - # plugindir: autoconf code is crappy and does not delay evaluation
346 - # until `make` time, so we have to use a full path here rather than
347 - # basing off other values.
348 - econf \
349 - --enable-zlib=system \
350 - --with-secure-path="${ROOTPATH}" \
351 - --with-editor="${EPREFIX}"/usr/libexec/editor \
352 - --with-env-editor \
353 - $(use_with offensive insults) \
354 - $(use_with offensive all-insults) \
355 - $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
356 - $(use_with ldap) \
357 - $(use_enable nls) \
358 - $(use_with pam) \
359 - $(use_with skey) \
360 - $(use_with selinux) \
361 - $(use_with sendmail) \
362 - --without-opie \
363 - --without-linux-audit \
364 - --with-rundir="${EPREFIX}"/var/run/sudo \
365 - --with-vardir="${EPREFIX}"/var/db/sudo \
366 - --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo \
367 - --docdir="${EPREFIX}"/usr/share/doc/${PF}
368 -}
369 -
370 -src_install() {
371 - default
372 -
373 - if use ldap ; then
374 - dodoc README.LDAP
375 - dosbin plugins/sudoers/sudoers2ldif
376 -
377 - cat <<-EOF > "${T}"/ldap.conf.sudo
378 - # See ldap.conf(5) and README.LDAP for details
379 - # This file should only be readable by root
380 -
381 - # supported directives: host, port, ssl, ldap_version
382 - # uri, binddn, bindpw, sudoers_base, sudoers_debug
383 - # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key}
384 - EOF
385 -
386 - insinto /etc
387 - doins "${T}"/ldap.conf.sudo
388 - fperms 0440 /etc/ldap.conf.sudo
389 -
390 - insinto /etc/openldap/schema
391 - newins doc/schema.OpenLDAP sudo.schema
392 - fi
393 -
394 - pamd_mimic system-auth sudo auth account session
395 -
396 - keepdir /var/db/sudo
397 - fperms 0700 /var/db/sudo
398 -
399 - # Don't install into /var/run as that is a tmpfs most of the time
400 - # (bug #504854)
401 - rm -rf "${D}"/var/run
402 -}
403 -
404 -pkg_postinst() {
405 - if use ldap ; then
406 - ewarn
407 - ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
408 - ewarn
409 - if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
410 - ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
411 - ewarn "configured in /etc/nsswitch.conf."
412 - ewarn
413 - ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
414 - ewarn " sudoers: ldap files"
415 - ewarn
416 - fi
417 - fi
418 - if use prefix ; then
419 - ewarn
420 - ewarn "To use sudo, you need to change file ownership and permissions"
421 - ewarn "with root privileges, as follows:"
422 - ewarn
423 - ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
424 - ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
425 - ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
426 - ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
427 - ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
428 - ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
429 - ewarn
430 - fi
431 -
432 - elog "To use the -A (askpass) option, you need to install a compatible"
433 - elog "password program from the following list. Starred packages will"
434 - elog "automatically register for the use with sudo (but will not force"
435 - elog "the -A option):"
436 - elog ""
437 - elog " [*] net-misc/ssh-askpass-fullscreen"
438 - elog " net-misc/x11-ssh-askpass"
439 - elog ""
440 - elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
441 - elog "variable to the program you want to use."
442 -}
443
444 diff --git a/app-admin/sudo/sudo-1.8.20.ebuild b/app-admin/sudo/sudo-1.8.20.ebuild
445 deleted file mode 100644
446 index 163cd385023..00000000000
447 --- a/app-admin/sudo/sudo-1.8.20.ebuild
448 +++ /dev/null
449 @@ -1,216 +0,0 @@
450 -# Copyright 1999-2017 Gentoo Foundation
451 -# Distributed under the terms of the GNU General Public License v2
452 -
453 -EAPI=6
454 -
455 -inherit eutils pam multilib libtool
456 -
457 -MY_P=${P/_/}
458 -MY_P=${MY_P/beta/b}
459 -
460 -uri_prefix=
461 -case ${P} in
462 - *_beta*|*_rc*) uri_prefix=beta/ ;;
463 -esac
464 -
465 -DESCRIPTION="Allows users or groups to run commands as other users"
466 -HOMEPAGE="http://www.sudo.ws/"
467 -SRC_URI="http://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
468 - ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
469 -
470 -# Basic license is ISC-style as-is, some files are released under
471 -# 3-clause BSD license
472 -LICENSE="ISC BSD"
473 -SLOT="0"
474 -if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
475 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~sparc-solaris"
476 -fi
477 -IUSE="gcrypt ldap nls pam offensive openssl selinux skey +sendmail"
478 -
479 -CDEPEND="
480 - gcrypt? ( dev-libs/libgcrypt:= )
481 - openssl? ( dev-libs/openssl:0= )
482 - pam? ( virtual/pam )
483 - skey? ( >=sys-auth/skey-1.1.5-r1 )
484 - ldap? (
485 - >=net-nds/openldap-2.1.30-r1
486 - dev-libs/cyrus-sasl
487 - )
488 - sys-libs/zlib
489 -"
490 -RDEPEND="
491 - ${CDEPEND}
492 - selinux? ( sec-policy/selinux-sudo )
493 - ldap? ( dev-lang/perl )
494 - pam? ( sys-auth/pambase )
495 - >=app-misc/editor-wrapper-3
496 - virtual/editor
497 - sendmail? ( virtual/mta )
498 -"
499 -DEPEND="
500 - ${CDEPEND}
501 - sys-devel/bison
502 -"
503 -
504 -S="${WORKDIR}/${MY_P}"
505 -
506 -REQUIRED_USE="
507 - pam? ( !skey )
508 - skey? ( !pam )
509 - ?? ( gcrypt openssl )
510 -"
511 -
512 -MAKEOPTS+=" SAMPLES="
513 -
514 -src_prepare() {
515 - default
516 - elibtoolize
517 -}
518 -
519 -set_rootpath() {
520 - # FIXME: secure_path is a compile time setting. using ROOTPATH
521 - # is not perfect, env-update may invalidate this, but until it
522 - # is available as a sudoers setting this will have to do.
523 - einfo "Setting secure_path ..."
524 -
525 - # first extract the default ROOTPATH from build env
526 - ROOTPATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}")
527 - if [[ -z ${ROOTPATH} ]] ; then
528 - ewarn " Failed to find ROOTPATH, please report this"
529 - fi
530 -
531 - # then remove duplicate path entries
532 - cleanpath() {
533 - local newpath thisp IFS=:
534 - for thisp in $1 ; do
535 - if [[ :${newpath}: != *:${thisp}:* ]] ; then
536 - newpath+=:$thisp
537 - else
538 - einfo " Duplicate entry ${thisp} removed..."
539 - fi
540 - done
541 - ROOTPATH=${newpath#:}
542 - }
543 - cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}}
544 -
545 - # finally, strip gcc paths #136027
546 - rmpath() {
547 - local e newpath thisp IFS=:
548 - for thisp in ${ROOTPATH} ; do
549 - for e ; do [[ $thisp == $e ]] && continue 2 ; done
550 - newpath+=:$thisp
551 - done
552 - ROOTPATH=${newpath#:}
553 - }
554 - rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
555 -
556 - einfo "... done"
557 -}
558 -
559 -src_configure() {
560 - local ROOTPATH
561 - set_rootpath
562 -
563 - # audit: somebody got to explain me how I can test this before I
564 - # enable it.. - Diego
565 - # plugindir: autoconf code is crappy and does not delay evaluation
566 - # until `make` time, so we have to use a full path here rather than
567 - # basing off other values.
568 - myeconfargs=(
569 - --enable-zlib=system
570 - --with-editor="${EPREFIX}"/usr/libexec/editor
571 - --with-env-editor
572 - --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo
573 - --with-rundir="${EPREFIX}"/var/run/sudo
574 - --with-secure-path="${ROOTPATH}"
575 - --with-vardir="${EPREFIX}"/var/db/sudo
576 - --without-linux-audit
577 - --without-opie
578 - $(use_enable gcrypt)
579 - $(use_enable nls)
580 - $(use_enable openssl)
581 - $(use_with offensive insults)
582 - $(use_with offensive all-insults)
583 - $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo)
584 - $(use_with ldap)
585 - $(use_with pam)
586 - $(use_with skey)
587 - $(use_with selinux)
588 - $(use_with sendmail)
589 - )
590 - econf "${myeconfargs[@]}"
591 -}
592 -
593 -src_install() {
594 - default
595 -
596 - if use ldap ; then
597 - dodoc README.LDAP
598 - dosbin plugins/sudoers/sudoers2ldif
599 -
600 - cat <<-EOF > "${T}"/ldap.conf.sudo
601 - # See ldap.conf(5) and README.LDAP for details
602 - # This file should only be readable by root
603 -
604 - # supported directives: host, port, ssl, ldap_version
605 - # uri, binddn, bindpw, sudoers_base, sudoers_debug
606 - # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key}
607 - EOF
608 -
609 - insinto /etc
610 - doins "${T}"/ldap.conf.sudo
611 - fperms 0440 /etc/ldap.conf.sudo
612 -
613 - insinto /etc/openldap/schema
614 - newins doc/schema.OpenLDAP sudo.schema
615 - fi
616 -
617 - pamd_mimic system-auth sudo auth account session
618 -
619 - keepdir /var/db/sudo
620 - fperms 0700 /var/db/sudo
621 -
622 - # Don't install into /var/run as that is a tmpfs most of the time
623 - # (bug #504854)
624 - rm -rf "${D}"/var/run
625 -}
626 -
627 -pkg_postinst() {
628 - if use ldap ; then
629 - ewarn
630 - ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
631 - ewarn
632 - if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
633 - ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
634 - ewarn "configured in /etc/nsswitch.conf."
635 - ewarn
636 - ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
637 - ewarn " sudoers: ldap files"
638 - ewarn
639 - fi
640 - fi
641 - if use prefix ; then
642 - ewarn
643 - ewarn "To use sudo, you need to change file ownership and permissions"
644 - ewarn "with root privileges, as follows:"
645 - ewarn
646 - ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
647 - ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
648 - ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
649 - ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
650 - ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
651 - ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
652 - ewarn
653 - fi
654 -
655 - elog "To use the -A (askpass) option, you need to install a compatible"
656 - elog "password program from the following list. Starred packages will"
657 - elog "automatically register for the use with sudo (but will not force"
658 - elog "the -A option):"
659 - elog ""
660 - elog " [*] net-misc/ssh-askpass-fullscreen"
661 - elog " net-misc/x11-ssh-askpass"
662 - elog ""
663 - elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
664 - elog "variable to the program you want to use."
665 -}