Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: gnome@g.o, freedesktop-bugs@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH] xdg-utils.eclass: reset XDG_STATE_HOME
Date: Sat, 01 Oct 2022 06:22:52
Message-Id: 20221001062231.637668-1-sam@gentoo.org
1 XDG_STATE_HOME is defined in the basedir spec just like XDG_DATA_HOME and
2 XDG_CONFIG_HOME, so we should cover it.
3
4 Noticed after a report on the forums at https://forums.gentoo.org/viewtopic-t-1157623.html
5 causing a sandbox violation if set by the user when building app-editors/neovim.
6
7 Signed-off-by: Sam James <sam@g.o>
8 ---
9 eclass/xdg-utils.eclass | 5 +++--
10 1 file changed, 3 insertions(+), 2 deletions(-)
11
12 diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
13 index ae2b71cd2495..9a58add23d36 100644
14 --- a/eclass/xdg-utils.eclass
15 +++ b/eclass/xdg-utils.eclass
16 @@ -1,4 +1,4 @@
17 -# Copyright 2004-2021 Gentoo Authors
18 +# Copyright 2004-2022 Gentoo Authors
19 # Distributed under the terms of the GNU General Public License v2
20
21 # @ECLASS: xdg-utils.eclass
22 @@ -42,9 +42,10 @@ xdg_environment_reset() {
23 export XDG_DATA_HOME="${HOME}/.local/share"
24 export XDG_CONFIG_HOME="${HOME}/.config"
25 export XDG_CACHE_HOME="${HOME}/.cache"
26 + export XDG_STATE_HOME="${HOME}/.local/state"
27 export XDG_RUNTIME_DIR="${T}/run"
28 mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" \
29 - "${XDG_RUNTIME_DIR}" || die
30 + "${XDG_STATE_HOME}" "${XDG_RUNTIME_DIR}" || die
31 # This directory needs to be owned by the user, and chmod 0700
32 # https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
33 chmod 0700 "${XDG_RUNTIME_DIR}" || die
34 --
35 2.37.3