winbindd: check if dcinfo from genache is expired
authorRalph Boehme <slow@samba.org>
Tue, 26 Apr 2016 06:43:26 +0000 (08:43 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 28 Apr 2016 18:48:14 +0000 (20:48 +0200)
The gencache parse function dcinfo_parser() used by
wb_dsgetdcname_gencache_get() misses a check for expired gencache
entries.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/wb_dsgetdcname.c

index 5aea7de626f8bc7884b774f7258e79208480f90e..125e98ade74f34717fd84cd7695357d6a144a4a8 100644 (file)
@@ -176,6 +176,10 @@ static void dcinfo_parser(time_t timeout, DATA_BLOB blob, void *private_data)
        struct dcinfo_parser_state *state = private_data;
        enum ndr_err_code ndr_err;
 
+       if (timeout <= time(NULL)) {
+               return;
+       }
+
        state->dcinfo = talloc(state->mem_ctx, struct netr_DsRGetDCNameInfo);
        if (state->dcinfo == NULL) {
                state->status = NT_STATUS_NO_MEMORY;