Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

sudo-prompt fails to detect pkexec or kdesudo in "strictly" confined snap #130

Open
Melvin-Abraham opened this issue Oct 2, 2020 · 0 comments

Comments

@Melvin-Abraham
Copy link

I am making an electron app which I am distributing as a "strictly" confined snap application. This app requires superuser privileges to run some commands, so I am using sudo-prompt. But it turns out that the command fails as it fails to find pkexec or kdesudo for authentication purpose. This does work in a "classic" snap though. Is there any way to get it working in a strictly confined snap?

Code Snippet

sudo.exec('snap refresh g-assist', {name: 'Google Assistant'}, (err, stdout, stderr) => {
    if (err) console.log(err);
    ...
});

Error Stacktrace

Error: Unable to find pkexec or kdesudo.
    at test (/snap/g-assist/x6/resources/app.asar/node_modules/sudo-prompt/index.js:205)
    at /snap/g-assist/x6/resources/app.asar/node_modules/sudo-prompt/index.js:212
    at FSReqCallback.oncomplete (fs.js:158)

Screenshot

sudo-prompt Error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant