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

Fix "Unable to find pkexec or kdesudo" error on NixOS #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jul1u5
Copy link

@jul1u5 jul1u5 commented May 12, 2020

Fixes #77

I reused the commit 0e933b7 that fallbacks to which if it cannot find kdesudo or pkexec in the hardcoded paths.

Fixed "Error: User did not grant permission" (from #77 (comment)) by replacing /bin/bash with /usr/bin/env bash.

Additional context
The above error ("Error: User did not grant permission") is very misleading because the underlying issue is that /bin/bash could not be found (the file does not exist on NixOS).

In the future, it would be nice to refactor the error handling in https://github.com/jorangreef/sudo-prompt/blob/master/index.js#L188 so that the error message would be more descriptive.

@ert78gb
Copy link

ert78gb commented Oct 23, 2020

Hi, what is the status of this PR? We have a same issue maybe this PR solve it.

@bobvanderlinden
Copy link

This looks like a good fix for the issue I ran into (pkexec is not in /usr/bin/pkexec, but is available in PATH). 👍 @jorangreef could you have a look?

@clintonmead
Copy link

I'd like this to be merged as well, although by the time it is I may have worked around this issue.

@pshirshov
Copy link

Pretty please?..

@jul1u5
Copy link
Author

jul1u5 commented Sep 18, 2021

Looks like this was fixed downstream in NixOS/nixpkgs#137912

@pshirshov
Copy link

Yes, it was me who applied that workaround and it's still a workaround.

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

Successfully merging this pull request may close these issues.

Broken on "obscure" platforms (such as NixOS)
5 participants