1 |
Teo wrote:[Sun Dec 08 2002, 08:53:38AM EST] |
2 |
> I'm trying to find out why the sandbox feature in portage makes it |
3 |
> crash in my system after a recent world update. I found out that |
4 |
> mplayer also crashes if run as root because he "Can't find HOME |
5 |
> directory". After a little dig-dug in the source I discovered that |
6 |
> getenv("HOME") returns NULL, even though the command "set" displays |
7 |
> "HOME=/root". Besides, if launched as "HOME=/root mplayer", the |
8 |
> program runs fine. However, so do "ls ~" and "echo $HOME". |
9 |
> |
10 |
> Does anyone know where does this discrepancy come from? |
11 |
|
12 |
The "set" command shows you the current set of internal bash variables. |
13 |
It doesn't necessarily reflect what will be passed to a child process's |
14 |
environment. To get that list use the "export" command. |
15 |
|
16 |
When you run "HOME=/root mplayer" you are adding the HOME variable to |
17 |
mplayer's environment. |
18 |
|
19 |
Normally I think HOME is automatically exported. What shell are you |
20 |
using? |
21 |
|
22 |
Aron |