From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IrCbD-000743-Ov for garchives@archives.gentoo.org; Sun, 11 Nov 2007 13:11:40 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lABDAk3J016101; Sun, 11 Nov 2007 13:10:46 GMT Received: from smtp.ferdyx.org (170.Red-213-96-222.staticIP.rima-tde.net [213.96.222.170]) by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lABD8ihM013614 for ; Sun, 11 Nov 2007 13:08:44 GMT Received: from localhost (localhost [127.0.0.1]) by smtp.ferdyx.org (Postfix) with ESMTP id AA4188D81D for ; Sun, 11 Nov 2007 14:10:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ferdyx.org Received: from smtp.ferdyx.org ([127.0.0.1]) by localhost (tungsteno.ferdyx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MH2sLG1jt3IF for ; Sun, 11 Nov 2007 14:10:23 +0100 (CET) Received: from localhost (unknown [213.121.151.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.ferdyx.org (Postfix) with ESMTP id 1E1738D7FC for ; Sun, 11 Nov 2007 14:10:22 +0100 (CET) Date: Sun, 11 Nov 2007 13:08:35 +0000 From: Ciaran McCreesh To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: Re: eselect_zenity: alpha eselect GUI Message-ID: <20071111130835.0f68bb10@blueyonder.co.uk> In-Reply-To: References: <20071108104813.GI5516@supernova> <20071108105454.1844a75c@blueyonder.co.uk> <20071108120742.GK5516@supernova> <20071108124333.2a3dfdc7@blueyonder.co.uk> <20071108183450.15b4a7bb@blueyonder.co.uk> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/sfIEBrCTPMIerP07dvqupmY"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Archives-Salt: 0afe0023-3423-457f-a77a-a76d66fa7a9f X-Archives-Hash: aef143e2c50863c69a8d14279cd454b6 --Sig_/sfIEBrCTPMIerP07dvqupmY Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 11 Nov 2007 09:43:49 +0000 Steve Long wrote: > > Which is just as bad. > > > No, it's better for the reason given: it doesn't require login as > root. And it's still checking the wrong thing. > Use of ((EUID)) is also quicker. Quicker than what? It's quicker than the almost-as-bad [[ -w ]] because it doesn't check things. Being EUID 0 does not mean you can write to anything you want. Having [[ -w ]] does not mean you can write to anything you want either, of course, but it's a slight step up from EUID. Checking for EUID or UID or anything else as Donnie was proposing is wrong anyway, for a very simple reason. Consider, for example, eselect kernel. Requiring ROOT to change the /usr/src/linux symlink is a nuisance, since any responsible user will have all of /usr/src managed by a normal user. > Whatever. Requiring root for certain tasks has a long history: On the kernel side. > Further, group membership, while not as fine-grained as ACLs or Linux > Capabilities, is still a legitimate security mechanism. Which isn't what eselect is providing. eselect has nothing to do with security. > >> You can check for that kind of thing with a writeable test, eg: > >> [[ -w $PORTDIR ]] || die 'Write access to portage dir required" > >=20 > > -w is not reliable. > > > How so? There are three very obvious ways in which [[ -w ]] can be wrong. Way the first: the target appears writable, but isn't. A simple example is /dev/full. Way the second: bash does not know how to check for permissions on the target. A simple example is where you're mounting NFS off a server that uses additional security mechanisms that aren't understood by NFS. Way the third, which is extremely important and has worrying implications for security: there is a time delay between when [[ -w ]] is run and when you do whatever it is you're doing. > > When it comes to die, from bad implementations to good=20 > > implementations, the order goes: the original drobbins prefix die > > sucks more than the original agriffis die, which sucks more than my > > original signalling eselect die, which sucks more than the current > > signalling paludis die. As time goes on we're finding better and > > better tricks to work around bash's lack of exceptions; eselect is > > currently one generation behind the best current known solution. > >=20 > Thing is you never, ever post code, or discuss actual solutions at a > technical level, beyond simply saying everyone else is wrong. Well, you're jumping in on a discussion about die implementations, so I assume you're fully aware of the relative merits and implementation details of all four solutions already. But if you're not... Try pointing out which the four solutions don't you recognise and understand. Explaining the implications of any one of them is non-trivial, so it's not something I'll do unnecessarily. > BTW people have implemented many correct solutions without > exceptions. You clearly still have much to learn from those who came > before you. ...Or maybe you really don't know the history of die implementations, because that's an insane claim to make. So, the things you should have known before you jumped in on a discussion about die implementations: The original 'die' wasn't 'die'. It was a prefix alias. The prefix alias had all kinds of issues, which were documented by agriffis in his proposal for 'die'. This is mostly the same 'die' you see in Portage and Pkgcore these days. That die function has a long list of conditions it can't handle correctly. When developing eclectic (which became eselect), I needed something better because every module call to die would be under one of those conditions. That was the original signal-die implementation, which worked for what it needed to do at the time. (It also introduced stack traces, which made their way into Portage.) Unfortunately, although it would die reliably, because of various bash implementation quirks, it would sometimes drop the friendly messages and merely show a 'Killed' message. The version currently included in Paludis is a refined version of the eselect implementation that doesn't have the message dropping problem. Hence why I suggested copying the changes for eselect. And there are *still* issues with the newer signalling solutions due to the limitations of Unix signals. Fortunately, any code that could possibly trigger any of those limitations is illegal in ebuilds (but not in eselect modules); unfortunately, people do it by accident anyway. So how, exactly, do I have something to learn from those before me? And why do you feel the need to comment when you don't know what the eselect die implementation is or how the changes to it introduced in Paludis make it better? --=20 Ciaran McCreesh --Sig_/sfIEBrCTPMIerP07dvqupmY Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFHNv7T96zL6DUtXhERAs2dAJoDEbRbmceAar4eSWRYEnbntnTY6wCgsnwV XX09xdJcWT601HEEH8qRY+c= =otKL -----END PGP SIGNATURE----- --Sig_/sfIEBrCTPMIerP07dvqupmY-- -- gentoo-dev@gentoo.org mailing list