Gentoo Archives: gentoo-dev

From: Christian Faulhammer <opfer@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: eselect_zenity: alpha eselect GUI
Date: Sun, 11 Nov 2007 12:01:48
Message-Id: 20071111125819.5151a9ab@gentoo.org
In Reply to: [gentoo-dev] Re: Re: eselect_zenity: alpha eselect GUI by Steve Long
1 Steve Long <slong@××××××××××××××××××.uk>:
2 > Ciaran McCreesh wrote:
3 > > Steve Long <slong@××××××××××××××××××.uk> wrote:
4 > >> I've always used EUID for the root check, eg:
5 > > Which is just as bad.
6 > No, it's better for the reason given: it doesn't require login as
7 > root. Use of ((EUID)) is also quicker.
8
9 Capabilites are the write access to the target you want to modify in
10 your eselect module:
11
12 test_for_root() {
13 # checks if the user has rights to modify /usr/bin/
14 [[ -w "${ROOT}/usr/bin" ]] || die -q "You need to be root!"
15 }
16
17 That's how the the vim and Emacs eselect modules do it. In my opinion
18 the best way to check for the rights needed.
19
20 V-Li
21
22 --
23 Christian Faulhammer, Gentoo Lisp project
24 <URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode
25
26 <URL:http://www.faulhammer.org/>

Attachments

File name MIME type
signature.asc application/pgp-signature