diff options
author | Jean-François Micouleau <jfm@samba.org> | 2001-07-09 18:25:40 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2001-07-09 18:25:40 +0000 |
commit | 62d399f3cf588b8b2f31672111ac67034009ee78 (patch) | |
tree | b41f01e1f0a04adb456533414b323159d5ed7e17 /source3/rpc_parse | |
parent | db77d64a2020ddcde5039dbd1572c7ba78abc8ec (diff) | |
download | samba-62d399f3cf588b8b2f31672111ac67034009ee78.tar.gz samba-62d399f3cf588b8b2f31672111ac67034009ee78.tar.bz2 samba-62d399f3cf588b8b2f31672111ac67034009ee78.zip |
add query user info level 20 (for RAS)
add query dominfo level 5
some cleanup, don't free talloced memory.
implement delete domain and local groups.
J.F.
(This used to be commit 3f14dda2a21850edfd540be2624867e5f70a382c)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index a7d758ea1b..76ec35e9c7 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -596,6 +596,40 @@ static BOOL sam_io_unk_info12(char *desc, SAM_UNK_INFO_12 * u_12, /******************************************************************* inits a structure. ********************************************************************/ +void init_unk_info5(SAM_UNK_INFO_5 * u_5,char *server) +{ + int len_server = strlen(server); + + init_uni_hdr(&u_5->hdr_server, len_server); + + init_unistr2(&u_5->uni_server, server, len_server); +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ + +static BOOL sam_io_unk_info5(char *desc, SAM_UNK_INFO_5 * u_5, + prs_struct *ps, int depth) +{ + if (u_5 == NULL) + return False; + + prs_debug(ps, depth, desc, "sam_io_unk_info5"); + depth++; + + if(!smb_io_unihdr("hdr_server", &u_5->hdr_server, ps, depth)) + return False; + + if(!smb_io_unistr2("uni_server", &u_5->uni_server, u_5->hdr_server.buffer, ps, depth)) + return False; + + return True; +} + +/******************************************************************* +inits a structure. +********************************************************************/ void init_unk_info2(SAM_UNK_INFO_2 * u_2, char *domain, char *server, uint32 seq_num) @@ -781,6 +815,10 @@ BOOL samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO * r_u, if(!sam_io_unk_info6("unk_inf6",&r_u->ctr->info.inf6, ps,depth)) return False; break; + case 0x05: + if(!sam_io_unk_info5("unk_inf5",&r_u->ctr->info.inf5, ps,depth)) + return False; + break; case 0x03: if(!sam_io_unk_info3("unk_inf3",&r_u->ctr->info.inf3, ps,depth)) return False; @@ -5930,6 +5968,42 @@ static BOOL sam_io_user_info21(char *desc, SAM_USER_INFO_21 * usr, return True; } +void init_sam_user_info20A(SAM_USER_INFO_20 *usr, SAM_ACCOUNT *pw) +{ + int len_munged_dial; + char* munged_dial = pdb_get_munged_dial(pw); + + len_munged_dial = munged_dial != NULL ? strlen(munged_dial )+1 : 0; + init_uni_hdr(&usr->hdr_munged_dial, len_munged_dial); + init_unistr2(&usr->uni_munged_dial, munged_dial, len_munged_dial); + +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ + +static BOOL sam_io_user_info20(char *desc, SAM_USER_INFO_20 *usr, + prs_struct *ps, int depth) +{ + if (usr == NULL) + return False; + + prs_debug(ps, depth, desc, "sam_io_user_info20"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */ + return False; + + if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial,usr->hdr_munged_dial.buffer, ps, depth)) /* worksations user can log on from */ + return False; + + return True; +} + /******************************************************************* inits a SAM_USERINFO_CTR structure. ********************************************************************/ @@ -6087,6 +6161,16 @@ static BOOL samr_io_userinfo_ctr(char *desc, SAM_USERINFO_CTR **ppctr, } ret = sam_io_user_info12("", ctr->info.id12, ps, depth); break; + case 20: + if (UNMARSHALLING(ps)) + ctr->info.id20 = (SAM_USER_INFO_20 *)prs_alloc_mem(ps,sizeof(SAM_USER_INFO_20)); + + if (ctr->info.id20 == NULL) { + DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n")); + return False; + } + ret = sam_io_user_info20("", ctr->info.id20, ps, depth); + break; case 21: if (UNMARSHALLING(ps)) ctr->info.id21 = (SAM_USER_INFO_21 *)prs_alloc_mem(ps,sizeof(SAM_USER_INFO_21)); |