libreport/0017-ureport-fall-back-to-the-hardcoded-rhsm-cert-dir.patch

43 lines
1.4 KiB
Diff

From 323ddb510c031a631ba294fc549b22a83d4159bb Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Thu, 23 Oct 2014 11:30:14 +0200
Subject: [PATCH] ureport: fall back to the hardcoded rhsm cert dir
This commit adds a fallback execution path for cases where getting the
rhsm entitlement dir path via an execution of python from the
librepor-web library fails for any reason.
See commit 2b20c9f91342da7744ae40ee623735ab95f83219
Related #1140224
Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
src/lib/ureport.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lib/ureport.c b/src/lib/ureport.c
index d39709d..868bb4f 100644
--- a/src/lib/ureport.c
+++ b/src/lib/ureport.c
@@ -31,6 +31,7 @@
#define RHSM_WEB_SERVICE_URL "https://api.access.redhat.com/rs/telemetry/abrt"
+#define RHSMENT_PEM_DIR_PATH "/etc/pki/entitlement"
#define RHSMENT_ENT_DATA_BEGIN_TAG "-----BEGIN ENTITLEMENT DATA-----"
#define RHSMENT_ENT_DATA_END_TAG "-----END ENTITLEMENT DATA-----"
#define RHSMENT_SIG_DATA_BEGIN_TAG "-----BEGIN RSA SIGNATURE-----"
@@ -90,7 +91,8 @@ rhsm_config_get_entitlement_cert_dir(void)
return result;
error:
free(result);
- error_msg_and_die("Failed to get 'rhsm':'entitlementCertDir' from rhsm.config python module.");
+ error_msg("Failed to get 'rhsm':'entitlementCertDir' from rhsm.config python module. Using "RHSMENT_PEM_DIR_PATH);
+ return xstrdup(RHSMENT_PEM_DIR_PATH);
}
void
--
2.1.0