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