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

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