winbind_msrpc: Use any_nt_status_not_ok
authorVolker Lendecke <vl@samba.org>
Thu, 9 Mar 2017 17:57:14 +0000 (18:57 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 12 Apr 2017 03:40:36 +0000 (05:40 +0200)
Less lines, less bytes .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 12 05:40:36 CEST 2017 on sn-devel-144

source3/winbindd/winbindd_msrpc.c

index cd7dfbc6425b44dd7ed363b6101a8ea05739708c..c56537662bad016f7b5e470030dc68bb38800dfc 100644 (file)
@@ -576,12 +576,9 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
                                       group_rid,
                                       &group_pol,
                                       &result);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                return status;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               return result;
-       }
 
         /* Step #1: Get a list of user rids that are the members of the
            group. */
@@ -604,14 +601,10 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
                dcerpc_samr_Close(b, mem_ctx, &group_pol, &_result);
        }
 
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                return status;
        }
 
-       if (!NT_STATUS_IS_OK(result)) {
-               return result;
-       }
-
        if (!rids || !rids->count) {
                names = NULL;
                name_types = NULL;
@@ -927,12 +920,8 @@ static NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain,
                                             DomainLockoutInformation,
                                             &info,
                                             &result);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto done;
-       }
-       if (!NT_STATUS_IS_OK(result)) {
-               status = result;
-               goto done;
+       if (any_nt_status_not_ok(status, result, &status)) {
+               return status;
        }
 
        *lockout_policy = info->info12;
@@ -1062,14 +1051,10 @@ NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
                status = NT_STATUS_ACCESS_DENIED;
        }
 
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                return status;
        }
 
-       if (!NT_STATUS_IS_OK(result)) {
-               return result;
-       }
-
        return NT_STATUS_OK;
 }
 
@@ -1141,14 +1126,10 @@ static NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
                status = NT_STATUS_ACCESS_DENIED;
        }
 
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                return status;
        }
 
-       if (!NT_STATUS_IS_OK(result)) {
-               return result;
-       }
-
        return NT_STATUS_OK;
 }