fix SUID issue

This commit is contained in:
Audric Ackermann 2021-03-16 13:56:18 +11:00
parent fca9bab068
commit 7dfe8042cd
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
4 changed files with 11 additions and 5 deletions

View File

@ -5,14 +5,14 @@ const util = require('util');
const renameAsync = util.promisify(fs.rename);
const unlinkAsync = util.promisify(fs.unlink);
module.exports = async function (context) {
module.exports = async function(context) {
// Replace the app launcher on linux only.
if (process.platform !== 'linux') {
return;
}
const isAppImage = context.targets.find(target => target.name === 'appImage')
const isAppImage = context.targets.find(target => target.name === 'appImage');
if (!isAppImage) {
return
return;
}
// eslint-disable-next-line no-console
console.log('afterPack hook triggered', context);

View File

@ -1,5 +1,11 @@
#!/usr/bin/env bash
set -ex
set -e
# Some distributions do not have unprivileged_userns_clone disabled.
# If that's the case, and we run an AppImage (deb is not impacted by this),
# the app won't start unless we start it with --no-sandbox.
# This bash script is the launcher script for AppImage only, and will at runtime check
# if we need to add the --no-sandbox before running the AppImage itself.
UNPRIVILEGED_USERNS_ENABLED=$(cat /proc/sys/kernel/unprivileged_userns_clone 2>/dev/null)
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

View File

@ -256,6 +256,7 @@ function isVisible(window, bounds) {
async function createWindow() {
const { screen } = electron;
const { minWidth, minHeight, width, height } = getWindowSize();
const windowOptions = Object.assign(
{
show: !startInTray, // allow to start minimised in tray

View File

@ -35,7 +35,6 @@
"test-electron": "yarn grunt test",
"test-integration": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --full-trace --timeout 10000 ts/test/session/integration/integration_itest.js",
"test-node": "mocha --recursive --exit --timeout 10000 test/app test/modules \"./ts/test/**/*_test.js\" libloki/test/node ",
"test-audric": "mocha --recursive --exit --timeout 10000 ts/test/session/unit/",
"eslint": "eslint --cache .",
"eslint-fix": "eslint --fix .",
"eslint-full": "eslint .",