[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 18/22] util: allow \n to terminate password input
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 18/22] util: allow \n to terminate password input |
Date: |
Fri, 22 May 2015 17:26:36 +0200 |
From: "Daniel P. Berrange" <address@hidden>
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: Daniel P. Berrange <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
util/oslib-posix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 1c23fd2..3ae4987 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -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;
}
--
1.8.3.1
- [Qemu-block] [PULL 05/22] qcow2: use one single memory block for the L2/refcount cache tables, (continued)
- [Qemu-block] [PULL 05/22] qcow2: use one single memory block for the L2/refcount cache tables, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 06/22] qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty(), Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 07/22] qcow2: use an LRU algorithm to replace entries from the L2 cache, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 09/22] qcow2: use a hash to look for entries in the L2 cache, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 08/22] qcow2: remove qcow2_cache_find_entry_to_replace(), Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 10/22] qcow2: make qcow2_cache_put() a void function, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 11/22] qcow2: style fixes in qcow2-cache.c, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 13/22] block: Detect multiplication overflow in bdrv_getlength, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 12/22] qemu-io: Use getopt() correctly, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 14/22] qemu-iotests: qemu-img info on afl VMDK image with a huge capacity, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 18/22] util: allow \n to terminate password input,
Kevin Wolf <=
- [Qemu-block] [PULL 16/22] qcow2/qcow: protect against uninitialized encryption key, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 17/22] util: move read_password method out of qemu-img into osdep/oslib, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 20/22] tests: add test case for encrypted qcow2 read/write, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 15/22] qemu-iotests: Make debugging python tests easier, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 21/22] MAINTAINERS: Add header files to Block Layer Core section, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 19/22] qemu-io: prompt for encryption keys when required, Kevin Wolf, 2015/05/22
- [Qemu-block] [PULL 22/22] MAINTAINERS: Split "Block QAPI, monitor, command line" off core, Kevin Wolf, 2015/05/22
- Re: [Qemu-block] [Qemu-devel] [PULL 00/22] Block layer core and image format patches, Peter Maydell, 2015/05/26