Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent parsing electron and argument options as files #969

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EstebanMacanek
Copy link

@EstebanMacanek EstebanMacanek commented Jan 24, 2025

Improve command-line argument options parse with minimist.

!['electron.exe', 'electron'].some(x => process.argv[0].endsWith(x))

This condition don't take into consideration .electron-wrapped or any other arbitrary named electron executable.

process.argv.length >= 3

This condition don't take into consideration argument options, like --no-sandbox.

argv._[0].endsWith('sabaki')

Instead of checking if a wrapper was run, it checks if an AppImage was run. The linux AppImage runs like this: /path/to/sabaki-v0.52.2-linux-x64.AppImage/sabaki. Note that the filename, sabaki, is hardcoded and cannot be changed. If it isn't an AppImage then it must be a wrapper and runs like this: /path/to/electron /path/to/app.asar.

Refs: #954

@EstebanMacanek EstebanMacanek changed the title fix: prevent parsing wrappers and argument options as files to be opened by sabaki fix: prevent parsing electron and argument options as files Jan 24, 2025
Improve command-line argument options parse with minimist.

Refs: SabakiHQ#954
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant