From 1d5cb5125c9ed911e9560a3cd99bc428306539c5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 18 Oct 2010 10:10:43 +0200 Subject: s3: Use any_nt_status_not_ok in winbind --- source3/winbindd/wb_dsgetdcname.c | 6 +----- source3/winbindd/wb_gid2sid.c | 6 +----- source3/winbindd/wb_group_members.c | 6 +----- source3/winbindd/wb_lookupname.c | 6 +----- source3/winbindd/wb_lookupuseraliases.c | 6 +----- source3/winbindd/wb_lookupusergroups.c | 6 +----- source3/winbindd/wb_query_user_list.c | 6 +----- source3/winbindd/wb_queryuser.c | 6 +----- source3/winbindd/wb_seqnum.c | 6 +----- source3/winbindd/wb_sid2gid.c | 6 +----- source3/winbindd/wb_sid2uid.c | 6 +----- source3/winbindd/wb_uid2sid.c | 6 +----- source3/winbindd/winbindd_allocate_gid.c | 6 +----- source3/winbindd/winbindd_allocate_uid.c | 6 +----- source3/winbindd/winbindd_change_machine_acct.c | 6 +----- source3/winbindd/winbindd_check_machine_acct.c | 6 +----- source3/winbindd/winbindd_dsgetdcname.c | 6 +----- source3/winbindd/winbindd_lookuprids.c | 6 +----- source3/winbindd/winbindd_ping_dc.c | 6 +----- 19 files changed, 19 insertions(+), 95 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/wb_dsgetdcname.c b/source3/winbindd/wb_dsgetdcname.c index 71aecfe97de..8c78599e9e9 100644 --- a/source3/winbindd/wb_dsgetdcname.c +++ b/source3/winbindd/wb_dsgetdcname.c @@ -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); } diff --git a/source3/winbindd/wb_gid2sid.c b/source3/winbindd/wb_gid2sid.c index 6bde2b5abfb..fd2fd0e8eb7 100644 --- a/source3/winbindd/wb_gid2sid.c +++ b/source3/winbindd/wb_gid2sid.c @@ -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); } diff --git a/source3/winbindd/wb_group_members.c b/source3/winbindd/wb_group_members.c index 1fb7af3694d..5be04a9c10c 100644 --- a/source3/winbindd/wb_group_members.c +++ b/source3/winbindd/wb_group_members.c @@ -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); } diff --git a/source3/winbindd/wb_lookupname.c b/source3/winbindd/wb_lookupname.c index c28b51a7743..783ee4cabc4 100644 --- a/source3/winbindd/wb_lookupname.c +++ b/source3/winbindd/wb_lookupname.c @@ -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); } diff --git a/source3/winbindd/wb_lookupuseraliases.c b/source3/winbindd/wb_lookupuseraliases.c index d8f8023b661..0459fe99f4e 100644 --- a/source3/winbindd/wb_lookupuseraliases.c +++ b/source3/winbindd/wb_lookupuseraliases.c @@ -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); } diff --git a/source3/winbindd/wb_lookupusergroups.c b/source3/winbindd/wb_lookupusergroups.c index e1478aa6bd5..fb675e35234 100644 --- a/source3/winbindd/wb_lookupusergroups.c +++ b/source3/winbindd/wb_lookupusergroups.c @@ -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); } diff --git a/source3/winbindd/wb_query_user_list.c b/source3/winbindd/wb_query_user_list.c index 5480763890e..fafbb76e3db 100644 --- a/source3/winbindd/wb_query_user_list.c +++ b/source3/winbindd/wb_query_user_list.c @@ -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)); diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c index f14fbcbed6c..9685119d7ef 100644 --- a/source3/winbindd/wb_queryuser.c +++ b/source3/winbindd/wb_queryuser.c @@ -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); } diff --git a/source3/winbindd/wb_seqnum.c b/source3/winbindd/wb_seqnum.c index 3084564a33a..15b1622831b 100644 --- a/source3/winbindd/wb_seqnum.c +++ b/source3/winbindd/wb_seqnum.c @@ -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); } diff --git a/source3/winbindd/wb_sid2gid.c b/source3/winbindd/wb_sid2gid.c index 76fe3269961..9adff51d16a 100644 --- a/source3/winbindd/wb_sid2gid.c +++ b/source3/winbindd/wb_sid2gid.c @@ -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); diff --git a/source3/winbindd/wb_sid2uid.c b/source3/winbindd/wb_sid2uid.c index 21bf61b3fc3..5395d534a71 100644 --- a/source3/winbindd/wb_sid2uid.c +++ b/source3/winbindd/wb_sid2uid.c @@ -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); diff --git a/source3/winbindd/wb_uid2sid.c b/source3/winbindd/wb_uid2sid.c index 46b896a1409..5beceafb149 100644 --- a/source3/winbindd/wb_uid2sid.c +++ b/source3/winbindd/wb_uid2sid.c @@ -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); } diff --git a/source3/winbindd/winbindd_allocate_gid.c b/source3/winbindd/winbindd_allocate_gid.c index d9264543cbd..c9c19727be7 100644 --- a/source3/winbindd/winbindd_allocate_gid.c +++ b/source3/winbindd/winbindd_allocate_gid.c @@ -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); } diff --git a/source3/winbindd/winbindd_allocate_uid.c b/source3/winbindd/winbindd_allocate_uid.c index b949b4a8608..5eecce3d47d 100644 --- a/source3/winbindd/winbindd_allocate_uid.c +++ b/source3/winbindd/winbindd_allocate_uid.c @@ -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); } diff --git a/source3/winbindd/winbindd_change_machine_acct.c b/source3/winbindd/winbindd_change_machine_acct.c index 8b31bb1f939..c98d71324c4 100644 --- a/source3/winbindd/winbindd_change_machine_acct.c +++ b/source3/winbindd/winbindd_change_machine_acct.c @@ -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); } diff --git a/source3/winbindd/winbindd_check_machine_acct.c b/source3/winbindd/winbindd_check_machine_acct.c index 65a975002b9..5f9cefa2092 100644 --- a/source3/winbindd/winbindd_check_machine_acct.c +++ b/source3/winbindd/winbindd_check_machine_acct.c @@ -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); } diff --git a/source3/winbindd/winbindd_dsgetdcname.c b/source3/winbindd/winbindd_dsgetdcname.c index f01d35428e0..7e46c9653c3 100644 --- a/source3/winbindd/winbindd_dsgetdcname.c +++ b/source3/winbindd/winbindd_dsgetdcname.c @@ -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); } diff --git a/source3/winbindd/winbindd_lookuprids.c b/source3/winbindd/winbindd_lookuprids.c index 20ba79ee16f..6e3d5c5ece8 100644 --- a/source3/winbindd/winbindd_lookuprids.c +++ b/source3/winbindd/winbindd_lookuprids.c @@ -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); } diff --git a/source3/winbindd/winbindd_ping_dc.c b/source3/winbindd/winbindd_ping_dc.c index e69e59399c9..db50f6dbecc 100644 --- a/source3/winbindd/winbindd_ping_dc.c +++ b/source3/winbindd/winbindd_ping_dc.c @@ -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); } -- cgit