summaryrefslogtreecommitdiffstats
path: root/src/responder
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2017-08-14 13:40:58 +0200
committerJakub Hrozek <jhrozek@redhat.com>2017-08-28 20:55:13 +0200
commit431c7508e0d256b9c712cb9dcb9aa4cb635f4a0b (patch)
treef50b75b06e91a2a4aaa244231dd51d23089b9d11 /src/responder
parent8888d7a46371ddd2c2514c3e81b58bb1090902a2 (diff)
downloadsssd-431c7508e0d256b9c712cb9dcb9aa4cb635f4a0b.tar.gz
sssd-431c7508e0d256b9c712cb9dcb9aa4cb635f4a0b.tar.xz
sssd-431c7508e0d256b9c712cb9dcb9aa4cb635f4a0b.zip
NSS: Don't error out when deleting an entry which has id = 0 from the memcache
This code path can be easily triggered by calling `id 0` after applying the previous patch in this series and SSSD should not error out in this case. As SSSD doesn't handle "root", this entry never will be part of the memcache and EOK can be safely returned there. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nss_get_object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/responder/nss/nss_get_object.c b/src/responder/nss/nss_get_object.c
index 9058793ea..e56480af5 100644
--- a/src/responder/nss/nss_get_object.c
+++ b/src/responder/nss/nss_get_object.c
@@ -125,6 +125,12 @@ memcache_delete_entry(struct nss_ctx *nss_ctx,
name, dom->name);
continue;
}
+ } else if (id == 0) {
+ /*
+ * As "root" is not handled by SSSD, let's just return EOK here
+ * instead of erroring out.
+ */
+ return EOK;
} else if (id != 0) {
ret = memcache_delete_entry_by_id(nss_ctx, id, type);
if (ret != EOK) {