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: Mon, 27 Mar 2017 12:37:14
Message-Id: 1490618179.c1d0997f797382c639a6c61b607dc9dd339e05e4.polynomial-c@gentoo
1 commit: c1d0997f797382c639a6c61b607dc9dd339e05e4
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 27 12:36:05 2017 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 27 12:36:19 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1d0997f
7
8 app-admin/sudo: Bump to version 1.8.20_beta1
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 app-admin/sudo/Manifest | 1 +
13 app-admin/sudo/sudo-1.8.20_beta1.ebuild | 201 ++++++++++++++++++++++++++++++++
14 2 files changed, 202 insertions(+)
15
16 diff --git a/app-admin/sudo/Manifest b/app-admin/sudo/Manifest
17 index 424de3dff76..82ff2ee75c4 100644
18 --- a/app-admin/sudo/Manifest
19 +++ b/app-admin/sudo/Manifest
20 @@ -1,2 +1,3 @@
21 DIST sudo-1.8.18p1.tar.gz 2822109 SHA256 e5a0471c721281a693025bbde33ebd9d3db43245d83ab8516bbfc23980379434 SHA512 8dceeb5024c4f94fcc15e75fa2fd164af5e0597734f95df43207738b3258c4d396e102faf2b6811e399f1cdbdbf617b87e5bfcc1e591ea6722f45d81d1098fe5 WHIRLPOOL 094c1232517706a6da4a0548f7ab5c0c7b9e12f8ce584db97d0c4793a38c4044538637f2834b9f3104326bd5b4b826d08ab79b1dc2c5b950de7d7f558685ef7b
22 DIST sudo-1.8.19p2.tar.gz 2861855 SHA256 237e18e67c2ad59ecacfa4b7707198b09fcf84914621585a9bc670dcc31a52e0 SHA512 21c83403e7ff219a273b2c4873be0d858997558ca150bc8239379a9dfcc587fdd7c0c49cdf4cdc27dfd6dd45f9f089fa034b58bfcee07dceb4a481542251b3fc WHIRLPOOL 550ed115ea711d6ba9aa698cd988295b74327dd770d79b6852f9f3f00a1c0420bbdcce5cc7c49467e0cf8a57fc79dbcfc73edaf3ad697e06ba9fd48919fece0b
23 +DIST sudo-1.8.20b1.tar.gz 2903798 SHA256 9e3caef7d9354fac382b2681ca895a44faec460080a2bad85813033ea81f4216 SHA512 8fd9a8d74883b83a4302c0e6e9980773d73c592be69e5246fcab097ae293c299b886a6f83d714bf1638d366f1bc0f00436e291c4f18611049a92f39bdd892e37 WHIRLPOOL ec54454f17c1805ca03eb426756c2e4a4291e710559168c989656e15b714670162df07cfcbcedca12373c849a364d0f6728be9a8dfe83c24b069e039e7d7cb02
24
25 diff --git a/app-admin/sudo/sudo-1.8.20_beta1.ebuild b/app-admin/sudo/sudo-1.8.20_beta1.ebuild
26 new file mode 100644
27 index 00000000000..5103d4888ee
28 --- /dev/null
29 +++ b/app-admin/sudo/sudo-1.8.20_beta1.ebuild
30 @@ -0,0 +1,201 @@
31 +# Copyright 1999-2017 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +inherit eutils pam multilib libtool
37 +
38 +MY_P=${P/_/}
39 +MY_P=${MY_P/beta/b}
40 +
41 +uri_prefix=
42 +case ${P} in
43 +*_beta*|*_rc*) uri_prefix=beta/ ;;
44 +esac
45 +
46 +DESCRIPTION="Allows users or groups to run commands as other users"
47 +HOMEPAGE="http://www.sudo.ws/"
48 +SRC_URI="http://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
49 + ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
50 +
51 +# Basic license is ISC-style as-is, some files are released under
52 +# 3-clause BSD license
53 +LICENSE="ISC BSD"
54 +SLOT="0"
55 +if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
56 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~sparc-solaris"
57 +fi
58 +IUSE="ldap nls pam offensive selinux skey +sendmail"
59 +
60 +DEPEND="pam? ( virtual/pam )
61 + skey? ( >=sys-auth/skey-1.1.5-r1 )
62 + ldap? (
63 + >=net-nds/openldap-2.1.30-r1
64 + dev-libs/cyrus-sasl
65 + )
66 + sys-libs/zlib"
67 +RDEPEND="${DEPEND}
68 + selinux? ( sec-policy/selinux-sudo )
69 + ldap? ( dev-lang/perl )
70 + pam? ( sys-auth/pambase )
71 + >=app-misc/editor-wrapper-3
72 + virtual/editor
73 + sendmail? ( virtual/mta )"
74 +DEPEND="${DEPEND}
75 + sys-devel/bison"
76 +
77 +S=${WORKDIR}/${MY_P}
78 +
79 +REQUIRED_USE="pam? ( !skey ) skey? ( !pam )"
80 +
81 +MAKEOPTS+=" SAMPLES="
82 +
83 +src_prepare() {
84 + default
85 + elibtoolize
86 +}
87 +
88 +set_rootpath() {
89 + # FIXME: secure_path is a compile time setting. using ROOTPATH
90 + # is not perfect, env-update may invalidate this, but until it
91 + # is available as a sudoers setting this will have to do.
92 + einfo "Setting secure_path ..."
93 +
94 + # first extract the default ROOTPATH from build env
95 + ROOTPATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}")
96 + if [[ -z ${ROOTPATH} ]] ; then
97 + ewarn " Failed to find ROOTPATH, please report this"
98 + fi
99 +
100 + # then remove duplicate path entries
101 + cleanpath() {
102 + local newpath thisp IFS=:
103 + for thisp in $1 ; do
104 + if [[ :${newpath}: != *:${thisp}:* ]] ; then
105 + newpath+=:$thisp
106 + else
107 + einfo " Duplicate entry ${thisp} removed..."
108 + fi
109 + done
110 + ROOTPATH=${newpath#:}
111 + }
112 + cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}}
113 +
114 + # finally, strip gcc paths #136027
115 + rmpath() {
116 + local e newpath thisp IFS=:
117 + for thisp in ${ROOTPATH} ; do
118 + for e ; do [[ $thisp == $e ]] && continue 2 ; done
119 + newpath+=:$thisp
120 + done
121 + ROOTPATH=${newpath#:}
122 + }
123 + rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
124 +
125 + einfo "... done"
126 +}
127 +
128 +src_configure() {
129 + local ROOTPATH
130 + set_rootpath
131 +
132 + # audit: somebody got to explain me how I can test this before I
133 + # enable it.. - Diego
134 + # plugindir: autoconf code is crappy and does not delay evaluation
135 + # until `make` time, so we have to use a full path here rather than
136 + # basing off other values.
137 + econf \
138 + --enable-zlib=system \
139 + --with-secure-path="${ROOTPATH}" \
140 + --with-editor="${EPREFIX}"/usr/libexec/editor \
141 + --with-env-editor \
142 + $(use_with offensive insults) \
143 + $(use_with offensive all-insults) \
144 + $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
145 + $(use_with ldap) \
146 + $(use_enable nls) \
147 + $(use_with pam) \
148 + $(use_with skey) \
149 + $(use_with selinux) \
150 + $(use_with sendmail) \
151 + --without-opie \
152 + --without-linux-audit \
153 + --with-rundir="${EPREFIX}"/var/run/sudo \
154 + --with-vardir="${EPREFIX}"/var/db/sudo \
155 + --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo \
156 + --docdir="${EPREFIX}"/usr/share/doc/${PF}
157 +}
158 +
159 +src_install() {
160 + default
161 +
162 + if use ldap ; then
163 + dodoc README.LDAP
164 + dosbin plugins/sudoers/sudoers2ldif
165 +
166 + cat <<-EOF > "${T}"/ldap.conf.sudo
167 + # See ldap.conf(5) and README.LDAP for details
168 + # This file should only be readable by root
169 +
170 + # supported directives: host, port, ssl, ldap_version
171 + # uri, binddn, bindpw, sudoers_base, sudoers_debug
172 + # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key}
173 + EOF
174 +
175 + insinto /etc
176 + doins "${T}"/ldap.conf.sudo
177 + fperms 0440 /etc/ldap.conf.sudo
178 +
179 + insinto /etc/openldap/schema
180 + newins doc/schema.OpenLDAP sudo.schema
181 + fi
182 +
183 + pamd_mimic system-auth sudo auth account session
184 +
185 + keepdir /var/db/sudo
186 + fperms 0700 /var/db/sudo
187 +
188 + # Don't install into /var/run as that is a tmpfs most of the time
189 + # (bug #504854)
190 + rm -rf "${D}"/var/run
191 +}
192 +
193 +pkg_postinst() {
194 + if use ldap ; then
195 + ewarn
196 + ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
197 + ewarn
198 + if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
199 + ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
200 + ewarn "configured in /etc/nsswitch.conf."
201 + ewarn
202 + ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
203 + ewarn " sudoers: ldap files"
204 + ewarn
205 + fi
206 + fi
207 + if use prefix ; then
208 + ewarn
209 + ewarn "To use sudo, you need to change file ownership and permissions"
210 + ewarn "with root privileges, as follows:"
211 + ewarn
212 + ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
213 + ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
214 + ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
215 + ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
216 + ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
217 + ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
218 + ewarn
219 + fi
220 +
221 + elog "To use the -A (askpass) option, you need to install a compatible"
222 + elog "password program from the following list. Starred packages will"
223 + elog "automatically register for the use with sudo (but will not force"
224 + elog "the -A option):"
225 + elog ""
226 + elog " [*] net-misc/ssh-askpass-fullscreen"
227 + elog " net-misc/x11-ssh-askpass"
228 + elog ""
229 + elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
230 + elog "variable to the program you want to use."
231 +}