From f7bc84409a7a6736ec2cf1110dd7200a954e3b7e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 24 Apr 2011 00:00:40 +0200 Subject: s3:rpc_client: map fault codes to NTSTATUS with dcerpc_fault_to_nt_status() Most fault codes have a NTSTATUS representation, so use that. This brings the fault handling in common with the source4/librpc/rpc code, which make it possible to share more highlevel code, between source3 and source4 as the error checking can be the same now. metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Sun Apr 24 10:44:53 CEST 2011 on sn-devel-104 --- source3/lib/netapi/user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/netapi/user.c') diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index 63be7ac751..653ece1385 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -322,7 +322,7 @@ static NTSTATUS set_user_info_USER_INFO_X(TALLOC_CTX *ctx, 25, &user_info, &result); - if (NT_STATUS_EQUAL(status, NT_STATUS(DCERPC_FAULT_INVALID_TAG))) { + if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE)) { user_info.info23.info = info21; -- cgit From e131c94ac1b06cc49b1c25717d3496dba8b0b3df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 13:42:05 -0700 Subject: More const fixes for compiler warnings from the waf build. --- source3/lib/netapi/user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/netapi/user.c') diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index 653ece1385..7831e20a0a 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -575,7 +575,7 @@ WERROR NetUserDel_r(struct libnetapi_ctx *ctx, status = dcerpc_samr_OpenDomain(b, talloc_tos(), &connect_handle, SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, - CONST_DISCARD(struct dom_sid *, &global_sid_Builtin), + discard_const_p(struct dom_sid, &global_sid_Builtin), &builtin_handle, &result); if (!NT_STATUS_IS_OK(status)) { -- cgit From 508e1607764d993c4d9a84793ffb7cfd22357f91 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 30 May 2011 16:26:17 +0200 Subject: s3: fix some -Wunused-but-set-variable build warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Mon May 30 17:41:18 CEST 2011 on sn-devel-104 --- source3/lib/netapi/user.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/lib/netapi/user.c') diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index 7831e20a0a..28619a0e44 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -3137,7 +3137,6 @@ WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx, size_t num_del_rids = 0; uint32_t *member_rids = NULL; - size_t num_member_rids = 0; struct GROUP_USERS_INFO_0 *i0 = NULL; struct GROUP_USERS_INFO_1 *i1 = NULL; @@ -3263,7 +3262,6 @@ WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx, } member_rids = group_rids.ids; - num_member_rids = group_rids.count; status = dcerpc_samr_GetGroupsForUser(b, talloc_tos(), &user_handle, -- cgit From 3d15137653a7d1b593a9af2eef12f6e5b9a04c4f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:30:12 +1000 Subject: s3-talloc Change TALLOC_ARRAY() to talloc_array() Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc. --- source3/lib/netapi/user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/netapi/user.c') diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index 28619a0e44..f1182100c7 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -3572,7 +3572,7 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx, } sid_array.num_sids = rid_array->count + 1; - sid_array.sids = TALLOC_ARRAY(ctx, struct lsa_SidPtr, sid_array.num_sids); + sid_array.sids = talloc_array(ctx, struct lsa_SidPtr, sid_array.num_sids); if (!sid_array.sids) { werr = WERR_NOMEM; goto done; -- cgit From 5e26e94092b56ee47e7ec7837f7cd0feb3fb0119 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:58:39 +1000 Subject: s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc. --- source3/lib/netapi/user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/lib/netapi/user.c') diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index f1182100c7..3003a39397 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -1436,7 +1436,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_USER(TALLOC_CTX *mem_ctx, struct NET_DISPLAY_USER *user = NULL; int i; - user = TALLOC_ZERO_ARRAY(mem_ctx, + user = talloc_zero_array(mem_ctx, struct NET_DISPLAY_USER, info->count); W_ERROR_HAVE_NO_MEMORY(user); @@ -1480,7 +1480,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_MACHINE(TALLOC_CTX *mem_ctx, struct NET_DISPLAY_MACHINE *machine = NULL; int i; - machine = TALLOC_ZERO_ARRAY(mem_ctx, + machine = talloc_zero_array(mem_ctx, struct NET_DISPLAY_MACHINE, info->count); W_ERROR_HAVE_NO_MEMORY(machine); @@ -1522,7 +1522,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_GROUP(TALLOC_CTX *mem_ctx, struct NET_DISPLAY_GROUP *group = NULL; int i; - group = TALLOC_ZERO_ARRAY(mem_ctx, + group = talloc_zero_array(mem_ctx, struct NET_DISPLAY_GROUP, info->count); W_ERROR_HAVE_NO_MEMORY(group); -- cgit