summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nsswitch/winbindd_cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c
index 81dd85e588..eea0d16ca8 100644
--- a/source3/nsswitch/winbindd_cache.c
+++ b/source3/nsswitch/winbindd_cache.c
@@ -989,7 +989,9 @@ do_query:
status = domain->backend->name_to_sid(domain, mem_ctx, domain_name, name, sid, type);
/* and save it */
- wcache_save_name_to_sid(domain, status, domain_name, name, sid, *type);
+ if (NT_STATUS_IS_OK(status)) {
+ wcache_save_name_to_sid(domain, status, domain_name, name, sid, *type);
+ }
/* We can't save the sid to name mapping as we don't know the
correct case of the name without looking it up */