1 |
> On 2018-06-26, at 15:44, Christoph Böhmwalder <christoph@×××××××××××.at> wrote: |
2 |
> |
3 |
> On Tue, Jun 26, 2018 at 03:15:09PM -0400, Andrew Udvare wrote: |
4 |
>> It should not be accessing this location in any case. What is the environment like? What does env show? emerge --config output? |
5 |
>> |
6 |
>> It would almost seem like you have $HOME set to /home/christoph while Portage is running (as root). |
7 |
> |
8 |
> The only thing that stands out about `env` is that XDG_CONFIG_HOME is set to |
9 |
> /home/christoph/.config (running as root). I'm not sure if it's supposed |
10 |
> to be this way, but I didn't find anything in my dotfiles that would |
11 |
> suggest that I'm overwriting it. |
12 |
|
13 |
Use `su -` to become root so the environment you are coming from gets ignored. I actually have su aliased to `su -` because I rarely need the opposite functionality. Otherwise just `unset XDG_CONFIG_HOME` and other things that reference your user when you become root. |
14 |
|
15 |
You should only have these, if any at all: |
16 |
|
17 |
# env | fgrep XDG |
18 |
XDG_DATA_DIRS=/usr/local/share:/usr/share |
19 |
XDG_CONFIG_DIRS=/etc/xdg |
20 |
|
21 |
What it would seems to be is that npm uses configstore https://www.npmjs.com/package/configstore and since it sees XDG_CONFIG_HOME is set and is a real path it tries to write a file to there. It falls back to tmpdir otherwise which would be writable by Portage. |
22 |
|
23 |
https://github.com/yeoman/configstore/blob/master/index.js#L11 |
24 |
https://github.com/yeoman/configstore/blob/master/index.js#L32 |
25 |
|
26 |
> |
27 |
> $HOME points to /root. |
28 |
> |
29 |
> I'm not sure what you mean by "emerge --config output"? Running |
30 |
> `emerge --config` just gives: |
31 |
|
32 |
Sorry I meant `emerge --info`. |
33 |
|
34 |
Andrew |