mirror of
https://github.com/clearlinux/linux-steam-integration.git
synced 2026-08-22 15:56:46 +00:00
shim: When in snapd mode, chdir to SNAP_USER_COMMON
This will alleviate some weird apparmor confinement denials when trying to access the wrong directory. Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "../common/files.h"
|
||||
#include "config.h"
|
||||
#include "lsi.h"
|
||||
#include "shim.h"
|
||||
|
||||
@@ -38,6 +39,8 @@ int main(int argc, char **argv)
|
||||
{
|
||||
const char *operation_prefix = NULL;
|
||||
const char *steam_binary = NULL;
|
||||
__attribute__((unused)) const char *tdir = NULL;
|
||||
__attribute__((unused)) int dir_ret = 0;
|
||||
|
||||
if (!shim_bootstrap()) {
|
||||
return EXIT_FAILURE;
|
||||
@@ -45,6 +48,7 @@ int main(int argc, char **argv)
|
||||
|
||||
#ifdef HAVE_SNAPD_SUPPORT
|
||||
operation_prefix = getenv("SNAP");
|
||||
tdir = getenv("SNAP_USER_COMMON");
|
||||
#endif
|
||||
|
||||
steam_binary = shim_get_steam_binary(operation_prefix);
|
||||
@@ -54,6 +58,10 @@ int main(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (tdir) {
|
||||
dir_ret = chdir(tdir);
|
||||
}
|
||||
|
||||
return shim_execute(steam_binary, --argc, ++argv);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user