diff options
author | Volker Lendecke <vl@samba.org> | 2019-02-25 14:38:50 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2019-03-12 11:25:42 +0000 |
commit | 14234542aa56dcee04609019db30c598f381a491 (patch) | |
tree | 7d8b5c27519a8c02e7024f44b3185f8c42cffb5a | |
parent | 29984beafc91ef6f45884adc3a0bd4617acbc0a0 (diff) | |
download | samba-14234542aa56dcee04609019db30c598f381a491.tar.gz |
lib: Make idmap_cache return negative mappings
Without this we'd query non-existent mappings over and over
again.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
(cherry picked from commit d9303e8eb90d48f09f2e2e8bdf01f4a7c3c21d11)
-rw-r--r-- | source3/lib/idmap_cache.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/idmap_cache.c b/source3/lib/idmap_cache.c index 1e8a1ebc607..0ec23df6a05 100644 --- a/source3/lib/idmap_cache.c +++ b/source3/lib/idmap_cache.c @@ -213,7 +213,12 @@ static void idmap_cache_xid2sid_parser(time_t timeout, DATA_BLOB blob, value = (char *)blob.data; - if (value[0] != '-') { + if ((value[0] == '-') && (value[1] == '\0')) { + /* + * Return NULL SID, see comment to uid2sid + */ + state->ret = true; + } else { state->ret = string_to_sid(state->sid, value); } if (state->ret) { |