>From 3e35dd68bed9bc28b07f261ae229838905ee6fa3 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik 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/nss/nsssrv_cmd.c | 14 ++++++++++++++ src/responder/pam/pamsrv_cmd.c | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 1affde874d8b8e8798b3d195090139ba5a433ace..f9056590a369b8cea358d12192357bf51599e7b6 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