winbindd: error handling in rpc_lookup_sids()
authorRalph Boehme <slow@samba.org>
Sun, 26 Mar 2017 06:22:13 +0000 (08:22 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 7 Apr 2017 20:52:24 +0000 (22:52 +0200)
NT_STATUS_NONE_MAPPED and NT_STATUS_SOME_NOT_MAPPED should not be
treated as fatal error. We should continue processing the results and
not bail out.

In case we got NT_STATUS_NONE_MAPPED we must have to ensure all
lsa_TranslatedName are of type SID_NAME_UNKNOWN.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12728

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/winbindd_rpc.c

index 3dd4f7773ee5901d176bb93775e4e6259d8c6832..0023e2aa8d764ad3a27eb6644203b97061f4e708 100644 (file)
@@ -32,6 +32,7 @@
 #include "rpc_client/cli_samr.h"
 #include "rpc_client/cli_lsarpc.h"
 #include "../libcli/security/security.h"
+#include "lsa.h"
 
 /* Query display info for a domain */
 NTSTATUS rpc_query_user_list(TALLOC_CTX *mem_ctx,
@@ -981,7 +982,7 @@ static NTSTATUS rpc_try_lookup_sids3(TALLOC_CTX *mem_ctx,
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
-       if (NT_STATUS_IS_ERR(result)) {
+       if (NT_STATUS_LOOKUP_ERR(result)) {
                return result;
        }
        if (sids->num_sids != lsa_names2.count) {
@@ -1010,7 +1011,7 @@ static NTSTATUS rpc_try_lookup_sids3(TALLOC_CTX *mem_ctx,
                        return NT_STATUS_INVALID_NETWORK_RESPONSE;
                }
        }
-       return result;
+       return NT_STATUS_OK;
 }
 
 NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
@@ -1043,7 +1044,7 @@ NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
-       if (NT_STATUS_IS_ERR(result)) {
+       if (NT_STATUS_LOOKUP_ERR(result)) {
                return result;
        }
 
@@ -1063,5 +1064,5 @@ NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
                }
        }
 
-       return result;
+       return NT_STATUS_OK;
 }