Skip to content
Browse files

Make sure to use the system sudo command

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: #6
  • Loading branch information...
Juan Cruz Viotti
Juan Cruz Viotti committed Oct 29, 2015
1 parent fcd0d20 commit 344da8f7b2325460f19353ff2dbcf59f92a89426
Showing with 1 addition and 1 deletion.
  1. +1 −1 index.js
@@ -27,7 +27,7 @@ Sudo.Mac = function(command, end, count) {
if (count >= 2) return end(new Error('Permission denied after several password prompts.'));
if (/^sudo/i.test(command)) return end(new Error('Command should not contain "sudo".'));
// Run sudo in non-interactive mode (-n).
Node.child.exec('sudo -n ' + command,
Node.child.exec('/usr/bin/sudo -n ' + command,
function(error, stdout, stderr) {
if (/sudo: a password is required/i.test(stderr)) {

0 comments on commit 344da8f

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