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

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

Open jul1u5 opened this issue 5 years ago • 6 comments

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 https://github.com/jorangreef/sudo-prompt/issues/77#issuecomment-445900662) 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.

jul1u5 avatar May 12 '20 21:05 jul1u5

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

ert78gb avatar Oct 23 '20 11:10 ert78gb

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

bobvanderlinden avatar Mar 01 '21 12:03 bobvanderlinden

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

clintonmead avatar Sep 09 '21 01:09 clintonmead

Pretty please?..

pshirshov avatar Sep 17 '21 23:09 pshirshov

Looks like this was fixed downstream in https://github.com/NixOS/nixpkgs/pull/137912

jul1u5 avatar Sep 18 '21 00:09 jul1u5

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

pshirshov avatar Sep 18 '21 11:09 pshirshov