ehlo,

Attached patch shoul fix ticket #2203

LS
>From 41afab71d8d3f02cf2c5395c427f2edb710b8ee9 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lsleb...@redhat.com>
Date: Wed, 18 Feb 2015 10:23:19 +0100
Subject: [PATCH] RESPONDERS: Warn to syslog about colliding objects

Resolves:
https://fedorahosted.org/sssd/ticket/2203
---
 src/responder/ifp/ifpsrv_cmd.c |  4 ++++
 src/responder/nss/nsssrv_cmd.c | 14 ++++++++++++++
 src/responder/pam/pamsrv_cmd.c |  4 ++++
 3 files changed, 22 insertions(+)

diff --git a/src/responder/ifp/ifpsrv_cmd.c b/src/responder/ifp/ifpsrv_cmd.c
index 
49792f53cb107cf909d8e82044a555abc721db62..adea3818ec6c7b0a8194c38f9fdfd29b135b70c0
 100644
--- a/src/responder/ifp/ifpsrv_cmd.c
+++ b/src/responder/ifp/ifpsrv_cmd.c
@@ -617,6 +617,10 @@ static errno_t ifp_user_get_attr_search(struct tevent_req 
*req)
             if (state->res->count > 1) {
                 DEBUG(SSSDBG_CRIT_FAILURE,
                         "getpwnam call returned more than one result !?!\n");
+                sss_log(SSS_LOG_ERR,
+                        "More users have the same name [%s@%s] in SSSD cache. "
+                        "SSSD will not work correctly.\n",
+                        name, dom->name);
                 return ENOENT;
             }
         }
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 
9c56096320f815e14f8c3e49223b7de29762a524..19a6121d8cf0ccc1d6f9af797b2ac58a36df9e36
 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -908,6 +908,10 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx 
*dctx)
         if (dctx->res->count > 1) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "getpwnam call returned more than one result !?!\n");
+            sss_log(SSS_LOG_ERR,
+                    "More users have the same name [%s@%s] in SSSD cache. "
+                    "SSSD will not work correctly.\n",
+                    name, dom->name);
             return ENOENT;
         }
 
@@ -1580,6 +1584,9 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx 
*dctx)
         if (dctx->res->count > 1) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "getpwuid call returned more than one result !?!\n");
+            sss_log(SSS_LOG_ERR,
+                    "More users have the same UID [%"PRIu32"] in directory "
+                    "server. SSSD will not work correctly.\n", cmdctx->id);
             ret = ENOENT;
             goto done;
         }
@@ -3003,6 +3010,10 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx 
*dctx)
         if (dctx->res->count > 1) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "getgrnam call returned more than one result !?!\n");
+            sss_log(SSS_LOG_ERR,
+                    "More groups have the same name [%s@%s] in SSSD cache. "
+                    "SSSD will not work correctly.\n",
+                    name, dom->name);
             return ENOENT;
         }
 
@@ -3138,6 +3149,9 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx 
*dctx)
         if (dctx->res->count > 1) {
             DEBUG(SSSDBG_FATAL_FAILURE,
                   "getgrgid call returned more than one result !?!\n");
+            sss_log(SSS_LOG_ERR,
+                    "More groups have the same GID [%"PRIu32"] in directory "
+                    "server. SSSD will not work correctly.\n", cmdctx->id);
             ret = ENOENT;
             goto done;
         }
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 
7cab7b2b4be99833d1446a25e1411898a9e5e67b..90cdbec519587a0d5dd680bfe3a991d896d6c008
 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -1090,6 +1090,10 @@ static int pam_check_user_search(struct pam_auth_req 
*preq)
             if (res->count > 1) {
                 DEBUG(SSSDBG_FATAL_FAILURE,
                       "getpwnam call returned more than one result !?!\n");
+                sss_log(SSS_LOG_ERR,
+                        "More users have the same name [%s@%s] in SSSD cache. "
+                        "SSSD will not work correctly.\n",
+                        name, dom->name);
                 return ENOENT;
             } else if (res->count == 0) {
                 ret = ENOENT;
-- 
2.1.0

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to