winbindd_cache: Fix timeout calculation for sid<->name cache
authorVolker Lendecke <vl@samba.org>
Sat, 13 Oct 2018 09:39:03 +0000 (11:39 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Oct 2018 11:59:02 +0000 (13:59 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13662
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit fb573c682353daf5b343b6a0f4832dcbc96ebc57)

Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-9-test): Wed Oct 24 13:59:02 CEST 2018 on sn-devel-144

source3/winbindd/winbindd_cache.c

index af67aa3b0cfa20529de4d5109a45d9498f6597e3..b0644d38761196a2c87621a0b059545f41815232 100644 (file)
@@ -1749,7 +1749,7 @@ static void wcache_name_to_sid_fn(const struct dom_sid *sid,
 
        *state->sid = *sid;
        *state->type = type;
-       state->found = (state->offline || (timeout < time(NULL)));
+       state->found = (state->offline || (timeout > time(NULL)));
 }
 
 static NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
@@ -1884,7 +1884,7 @@ static void wcache_sid_to_name_fn(const char *domain, const char *name,
                return;
        }
        *state->type = type;
-       state->found = (state->offline || (timeout < time(NULL)));
+       state->found = (state->offline || (timeout > time(NULL)));
 }
 
 static NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain,