[icinga-checkins] icinga.org: icinga2/feature/magic: Fix that pki sign-csr is not logging the certificate file location

git at icinga.org git at icinga.org
Sun Aug 14 13:50:07 CEST 2016


Module: icinga2
Branch: feature/magic
Commit: a83d81a71dff58b280dc7e4a13416ee4019b2179
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=a83d81a71dff58b280dc7e4a13416ee4019b2179

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sun Aug 14 09:21:52 2016 +0200

Fix that pki sign-csr is not logging the certificate file location

fixes #12422

---

 lib/cli/pkiutility.cpp |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/lib/cli/pkiutility.cpp b/lib/cli/pkiutility.cpp
index 834cdcc..9154770 100644
--- a/lib/cli/pkiutility.cpp
+++ b/lib/cli/pkiutility.cpp
@@ -96,17 +96,7 @@ int PkiUtility::SignCsr(const String& csrfile, const String& certfile)
 
 	X509_REQ_free(req);
 
-	std::ofstream fpcert;
-	fpcert.open(certfile.CStr());
-
-	if (!fpcert) {
-		Log(LogCritical, "cli")
-		    << "Failed to open certificate file '" << certfile << "' for output";
-		return 1;
-	}
-
-	fpcert << CertificateToString(cert);
-	fpcert.close();
+	WriteCert(cert, certfile);
 
 	return 0;
 }



More information about the icinga-checkins mailing list