Blob Blame History Raw
From 89a40e77a1477a3957f4ddc47890eaecbc4d5c7c Mon Sep 17 00:00:00 2001
From: Deepak Das <ddas@redhat.com>
Date: Sat, 19 Jun 2021 17:51:21 +0530
Subject: [PATCH] SSSD Log: invalid_argument msg mod

Improve invalid argument msg with additional information

Resolves: https://github.com/SSSD/sssd/issues/5578

Reviewed-by: Pawel Polawski <ppolawsk@redhat.com>
---
 src/providers/ad/ad_gpo.c       | 15 ++++++++++++---
 src/providers/ldap/sdap_idmap.c | 19 +++++++++++++++----
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c
index 4ef6a7219..b2df3e998 100644
--- a/src/providers/ad/ad_gpo.c
+++ b/src/providers/ad/ad_gpo.c
@@ -4742,9 +4742,18 @@ static void gpo_cse_done(struct tevent_req *subreq)
     ret = ad_gpo_parse_gpo_child_response(state->buf, state->len,
                                           &sysvol_gpt_version, &child_result);
     if (ret != EOK) {
-        DEBUG(SSSDBG_CRIT_FAILURE,
-              "ad_gpo_parse_gpo_child_response failed: [%d][%s]\n",
-              ret, sss_strerror(ret));
+        if (ret == EINVAL) {
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  "ad_gpo_parse_gpo_child_response failed: [%d][%s]. "
+                  "Broken GPO data received from AD. Check AD child logs for "
+                  "more information.\n",
+                  ret, sss_strerror(ret));
+        } else {
+            DEBUG(SSSDBG_CRIT_FAILURE,
+                  "ad_gpo_parse_gpo_child_response failed: [%d][%s]\n",
+                  ret, sss_strerror(ret));
+        }
+
         tevent_req_error(req, ret);
         return;
     } else if (child_result != 0){
diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c
index 22ed9d301..3795ed69a 100644
--- a/src/providers/ldap/sdap_idmap.c
+++ b/src/providers/ldap/sdap_idmap.c
@@ -270,10 +270,21 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx,
             ret = sdap_idmap_add_domain(idmap_ctx, dom_name,
                                         sid_str, slice_num);
             if (ret != EOK) {
-                DEBUG(SSSDBG_CRIT_FAILURE,
-                      "Could not add domain [%s][%s][%"SPRIid"] "
-                       "to ID map: [%s]\n",
-                       dom_name, sid_str, slice_num, strerror(ret));
+                if (ret == EINVAL) {
+                    DEBUG(SSSDBG_CRIT_FAILURE,
+                          "Could not add domain [%s][%s][%"SPRIid"] "
+                          "to ID map: [%s] "
+                          "Unexpected ID map configuration. Check ID map related "
+                          "parameters in sssd.conf and remove the sssd cache if "
+                          "some of these parameters were changed recently.\n",
+                          dom_name, sid_str, slice_num, strerror(ret));
+                } else {
+                    DEBUG(SSSDBG_CRIT_FAILURE,
+                          "Could not add domain [%s][%s][%"SPRIid"] "
+                          "to ID map: [%s]\n",
+                          dom_name, sid_str, slice_num, strerror(ret));
+                }
+
                 goto done;
             }
         }
-- 
2.26.3