mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-08 21:17:47 +03:00
shared/ask-password-api: when echoing multi-byte characters, print the whole sequence
This is untested, but I don't see how the previous code could have worked for multibyte characters (with echo on).
This commit is contained in:
parent
92e068b465
commit
d26eef9252
@ -442,8 +442,11 @@ int ask_password_tty(
|
||||
/* Check if we got a complete UTF-8 character now. If so, let's output one '*'. */
|
||||
n = utf8_encoded_valid_unichar(passphrase + codepoint, (size_t) -1);
|
||||
if (n >= 0) {
|
||||
if (flags & ASK_PASSWORD_ECHO)
|
||||
(void) loop_write(ttyfd, passphrase + codepoint, n, false);
|
||||
else
|
||||
(void) loop_write(ttyfd, "*", 1, false);
|
||||
codepoint = p;
|
||||
(void) loop_write(ttyfd, (flags & ASK_PASSWORD_ECHO) ? &c : "*", 1, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user