Skip to content
This repository was 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

@Melvin-Abraham

Description

@Melvin-Abraham

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions