Skip to content

Commit

Permalink
added info level 1 to samr_query_alias()
Browse files Browse the repository at this point in the history
(This used to be commit 589aa4f)
  • Loading branch information
Jean-François Micouleau committed Dec 19, 2001
1 parent dccc1ed commit ea274ac
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
11 changes: 11 additions & 0 deletions source3/include/rpc_samr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,16 @@ typedef struct q_samr_query_alias_info

} SAMR_Q_QUERY_ALIASINFO;

typedef struct samr_alias_info1
{
UNIHDR hdr_acct_name;
UNIHDR hdr_acct_desc;
uint32 num_member;
UNISTR2 uni_acct_name;
UNISTR2 uni_acct_desc;

} ALIAS_INFO1;

typedef struct samr_alias_info3
{
UNIHDR hdr_acct_desc;
Expand All @@ -1151,6 +1161,7 @@ typedef struct alias_info_ctr

union
{
ALIAS_INFO1 info1;
ALIAS_INFO3 info3;

} alias;
Expand Down
61 changes: 61 additions & 0 deletions source3/rpc_parse/parse_samr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3431,6 +3431,63 @@ BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES * r_u,
return True;
}

/*******************************************************************
inits a ALIAS_INFO1 structure.
********************************************************************/

void init_samr_alias_info1(ALIAS_INFO1 * al1, char *acct_name, uint32 num_member, char *acct_desc)
{
int acct_len_name = acct_name != NULL ? strlen(acct_name) : 0;
int acct_len_desc = acct_desc != NULL ? strlen(acct_desc) : 0;

DEBUG(5, ("init_samr_alias_info1\n"));

init_uni_hdr(&al1->hdr_acct_name, acct_len_name);
init_unistr2(&al1->uni_acct_name, acct_name, acct_len_name);

al1->num_member=num_member;

init_uni_hdr(&al1->hdr_acct_desc, acct_len_desc);
init_unistr2(&al1->uni_acct_desc, acct_desc, acct_len_desc);
}

/*******************************************************************
reads or writes a structure.
********************************************************************/

BOOL samr_io_alias_info1(char *desc, ALIAS_INFO1 * al1,
prs_struct *ps, int depth)
{
if (al1 == NULL)
return False;

prs_debug(ps, depth, desc, "samr_io_alias_info1");
depth++;

if(!prs_align(ps))
return False;

if(!smb_io_unihdr("hdr_acct_name", &al1->hdr_acct_name, ps, depth))
return False;
if(!prs_uint32("num_member", ps, depth, &al1->num_member))
return False;
if(!smb_io_unihdr("hdr_acct_desc", &al1->hdr_acct_desc, ps, depth))
return False;

if(!smb_io_unistr2("uni_acct_name", &al1->uni_acct_name,
al1->hdr_acct_name.buffer, ps, depth))
return False;

if(!prs_align(ps))
return False;

if(!smb_io_unistr2("uni_acct_desc", &al1->uni_acct_desc,
al1->hdr_acct_desc.buffer, ps, depth))
return False;

return True;
}

/*******************************************************************
inits a ALIAS_INFO3 structure.
********************************************************************/
Expand Down Expand Up @@ -3489,6 +3546,10 @@ BOOL samr_alias_info_ctr(char *desc, ALIAS_INFO_CTR * ctr,
return False;

switch (ctr->switch_value1) {
case 1:
if(!samr_io_alias_info1("alias_info1", &ctr->alias.info1, ps, depth))
return False;
break;
case 3:
if(!samr_io_alias_info3("alias_info3", &ctr->alias.info3, ps, depth))
return False;
Expand Down
5 changes: 5 additions & 0 deletions source3/rpc_server/srv_samr_nt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,11 @@ NTSTATUS _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAM
return NT_STATUS_NO_SUCH_ALIAS;

switch (q_u->switch_level) {
case 1:
r_u->ptr = 1;
r_u->ctr.switch_value1 = 1;
init_samr_alias_info1(&r_u->ctr.alias.info1, map.nt_name, 1, map.comment);
break;
case 3:
r_u->ptr = 1;
r_u->ctr.switch_value1 = 3;
Expand Down

0 comments on commit ea274ac

Please sign in to comment.