diff options
author | Günther Deschner <gd@samba.org> | 2005-11-22 14:38:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:31 -0500 |
commit | 1b624b69bda1eb94a0aa511eba3df0b9549a3000 (patch) | |
tree | 06b292711b37be6f8cda652ff972909e5152412b | |
parent | 4c34e1b7e27bb72075f22b22b2b11d8d654ffdf5 (diff) | |
download | samba-1b624b69bda1eb94a0aa511eba3df0b9549a3000.tar.gz samba-1b624b69bda1eb94a0aa511eba3df0b9549a3000.tar.bz2 samba-1b624b69bda1eb94a0aa511eba3df0b9549a3000.zip |
r11858: Fill in the clientside TRUSTED_DOMAIN_INFO_EX query.
Guenther
(This used to be commit 02f13dee6d0bbca71a991682bfe214ed8363e818)
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 42 | ||||
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 16 |
2 files changed, 57 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index d924ea27d1..3d28b657f3 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -3009,6 +3009,44 @@ static BOOL lsa_io_trustdom_query_4(const char *desc, TRUSTED_DOMAIN_INFO_PASSWO /******************************************************************* ********************************************************************/ +static BOOL lsa_io_trustdom_query_6(const char *desc, TRUSTED_DOMAIN_INFO_EX *info_ex, + prs_struct *ps, int depth) +{ + uint32 dom_sid_ptr; + + if (!smb_io_unihdr("domain_name_hdr", &info_ex->domain_name.hdr, ps, depth)) + return False; + + if (!smb_io_unihdr("netbios_name_hdr", &info_ex->netbios_name.hdr, ps, depth)) + return False; + + if (!prs_uint32("dom_sid_ptr", ps, depth, &dom_sid_ptr)) + return False; + + if (!prs_uint32("trust_direction", ps, depth, &info_ex->trust_direction)) + return False; + + if (!prs_uint32("trust_type", ps, depth, &info_ex->trust_type)) + return False; + + if (!prs_uint32("trust_attributes", ps, depth, &info_ex->trust_attributes)) + return False; + + if (!smb_io_unistr2("domain_name_unistring", &info_ex->domain_name.unistring, info_ex->domain_name.hdr.buffer, ps, depth)) + return False; + + if (!smb_io_unistr2("netbios_name_unistring", &info_ex->netbios_name.unistring, info_ex->netbios_name.hdr.buffer, ps, depth)) + return False; + + if (!smb_io_dom_sid2("sid", &info_ex->sid, ps, depth)) + return False; + + return True; +} + +/******************************************************************* +********************************************************************/ + static BOOL lsa_io_trustdom_query(const char *desc, prs_struct *ps, int depth, LSA_TRUSTED_DOMAIN_INFO *info) { prs_debug(ps, depth, desc, "lsa_io_trustdom_query"); @@ -3033,6 +3071,10 @@ static BOOL lsa_io_trustdom_query(const char *desc, prs_struct *ps, int depth, L if(!lsa_io_trustdom_query_4("password", &info->password, ps, depth)) return False; break; + case 6: + if(!lsa_io_trustdom_query_6("info_ex", &info->info_ex, ps, depth)) + return False; + break; default: DEBUG(0,("unsupported info-level: %d\n", info->info_class)); return False; diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 5a0ba05483..c79508de8d 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -771,7 +771,7 @@ static void display_trust_dom_info_1(TRUSTED_DOMAIN_INFO_NAME *n) static void display_trust_dom_info_3(TRUSTED_DOMAIN_INFO_POSIX_OFFSET *p) { - printf("Posix Offset:\t%d\n", p->posix_offset); + printf("Posix Offset:\t%08x (%d)\n", p->posix_offset, p->posix_offset); } static void display_trust_dom_info_4(TRUSTED_DOMAIN_INFO_PASSWORD *p, const char *password) @@ -800,6 +800,17 @@ static void display_trust_dom_info_4(TRUSTED_DOMAIN_INFO_PASSWORD *p, const char data_blob_free(&data_old); } +static void display_trust_dom_info_6(TRUSTED_DOMAIN_INFO_EX *i) +{ + printf("Domain Name:\t\t%s\n", unistr2_static(&i->domain_name.unistring)); + printf("NetBIOS Name:\t\t%s\n", unistr2_static(&i->netbios_name.unistring)); + printf("SID:\t\t\t%s\n", sid_string_static(&i->sid.sid)); + printf("Trust Direction:\t0x%08x\n", i->trust_direction); + printf("Trust Type:\t\t0x%08x\n", i->trust_type); + printf("Trust Attributes:\t0x%08x\n", i->trust_attributes); +} + + static void display_trust_dom_info(LSA_TRUSTED_DOMAIN_INFO *info, uint32 info_class, const char *pass) { switch (info_class) { @@ -812,6 +823,9 @@ static void display_trust_dom_info(LSA_TRUSTED_DOMAIN_INFO *info, uint32 info_cl case 4: display_trust_dom_info_4(&info->password, pass); break; + case 6: + display_trust_dom_info_6(&info->info_ex); + break; default: printf("unsupported info-class: %d\n", info_class); break; |