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: sudo-1.7.2_p1.ebuild ChangeLog sudo-1.7.0.ebuild sudo-1.7.2.ebuild
Date: Thu, 30 Jul 2009 13:36:32
Message-Id: E1MWVo5-00032J-CF@stork.gentoo.org
1 flameeyes 09/07/30 13:36:29
2
3 Modified: ChangeLog
4 Added: sudo-1.7.2_p1.ebuild
5 Removed: sudo-1.7.0.ebuild sudo-1.7.2.ebuild
6 Log:
7 Version bump, cleanup old versions.
8 (Portage version: 2.2_rc33/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.184 app-admin/sudo/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/sudo/ChangeLog?rev=1.184&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/sudo/ChangeLog?rev=1.184&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/sudo/ChangeLog?r1=1.183&r2=1.184
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v
20 retrieving revision 1.183
21 retrieving revision 1.184
22 diff -u -r1.183 -r1.184
23 --- ChangeLog 17 Jul 2009 14:47:53 -0000 1.183
24 +++ ChangeLog 30 Jul 2009 13:36:29 -0000 1.184
25 @@ -1,6 +1,13 @@
26 # ChangeLog for app-admin/sudo
27 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v 1.183 2009/07/17 14:47:53 armin76 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/ChangeLog,v 1.184 2009/07/30 13:36:29 flameeyes Exp $
30 +
31 +*sudo-1.7.2_p1 (30 Jul 2009)
32 +
33 + 30 Jul 2009; Diego E. Pettenò <flameeyes@g.o> -sudo-1.7.0.ebuild,
34 + -files/sudo-1.7.0-parallelinstall.patch, -sudo-1.7.2.ebuild,
35 + +sudo-1.7.2_p1.ebuild:
36 + Version bump, cleanup old versions.
37
38 17 Jul 2009; Raúl Porcel <armin76@g.o> sudo-1.7.1-r1.ebuild:
39 arm/ia64/m68k/s390/sh stable wrt #272819
40
41
42
43 1.1 app-admin/sudo/sudo-1.7.2_p1.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/sudo/sudo-1.7.2_p1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/sudo/sudo-1.7.2_p1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: sudo-1.7.2_p1.ebuild
49 ===================================================================
50 # Copyright 1999-2009 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.7.2_p1.ebuild,v 1.1 2009/07/30 13:36:29 flameeyes Exp $
53
54 inherit eutils pam confutils
55
56 MY_P=${P/_/}
57 MY_P=${MY_P/beta/b}
58
59 case "${P}" in
60 *_beta* | *_rc*)
61 uri_prefix=beta/
62 ;;
63 *)
64 uri_prefix=""
65 ;;
66 esac
67
68 DESCRIPTION="Allows users or groups to run commands as other users"
69 HOMEPAGE="http://www.sudo.ws/"
70 SRC_URI="ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
71 # Basic license is ISC-style as-is, some files are released under
72 # 3-clause BSD license
73 LICENSE="as-is BSD"
74 SLOT="0"
75 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
76 IUSE="pam skey offensive ldap selinux"
77
78 DEPEND="pam? ( virtual/pam )
79 ldap? (
80 >=net-nds/openldap-2.1.30-r1
81 dev-libs/cyrus-sasl
82 )
83 skey? ( >=sys-auth/skey-1.1.5-r1 )
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 # remove useless c++ checks
150 epunt_cxx
151 }
152
153 src_compile() {
154 local line ROOTPATH
155
156 # FIXME: secure_path is a compile time setting. using ROOTPATH
157 # is not perfect, env-update may invalidate this, but until it
158 # is available as a sudoers setting this will have to do.
159 einfo "Setting secure_path..."
160
161 # why not use grep? variable might be expanded from other variables
162 # declared in that file. cannot just source the file, would override
163 # any variables already set.
164 eval `PS4= bash -x /etc/profile.env 2>&1 | \
165 while read line; do
166 case $line in
167 ROOTPATH=*) echo $line; break;;
168 *) continue;;
169 esac
170 done` && einfo " Found ROOTPATH..." || \
171 ewarn " Failed to find ROOTPATH, please report this."
172
173 # remove duplicate path entries from $1
174 cleanpath() {
175 local i=1 x n IFS=:
176 local -a paths; paths=($1)
177
178 for ((n=${#paths[*]}-1;i<=n;i++)); do
179 for ((x=0;x<i;x++)); do
180 test "${paths[i]}" == "${paths[x]}" && {
181 einfo " Duplicate entry ${paths[i]} removed..." 1>&2
182 unset paths[i]; continue 2; }
183 done; # einfo " Adding ${paths[i]}..." 1>&2
184 done; echo "${paths[*]}"
185 }
186
187 ROOTPATH=$(cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}})
188
189 # strip gcc path (bug #136027)
190 rmpath() {
191 declare e newpath oldpath=${!1} PATHvar=$1 thisp IFS=:
192 shift
193 for thisp in $oldpath; do
194 for e; do [[ $thisp == $e ]] && continue 2; done
195 newpath=$newpath:$thisp
196 done
197 eval $PATHvar='${newpath#:}'
198 }
199
200 rmpath ROOTPATH '*/gcc-bin/*'
201
202 einfo "...done."
203
204 # XXX: --disable-path-info closes an info leak, but may be confusing.
205 # XXX: /bin/vi may not be available, make nano visudo's default.
206 econf --with-secure-path="${ROOTPATH}" \
207 --with-editor=/bin/nano \
208 --with-env-editor \
209 $(use_with offensive insults) \
210 $(use_with offensive all-insults) \
211 $(use_with pam) \
212 $(use_with skey) \
213 $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
214 $(use_with ldap) || die
215
216 emake || die
217 }
218
219 src_install() {
220 emake DESTDIR="${D}" install || die
221 dodoc ChangeLog HISTORY PORTING README TROUBLESHOOTING \
222 UPGRADE WHATSNEW sample.sudoers sample.syslog.conf
223
224 if use ldap; then
225 dodoc README.LDAP schema.OpenLDAP
226 dosbin sudoers2ldif
227
228 cat - > "${T}"/ldap.conf.sudo <<EOF
229 # See ldap.conf(5) and README.LDAP for details\n"
230 # This file should only be readable by root\n\n"
231 # supported directives: host, port, ssl, ldap_version\n"
232 # uri, binddn, bindpw, sudoers_base, sudoers_debug\n"
233 # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key
234 EOF
235
236 insinto /etc
237 doins "${T}"/ldap.conf.sudo
238 fperms 0440 /etc/ldap.conf.sudo
239 fi
240
241 pamd_mimic system-auth sudo auth account password session
242
243 insinto /etc
244 doins "${S}"/sudoers
245 fperms 0440 /etc/sudoers
246 }
247
248 pkg_postinst() {
249 if use ldap; then
250 ewarn
251 ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
252 ewarn
253 if egrep -q '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf; then
254 ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
255 ewarn "configured in /etc/nsswitch.conf."
256 ewarn
257 ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
258 ewarn " sudoers: ldap files"
259 ewarn
260 fi
261 fi
262 }