-
Notifications
You must be signed in to change notification settings - Fork 649
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
Safer way to handle unlock command of cli_wallet #1171 #1382
Conversation
this PR troglobit/editline#21 was merged already. Guys check please other 2 PRs when you will have time for it:
Thanks ! |
1263fc9
to
88029da
Compare
fixed conflicts with latest |
will bump FC now after merged PR bitshares/bitshares-fc#82 |
88029da
to
c2de850
Compare
need to be rebased after merging PR #1405 |
c2de850
to
022b6c6
Compare
rebased already |
programs/cli_wallet/main.cpp
Outdated
@@ -72,6 +72,9 @@ int main( int argc, char** argv ) | |||
{ | |||
try { | |||
|
|||
const char* regex_secret_name = "regex-secret"; | |||
const string regex_secret = "^(unlock|set_password)\\s.*"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must allow \s*
at the start of the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ! Thanks !
Ok no problems ! Thanks ! |
Seems to work as designed BUT this solution is unusable IMO. Once the line matches the regexp there is no visual feedback - no cursor movement, no placeholder for keys pressed etc.. |
I wanted to add placeholder '*' but made without it for security reasons for example as git works in command line with passwords |
I'm aware of two ways to enter passwords (well, three if you count cleartext):
I've never seen a normal editable command line that suddenly stops all visual feedback while still accepting (and expecting) input. A normal user will think the client is frozen, and will try to kill it, and then complain here. |
ok ! I will improve it !
or whitespaces also possible (just cursor feedback) ? Right ? |
I've added new PR in |
I think something other would be preferrable. Try to imagine how you as an unsuspecting user would react when observing that behaviour for the first time. I bet you'd find it confusing. |
@pmconrad I mean cursor movement
As you told cursor movement is already done in new PR for |
@pmconrad did you have a chance to check locally how works my new PR in Thanks ! JFYI @troglobit commented here troglobit/editline#22 (comment) in my new PR with visual feedback by cursor. I'm thinking what should I answer to him cause my answer depends on your review. Thanks for your time and efforts ! |
328f06e
to
84ad039
Compare
rebased due to conflicts |
Guys what should we do with this PR ? Look please when you will have time + new PR in |
@cogutvalera I'm still open to a PR that adds visual feedback when in |
You can remove the change in I don't think it makes much sense to have a command line option for the regex. Better remove it. |
About command line option for the regex I did it before you told earlier that it can be more flexible if there will be possibility to configure it for any desired data like brain key for example (look here your comment #1171 (comment)). I see next 3 possible ways for configuring this mechanism:
Which one do you prefer @pmconrad ? Guys what do you think too ? What is the best way ? |
What I meant with "configurable by the calling application" is that IMO neither cli option nor config file option make sense. Definition via |
Merged bitshares/bitshares-fc#97 . Please rebase on latest develop and bump fc to latest master. |
Please squash your changes, we don't need 5 commits in the history for a one-liner. |
ok sure, not a problem at all ! |
12af65f
to
6aad78b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Nice that it is already merged ! Thank you ! |
PR for #1171
bitshares/bitshares-fc#82