electron-sudo icon indicating copy to clipboard operation
electron-sudo copied to clipboard

Support for sudo with tty-tickets enabled (MacOS Sierra by default)

Open automation-stack opened this issue 7 years ago • 15 comments

https://derflounder.wordpress.com/2016/09/21/tty_tickets-option-now-on-by-default-for-macos-sierras-sudo-tool/

automation-stack avatar Nov 29 '16 23:11 automation-stack

Hello! Just want to check if this is the issue i'm hitting. I have a simple app just trying to test out electron-sudo. Here is my code and the output. Running on MacOS Sierra.

var Sudoer = require('electron-sudo').default;
let options = {name: 'electron sudo application'};
var sudoer = new Sudoer(options);

sudoer.spawn('ls', ['/']).then(function (cp) {
  cp.stdout.on('data', (msg) => {
    console.log('Looks like we have a message on STDOUT');
    console.log(err.toString('utf8'));
  });

  cp.stderr.on('data',(err) => {
    console.log('Looks like we have a message on STDERR');
    console.log(err.toString('utf8'));
  });

  cp.on('close',() => {
    console.log('Processed Finished!');
  });
});
$ electron launcher.js
Looks like we have a message on STDERR
sudo: a password is required

Processed Finished!

ZackMattor avatar Jan 31 '17 21:01 ZackMattor

@automation-stack Hi Aleksandr. Do you have any ideas how to fix that?

igor-lemon avatar Mar 04 '17 13:03 igor-lemon

@igor-lemon yes, it will be fixed soon, sudo will become not required for electron-sudo

automation-stack avatar Mar 04 '17 13:03 automation-stack

Cool. Thank you. I'm looking forward changes. :)

igor-lemon avatar Mar 04 '17 13:03 igor-lemon

@automation-stack So is this completely broken on MacOS Sierra or can it still be used? Do you have an ETA on the fix?

justechn avatar Mar 14 '17 15:03 justechn

@justechn working hard on this issues, details will follow

automation-stack avatar Mar 14 '17 15:03 automation-stack

Any chance this is fixed? I have been using sudo-prompt but it is actually quite poor in that it doesn't give you access to the underlying child process after it is created.

treyreynolds avatar Jun 06 '17 21:06 treyreynolds

Same issue here. macOS Sierra 10.12.5.

rameerez avatar Jul 03 '17 16:07 rameerez

Would also love to see this working again. If there's anything we can do to help, let us know! I'd jump in to fix it, but I have little idea where to start.

DSBalaban avatar Jul 12 '17 11:07 DSBalaban

@DSBalaban the idea is to refuse to use sudo in this package, I'm working on this

automation-stack avatar Jul 12 '17 11:07 automation-stack

I ran into the same issue and made it work on Sierra at least by using osascript.

The change is hacky but might help someone running into this problem, https://github.com/eriklarko/electron-sudo/commit/f71134f86541b15359f4813715d721818fb2b1f4

eriklarko avatar Jul 20 '17 12:07 eriklarko

@eriklarko i think you should post a PR to @automation-stack :)

robsontenorio avatar Jul 22 '17 02:07 robsontenorio

Personally I feel the osascript idea is a bit too hack-ish. Really looking forward to @automation-stack 's fix.

imdreamrunner avatar Aug 02 '17 09:08 imdreamrunner

@imdreamrunner yeah but how's that any different from using sudo and what difference does it make if electron-sudo is broken for over 6 months..

pronebird avatar Feb 09 '18 12:02 pronebird

Is electron-sudo still maintaining? any updates for this issue?

wemteqdev avatar Oct 04 '18 16:10 wemteqdev