The branch, master has been updated
       via  650c967 s3:winbind correct a copy&paste error
       via  8d28ae1 s3: Correctly calculate the wbinfo -s result
      from  f10dd12 s3-test: try to avoid a problem of CFLAGS propogating to 
the torture build

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 650c96725e5648397a15c806ca28c5733b749968
Author: Christian Ambach <christian.amb...@de.ibm.com>
Date:   Wed Nov 24 11:57:59 2010 +0100

    s3:winbind correct a copy&paste error
    
    negative results of sid->gid lookups should be stored with
    idmap_cache_set_sid2gid instead of idmap_cache_set_sid2uid
    
    This seems to be a copy&paste error when similar logic from the
    sid2uid path was copied here in 84b88f4b.
    
    Autobuild-User: Volker Lendecke <vlen...@samba.org>
    Autobuild-Date: Wed Nov 24 16:53:01 CET 2010 on sn-devel-104

commit 8d28ae10d278d6d2a738d55f47404651a20c17f4
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Nov 23 14:28:45 2010 +0100

    s3: Correctly calculate the wbinfo -s result

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_client/cli_lsarpc.c |   34 +++++++++++++++++++++++++---------
 source3/winbindd/idmap_util.c   |    6 +++---
 2 files changed, 28 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 1b1c072..29cb09c 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -289,6 +289,8 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct 
rpc_pipe_client *cli,
        char **domains = NULL;
        char **names = NULL;
        enum lsa_SidType *types = NULL;
+       bool have_mapped = false;
+       bool have_unmapped = false;
 
        if (num_sids) {
                if (!(domains = TALLOC_ARRAY(mem_ctx, char *, num_sids))) {
@@ -348,14 +350,21 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct 
rpc_pipe_client *cli,
                        goto fail;
                }
 
-               /* adapt overall result */
-               if (( NT_STATUS_IS_OK(result) &&
-                    !NT_STATUS_IS_OK(hunk_result))
-                   ||
-                   ( NT_STATUS_EQUAL(result, NT_STATUS_NONE_MAPPED) &&
-                    !NT_STATUS_EQUAL(hunk_result, NT_STATUS_NONE_MAPPED)))
-               {
-                       result = STATUS_SOME_UNMAPPED;
+               if (NT_STATUS_IS_OK(hunk_result)) {
+                       have_mapped = true;
+               }
+               if (NT_STATUS_EQUAL(hunk_result, NT_STATUS_NONE_MAPPED)) {
+                       have_unmapped = true;
+               }
+               if (NT_STATUS_EQUAL(hunk_result, STATUS_SOME_UNMAPPED)) {
+                       int i;
+                       for (i=0; i<hunk_num_sids; i++) {
+                               if (hunk_types[i] == SID_NAME_UNKNOWN) {
+                                       have_unmapped = true;
+                               } else {
+                                       have_mapped = true;
+                               }
+                       }
                }
 
                sids_left -= hunk_num_sids;
@@ -369,7 +378,14 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct 
rpc_pipe_client *cli,
        *pdomains = domains;
        *pnames = names;
        *ptypes = types;
-       return result;
+
+       if (!have_mapped) {
+               return NT_STATUS_NONE_MAPPED;
+       }
+       if (have_unmapped) {
+               return STATUS_SOME_UNMAPPED;
+       }
+       return NT_STATUS_OK;
 
 fail:
        TALLOC_FREE(domains);
diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c
index 7525fa7..a25bac4 100644
--- a/source3/winbindd/idmap_util.c
+++ b/source3/winbindd/idmap_util.c
@@ -132,7 +132,7 @@ backend:
                if (winbindd_use_idmap_cache()) {
                        struct dom_sid null_sid;
                        ZERO_STRUCT(null_sid);
-                       idmap_cache_set_sid2uid(&null_sid, gid);
+                       idmap_cache_set_sid2gid(&null_sid, gid);
                }
                DEBUG(10, ("gid [%lu] not mapped\n", (unsigned long)gid));
                return NT_STATUS_NONE_MAPPED;
@@ -258,7 +258,7 @@ backend:
                DEBUG(10, ("idmap_backends_sid_to_unixid failed: %s\n",
                           nt_errstr(ret)));
                if (winbindd_use_idmap_cache()) {
-                       idmap_cache_set_sid2uid(sid, -1);
+                       idmap_cache_set_sid2gid(sid, -1);
                }
                return ret;
        }
@@ -266,7 +266,7 @@ backend:
        if (map.status != ID_MAPPED) {
                DEBUG(10, ("sid [%s] is not mapped\n", sid_string_dbg(sid)));
                if (winbindd_use_idmap_cache()) {
-                       idmap_cache_set_sid2uid(sid, -1);
+                       idmap_cache_set_sid2gid(sid, -1);
                }
                return NT_STATUS_NONE_MAPPED;
        }


-- 
Samba Shared Repository

Reply via email to