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
vault: piped input for ipa vault-add fails #747
Conversation
| @@ -304,7 +279,8 @@ def forward(self, *args, **options): | |||
| password = password.rstrip('\n') | |||
|
|
|||
| else: | |||
| password = get_new_password() | |||
| password = self.api.Backend.textui.prompt_password( | |||
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.
LGTM
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.
Is this LGTM meant for the whole patch or just this one-liner? If the prior, please, don't add your LGTMs to single lines, if the latter, please, do complete reviews.
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.
LGTM was for complete review. I tried the patch and worked for me, so add ACK and LGTM.
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.
LGTM
|
@Akasurde: Don't add ACK label when the PR is not OK! |
An exception is raised when using echo "Secret123\n" | ipa vault-add myvault This happens because the code is using (string).decode(sys.stdin.encoding) and sys.stdin.encoding is None when the input is read from a pipe. The fix is using the prompt_password method defined by Backend.textui, which gracefully handles this issue. https://pagure.io/freeipa/issue/6907
|
@stlaz |
|
Thank you for the brief action taken. Re-adding the ACK label. |
An exception is raised when using echo "Secret123\n" | ipa vault-add myvault
This happens because the code is using (string).decode(sys.stdin.encoding)
and sys.stdin.encoding is None when the input is read from a pipe.
The fix is using the prompt_password method defined by Backend.textui,
which gracefully handles this issue.
https://bugzilla.redhat.com/show_bug.cgi?id=1445358