関数 | |
NTSTATUS | rpccli_ds_getprimarydominfo (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16 level, DS_DOMINFO_CTR *ctr) |
NTSTATUS | rpccli_ds_enum_domain_trusts (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *server, uint32 flags, struct ds_domain_trust **trusts, uint32 *num_domains) |
NTSTATUS rpccli_ds_getprimarydominfo | ( | struct rpc_pipe_client * | cli, | |
TALLOC_CTX * | mem_ctx, | |||
uint16 | level, | |||
DS_DOMINFO_CTR * | ctr | |||
) |
参照先 DS_DOMINFO_CTR::basic・cli・ds_io_q_getprimdominfo()・ds_io_r_getprimdominfo()・DS_R_GETPRIMDOMINFO::info・DS_Q_GETPRIMDOMINFO::level・DS_R_GETPRIMDOMINFO::ptr・result・DS_R_GETPRIMDOMINFO::status.
参照元 cmd_ds_dsrole_getprimarydominfo()・set_dc_type_and_flags().
00033 { 00034 prs_struct qbuf, rbuf; 00035 DS_Q_GETPRIMDOMINFO q; 00036 DS_R_GETPRIMDOMINFO r; 00037 NTSTATUS result; 00038 00039 ZERO_STRUCT(q); 00040 ZERO_STRUCT(r); 00041 00042 q.level = level; 00043 00044 CLI_DO_RPC( cli, mem_ctx, PI_LSARPC_DS, DS_GETPRIMDOMINFO, 00045 q, r, 00046 qbuf, rbuf, 00047 ds_io_q_getprimdominfo, 00048 ds_io_r_getprimdominfo, 00049 NT_STATUS_UNSUCCESSFUL); 00050 00051 /* Return basic info - if we are requesting at info != 1 then 00052 there could be trouble. */ 00053 00054 result = r.status; 00055 00056 if ( r.ptr && ctr ) { 00057 ctr->basic = TALLOC_P(mem_ctx, DSROLE_PRIMARY_DOMAIN_INFO_BASIC); 00058 if (!ctr->basic) 00059 goto done; 00060 memcpy(ctr->basic, r.info.basic, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC)); 00061 } 00062 00063 done: 00064 00065 return result; 00066 }
NTSTATUS rpccli_ds_enum_domain_trusts | ( | struct rpc_pipe_client * | cli, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | server, | |||
uint32 | flags, | |||
struct ds_domain_trust ** | trusts, | |||
uint32 * | num_domains | |||
) |
参照先 cli・DS_DOMAIN_TRUSTS::dns_domain・DS_DOMAIN_TRUSTS::dns_ptr・DS_R_ENUM_DOM_TRUSTS::domains・ds_io_q_enum_domain_trusts()・ds_io_r_enum_domain_trusts()・DS_DOMAIN_TRUSTS::flags・DS_DOMAIN_TRUSTS::guid・init_q_ds_enum_domain_trusts()・DS_DOMAIN_TRUSTS::netbios_domain・DS_DOMAIN_TRUSTS::netbios_ptr・DS_R_ENUM_DOM_TRUSTS::num_domains・DS_DOMAIN_TRUSTS::parent_index・result・DOM_SID2::sid・DS_DOMAIN_TRUSTS::sid・sid_copy()・DS_DOMAIN_TRUSTS::sid_ptr・DS_R_ENUM_DOM_TRUSTS::status・DS_DOMAIN_TRUSTS::trust_attributes・DS_DOMAIN_TRUSTS::trust_type・DS_DOMAIN_TRUSTS_CTR::trusts・unistr2_tdup().
参照元 cmd_ds_enum_domain_trusts()・trusted_domains().
00077 { 00078 prs_struct qbuf, rbuf; 00079 DS_Q_ENUM_DOM_TRUSTS q; 00080 DS_R_ENUM_DOM_TRUSTS r; 00081 NTSTATUS result; 00082 00083 ZERO_STRUCT(q); 00084 ZERO_STRUCT(r); 00085 00086 init_q_ds_enum_domain_trusts( &q, server, flags ); 00087 00088 CLI_DO_RPC( cli, mem_ctx, PI_NETLOGON, DS_ENUM_DOM_TRUSTS, 00089 q, r, 00090 qbuf, rbuf, 00091 ds_io_q_enum_domain_trusts, 00092 ds_io_r_enum_domain_trusts, 00093 NT_STATUS_UNSUCCESSFUL); 00094 00095 result = r.status; 00096 00097 if ( NT_STATUS_IS_OK(result) ) { 00098 int i; 00099 00100 *num_domains = r.num_domains; 00101 if (r.num_domains) { 00102 *trusts = TALLOC_ARRAY(mem_ctx, struct ds_domain_trust, r.num_domains); 00103 00104 if (*trusts == NULL) { 00105 return NT_STATUS_NO_MEMORY; 00106 } 00107 } else { 00108 *trusts = NULL; 00109 } 00110 00111 for ( i=0; i< *num_domains; i++ ) { 00112 (*trusts)[i].flags = r.domains.trusts[i].flags; 00113 (*trusts)[i].parent_index = r.domains.trusts[i].parent_index; 00114 (*trusts)[i].trust_type = r.domains.trusts[i].trust_type; 00115 (*trusts)[i].trust_attributes = r.domains.trusts[i].trust_attributes; 00116 (*trusts)[i].guid = r.domains.trusts[i].guid; 00117 00118 if (r.domains.trusts[i].sid_ptr) { 00119 sid_copy(&(*trusts)[i].sid, &r.domains.trusts[i].sid.sid); 00120 } else { 00121 ZERO_STRUCT((*trusts)[i].sid); 00122 } 00123 00124 if (r.domains.trusts[i].netbios_ptr) { 00125 (*trusts)[i].netbios_domain = unistr2_tdup( mem_ctx, &r.domains.trusts[i].netbios_domain ); 00126 } else { 00127 (*trusts)[i].netbios_domain = NULL; 00128 } 00129 00130 if (r.domains.trusts[i].dns_ptr) { 00131 (*trusts)[i].dns_domain = unistr2_tdup( mem_ctx, &r.domains.trusts[i].dns_domain ); 00132 } else { 00133 (*trusts)[i].dns_domain = NULL; 00134 } 00135 } 00136 } 00137 00138 return result; 00139 }