1 |
On Thu, 2004-09-30 at 14:39, Chris L. Mason wrote: |
2 |
> On Thu, 30 Sep 2004 19:50:13 +0200, Simon Stelling <blubb@g.o> wrote: |
3 |
> > |
4 |
> > Guys, it's not the idea of UNIX to install a software-package without |
5 |
> > root-access. Why do you want to install something without beeing root? |
6 |
> |
7 |
> I'm not sure about some of the other posts, but that wasn't my |
8 |
> intention. I believe the standard (and secure) UNIX way has always |
9 |
> been to compile stuff yourself (i.e. in your home directory) and then |
10 |
> su to root for the "make install". Basically I was just looking for a |
11 |
> way to do that with emerge (i.e. calling "sudo" for the actual copy of |
12 |
> files into /). That's what OpenBSD does, and they tend to set the |
13 |
> example in secure practises. |
14 |
> |
15 |
|
16 |
|
17 |
> This should be easily doable without any kernel modules or other such magic. |
18 |
|
19 |
The idea seemed simple enough to me so I wrote a real quick wrapper |
20 |
script to see how hard it would be do it. few mins of hacking later.. |
21 |
|
22 |
Your right it's not so hard at all. Atleast from a wrapper script. |
23 |
Here is what the end result gives us. |
24 |
|
25 |
--- USER EBUILD_PHASE |
26 |
>>> solar phase(clean) |
27 |
>>> solar phase(setup) |
28 |
>>> solar phase(unpack) |
29 |
>>> solar phase(compile) |
30 |
>>> solar phase(test) |
31 |
>>> solar phase(install) |
32 |
>>> solar phase(package) |
33 |
--- call remaining phases with root privs |
34 |
>>> root phase(setup) |
35 |
>>> root phase(preinst) |
36 |
>>> root phase(prerm) |
37 |
>>> root phase(postrm) |
38 |
>>> root phase(postinst) |
39 |
|
40 |
I would not really consider this any more secure by any means. An |
41 |
attacker can still take control of your system via other methods. |
42 |
But as far as keeping ebuilds from major screwups like rm -rf ${TYPO}/* |
43 |
this should do the trick. |
44 |
http://dev.gentoo.org/~solar/portage_misc/emerge-wrapper |
45 |
I've only tested with some fairly small packages. No idea how a kernel |
46 |
module or whatever would be handled. |
47 |
|
48 |
If you build an the idea please share your changes with me. I'm all for |
49 |
handling as many phases as we can as non root. Assuming it does not lead |
50 |
to us having to install some new suid bin todo it. |
51 |
|
52 |
> |
53 |
> |
54 |
> Chris |
55 |
> |
56 |
> -- |
57 |
> gentoo-dev@g.o mailing list |
58 |
-- |
59 |
Ned Ludd <solar@g.o> |
60 |
Gentoo (hardened,security,infrastructure,embedded,toolchain) Developer |