summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/netapi/user.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 5aff7f0d1e..51c946bf6d 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -78,6 +78,9 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
if (infoX->usriX_home_dir_drive) {
fields_present |= SAMR_FIELD_HOME_DRIVE;
}
+ if (infoX->usriX_primary_group_id) {
+ fields_present |= SAMR_FIELD_PRIMARY_GID;
+ }
unix_to_nt_time_abs(&password_age, infoX->usriX_password_age);
@@ -100,7 +103,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
infoX->usriX_usr_comment,
&zero_parameters,
0,
- 0,
+ infoX->usriX_primary_group_id,
infoX->usriX_flags,
fields_present,
zero_logon_hours,
@@ -129,6 +132,7 @@ static NTSTATUS construct_USER_INFO_X(uint32_t level,
struct USER_INFO_1009 *u1009 = NULL;
struct USER_INFO_1011 *u1011 = NULL;
struct USER_INFO_1012 *u1012 = NULL;
+ struct USER_INFO_1051 *u1051 = NULL;
struct USER_INFO_1052 *u1052 = NULL;
struct USER_INFO_1053 *u1053 = NULL;
@@ -205,6 +209,10 @@ static NTSTATUS construct_USER_INFO_X(uint32_t level,
u1012 = (struct USER_INFO_1012 *)buffer;
uX->usriX_usr_comment = u1012->usri1012_usr_comment;
break;
+ case 1051:
+ u1051 = (struct USER_INFO_1051 *)buffer;
+ uX->usriX_primary_group_id = u1051->usri1051_primary_group_id;
+ break;
case 1052:
u1052 = (struct USER_INFO_1052 *)buffer;
uX->usriX_profile = u1052->usri1052_profile;
@@ -1358,6 +1366,9 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
break;
case 1012:
user_mask = SAMR_USER_ACCESS_SET_LOC_COM;
+ case 1051:
+ user_mask = SAMR_USER_ACCESS_SET_ATTRIBUTES |
+ SAMR_USER_ACCESS_GET_GROUPS;
break;
default:
werr = WERR_NOT_SUPPORTED;