use SUDO_ASKPASS program if set#261
Conversation
|
The diff looks good, no notes on that, but I'm not entirely sure if I agree with the intentions of this change.
nh is a command-line program and it seems only natural to me that you would enter the sudo password in the terminal. Though I understand it's annoying for fingerprint users (all 3 of them |
|
I have no idea what SUDO_ASKPASS does but if it works then sure |
|
|
|
Actually
If |
|
Just to be explicit, maybe we could listen to a |
|
Ah, but this would be a problem though, sudo uses |
4ce6fc3 to
b6795f7
Compare
|
That should do it. |
|
Okay, looks good. I'll be reviewing this when I get to my office. |
with reference to #261 (comment)
A GUI based popup seems more "intuitive" when calling
sudointernally, as the application just asking for password with sudo on terminal "feels" like hijacking the program. Ofcourse that is not the case, it is completely personal opinion, but you may want to consider this.Also for those with
sudoenabled with fingerprint access, it is much more difficult to deal with terminal, as default configuration makes you go for "three fingerprint attempts" before it asks you for password. So if you do not want to use fingerprint, but password instead, normally for programs running withsudo(saysudo echo hello), you can just Ctrl+C during the first attempt, and then password input appears. But sincenhcalls it internally, Ctrl+C just halts the execution instead ofnhinstead of lettingsudohandle it.Hence running
sudowith-Aflag makes sense. But since not everyone have a askpass setup right away, one can conditionally check for the environment variableSUDO_ASKPASS(at runtime), and if set, then runsudowith-Aflag to let the ask pass program handle password entry stuff in more "elegant" way.It will be convenient to both
SUDO_ASKPASSusers and non-users since it will be checked to triggersudo, and hence experience will either remain the same or improve.Here is an example configuration for nixos for
SUDO_ASKPASSconfig which presents a GUI prompt, and if GUI is not available (say running from tty) password is input fallback is done on terminal.