Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals #5075

Mergedarhxam(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5075/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 20 additions and 4 deletions.

x
0 of 2 viewed, 2 left
7 additions and 0 deletionsapps/server/src/terminal/Manager.test.tsModified
View file
@@ -1345,6 +1345,8 @@
OWD: "/home/user/project",
PATH: `${appDir}/usr/bin:${appDir}:/usr/local/bin:/usr/bin:/bin`,
LD_LIBRARY_PATH: `${appDir}/usr/lib:/home/user/.local/lib`,
+ XDG_DATA_DIRS: `${appDir}/usr/share:/usr/local/share:/usr/share`,
+ GSETTINGS_SCHEMA_DIR: `${appDir}/usr/share/glib-2.0/schemas`,
TEST_TERMINAL_KEEP: "keep-me",
@@ -1364,6 +1366,11 @@
// mount segments that the runtime prepended.
expect(spawnInput.env.PATH).toBe("/usr/local/bin:/usr/bin:/bin");
expect(spawnInput.env.LD_LIBRARY_PATH).toBe("/home/user/.local/lib");
+ // XDG_DATA_DIRS keeps the host entries but drops the AppImage share dir.
+ expect(spawnInput.env.XDG_DATA_DIRS).toBe("/usr/local/share:/usr/share");
+ // GSETTINGS_SCHEMA_DIR pointed only at the mount, so it is removed and
+ // gsettings falls back to the host schema location.
+ expect(spawnInput.env.GSETTINGS_SCHEMA_DIR).toBeUndefined();
// Unrelated host vars still pass through untouched.
expect(spawnInput.env.TEST_TERMINAL_KEEP).toBe("keep-me");
13 additions and 4 deletionsapps/server/src/terminal/Manager.tsModified
View file
@@ -1069,10 +1069,19 @@
// They describe the AppImage itself, not the user's session, so terminals must
// not inherit them.
const APPIMAGE_RUNTIME_ENV_KEYS = ["APPIMAGE", "APPDIR", "ARGV0", "OWD"] as const;