Skip to content

Commit f8820b5

Browse files
committed
fix: disable sandbox on any linux
1 parent 0c3fe08 commit f8820b5

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

electron-app/main.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,11 @@ import { createWindow } from "./src/windows/mainWindow.js";
1717

1818
const { autoUpdater } = pkg;
1919

20-
// Disable sandbox for Linux
20+
// Disable sandbox on Linux — sandbox restrictions vary across distros
21+
// (AppArmor on Ubuntu, SELinux on Fedora, etc.) and this is an internal
22+
// app where all content is trusted.
2123
if (process.platform === "linux") {
22-
try {
23-
const userns = fs
24-
.readFileSync("/proc/sys/kernel/unprivileged_userns_clone", "utf8")
25-
.trim();
26-
if (userns === "0") {
27-
app.commandLine.appendSwitch("no-sandbox");
28-
}
29-
} catch (e) {}
30-
31-
if (process.getuid && process.getuid() === 0) {
32-
app.commandLine.appendSwitch("no-sandbox");
33-
}
24+
app.commandLine.appendSwitch("no-sandbox");
3425
}
3526

3627
// Setup IPC handlers for renderer process communication

0 commit comments

Comments
 (0)