関数 | |
NTSTATUS | winbindd_get_creds (struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const DOM_SID *sid, NET_USER_INFO_3 **info3, const uint8 *cached_nt_pass[NT_HASH_LEN], const uint8 *cred_salt[NT_HASH_LEN]) |
NTSTATUS | winbindd_store_creds (struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const char *user, const char *pass, NET_USER_INFO_3 *info3, const DOM_SID *user_sid) |
NTSTATUS | winbindd_update_creds_by_info3 (struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const char *user, const char *pass, NET_USER_INFO_3 *info3) |
NTSTATUS | winbindd_update_creds_by_sid (struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const DOM_SID *sid, const char *pass) |
NTSTATUS | winbindd_update_creds_by_name (struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const char *user, const char *pass) |
NTSTATUS winbindd_get_creds | ( | struct winbindd_domain * | domain, | |
TALLOC_CTX * | mem_ctx, | |||
const DOM_SID * | sid, | |||
NET_USER_INFO_3 ** | info3, | |||
const uint8 * | cached_nt_pass[NT_HASH_LEN], | |||
const uint8 * | cred_salt[NT_HASH_LEN] | |||
) |
winbindd_creds.c の 30 行で定義されています。
参照先 netsamlogon_cache_get()・status・wcache_get_creds().
参照元 winbindd_dual_pam_auth_cached().
00036 { 00037 NET_USER_INFO_3 *info; 00038 NTSTATUS status; 00039 00040 status = wcache_get_creds(domain, mem_ctx, sid, cached_nt_pass, cred_salt); 00041 if (!NT_STATUS_IS_OK(status)) { 00042 return status; 00043 } 00044 00045 info = netsamlogon_cache_get(mem_ctx, sid); 00046 if (info == NULL) { 00047 return NT_STATUS_OBJECT_NAME_NOT_FOUND; 00048 } 00049 00050 *info3 = info; 00051 00052 return NT_STATUS_OK; 00053 }
NTSTATUS winbindd_store_creds | ( | struct winbindd_domain * | domain, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | user, | |||
const char * | pass, | |||
NET_USER_INFO_3 * | info3, | |||
const DOM_SID * | user_sid | |||
) |
winbindd_creds.c の 56 行で定義されています。
参照先 net_user_info_3::dom_sid・dump_data()・E_md4hash()・lookup_cached_name()・winbindd_domain::name・netsamlogon_cache_store()・nt_errstr()・DOM_SID2::sid・sid_append_rid()・sid_copy()・status・type・net_user_info_3::user_flgs・net_user_info_3::user_rid・wcache_count_cached_creds()・wcache_remove_oldest_cached_creds()・wcache_save_creds().
参照元 winbindd_dual_pam_auth()・winbindd_update_creds_by_info3()・winbindd_update_creds_by_name()・winbindd_update_creds_by_sid().
00062 { 00063 NTSTATUS status; 00064 uchar nt_pass[NT_HASH_LEN]; 00065 DOM_SID cred_sid; 00066 00067 if (info3 != NULL) { 00068 00069 DOM_SID sid; 00070 sid_copy(&sid, &(info3->dom_sid.sid)); 00071 sid_append_rid(&sid, info3->user_rid); 00072 sid_copy(&cred_sid, &sid); 00073 info3->user_flgs |= LOGON_CACHED_ACCOUNT; 00074 00075 } else if (user_sid != NULL) { 00076 00077 sid_copy(&cred_sid, user_sid); 00078 00079 } else if (user != NULL) { 00080 00081 /* do lookup ourself */ 00082 00083 enum lsa_SidType type; 00084 00085 if (!lookup_cached_name(mem_ctx, 00086 domain->name, 00087 user, 00088 &cred_sid, 00089 &type)) { 00090 return NT_STATUS_NO_SUCH_USER; 00091 } 00092 } else { 00093 return NT_STATUS_INVALID_PARAMETER; 00094 } 00095 00096 if (pass) { 00097 00098 int count = 0; 00099 00100 status = wcache_count_cached_creds(domain, &count); 00101 if (!NT_STATUS_IS_OK(status)) { 00102 return status; 00103 } 00104 00105 DEBUG(11,("we have %d cached creds\n", count)); 00106 00107 if (count + 1 > MAX_CACHED_LOGINS) { 00108 00109 DEBUG(10,("need to delete the oldest cached login\n")); 00110 00111 status = wcache_remove_oldest_cached_creds(domain, &cred_sid); 00112 if (!NT_STATUS_IS_OK(status)) { 00113 DEBUG(10,("failed to remove oldest cached cred: %s\n", 00114 nt_errstr(status))); 00115 return status; 00116 } 00117 } 00118 00119 E_md4hash(pass, nt_pass); 00120 00121 #if DEBUG_PASSWORD 00122 dump_data(100, (const char *)nt_pass, NT_HASH_LEN); 00123 #endif 00124 00125 status = wcache_save_creds(domain, mem_ctx, &cred_sid, nt_pass); 00126 if (!NT_STATUS_IS_OK(status)) { 00127 return status; 00128 } 00129 } 00130 00131 if (info3 != NULL && user != NULL) { 00132 if (!netsamlogon_cache_store(user, info3)) { 00133 return NT_STATUS_ACCESS_DENIED; 00134 } 00135 } 00136 00137 return NT_STATUS_OK; 00138 }
NTSTATUS winbindd_update_creds_by_info3 | ( | struct winbindd_domain * | domain, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | user, | |||
const char * | pass, | |||
NET_USER_INFO_3 * | info3 | |||
) |
winbindd_creds.c の 140 行で定義されています。
参照元 winbindd_dual_pam_auth_cached().
00145 { 00146 return winbindd_store_creds(domain, mem_ctx, user, pass, info3, NULL); 00147 }
NTSTATUS winbindd_update_creds_by_sid | ( | struct winbindd_domain * | domain, | |
TALLOC_CTX * | mem_ctx, | |||
const DOM_SID * | sid, | |||
const char * | pass | |||
) |
winbindd_creds.c の 149 行で定義されています。
00153 { 00154 return winbindd_store_creds(domain, mem_ctx, NULL, pass, NULL, sid); 00155 }
NTSTATUS winbindd_update_creds_by_name | ( | struct winbindd_domain * | domain, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | user, | |||
const char * | pass | |||
) |
winbindd_creds.c の 157 行で定義されています。
参照元 winbindd_dual_pam_chauthtok().
00161 { 00162 return winbindd_store_creds(domain, mem_ctx, user, pass, NULL, NULL); 00163 }