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>
Some child processes executed with this module might benefit from being
able to read their parent process environment variables.
Fixes: https://github.com/jorangreef/sudo-prompt/issues/20
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
Add support for `tty_tickets` on OS X.
Ensure all line lengths are less than 80 characters.
Fix shell commands to use absolute path (e.g. `/bin/rm`, `/usr/bin/defaults`).
Fix `options.icns` to work with asar packages.
Fix internal method names to reduce chance of a clash with local variables.
Remove `options.onChildProcess()` (no longer possible to support).
Remove batching of password prompts on OS X.
Remove deprecated `setName()`.
Remove deprecated `touch()`.
Fixes: https://github.com/jorangreef/sudo-prompt/issues/13
Some modules, like `windosu` expose a binary called `sudo`. By just
calling `sudo`, `sudo-prompt` might accidentally call a `sudo` command
which is not the system one, causing tons of confusions.
Fixes: https://github.com/jorangreef/sudo-prompt/issues/6