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

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