s3: Use any_nt_status_not_ok in winbind
authorVolker Lendecke <vl@samba.org>
Mon, 18 Oct 2010 08:10:43 +0000 (10:10 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 20 Oct 2010 16:09:20 +0000 (18:09 +0200)
19 files changed:
source3/winbindd/wb_dsgetdcname.c
source3/winbindd/wb_gid2sid.c
source3/winbindd/wb_group_members.c
source3/winbindd/wb_lookupname.c
source3/winbindd/wb_lookupuseraliases.c
source3/winbindd/wb_lookupusergroups.c
source3/winbindd/wb_query_user_list.c
source3/winbindd/wb_queryuser.c
source3/winbindd/wb_seqnum.c
source3/winbindd/wb_sid2gid.c
source3/winbindd/wb_sid2uid.c
source3/winbindd/wb_uid2sid.c
source3/winbindd/winbindd_allocate_gid.c
source3/winbindd/winbindd_allocate_uid.c
source3/winbindd/winbindd_change_machine_acct.c
source3/winbindd/winbindd_check_machine_acct.c
source3/winbindd/winbindd_dsgetdcname.c
source3/winbindd/winbindd_lookuprids.c
source3/winbindd/winbindd_ping_dc.c

index 71aecfe97deae2b86fa9a5f9273c17bc274a02af..8c78599e9e9e94775ead503a9d584b937ccf6155 100644 (file)
@@ -93,14 +93,10 @@ static void wb_dsgetdcname_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_DsGetDcName_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 6bde2b5abfb24e28e1b7961deb42b7cd34163694..fd2fd0e8eb7f7c9bc09f2b216f42f0a5c6c3b441 100644 (file)
@@ -97,14 +97,10 @@ static void wb_gid2sid_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_Gid2Sid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 1fb7af3694da8a6f7791512a8449ca8c7ce83061..5be04a9c10cb27cbfcc72c5fd080b9d77fcb003a 100644 (file)
@@ -92,14 +92,10 @@ static void wb_lookupgroupmem_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_LookupGroupMembers_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index c28b51a77430c08e7cde13f1be3082ddc59694b3..783ee4cabc4b4c284e0eb81f00a128b890af3a6b 100644 (file)
@@ -129,14 +129,10 @@ static void wb_lookupname_root_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_LookupName_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index d8f8023b661d48ab2465fd1a3e44c9b6d5f79bd0..0459fe99f4e29167f60bec0c899fd1dd7a589aac 100644 (file)
@@ -65,14 +65,10 @@ static void wb_lookupuseraliases_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_LookupUserAliases_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index e1478aa6bd57441539ee74f9f4e721600a2c39ff..fb675e35234505558af09a87e4799527ebf8c386 100644 (file)
@@ -64,14 +64,10 @@ static void wb_lookupusergroups_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_LookupUserGroups_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 5480763890e2da6fe6d0f850e55e9178d5cbb2bc..fafbb76e3db8e6e988067208aecafeb2f1b78b29 100644 (file)
@@ -60,14 +60,10 @@ static void wb_query_user_list_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_QueryUserList_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
 
        DEBUG(10, ("dcerpc_wbint_QueryUserList returned %d users\n",
                   state->users.num_userinfos));
index f14fbcbed6cb2083d02f0a0b8de953bc9290c1a9..9685119d7ef762bac2bfef3c49ab745419186d46 100644 (file)
@@ -73,14 +73,10 @@ static void wb_queryuser_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_QueryUser_recv(subreq, state->info, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 3084564a33a522d0e7693c1926e2d9a1d77db74e..15b1622831b2f7956272cdb8aa2f509cb45cdd1a 100644 (file)
@@ -57,14 +57,10 @@ static void wb_seqnum_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_QuerySequenceNumber_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 76fe326996107a53d83e19e6f89a02b863dc642d..9adff51d16a969a1c27851835af37681c4f19195 100644 (file)
@@ -145,14 +145,10 @@ static void wb_sid2gid_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_Sid2Gid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
 
        state->gid = state->gid64;
        tevent_req_done(req);
index 21bf61b3fc3d45a3326191529dadbcf74a790cf5..5395d534a71dc7f3261bca315cbeafba4a0d7097 100644 (file)
@@ -143,14 +143,10 @@ static void wb_sid2uid_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_Sid2Uid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
 
        state->uid = state->uid64;
        tevent_req_done(req);
index 46b896a1409fa25dfe7cc278f81bdae7516d876a..5beceafb149a27d45b7a93b17e6a7fd56f981753 100644 (file)
@@ -97,14 +97,10 @@ static void wb_uid2sid_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_Uid2Sid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index d9264543cbd93e3a51f0e9276b259bdccd385e7f..c9c19727be7a8a8f7cb7d2eed2a3da87d78a93bc 100644 (file)
@@ -65,14 +65,10 @@ static void winbindd_allocate_gid_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_AllocateGid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index b949b4a8608d1acfe309b487e8157d8461c213a3..5eecce3d47dbc67a15ddf3b3068c49d769aa686f 100644 (file)
@@ -65,14 +65,10 @@ static void winbindd_allocate_uid_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_AllocateUid_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 8b31bb1f9399ec5e77ba737ba24c20b9a08cd933..c98d71324c43c88c6936166f83c8e2edde7d0b94 100644 (file)
@@ -75,14 +75,10 @@ static void winbindd_change_machine_acct_done(struct tevent_req *subreq)
        NTSTATUS status, result;
 
        status = dcerpc_wbint_ChangeMachineAccount_recv(subreq, state, &result);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 65a975002b95d226ea13b1d521d04b4d42f5582e..5f9cefa20920ea38d0347fbe8cbed1af50b78449 100644 (file)
@@ -79,14 +79,10 @@ static void winbindd_check_machine_acct_done(struct tevent_req *subreq)
        NTSTATUS status, result;
 
        status = dcerpc_wbint_CheckMachineAccount_recv(subreq, state, &result);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index f01d35428e0d6318ee51d384c4cc30e37ec7f6ef..7e46c9653c3915addd8fa80636fe0f8b8159d6a1 100644 (file)
@@ -89,14 +89,10 @@ static void winbindd_dsgetdcname_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_DsGetDcName_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index 20ba79ee16f317b08e55179dd63c611403605ef0..6e3d5c5ece83f34e6318a60339b4b3aef54c2150 100644 (file)
@@ -102,14 +102,10 @@ static void winbindd_lookuprids_done(struct tevent_req *subreq)
 
        status = dcerpc_wbint_LookupRids_recv(subreq, state, &result);
        TALLOC_FREE(subreq);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }
 
index e69e59399c9a4a9c4a8431ee2355eaa958b90e2a..db50f6dbeccc9ce77cb6221fa7090c2d2b0aa2b0 100644 (file)
@@ -78,14 +78,10 @@ static void winbindd_ping_dc_done(struct tevent_req *subreq)
        NTSTATUS status, result;
 
        status = dcerpc_wbint_PingDc_recv(subreq, state, &result);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (any_nt_status_not_ok(status, result, &status)) {
                tevent_req_nterror(req, status);
                return;
        }
-       if (!NT_STATUS_IS_OK(result)) {
-               tevent_req_nterror(req, result);
-               return;
-       }
        tevent_req_done(req);
 }