[PATCH] winbindd: check if dcinfo from genache is expired
Ralph Boehme
slow at samba.org
Tue Apr 26 08:20:59 UTC 2016
Hi!
I believe a gencache_parse() caller is missing a timeout check, patch
attached.
Please review & push if ok.
Cheerio!
-slow
-------------- next part --------------
From 9657023b3deee71480c9c539b5e5997f15ad70d3 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Tue, 26 Apr 2016 08:43:26 +0200
Subject: [PATCH] winbindd: check if dcinfo from genache is expired
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 at samba.org>
---
source3/winbindd/wb_dsgetdcname.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source3/winbindd/wb_dsgetdcname.c b/source3/winbindd/wb_dsgetdcname.c
index 5aea7de..2d7e298 100644
--- a/source3/winbindd/wb_dsgetdcname.c
+++ b/source3/winbindd/wb_dsgetdcname.c
@@ -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;
--
2.5.0
More information about the samba-technical
mailing list