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.3.ebuild sudo-1.7.3_rc1.ebuild
Date: Wed, 30 Jun 2010 23:23:27
Message-Id: 20100630232322.364562CE15@corvid.gentoo.org
1 flameeyes 10/06/30 23:23:22
2
3 Modified: ChangeLog
4 Added: sudo-1.7.3.ebuild
5 Removed: sudo-1.7.3_rc1.ebuild
6 Log:
7 Version bump to 1.7.3 final.
8 (Portage version: 2.2_rc67/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.232 app-admin/sudo/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/ChangeLog?rev=1.232&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/ChangeLog?rev=1.232&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/ChangeLog?r1=1.231&r2=1.232
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v
20 retrieving revision 1.231
21 retrieving revision 1.232
22 diff -u -r1.231 -r1.232
23 --- ChangeLog 29 Jun 2010 11:29:21 -0000 1.231
24 +++ ChangeLog 30 Jun 2010 23:23:21 -0000 1.232
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.231 2010/06/29 11:29:21 flameeyes Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v 1.232 2010/06/30 23:23:21 flameeyes Exp $
30 +
31 +*sudo-1.7.3 (30 Jun 2010)
32 +
33 + 30 Jun 2010; Diego E. Pettenò <flameeyes@g.o>
34 + -sudo-1.7.3_rc1.ebuild, +sudo-1.7.3.ebuild:
35 + Version bump to 1.7.3 final.
36
37 *sudo-1.7.3_rc1 (29 Jun 2010)
38
39
40
41
42 1.1 app-admin/sudo/sudo-1.7.3.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/sudo-1.7.3.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/sudo/sudo-1.7.3.ebuild?rev=1.1&content-type=text/plain
46
47 Index: sudo-1.7.3.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.3.ebuild,v 1.1 2010/06/30 23:23:21 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 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~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 # audit: somebody got to explain me how I can test this before I
203 # enable it.. — Diego
204 econf --with-secure-path="${ROOTPATH}" \
205 --with-editor=/usr/libexec/gentoo-editor \
206 --with-env-editor \
207 $(use_with offensive insults) \
208 $(use_with offensive all-insults) \
209 $(use_with pam) \
210 $(use_with skey) \
211 $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
212 $(use_with ldap) \
213 --without-linux-audit
214
215 emake || die
216 }
217
218 src_install() {
219 emake DESTDIR="${D}" install || die
220 dodoc ChangeLog HISTORY PORTING README TROUBLESHOOTING \
221 UPGRADE WHATSNEW sample.sudoers sample.syslog.conf
222
223 if use ldap; then
224 dodoc README.LDAP schema.OpenLDAP
225 dosbin sudoers2ldif
226
227 cat - > "${T}"/ldap.conf.sudo <<EOF
228 # See ldap.conf(5) and README.LDAP for details\n"
229 # This file should only be readable by root\n\n"
230 # supported directives: host, port, ssl, ldap_version\n"
231 # uri, binddn, bindpw, sudoers_base, sudoers_debug\n"
232 # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key
233 EOF
234
235 insinto /etc
236 doins "${T}"/ldap.conf.sudo
237 fperms 0440 /etc/ldap.conf.sudo
238 fi
239
240 pamd_mimic system-auth sudo auth account password session
241
242 insinto /etc
243 doins "${S}"/sudoers
244 fperms 0440 /etc/sudoers
245 }
246
247 pkg_postinst() {
248 if use ldap; then
249 ewarn
250 ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
251 ewarn
252 if egrep -q '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf; then
253 ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
254 ewarn "configured in /etc/nsswitch.conf."
255 ewarn
256 ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
257 ewarn " sudoers: ldap files"
258 ewarn
259 fi
260 fi
261
262 elog "To use the -A (askpass) option, you need to install a compatible"
263 elog "password program from the following list. Starred packages will"
264 elog "automatically register for the use with sudo (but will not force"
265 elog "the -A option):"
266 elog ""
267 elog " [*] net-misc/ssh-askpass-fullscreen"
268 elog " net-misc/x11-ssh-askpass"
269 elog ""
270 elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
271 elog "variable to the program you want to use."
272 }