Commit 6a11d518 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé Committed by Kevin Wolf
Browse files

util: allow \n to terminate password input



The qemu_read_password() method looks for \r to terminate the
reading of the a password. This is what will be seen when
reading the password from a TTY. When scripting though, it is
useful to be able to send the password via a pipe, in which
case we must look for \n to terminate password input.

Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent d57e4e48
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -467,7 +467,8 @@ int qemu_read_password(char *buf, int buf_size)
            ret = -1;
            break;
        } else {
            if (ch == '\r') {
            if (ch == '\r' ||
                ch == '\n') {
                ret = 0;
                break;
            }