summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-01-18 11:37:52 +0100
committerGünther Deschner <gd@samba.org>2011-02-01 23:29:13 +0100
commit1d3b3780012b15b6287cb5f649680ad3eff0e8dc (patch)
treee5e0c41ec2d4f08620525ac4de7a8fff025854de /source3/utils
parenta87a9fc9ce68438526d5146feab04986c719f11b (diff)
downloadsamba-1d3b3780012b15b6287cb5f649680ad3eff0e8dc.tar.gz
samba-1d3b3780012b15b6287cb5f649680ad3eff0e8dc.tar.bz2
samba-1d3b3780012b15b6287cb5f649680ad3eff0e8dc.zip
s3-net: prefer dcerpc_samr_X functions in rpc_sh_user_str_edit_internals.
Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 77eb4e7220..4bfb1a6b8c 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -1288,10 +1288,11 @@ static NTSTATUS rpc_sh_user_str_edit_internals(struct net_context *c,
struct policy_handle *user_hnd,
int argc, const char **argv)
{
- NTSTATUS result;
+ NTSTATUS status, result;
const char *username;
const char *oldval = "";
union samr_UserInfo *info = NULL;
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
if (argc > 1) {
d_fprintf(stderr, "%s %s <username> [new value|NULL]\n",
@@ -1299,10 +1300,14 @@ static NTSTATUS rpc_sh_user_str_edit_internals(struct net_context *c,
return NT_STATUS_INVALID_PARAMETER;
}
- result = rpccli_samr_QueryUserInfo(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_QueryUserInfo(b, mem_ctx,
user_hnd,
21,
- &info);
+ &info,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
if (!NT_STATUS_IS_OK(result)) {
return result;
}
@@ -1334,17 +1339,23 @@ static NTSTATUS rpc_sh_user_str_edit_internals(struct net_context *c,
SETSTR("profilepath", profile_path, PROFILE_PATH);
SETSTR("description", description, DESCRIPTION);
- result = rpccli_samr_SetUserInfo(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_SetUserInfo(b, mem_ctx,
user_hnd,
21,
- info);
+ info,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ status = result;
d_printf(_("Set %s's %s from [%s] to [%s]\n"), username,
ctx->thiscmd, oldval, argv[0]);
done:
- return result;
+ return status;
}
#define HANDLEFLG(name, rec) \