Don't keep parsing command options in gksudo/kdesudo
When `gksudo` is detected, this module executes the following command: ``` "/usr/bin/gksudo" --preserve-env --sudo-mode --description="MyApp" <COMMAND> ``` Consider the following command: ``` /home/jviotti/Projects/etcher/node_modules/electron-prebuilt/dist/electron /home/jviotti/Projects/etcher/lib/src/run-child-writer.js lib/start.js /home/jviotti/Downloads/CorePlus-current.iso --robot --drive /dev/sdb --unmount --check ``` Given that the command I'm running contains option arguments, it seems like `gksudo` tries to interpret the options to my command as `gksudo` options, failing with errors like this one: ``` /usr/bin/gksudo: unrecognized option '--robot' ``` To prevent this from happening, we can tell `gksudo` to stop parsing options with the `--` identifier. The same error happens with `kdesudo`. Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
41be5f72f0
commit
3f6c485c4d
1 changed files with 3 additions and 0 deletions
3
index.js
3
index.js
|
@ -118,6 +118,9 @@ function Linux(instance, end) {
|
|||
command.push('--sudo-mode');
|
||||
var description = EscapeDoubleQuotes(instance.options.name);
|
||||
command.push('--description="' + description + '"');
|
||||
command.push('--');
|
||||
} else if (/kdesudo/i.test(binary)) {
|
||||
command.push('--');
|
||||
} else if (/pkexec/i.test(binary)) {
|
||||
command.push('--disable-internal-agent');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue