|
|
b7b64b |
From 7c5540bb47799b4db95673d22f61995ad5c56440 Mon Sep 17 00:00:00 2001
|
|
|
b7b64b |
From: Rob Crittenden <rcritten@redhat.com>
|
|
|
b7b64b |
Date: Mon, 31 Jan 2022 17:31:50 -0500
|
|
|
b7b64b |
Subject: [PATCH] Remove ipa-join errors from behind the debug option
|
|
|
b7b64b |
|
|
|
b7b64b |
This brings it inline with the previous XML-RPC output which
|
|
|
b7b64b |
only hid the request and response from the output and not
|
|
|
b7b64b |
any errors returned.
|
|
|
b7b64b |
|
|
|
b7b64b |
https://pagure.io/freeipa/issue/9103
|
|
|
b7b64b |
|
|
|
b7b64b |
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
|
|
|
b7b64b |
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
|
|
|
b7b64b |
Reviewed-By: Peter Keresztes Schmidt <carbenium@outlook.com>
|
|
|
b7b64b |
---
|
|
|
b7b64b |
client/ipa-join.c | 27 +++++++++------------------
|
|
|
b7b64b |
1 file changed, 9 insertions(+), 18 deletions(-)
|
|
|
b7b64b |
|
|
|
b7b64b |
diff --git a/client/ipa-join.c b/client/ipa-join.c
|
|
|
b7b64b |
index d98739a9a..5888a33bf 100644
|
|
|
b7b64b |
--- a/client/ipa-join.c
|
|
|
b7b64b |
+++ b/client/ipa-join.c
|
|
|
b7b64b |
@@ -743,8 +743,7 @@ jsonrpc_request(const char *ipaserver, const json_t *json, curl_buffer *response
|
|
|
b7b64b |
|
|
|
b7b64b |
json_str = json_dumps(json, 0);
|
|
|
b7b64b |
if (!json_str) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("json_dumps() failed\n"));
|
|
|
b7b64b |
+ fprintf(stderr, _("json_dumps() failed\n"));
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -758,8 +757,7 @@ jsonrpc_request(const char *ipaserver, const json_t *json, curl_buffer *response
|
|
|
b7b64b |
CURLcode res = curl_easy_perform(curl);
|
|
|
b7b64b |
if (res != CURLE_OK)
|
|
|
b7b64b |
{
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("JSON-RPC call failed: %s\n"), curl_easy_strerror(res));
|
|
|
b7b64b |
+ fprintf(stderr, _("JSON-RPC call failed: %s\n"), curl_easy_strerror(res));
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -769,8 +767,7 @@ jsonrpc_request(const char *ipaserver, const json_t *json, curl_buffer *response
|
|
|
b7b64b |
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp_code);
|
|
|
b7b64b |
|
|
|
b7b64b |
if (resp_code != 200) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("JSON-RPC call failed with status code: %li\n"), resp_code);
|
|
|
b7b64b |
+ fprintf(stderr, _("JSON-RPC call failed with status code: %li\n"), resp_code);
|
|
|
b7b64b |
|
|
|
b7b64b |
if (!quiet && resp_code == 401)
|
|
|
b7b64b |
fprintf(stderr, _("JSON-RPC call was unauthorized. Check your credentials.\n"));
|
|
|
b7b64b |
@@ -848,8 +845,7 @@ jsonrpc_parse_response(const char *payload, json_t** j_result_obj, bool quiet) {
|
|
|
b7b64b |
|
|
|
b7b64b |
j_root = json_loads(payload, 0, &j_error);
|
|
|
b7b64b |
if (!j_root) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("Parsing JSON-RPC response failed: %s\n"), j_error.text);
|
|
|
b7b64b |
+ fprintf(stderr, _("Parsing JSON-RPC response failed: %s\n"), j_error.text);
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -864,8 +860,7 @@ jsonrpc_parse_response(const char *payload, json_t** j_result_obj, bool quiet) {
|
|
|
b7b64b |
|
|
|
b7b64b |
*j_result_obj = json_object_get(j_root, "result");
|
|
|
b7b64b |
if (!*j_result_obj) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("Parsing JSON-RPC response failed: no 'result' value found.\n"));
|
|
|
b7b64b |
+ fprintf(stderr, _("Parsing JSON-RPC response failed: no 'result' value found.\n"));
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -897,8 +892,7 @@ jsonrpc_parse_join_response(const char *payload, join_info *join_i, bool quiet)
|
|
|
b7b64b |
&tmp_hostdn,
|
|
|
b7b64b |
"krbprincipalname", &tmp_princ,
|
|
|
b7b64b |
"krblastpwdchange", &tmp_pwdch) != 0) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("Extracting the data from the JSON-RPC response failed: %s\n"), j_error.text);
|
|
|
b7b64b |
+ fprintf(stderr, _("Extracting the data from the JSON-RPC response failed: %s\n"), j_error.text);
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -941,8 +935,7 @@ join_krb5_jsonrpc(const char *ipaserver, const char *hostname, char **hostdn, co
|
|
|
b7b64b |
"nshardwareplatform", uinfo.machine);
|
|
|
b7b64b |
|
|
|
b7b64b |
if (!json_req) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("json_pack_ex() failed: %s\n"), j_error.text);
|
|
|
b7b64b |
+ fprintf(stderr, _("json_pack_ex() failed: %s\n"), j_error.text);
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -990,8 +983,7 @@ jsonrpc_parse_unenroll_response(const char *payload, bool* result, bool quiet) {
|
|
|
b7b64b |
|
|
|
b7b64b |
if (json_unpack_ex(j_result_obj, &j_error, 0, "{s:b}",
|
|
|
b7b64b |
"result", result) != 0) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("Extracting the data from the JSON-RPC response failed: %s\n"), j_error.text);
|
|
|
b7b64b |
+ fprintf(stderr, _("Extracting the data from the JSON-RPC response failed: %s\n"), j_error.text);
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 20;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
@@ -1021,8 +1013,7 @@ jsonrpc_unenroll_host(const char *ipaserver, const char *host, bool quiet) {
|
|
|
b7b64b |
host);
|
|
|
b7b64b |
|
|
|
b7b64b |
if (!json_req) {
|
|
|
b7b64b |
- if (debug)
|
|
|
b7b64b |
- fprintf(stderr, _("json_pack_ex() failed: %s\n"), j_error.text);
|
|
|
b7b64b |
+ fprintf(stderr, _("json_pack_ex() failed: %s\n"), j_error.text);
|
|
|
b7b64b |
|
|
|
b7b64b |
rval = 17;
|
|
|
b7b64b |
goto cleanup;
|
|
|
b7b64b |
--
|
|
|
b7b64b |
2.34.1
|
|
|
b7b64b |
|