summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-27 00:33:49 +0200
committerGünther Deschner <gd@samba.org>2008-08-29 13:57:55 +0200
commita5fc8ee45736b39def94a2192a9b7899e60af205 (patch)
treeea61f1ebbae9de0dc666669d4444d2689dd4d69c /source3
parent870944ca970f2b9484f0a36575b76f3eaeed66ee (diff)
downloadsamba-a5fc8ee45736b39def94a2192a9b7899e60af205.tar.gz
samba-a5fc8ee45736b39def94a2192a9b7899e60af205.tar.bz2
samba-a5fc8ee45736b39def94a2192a9b7899e60af205.zip
netapi: support level 1003 in NetUserSetInfo.
Guenther (This used to be commit 863827eb2d5210350011055dda4319070bd1c520)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/netapi/user.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 97eb9d8002..045491c541 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -1286,7 +1286,7 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
struct lsa_String lsa_account_name;
struct dom_sid2 *domain_sid = NULL;
struct samr_Ids user_rids, name_types;
- union samr_UserInfo user_info;
+ uint32_t user_mask = 0;
struct USER_INFO_X uX;
@@ -1301,7 +1301,11 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
switch (r->in.level) {
case 0:
+ case 1003:
+ user_mask = SAMR_USER_ACCESS_SET_PASSWORD;
+ break;
case 1007:
+ user_mask = SAMR_USER_ACCESS_SET_ATTRIBUTES;
break;
default:
werr = WERR_NOT_SUPPORTED;
@@ -1354,7 +1358,7 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
status = rpccli_samr_OpenUser(pipe_cli, ctx,
&domain_handle,
- SAMR_USER_ACCESS_SET_ATTRIBUTES,
+ user_mask,
user_rids.ids[0],
&user_handle);
if (!NT_STATUS_IS_OK(status)) {
@@ -1368,12 +1372,10 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
goto done;
}
- convert_USER_INFO_X_to_samr_user_info21(&uX, &user_info.info21);
-
- status = rpccli_samr_SetUserInfo(pipe_cli, ctx,
- &user_handle,
- 21,
- &user_info);
+ status = set_user_info_USER_INFO_X(ctx, pipe_cli,
+ &cli->user_session_key,
+ &user_handle,
+ &uX);
if (!NT_STATUS_IS_OK(status)) {
werr = ntstatus_to_werror(status);
goto done;