Blame SOURCES/0003-Remove-n-or-r-n-from-stdin-password.patch

743651
From c334771f214e6f0cc2f13edf1032389e7bf74684 Mon Sep 17 00:00:00 2001
743651
From: Sumit Bose <sbose@redhat.com>
743651
Date: Fri, 13 May 2016 18:05:37 +0200
743651
Subject: [PATCH 3/3] Remove \n or \r\n from stdin password
743651
743651
https://bugs.freedesktop.org/show_bug.cgi?id=78448
743651
---
743651
 tools/tools.c | 7 +++++++
743651
 1 file changed, 7 insertions(+)
743651
743651
diff --git a/tools/tools.c b/tools/tools.c
743651
index 3e3435e..4b243de 100644
743651
--- a/tools/tools.c
743651
+++ b/tools/tools.c
743651
@@ -250,6 +250,13 @@ adcli_read_password_func (adcli_login_type login_type,
743651
 
743651
 		} else if (res == 0) {
743651
 			buffer[offset] = '\0';
743651
+			/* remove new line character */
743651
+			if (offset > 0 && buffer[offset - 1] == '\n') {
743651
+				buffer[offset - 1] = '\0';
743651
+				if (offset > 1 && buffer[offset - 2] == '\r') {
743651
+					buffer[offset - 2] = '\0';
743651
+				}
743651
+			}
743651
 			return buffer;
743651
 
743651
 		} else {
743651
-- 
743651
2.5.5
743651