summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-08-25 12:25:12 +0200
committerVolker Lendecke <vl@samba.org>2009-08-27 15:04:09 +0200
commit94948f7a401df781ad64090a804a894cf2976a86 (patch)
tree62a24ec53ce9fdec03c509e21ab0dc6778718b53 /source3
parent2f16bf54452ba6ef5fc2ad1c031b62ec8454a26b (diff)
downloadsamba-94948f7a401df781ad64090a804a894cf2976a86.tar.gz
samba-94948f7a401df781ad64090a804a894cf2976a86.tar.bz2
samba-94948f7a401df781ad64090a804a894cf2976a86.zip
s3:winbind: Some calls are not cacheable
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_cache.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index cc1f095919..d1aeba9f39 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -27,6 +27,7 @@
#include "winbindd.h"
#include "tdb_validate.h"
#include "../libcli/auth/libcli_auth.h"
+#include "../librpc/gen_ndr/ndr_wbint.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
@@ -4336,12 +4337,26 @@ static bool wcache_ndr_key(TALLOC_CTX *mem_ctx, char *domain_name,
return true;
}
+static bool wcache_opnum_cacheable(uint32_t opnum)
+{
+ switch (opnum) {
+ case NDR_WBINT_PING:
+ case NDR_WBINT_QUERYSEQUENCENUMBER:
+ return false;
+ }
+ return true;
+}
+
bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp)
{
TDB_DATA key, data;
bool ret = false;
+ if (!wcache_opnum_cacheable(opnum)) {
+ return false;
+ }
+
if (wcache->tdb == NULL) {
return false;
}
@@ -4394,6 +4409,10 @@ void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
TDB_DATA key, data;
uint32_t dom_seqnum, last_check;
+ if (!wcache_opnum_cacheable(opnum)) {
+ return;
+ }
+
if (wcache->tdb == NULL) {
return;
}