From 947654d9d3da83f58b477a1a70abfc900d4338fe Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Tue, 14 Nov 2017 23:16:09 +0000 Subject: [PATCH] shim: Read config AFTER setting up the environment Under snapd we forcibly change XDG_CONFIG_HOME away from the "norm", and read before the variable is set. Thus, the config written by lsi-settings is correct, but under snapd the wrong file would be read all the time. Signed-off-by: Ikey Doherty --- src/shim/shim.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shim/shim.c b/src/shim/shim.c index ade2a13..3d9884f 100644 --- a/src/shim/shim.c +++ b/src/shim/shim.c @@ -281,14 +281,16 @@ bool shim_bootstrap() operation_prefix = getenv("SNAP"); #endif + /* We might have additional variables we need to export and we + * might also end up changing XDG_CONFIG_HOME - ensure we actually + * read our settings from the right place. */ + shim_export_extra(operation_prefix); + /* Ensure we now have some kind of config */ if (!lsi_config_load(&lsi_config)) { lsi_config_load_defaults(&lsi_config); } - /* We might have additional variables we need to export */ - shim_export_extra(operation_prefix); - /* Force STEAM_RUNTIME into the environment */ if (lsi_config.use_native_runtime) { /* Explicitly disable the runtime */