`pkexec` prints an error to `stderr` if no authentication agent was
found, and if we pass the `--disable-internal-agent` option.
Currently, this module doesn't handle this edge case by yielding a
meaningful error, and therefore causes client applications to usually
miss it.
Fixes: https://github.com/jorangreef/sudo-prompt/issues/28
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Otherwise, `kdesudo` also displays the command as the dialog title,
making it very ugly and unfriendly.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is very similar to 3f6c485. It implements the fix to the
same problem for `sudo` when the module makes an attempt to determine if
the dialog needs to be shown or not.
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
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>