1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

netapi: support level 1012 in NetUserSetInfo.

Guenther
(This used to be commit db650e9b6ead70152b2640415477bb26d0b16097)
This commit is contained in:
Günther Deschner 2008-08-27 01:36:49 +02:00
parent f1ce72a80b
commit 3029122f5e

View File

@ -69,6 +69,9 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
if (infoX->usriX_full_name) { if (infoX->usriX_full_name) {
fields_present |= SAMR_FIELD_FULL_NAME; fields_present |= SAMR_FIELD_FULL_NAME;
} }
if (infoX->usriX_usr_comment) {
fields_present |= SAMR_FIELD_COMMENT;
}
unix_to_nt_time_abs(&password_age, infoX->usriX_password_age); unix_to_nt_time_abs(&password_age, infoX->usriX_password_age);
@ -88,7 +91,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
NULL, NULL,
infoX->usriX_comment, infoX->usriX_comment,
NULL, NULL,
NULL, infoX->usriX_usr_comment,
&zero_parameters, &zero_parameters,
0, 0,
0, 0,
@ -118,6 +121,7 @@ static NTSTATUS construct_USER_INFO_X(uint32_t level,
struct USER_INFO_1007 *u1007 = NULL; struct USER_INFO_1007 *u1007 = NULL;
struct USER_INFO_1009 *u1009 = NULL; struct USER_INFO_1009 *u1009 = NULL;
struct USER_INFO_1011 *u1011 = NULL; struct USER_INFO_1011 *u1011 = NULL;
struct USER_INFO_1012 *u1012 = NULL;
if (!buffer || !uX) { if (!buffer || !uX) {
return NT_STATUS_INVALID_PARAMETER; return NT_STATUS_INVALID_PARAMETER;
@ -184,6 +188,10 @@ static NTSTATUS construct_USER_INFO_X(uint32_t level,
u1011 = (struct USER_INFO_1011 *)buffer; u1011 = (struct USER_INFO_1011 *)buffer;
uX->usriX_full_name = u1011->usri1011_full_name; uX->usriX_full_name = u1011->usri1011_full_name;
break; break;
case 1012:
u1012 = (struct USER_INFO_1012 *)buffer;
uX->usriX_usr_comment = u1012->usri1012_usr_comment;
break;
case 3: case 3:
case 4: case 4:
default: default:
@ -1324,6 +1332,9 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
case 1011: case 1011:
user_mask = SAMR_USER_ACCESS_SET_ATTRIBUTES; user_mask = SAMR_USER_ACCESS_SET_ATTRIBUTES;
break; break;
case 1012:
user_mask = SAMR_USER_ACCESS_SET_LOC_COM;
break;
default: default:
werr = WERR_NOT_SUPPORTED; werr = WERR_NOT_SUPPORTED;
goto done; goto done;