intercept: When in Steam mode, try to find host libraries ourselves

This gives help when LD_LIBRARY_PATH is a bit busted, as the "normal"
operational mode gets more help than we currently give to games.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2017-11-14 01:30:37 +00:00
parent 04e32cd5c5
commit 94e5d09eba
+11 -1
View File
@@ -30,6 +30,9 @@
*/
static const char *matched_process = NULL;
static bool lsi_override_replace_with_host(const char *orig_name, const char **soname,
const char *msg);
/**
* We support a number of modes, but we mostly exist to make Steam behave
*/
@@ -211,6 +214,7 @@ char *lsi_search_steam(const char *name)
{
/* Find out if it exists */
bool file_exists = lsi_file_exists(name);
const char *replace = NULL;
/* Find out if its a Steam private lib.. These are relative "./" files too! */
if (name && (strstr(name, "/Steam/") || strncmp(name, "./", 2) == 0)) {
@@ -223,10 +227,13 @@ char *lsi_search_steam(const char *name)
lsi_log_debug("blacklisted loading of vendor library: \033[34;1m%s\033[0m",
name);
}
return NULL;
}
if (lsi_override_replace_with_host(name, &replace, NULL)) {
return replace;
}
return (char *)name;
}
@@ -441,6 +448,9 @@ static bool lsi_override_replace_with_host(const char *orig_name, const char **s
}
*soname = path_lookup;
if (!msg) {
return true;
}
lsi_log_debug("%s \033[31;1m%s\033[0m -> \033[34;1m%s\033[0m",
msg,
orig_name,