1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s4-samr: merge samr_UserInfo20 from s3 idl.

This must not be treated as a normal string (strlen truncates it).

Guenther
This commit is contained in:
Günther Deschner 2008-11-07 15:04:46 +01:00
parent 1f846f6e61
commit 9888ed1d9b
2 changed files with 20 additions and 8 deletions

View File

@ -742,7 +742,7 @@ import "misc.idl", "lsa.idl", "security.idl";
} samr_UserInfo18;
typedef struct {
lsa_String parameters;
lsa_BinaryString parameters;
} samr_UserInfo20;
/* this defines the bits used for fields_present in info21 */
@ -799,7 +799,7 @@ import "misc.idl", "lsa.idl", "security.idl";
lsa_String description;
lsa_String workstations;
lsa_String comment;
lsa_String parameters;
lsa_BinaryString parameters;
lsa_String unknown1;
lsa_String unknown2;
lsa_String unknown3;

View File

@ -57,6 +57,8 @@
r->out.info->field = samdb_result_logon_hours(mem_ctx, msg, attr);
#define QUERY_AFLAGS(msg, field, attr) \
r->out.info->field = samdb_result_acct_flags(sam_ctx, mem_ctx, msg, a_state->domain_state->domain_dn);
#define QUERY_PARAMETERS(msg, field, attr) \
r->out.info->field = samdb_result_parameters(mem_ctx, msg, attr);
/* these are used to make the Set[User|Group]Info code easier to follow */
@ -136,6 +138,16 @@
set_el->flags = LDB_FLAG_MOD_REPLACE; \
} while (0)
#define SET_PARAMETERS(msg, field, attr) do { \
struct ldb_message_element *set_el; \
if (samdb_msg_add_parameters(sam_ctx, mem_ctx, msg, attr, &r->in.info->field) != 0) { \
return NT_STATUS_NO_MEMORY; \
} \
set_el = ldb_msg_find_element(msg, attr); \
set_el->flags = LDB_FLAG_MOD_REPLACE; \
} while (0)
/*
samr_Connect
@ -3290,7 +3302,7 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA
break;
case 20:
QUERY_STRING(msg, info20.parameters, "userParameters");
QUERY_PARAMETERS(msg, info20.parameters, "userParameters");
break;
case 21:
@ -3309,7 +3321,7 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA
QUERY_STRING(msg, info21.description, "description");
QUERY_STRING(msg, info21.workstations, "userWorkstations");
QUERY_STRING(msg, info21.comment, "comment");
QUERY_STRING(msg, info21.parameters, "userParameters");
QUERY_PARAMETERS(msg, info21.parameters, "userParameters");
QUERY_RID (msg, info21.rid, "objectSid");
QUERY_UINT (msg, info21.primary_gid, "primaryGroupID");
QUERY_AFLAGS(msg, info21.acct_flags, "userAccountControl");
@ -3416,7 +3428,7 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
break;
case 20:
SET_STRING(msg, info20.parameters, "userParameters");
SET_PARAMETERS(msg, info20.parameters, "userParameters");
break;
case 21:
@ -3446,7 +3458,7 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
IFSET(SAMR_FIELD_ACCT_FLAGS)
SET_AFLAGS(msg, info21.acct_flags, "userAccountControl");
IFSET(SAMR_FIELD_PARAMETERS)
SET_STRING(msg, info21.parameters, "userParameters");
SET_PARAMETERS(msg, info21.parameters, "userParameters");
IFSET(SAMR_FIELD_COUNTRY_CODE)
SET_UINT (msg, info21.country_code, "countryCode");
IFSET(SAMR_FIELD_CODE_PAGE)
@ -3477,7 +3489,7 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
IFSET(SAMR_FIELD_ACCT_FLAGS)
SET_AFLAGS(msg, info23.info.acct_flags, "userAccountControl");
IFSET(SAMR_FIELD_PARAMETERS)
SET_STRING(msg, info23.info.parameters, "userParameters");
SET_PARAMETERS(msg, info23.info.parameters, "userParameters");
IFSET(SAMR_FIELD_COUNTRY_CODE)
SET_UINT (msg, info23.info.country_code, "countryCode");
IFSET(SAMR_FIELD_CODE_PAGE)
@ -3533,7 +3545,7 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
IFSET(SAMR_FIELD_ACCT_FLAGS)
SET_AFLAGS(msg, info25.info.acct_flags, "userAccountControl");
IFSET(SAMR_FIELD_PARAMETERS)
SET_STRING(msg, info25.info.parameters, "userParameters");
SET_PARAMETERS(msg, info25.info.parameters, "userParameters");
IFSET(SAMR_FIELD_COUNTRY_CODE)
SET_UINT (msg, info25.info.country_code, "countryCode");
IFSET(SAMR_FIELD_CODE_PAGE)