summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_msrpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd/winbindd_msrpc.c')
-rw-r--r--source3/winbindd/winbindd_msrpc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c
index 42879f2653..b17cafe5d6 100644
--- a/source3/winbindd/winbindd_msrpc.c
+++ b/source3/winbindd/winbindd_msrpc.c
@@ -400,7 +400,7 @@ static NTSTATUS msrpc_query_user(struct winbindd_domain *domain,
{
struct rpc_pipe_client *samr_pipe;
struct policy_handle dom_pol;
- struct netr_SamInfo3 *user;
+ struct netr_SamInfo3 *user = NULL;
TALLOC_CTX *tmp_ctx;
NTSTATUS status;
@@ -418,7 +418,9 @@ static NTSTATUS msrpc_query_user(struct winbindd_domain *domain,
}
/* try netsamlogon cache first */
- user = netsamlogon_cache_get(tmp_ctx, user_sid);
+ if (winbindd_use_cache()) {
+ user = netsamlogon_cache_get(tmp_ctx, user_sid);
+ }
if (user != NULL) {
DEBUG(5,("msrpc_query_user: Cache lookup succeeded for %s\n",
sid_string_dbg(user_sid)));