Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Linux bug where a stat object was returned instead of a binary … #64

Closed
wants to merge 1 commit into from

Conversation

nabil1337
Copy link

…path.

Hey, this makes your lib run on my Linux machine. :)
While tests fail, this has also been the case before I did any changes. So I suggest you counter check it first and then merge, if you feel like doing so.

#61 #41 #53

@Muffinman
Copy link

Muffinman commented Jun 19, 2019

@nabil1337 I'm wondering if you've tried this recently? Can't seem to get this or your fork to work on the latest Electron at the moment. (Ubuntu 18.04)

@nabil1337
Copy link
Author

nabil1337 commented Jun 19, 2019

@Muffinman yeah, still worked for me with electron 4. But I cannot test it with v5, because of some other failing dependencies in my only project using it. Can you create a minimal test case (like a fiddle, not a unit test) showing how it fails?

I'm using this code (obfuscated it a bit, it also relies on webpack):

const sudoerModule = await import('electron-sudo');
const Sudoer = sudoerModule.default;
const sudoer = new Sudoer({name: 'my-app'});
const workerPath = getWorkerPath();
const child = await sudoer.spawn('node', [workerPath]);

child.stdout.on('data', buffer => console.log('[my-process] '
        + buffer.toString()));

child.stderr.on('data', buffer => console.log('[my-process/err] '
        + buffer.toString()));

return child;

This should also work without dynamic import and just plain old require. In that case, try omitting the .default.

@Muffinman
Copy link

Thanks for the reply, I've since found a related issue on the Electron issue tracker. It seems to be specific to v5.0.0+ where no setuid binaries can currently be called at all on any linux builds.

Hopefully they fix this soon.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants