Blame SOURCES/0012-Remove-trailing-CR-LF-when-reading-passwords-from-a-.patch

7a8c6d
From a55000a067d68cbf7aaf201b73ba2eb14090f916 Mon Sep 17 00:00:00 2001
7a8c6d
From: Rob Crittenden <rcritten@redhat.com>
7a8c6d
Date: Wed, 21 Feb 2018 15:28:38 -0500
7a8c6d
Subject: [PATCH] Remove trailing CR/LF when reading passwords from a file.
7a8c6d
7a8c6d
https://bugzilla.redhat.com/show_bug.cgi?id=1547641
7a8c6d
---
7a8c6d
 src/dogtag.c | 8 ++++++++
7a8c6d
 1 file changed, 8 insertions(+)
7a8c6d
7a8c6d
diff --git a/src/dogtag.c b/src/dogtag.c
7a8c6d
index 5b55b04d..871f3875 100644
7a8c6d
--- a/src/dogtag.c
7a8c6d
+++ b/src/dogtag.c
7a8c6d
@@ -476,9 +476,17 @@ main(int argc, const char **argv)
7a8c6d
 	/* Read the client password and/or PIN, if we need to. */
7a8c6d
 	if ((pwdfile != NULL) && (pwd == NULL)) {
7a8c6d
 		pwd = cm_submit_u_from_file(pwdfile);
7a8c6d
+        if (pwd != NULL) {
7a8c6d
+            pwd = talloc_strndup(ctx, pwd,
7a8c6d
+                        strcspn(pwd, "\r\n"));
7a8c6d
+		}
7a8c6d
 	}
7a8c6d
 	if ((pinfile != NULL) && (pin == NULL)) {
7a8c6d
 		pin = cm_submit_u_from_file(pinfile);
7a8c6d
+        if (pin != NULL) {
7a8c6d
+            pin = talloc_strndup(ctx, pin,
7a8c6d
+                        strcspn(pin, "\r\n"));
7a8c6d
+		}
7a8c6d
 	}
7a8c6d
 
7a8c6d
 	/* Figure out which form and arguments to use. */
7a8c6d
-- 
7a8c6d
2.13.6
7a8c6d