fix SUID issue

pull/1528/head
Audric Ackermann 5 years ago
parent fca9bab068
commit 7dfe8042cd
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

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

@ -1,5 +1,11 @@
#!/usr/bin/env bash #!/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) UNPRIVILEGED_USERNS_ENABLED=$(cat /proc/sys/kernel/unprivileged_userns_clone 2>/dev/null)
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

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

@ -35,7 +35,6 @@
"test-electron": "yarn grunt test", "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-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-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": "eslint --cache .",
"eslint-fix": "eslint --fix .", "eslint-fix": "eslint --fix .",
"eslint-full": "eslint .", "eslint-full": "eslint .",

Loading…
Cancel
Save