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 <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2017-11-14 23:16:09 +00:00
parent c59949cf0e
commit 947654d9d3
+5 -3
View File
@@ -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 */