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
lncli unlock --stdin uses newline instead of EOF as a terminator #5584
Comments
why do you have a newline in the password ? |
We generated random byte passwords and used those. |
Looks like a very simple and sensible fix, I would like to work on this! |
10 tasks
This is quite a footgun from my experience. I almost permanently lost access to my sats once because of having non-ascii chars in password. Here's a oneliner that generates secure password easily: |
ziggie1984
added
the
good first issue
Issues suitable for first time contributors to LND
label
Apr 15, 2024
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background
lncli unlock --stdin will stop reading when it encounters its first newline, meaning that if your password has a newline in it, it will not be able to read it.
My suggestion is to read until EOF if it is coming in over stdin. The alternative is that we need a way to escape newlines so that lncli will propagate them instead of terminate on them.
Your environment
Steps to reproduce
cat pwd.txt | lncli unlock --stdin
Expected behaviour
I'd expect that any password that can be created via any of the 3 interfaces would be usable on any of the 3 interfaces.
My recommendation is that if
--stdin
is set onlncli unlock
that the stream is read until EOF rather than terminating on a newline as it does in the interactive mode.Actual behaviour
Password is rejected because only a subset of it is read.
The text was updated successfully, but these errors were encountered: