関数 | |
| BOOL | is_valid_policy_hnd (const POLICY_HND *hnd) |
| NTSTATUS | net_rpc_lookup_name (TALLOC_CTX *mem_ctx, struct cli_state *cli, const char *name, const char **ret_domain, const char **ret_name, DOM_SID *ret_sid, enum lsa_SidType *ret_type) |
| BOOL is_valid_policy_hnd | ( | const POLICY_HND * | hnd | ) |
net_util.c の 25 行で定義されています。
参照元 net_rpc_lookup_name()・rpc_sh_acct_do()・rpc_sh_handle_user().
00026 { 00027 POLICY_HND tmp; 00028 ZERO_STRUCT(tmp); 00029 return (memcmp(&tmp, hnd, sizeof(tmp)) != 0); 00030 }
| NTSTATUS net_rpc_lookup_name | ( | TALLOC_CTX * | mem_ctx, | |
| struct cli_state * | cli, | |||
| const char * | name, | |||
| const char ** | ret_domain, | |||
| const char ** | ret_name, | |||
| DOM_SID * | ret_sid, | |||
| enum lsa_SidType * | ret_type | |||
| ) |
net_util.c の 32 行で定義されています。
参照先 cli・cli_rpc_pipe_close()・cli_rpc_pipe_open_noauth()・d_fprintf()・is_valid_policy_hnd()・nt_errstr()・pol・result・rpccli_lsa_close()・rpccli_lsa_lookup_names()・rpccli_lsa_open_policy()・sid_copy()・talloc_strdup().
参照元 rpc_sh_handle_user().
00036 { 00037 struct rpc_pipe_client *lsa_pipe; 00038 POLICY_HND pol; 00039 NTSTATUS result = NT_STATUS_OK; 00040 const char **dom_names; 00041 DOM_SID *sids; 00042 enum lsa_SidType *types; 00043 00044 ZERO_STRUCT(pol); 00045 00046 lsa_pipe = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result); 00047 if (lsa_pipe == NULL) { 00048 d_fprintf(stderr, "Could not initialise lsa pipe\n"); 00049 return result; 00050 } 00051 00052 result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False, 00053 SEC_RIGHTS_MAXIMUM_ALLOWED, 00054 &pol); 00055 if (!NT_STATUS_IS_OK(result)) { 00056 d_fprintf(stderr, "open_policy failed: %s\n", 00057 nt_errstr(result)); 00058 return result; 00059 } 00060 00061 result = rpccli_lsa_lookup_names(lsa_pipe, mem_ctx, &pol, 1, 00062 &name, &dom_names, &sids, &types); 00063 00064 if (!NT_STATUS_IS_OK(result)) { 00065 /* This can happen easily, don't log an error */ 00066 goto done; 00067 } 00068 00069 if (ret_domain != NULL) { 00070 *ret_domain = dom_names[0]; 00071 } 00072 if (ret_name != NULL) { 00073 *ret_name = talloc_strdup(mem_ctx, name); 00074 } 00075 if (ret_sid != NULL) { 00076 sid_copy(ret_sid, &sids[0]); 00077 } 00078 if (ret_type != NULL) { 00079 *ret_type = types[0]; 00080 } 00081 00082 done: 00083 if (is_valid_policy_hnd(&pol)) { 00084 rpccli_lsa_close(lsa_pipe, mem_ctx, &pol); 00085 } 00086 cli_rpc_pipe_close(lsa_pipe); 00087 00088 return result; 00089 }
1.4.7