Gentoo Archives: gentoo-commits

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