Skip to content
Browse files

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 <>
  • Loading branch information...
Juan Cruz Viotti
Juan Cruz Viotti committed May 20, 2016
1 parent 41be5f7 commit 3f6c485c4d5e8b6d993cdc21468e6dbd19b3d173
Showing with 3 additions and 0 deletions.
  1. +3 −0 index.js
@@ -118,6 +118,9 @@ function Linux(instance, end) {
var description = EscapeDoubleQuotes(;
command.push('--description="' + description + '"');
} else if (/kdesudo/i.test(binary)) {
} else if (/pkexec/i.test(binary)) {

0 comments on commit 3f6c485

Please sign in to comment.
You can’t perform that action at this time.