Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: init.d-scripts don't see stuff from /etc/profile.env
Date: Wed, 31 Aug 2005 02:23:37
Message-Id: 200508302221.22868.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] Re: init.d-scripts don't see stuff from /etc/profile.env by Martin Schlemmer
1 On Tuesday 30 August 2005 10:15 pm, Martin Schlemmer wrote:
2 > On Tue, 2005-08-30 at 21:57 -0400, Mike Frysinger wrote:
3 > > On Tuesday 30 August 2005 09:41 pm, Sven Köhler wrote:
4 > > > > init.d scripts should have a pure env given to them ... which means,
5 > > > > they should be run with `env -i` and have only whitelisted variables
6 > > > > given to them (and everything that appears in /etc/conf.d/$service
7 > > > > /etc/conf.d/rc and /etc/rc.conf) ...
8 > > >
9 > > > Now that may be too few variables. At least the variable LANG (or
10 > > > whatever the system-admin may chose to set) could be seen as a
11 > > > system-wide language-setting. It could be intentional, that at least
12 > > > some variables are available to the started server-processes.
13 > > > Especially a system-wide language-setting would be a good idea.
14 > >
15 > > that is the point of the whitelist idea ... we gather a 'full
16 > > env' (source /etc/profile i guess) and rip out just the whitelisted
17 > > variables to pass on to init scripts
18 >
19 > Although I agree, my personal opinion is that its going to be a major
20 > PITA to maintain, and slow things down.
21
22 with the first run, we cache the 'scrubbed' env, and then just use that in the
23 future ?
24
25 > Also, not only runscript.sh
26 > will have to be 'whitelisted', but also /sbin/rc, which will mean that
27 > we now have to wrap two things. I guess a solution could have been to
28 > use /sbin/runscript (the C thing) for both (should work fine
29 > as /sbin/rc's interpreter as well), as that would buy some speed and
30 > kill one bash fork, but the problem comes in when we start with a
31 > vanilla environment that do not have /etc/profile sourced.
32
33 mmm unification is good :)
34 -mike
35
36 --
37 gentoo-dev@g.o mailing list

Replies