Gentoo Archives: gentoo-commits

From: "Alex Legler (a3li)" <a3li@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/sudo: ChangeLog sudo-1.7.4_p3-r1.ebuild sudo-1.7.3.ebuild sudo-1.7.2_p7.ebuild sudo-1.7.4_p3.ebuild
Date: Tue, 07 Sep 2010 12:01:05
Message-Id: 20100907120059.3C4C220051@flycatcher.gentoo.org
1 a3li 10/09/07 12:00:59
2
3 Modified: ChangeLog
4 Added: sudo-1.7.4_p3-r1.ebuild
5 Removed: sudo-1.7.3.ebuild sudo-1.7.2_p7.ebuild
6 sudo-1.7.4_p3.ebuild
7 Log:
8 Non-maintainer commit: Revision bump to fix CVE-2010-2956 (bug 335381). Removing vulnerable versions.
9 (Portage version: 2.2_rc67/cvs/Linux x86_64, RepoMan options: --force)
10
11 Revision Changes Path
12 1.243 app-admin/sudo/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/ChangeLog?rev=1.243&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/ChangeLog?rev=1.243&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/ChangeLog?r1=1.242&r2=1.243
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v
21 retrieving revision 1.242
22 retrieving revision 1.243
23 diff -u -r1.242 -r1.243
24 --- ChangeLog 6 Sep 2010 20:46:37 -0000 1.242
25 +++ ChangeLog 7 Sep 2010 12:00:58 -0000 1.243
26 @@ -1,6 +1,14 @@
27 # ChangeLog for app-admin/sudo
28 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v 1.242 2010/09/06 20:46:37 ranger Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v 1.243 2010/09/07 12:00:58 a3li Exp $
31 +
32 +*sudo-1.7.4_p3-r1 (07 Sep 2010)
33 +
34 + 07 Sep 2010; Alex Legler <a3li@g.o> -sudo-1.7.2_p7.ebuild,
35 + -sudo-1.7.3.ebuild, -sudo-1.7.4_p3.ebuild, +sudo-1.7.4_p3-r1.ebuild,
36 + +files/sudo-CVE-2010-2956.patch:
37 + Non-maintainer commit: Revision bump to fix CVE-2010-2956 (bug 335381).
38 + Removing vulnerable versions.
39
40 06 Sep 2010; Brent Baude <ranger@g.o> sudo-1.7.3.ebuild:
41 Marking sudo-1.7.3 ppc64 for bug 330827
42
43
44
45 1.1 app-admin/sudo/sudo-1.7.4_p3-r1.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/sudo-1.7.4_p3-r1.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/sudo-1.7.4_p3-r1.ebuild?rev=1.1&content-type=text/plain
49
50 Index: sudo-1.7.4_p3-r1.ebuild
51 ===================================================================
52 # Copyright 1999-2010 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.7.4_p3-r1.ebuild,v 1.1 2010/09/07 12:00:58 a3li Exp $
55
56 inherit eutils pam
57
58 MY_P=${P/_/}
59 MY_P=${MY_P/beta/b}
60
61 case "${P}" in
62 *_beta* | *_rc*)
63 uri_prefix=beta/
64 ;;
65 *)
66 uri_prefix=""
67 ;;
68 esac
69
70 DESCRIPTION="Allows users or groups to run commands as other users"
71 HOMEPAGE="http://www.sudo.ws/"
72 SRC_URI="http://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
73 ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
74
75 # Basic license is ISC-style as-is, some files are released under
76 # 3-clause BSD license
77 LICENSE="as-is BSD"
78
79 SLOT="0"
80 KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
81 IUSE="pam skey offensive ldap selinux"
82
83 DEPEND="pam? ( virtual/pam )
84 ldap? (
85 >=net-nds/openldap-2.1.30-r1
86 dev-libs/cyrus-sasl
87 )
88 !pam? ( skey? ( >=sys-auth/skey-1.1.5-r1 ) )
89 app-editors/gentoo-editor
90 virtual/editor
91 virtual/mta"
92 RDEPEND="selinux? ( sec-policy/selinux-sudo )
93 ldap? ( dev-lang/perl )
94 pam? ( sys-auth/pambase )
95 ${DEPEND}"
96 DEPEND="${DEPEND}
97 sys-devel/bison"
98
99 S=${WORKDIR}/${MY_P}
100
101 pkg_setup() {
102 if use pam && use skey; then
103 ewarn "You cannot enable both S/KEY and PAM at the same time, PAM will"
104 ewarn "be used then."
105 fi
106 }
107
108 src_unpack() {
109 unpack ${A}; cd "${S}"
110
111 # compatability fix.
112 epatch "${FILESDIR}"/${PN}-skeychallengeargs.diff
113
114 epatch "${FILESDIR}"/${PN}-CVE-2010-2956.patch
115
116 # additional variables to disallow, should user disable env_reset.
117
118 # NOTE: this is not a supported mode of operation, these variables
119 # are added to the blacklist as a convenience to administrators
120 # who fail to heed the warnings of allowing untrusted users
121 # to access sudo.
122 #
123 # there is *no possible way* to foresee all attack vectors in
124 # all possible applications that could potentially be used via
125 # sudo, these settings will just delay the inevitable.
126 #
127 # that said, I will accept suggestions for variables that can
128 # be misused in _common_ interpreters or libraries, such as
129 # perl, bash, python, ruby, etc., in the hope of dissuading
130 # a casual attacker.
131
132 # XXX: perl should be using suid_perl.
133 # XXX: users can remove/add more via env_delete and env_check.
134 # XXX: <?> = probably safe enough for most circumstances.
135
136 einfo "Blacklisting common variables (env_delete)..."
137 sudo_bad_var() {
138 local target='env.c' marker='\*initial_badenv_table\[\]'
139
140 ebegin " $1"
141 sed -i 's#\(^.*'${marker}'.*$\)#\1\n\t"'${1}'",#' "${S}"/${target}
142 eend $?
143 }
144
145 sudo_bad_var 'PERLIO_DEBUG' # perl, write debug to file.
146 sudo_bad_var 'FPATH' # ksh, search path for functions.
147 sudo_bad_var 'NULLCMD' # zsh, command on null-redir. <?>
148 sudo_bad_var 'READNULLCMD' # zsh, command on null-redir. <?>
149 sudo_bad_var 'GLOBIGNORE' # bash, glob paterns to ignore. <?>
150 sudo_bad_var 'PYTHONHOME' # python, module search path.
151 sudo_bad_var 'PYTHONPATH' # python, search path.
152 sudo_bad_var 'PYTHONINSPECT' # python, allow inspection.
153 sudo_bad_var 'RUBYLIB' # ruby, lib load path.
154 sudo_bad_var 'RUBYOPT' # ruby, cl options.
155 sudo_bad_var 'ZDOTDIR' # zsh, path to search for dotfiles.
156 einfo "...done."
157
158 # prevent binaries from being stripped.
159 sed -i 's/\($(INSTALL).*\) -s \(.*[(sudo|visudo)]\)/\1 \2/g' Makefile.in
160 }
161
162 src_compile() {
163 local line ROOTPATH
164
165 # FIXME: secure_path is a compile time setting. using ROOTPATH
166 # is not perfect, env-update may invalidate this, but until it
167 # is available as a sudoers setting this will have to do.
168 einfo "Setting secure_path..."
169
170 # why not use grep? variable might be expanded from other variables
171 # declared in that file. cannot just source the file, would override
172 # any variables already set.
173 eval `PS4= bash -x /etc/profile.env 2>&1 | \
174 while read line; do
175 case $line in
176 ROOTPATH=*) echo $line; break;;
177 *) continue;;
178 esac
179 done` && einfo " Found ROOTPATH..." || \
180 ewarn " Failed to find ROOTPATH, please report this."
181
182 # remove duplicate path entries from $1
183 cleanpath() {
184 local i=1 x n IFS=:
185 local -a paths; paths=($1)
186
187 for ((n=${#paths[*]}-1;i<=n;i++)); do
188 for ((x=0;x<i;x++)); do
189 test "${paths[i]}" == "${paths[x]}" && {
190 einfo " Duplicate entry ${paths[i]} removed..." 1>&2
191 unset paths[i]; continue 2; }
192 done; # einfo " Adding ${paths[i]}..." 1>&2
193 done; echo "${paths[*]}"
194 }
195
196 ROOTPATH=$(cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}})
197
198 # strip gcc path (bug #136027)
199 rmpath() {
200 declare e newpath oldpath=${!1} PATHvar=$1 thisp IFS=:
201 shift
202 for thisp in $oldpath; do
203 for e; do [[ $thisp == $e ]] && continue 2; done
204 newpath=$newpath:$thisp
205 done
206 eval $PATHvar='${newpath#:}'
207 }
208
209 rmpath ROOTPATH '*/gcc-bin/*'
210
211 einfo "...done."
212
213 if use pam; then
214 myconf="--with-pam --without-skey"
215 elif use skey; then
216 myconf="--without-pam --with-skey"
217 else
218 myconf="--without-pam --without-skey"
219 fi
220
221 # audit: somebody got to explain me how I can test this before I
222 # enable it.. — Diego
223 econf --with-secure-path="${ROOTPATH}" \
224 --with-editor=/usr/libexec/gentoo-editor \
225 --with-env-editor \
226 $(use_with offensive insults) \
227 $(use_with offensive all-insults) \
228 $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
229 $(use_with ldap) \
230 --without-linux-audit \
231 --with-timedir=/var/db/sudo \
232 --docdir=/usr/share/doc/${PF} \
233 ${myconf}
234
235 emake || die
236 }
237
238 src_install() {
239 emake DESTDIR="${D}" install || die
240
241 if use ldap; then
242 dodoc README.LDAP schema.OpenLDAP
243 dosbin sudoers2ldif
244
245 cat - > "${T}"/ldap.conf.sudo <<EOF
246 # See ldap.conf(5) and README.LDAP for details\n"
247 # This file should only be readable by root\n\n"
248 # supported directives: host, port, ssl, ldap_version\n"
249 # uri, binddn, bindpw, sudoers_base, sudoers_debug\n"
250 # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key
251 EOF
252
253 insinto /etc
254 doins "${T}"/ldap.conf.sudo
255 fperms 0440 /etc/ldap.conf.sudo
256 fi
257
258 pamd_mimic system-auth sudo auth account session
259
260 insinto /etc
261 doins "${S}"/sudoers
262 fperms 0440 /etc/sudoers
263
264 keepdir /var/db/sudo
265 fperms 0700 /var/db/sudo
266 }
267
268 pkg_postinst() {
269 if use ldap; then
270 ewarn
271 ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
272 ewarn
273 if egrep -q '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf; then
274 ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
275 ewarn "configured in /etc/nsswitch.conf."
276 ewarn
277 ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
278 ewarn " sudoers: ldap files"
279 ewarn
280 fi
281 fi
282
283 elog "To use the -A (askpass) option, you need to install a compatible"
284 elog "password program from the following list. Starred packages will"
285 elog "automatically register for the use with sudo (but will not force"
286 elog "the -A option):"
287 elog ""
288 elog " [*] net-misc/ssh-askpass-fullscreen"
289 elog " net-misc/x11-ssh-askpass"
290 elog ""
291 elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
292 elog "variable to the program you want to use."
293 }