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