s3-winbindd: make sure we obey the -n switch also for samlogon cache access.
authorGünther Deschner <gd@samba.org>
Wed, 8 Jun 2011 10:56:10 +0000 (12:56 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 8 Jun 2011 12:44:31 +0000 (14:44 +0200)
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jun  8 14:44:31 CEST 2011 on sn-devel-104

source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_creds.c
source3/winbindd/winbindd_msrpc.c
source3/winbindd/winbindd_util.c

index dde8e3f53d204eb8c40db350d9774c0e17efde26..770ed43aa006c93fca0c52965de368574831da85 100644 (file)
@@ -489,7 +489,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
 
        /* try netsamlogon cache first */
 
-       if ( (user = netsamlogon_cache_get( mem_ctx, sid )) != NULL ) 
+       if (winbindd_use_cache() && (user = netsamlogon_cache_get( mem_ctx, sid )) != NULL )
        {
                DEBUG(5,("query_user: Cache lookup succeeded for %s\n", 
                         sid_string_dbg(sid)));
index d733be06723dd638bcd5262a2826a1f6ca3dbd86..50da98f62cabb0d3f3d7a4c61c3cd5a5a30b21f3 100644 (file)
@@ -1296,6 +1296,10 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
        uint32 rid;
        fstring tmp;
 
+       if (!winbindd_use_cache()) {
+               return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+
        if (!cache->tdb) {
                return NT_STATUS_INTERNAL_DB_ERROR;
        }
index 6bbd0ffd9d134bd7dc6206d6d3bea2d97ad13a13..a160f7a6b5bb3080759a126d058d82448bc9dc8f 100644 (file)
@@ -38,6 +38,10 @@ NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
        struct netr_SamInfo3 *info;
        NTSTATUS status;
 
+       if (!winbindd_use_cache()) {
+               return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+
        status = wcache_get_creds(domain, mem_ctx, sid, cached_nt_pass, cred_salt);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
index 42879f265309db439a1abeb416be3750b147bb99..b17cafe5d67a8112d10370378e0b30ea44dcaf21 100644 (file)
@@ -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)));
index 63cb2d2f02a908345f8eeb7c7ead5bffc95a0952..7fede49e09bf958a44ca3dbdb3b2816d2f7d6662 100644 (file)
@@ -1022,6 +1022,10 @@ NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
        *user_sids = NULL;
        *p_num_groups = 0;
 
+       if (!winbindd_use_cache()) {
+               return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+
        info3 = netsamlogon_cache_get(mem_ctx, user_sid);
 
        if (info3 == NULL) {