New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: encryptwallet password entered from stdin. fixes #15318 #15346
Conversation
I dislike the fact that bitcoin-cli does have insight into specific commands and argument positions, etc. Nevertheless I think this is an improvement. Concept ACK |
Concept ACK If we should do special handling for |
Yes, I wanted to add the other commands once this one is accepted, in order to do one thing at a time. |
3e9a00e
to
20816de
Compare
I'd prefer to do this all at once, if we're going to do this. |
I agree with @laanwj, less time spent on testing and code review. |
One way to avoid client side knowledge of these commands is to support special arguments that are replaced after reading the stdin. For instance: # before
bitcoin-cli encryptwallet myawesomepass
# after
bitcoin-cli encryptwallet -p
Enter password: *************
Verify password: ************* When |
Problem is these three RPCs differ - with Using So, I don't see how we can work around special handling for these three there (ok, without introducing some obscure syntax that no one would use, like "-passarg=3,2" before arguments = ask for a third argument with a password prompt, requiring entering it twice). But
I am also not a fan of special handling for some RPCs in client, but I think benefits are worth it here. |
Ok, I'll commit changes for the other commands.
This is similar to using About the echoing, I have not found a clean and not too verbose way to achieve it. Maybe now that 3 commands will be covered it worth adding a function (kind of |
Have you seen #13716? |
782288d
to
2b620a8
Compare
Yes I have, and I still think it is more convenient for the user to change the behavior of the existing commands instead of adding another. |
I added a commit to change the behavior of
|
2b620a8
to
799c543
Compare
Tested this and #13716 and I like this approach better, apart from no-echo password part from by @kallewoof, which would be cool have here too. |
1867f27
to
3e9d5df
Compare
3e9d5df
to
00b422b
Compare
Closing in favor of #13716 |
This PR adds the possibility to enter the password from
encryptwallet
to be entered from stdin, as discussed in #15318.I know it can be done using the
-stdin
parameter from , but I think entering the password from stdin should become the default forencryptwallet
(as well as forwalletpassphrase
) as it can be retrieved easily (grep encryptwallet ~/.bash_history
).