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

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