関数 | |
uint32 | pdb_get_acct_ctrl (const struct samu *sampass) |
time_t | pdb_get_logon_time (const struct samu *sampass) |
time_t | pdb_get_logoff_time (const struct samu *sampass) |
time_t | pdb_get_kickoff_time (const struct samu *sampass) |
time_t | pdb_get_bad_password_time (const struct samu *sampass) |
time_t | pdb_get_pass_last_set_time (const struct samu *sampass) |
time_t | pdb_get_pass_can_change_time (const struct samu *sampass) |
time_t | pdb_get_pass_can_change_time_noncalc (const struct samu *sampass) |
time_t | pdb_get_pass_must_change_time (const struct samu *sampass) |
BOOL | pdb_get_pass_can_change (const struct samu *sampass) |
uint16 | pdb_get_logon_divs (const struct samu *sampass) |
uint32 | pdb_get_hours_len (const struct samu *sampass) |
const uint8 * | pdb_get_hours (const struct samu *sampass) |
const uint8 * | pdb_get_nt_passwd (const struct samu *sampass) |
const uint8 * | pdb_get_lanman_passwd (const struct samu *sampass) |
const uint8 * | pdb_get_pw_history (const struct samu *sampass, uint32 *current_hist_len) |
const char * | pdb_get_plaintext_passwd (const struct samu *sampass) |
const DOM_SID * | pdb_get_user_sid (const struct samu *sampass) |
const DOM_SID * | pdb_get_group_sid (struct samu *sampass) |
enum pdb_value_state | pdb_get_init_flags (const struct samu *sampass, enum pdb_elements element) |
Get flags showing what is initalised in the struct samu | |
const char * | pdb_get_username (const struct samu *sampass) |
const char * | pdb_get_domain (const struct samu *sampass) |
const char * | pdb_get_nt_username (const struct samu *sampass) |
const char * | pdb_get_fullname (const struct samu *sampass) |
const char * | pdb_get_homedir (const struct samu *sampass) |
const char * | pdb_get_unix_homedir (const struct samu *sampass) |
const char * | pdb_get_dir_drive (const struct samu *sampass) |
const char * | pdb_get_logon_script (const struct samu *sampass) |
const char * | pdb_get_profile_path (const struct samu *sampass) |
const char * | pdb_get_acct_desc (const struct samu *sampass) |
const char * | pdb_get_workstations (const struct samu *sampass) |
const char * | pdb_get_comment (const struct samu *sampass) |
const char * | pdb_get_munged_dial (const struct samu *sampass) |
uint16 | pdb_get_bad_password_count (const struct samu *sampass) |
uint16 | pdb_get_logon_count (const struct samu *sampass) |
uint32 | pdb_get_unknown_6 (const struct samu *sampass) |
void * | pdb_get_backend_private_data (const struct samu *sampass, const struct pdb_methods *my_methods) |
BOOL | pdb_set_acct_ctrl (struct samu *sampass, uint32 acct_ctrl, enum pdb_value_state flag) |
BOOL | pdb_set_logon_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_logoff_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_kickoff_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_bad_password_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_pass_can_change_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_pass_must_change_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_pass_last_set_time (struct samu *sampass, time_t mytime, enum pdb_value_state flag) |
BOOL | pdb_set_hours_len (struct samu *sampass, uint32 len, enum pdb_value_state flag) |
BOOL | pdb_set_logon_divs (struct samu *sampass, uint16 hours, enum pdb_value_state flag) |
BOOL | pdb_set_init_flags (struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag) |
Set flags showing what is initalised in the struct samu | |
BOOL | pdb_set_user_sid (struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag) |
BOOL | pdb_set_user_sid_from_string (struct samu *sampass, fstring u_sid, enum pdb_value_state flag) |
BOOL | pdb_set_group_sid (struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag) |
BOOL | pdb_set_username (struct samu *sampass, const char *username, enum pdb_value_state flag) |
BOOL | pdb_set_domain (struct samu *sampass, const char *domain, enum pdb_value_state flag) |
BOOL | pdb_set_nt_username (struct samu *sampass, const char *nt_username, enum pdb_value_state flag) |
BOOL | pdb_set_fullname (struct samu *sampass, const char *full_name, enum pdb_value_state flag) |
BOOL | pdb_set_logon_script (struct samu *sampass, const char *logon_script, enum pdb_value_state flag) |
BOOL | pdb_set_profile_path (struct samu *sampass, const char *profile_path, enum pdb_value_state flag) |
BOOL | pdb_set_dir_drive (struct samu *sampass, const char *dir_drive, enum pdb_value_state flag) |
BOOL | pdb_set_homedir (struct samu *sampass, const char *home_dir, enum pdb_value_state flag) |
BOOL | pdb_set_acct_desc (struct samu *sampass, const char *acct_desc, enum pdb_value_state flag) |
BOOL | pdb_set_workstations (struct samu *sampass, const char *workstations, enum pdb_value_state flag) |
BOOL | pdb_set_comment (struct samu *sampass, const char *comment, enum pdb_value_state flag) |
BOOL | pdb_set_munged_dial (struct samu *sampass, const char *munged_dial, enum pdb_value_state flag) |
BOOL | pdb_set_nt_passwd (struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum pdb_value_state flag) |
BOOL | pdb_set_lanman_passwd (struct samu *sampass, const uint8 pwd[LM_HASH_LEN], enum pdb_value_state flag) |
BOOL | pdb_set_pw_history (struct samu *sampass, const uint8 *pwd, uint32 historyLen, enum pdb_value_state flag) |
BOOL | pdb_set_plaintext_pw_only (struct samu *sampass, const char *password, enum pdb_value_state flag) |
BOOL | pdb_set_bad_password_count (struct samu *sampass, uint16 bad_password_count, enum pdb_value_state flag) |
BOOL | pdb_set_logon_count (struct samu *sampass, uint16 logon_count, enum pdb_value_state flag) |
BOOL | pdb_set_unknown_6 (struct samu *sampass, uint32 unkn, enum pdb_value_state flag) |
BOOL | pdb_set_hours (struct samu *sampass, const uint8 *hours, enum pdb_value_state flag) |
BOOL | pdb_set_backend_private_data (struct samu *sampass, void *private_data, void(*free_fn)(void **), const struct pdb_methods *my_methods, enum pdb_value_state flag) |
BOOL | pdb_set_pass_can_change (struct samu *sampass, BOOL canchange) |
BOOL | pdb_set_plaintext_passwd (struct samu *sampass, const char *plaintext) |
uint32 | pdb_build_fields_present (struct samu *sampass) |
uint32 pdb_get_acct_ctrl | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 43 行で定義されています。
参照先 samu::acct_ctrl.
参照元 _cleanup_failures()・_net_sam_logon_internal()・_net_srv_pwset()・_samr_delete_dom_user()・_samr_set_userinfo()・_samr_set_userinfo2()・_smb_add_user()・change_lanman_password()・check_lanman_password()・check_oem_password()・check_sam_security()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・get_md4pw()・get_user_info_16()・get_user_info_18()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_from_ldap()・init_sam_user_info21A()・ldapsam_modify_entry()・local_password_change()・net_sam_set_userflag()・next_entry_users()・pam_sm_acct_mgmt()・pdb_increment_bad_password_count()・pdb_set_plaintext_passwd()・pdb_update_autolock_flag()・print_sam_info()・process_root()・sam_account_ok()・sam_password_ok()・samu_correct()・set_user_info()・set_user_info_23()・set_user_info_pw()・update_smbpassword_file().
00044 { 00045 return sampass->acct_ctrl; 00046 }
time_t pdb_get_logon_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 48 行で定義されています。
参照先 samu::logon_time.
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta()・samu_correct().
00049 { 00050 return sampass->logon_time; 00051 }
time_t pdb_get_logoff_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 53 行で定義されています。
参照先 samu::logoff_time.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta()・samu_correct().
00054 { 00055 return sampass->logoff_time; 00056 }
time_t pdb_get_kickoff_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 58 行で定義されています。
参照先 samu::kickoff_time.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta()・sam_account_ok()・samu_correct().
00059 { 00060 return sampass->kickoff_time; 00061 }
time_t pdb_get_bad_password_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 63 行で定義されています。
参照元 init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_from_ldap()・pdb_update_autolock_flag()・pdb_update_bad_password_count()・print_sam_info()・samu_correct().
00064 { 00065 return sampass->bad_password_time; 00066 }
time_t pdb_get_pass_last_set_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 68 行で定義されています。
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta()・sam_account_ok()・samu_correct()・set_user_info_pw().
00069 { 00070 return sampass->pass_last_set_time; 00071 }
time_t pdb_get_pass_can_change_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 73 行で定義されています。
参照先 get_time_t_max()・samu::pass_can_change_time・samu::pass_last_set_time・PDB_CANCHANGETIME・PDB_CHANGED・pdb_get_account_policy()・pdb_get_init_flags().
参照元 _net_sam_logon_internal()・change_oem_password()・init_sam_user_info21A()・print_sam_info()・samu_correct().
00074 { 00075 uint32 allow; 00076 00077 /* if the last set time is zero, it means the user cannot 00078 change their password, and this time must be zero. jmcd 00079 */ 00080 if (sampass->pass_last_set_time == 0) 00081 return (time_t) 0; 00082 00083 /* if the time is max, and the field has been changed, 00084 we're trying to update this real value from the sampass 00085 to indicate that the user cannot change their password. jmcd 00086 */ 00087 if (sampass->pass_can_change_time == get_time_t_max() && 00088 pdb_get_init_flags(sampass, PDB_CANCHANGETIME) == PDB_CHANGED) 00089 return sampass->pass_can_change_time; 00090 00091 if (!pdb_get_account_policy(AP_MIN_PASSWORD_AGE, &allow)) 00092 allow = 0; 00093 00094 /* in normal cases, just calculate it from policy */ 00095 return sampass->pass_last_set_time + allow; 00096 }
time_t pdb_get_pass_can_change_time_noncalc | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 100 行で定義されています。
参照先 samu::pass_can_change_time.
参照元 init_buffer_from_sam_v3()・init_ldap_from_sam().
00101 { 00102 return sampass->pass_can_change_time; 00103 }
time_t pdb_get_pass_must_change_time | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 105 行で定義されています。
参照先 samu::acct_ctrl・get_time_t_max()・samu::pass_last_set_time・pdb_get_account_policy().
参照元 _net_sam_logon_internal()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_ok()・samu_correct().
00106 { 00107 uint32 expire; 00108 00109 if (sampass->pass_last_set_time == 0) 00110 return (time_t) 0; 00111 00112 if (sampass->acct_ctrl & ACB_PWNOEXP) 00113 return get_time_t_max(); 00114 00115 if (!pdb_get_account_policy(AP_MAX_PASSWORD_AGE, &expire) 00116 || expire == (uint32)-1 || expire == 0) 00117 return get_time_t_max(); 00118 00119 return sampass->pass_last_set_time + expire; 00120 }
pdb_get_set.c の 122 行で定義されています。
参照先 get_time_t_max()・samu::pass_can_change_time・samu::pass_last_set_time.
参照元 change_oem_password()・check_change_pw_access().
00123 { 00124 if (sampass->pass_can_change_time == get_time_t_max() && 00125 sampass->pass_last_set_time != 0) 00126 return False; 00127 return True; 00128 }
uint16 pdb_get_logon_divs | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 130 行で定義されています。
参照先 samu::logon_divs.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_sam_user_info21A()・sam_account_from_delta()・samu_correct().
00131 { 00132 return sampass->logon_divs; 00133 }
uint32 pdb_get_hours_len | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 135 行で定義されています。
参照先 samu::hours_len.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_sam_user_info21A()・sam_account_from_delta()・samu_correct()・set_user_info().
00136 { 00137 return sampass->hours_len; 00138 }
const uint8* pdb_get_hours | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 140 行で定義されています。
参照先 samu::hours.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・logon_hours_ok()・print_sam_info()・sam_account_from_delta()・samu_correct().
00141 { 00142 return (sampass->hours); 00143 }
const uint8* pdb_get_nt_passwd | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 145 行で定義されています。
参照先 data_blob_::data・data_blob_::length・samu::nt_pw.
参照元 _cleanup_failures()・_net_srv_pwset()・check_oem_password()・check_passwd_history()・get_md4pw()・get_user_info_18()・init_buffer_from_sam_v3()・init_ldap_from_sam()・print_sam_info()・process_root()・sam_password_ok()・samu_correct().
00146 { 00147 SMB_ASSERT((!sampass->nt_pw.data) 00148 || sampass->nt_pw.length == NT_HASH_LEN); 00149 return (uint8 *)sampass->nt_pw.data; 00150 }
const uint8* pdb_get_lanman_passwd | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 152 行で定義されています。
参照先 data_blob_::data・data_blob_::length・samu::lm_pw.
参照元 change_lanman_password()・check_lanman_password()・check_oem_password()・get_user_info_18()・init_buffer_from_sam_v3()・init_ldap_from_sam()・local_password_change()・print_sam_info()・sam_password_ok()・samu_correct().
00153 { 00154 SMB_ASSERT((!sampass->lm_pw.data) 00155 || sampass->lm_pw.length == LM_HASH_LEN); 00156 return (uint8 *)sampass->lm_pw.data; 00157 }
const uint8* pdb_get_pw_history | ( | const struct samu * | sampass, | |
uint32 * | current_hist_len | |||
) |
pdb_get_set.c の 159 行で定義されています。
参照先 data_blob_::data・data_blob_::length・samu::nt_pw_his.
参照元 check_passwd_history()・init_buffer_from_sam_v3()・init_ldap_from_sam()・pdb_set_plaintext_passwd()・samu_correct().
00160 { 00161 SMB_ASSERT((!sampass->nt_pw_his.data) 00162 || ((sampass->nt_pw_his.length % PW_HISTORY_ENTRY_LEN) == 0)); 00163 *current_hist_len = sampass->nt_pw_his.length / PW_HISTORY_ENTRY_LEN; 00164 return (uint8 *)sampass->nt_pw_his.data; 00165 }
const char* pdb_get_plaintext_passwd | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 173 行で定義されています。
参照先 samu::plaintext_pw.
00174 { 00175 return sampass->plaintext_pw; 00176 }
pdb_get_set.c の 178 行で定義されています。
参照先 samu::user_sid.
参照元 _cleanup_failures()・_net_sam_logon_internal()・create_local_token()・init_ldap_from_sam()・init_sam_from_ldap()・init_sam_user_info21A()・ldapsam_add_sam_account()・lookup_global_sam_name()・pam_sm_chauthtok()・pdb_default_create_user()・pdb_default_uid_to_sid()・pdb_delete_user()・pdb_get_user_rid()・pdb_getsampwsid()・pdb_rename_sam_account()・print_sam_info().
00179 { 00180 return &sampass->user_sid; 00181 }
pdb_get_set.c の 183 行で定義されています。
参照先 get_global_sam_sid()・Get_Pwnam_alloc()・samu::group_sid・lookup_sid()・pdb_get_username()・pdb_gid_to_sid()・sid_append_rid()・sid_copy()・SID_NAME_DOM_GRP・SID_NAME_UNKNOWN・sid_type_lookup()・talloc_init()・type・samu::unix_pw.
参照元 _net_sam_logon_internal()・_samr_query_usergroups()・fetch_account_info()・init_ldap_from_sam()・init_sam_user_info21A()・ldapsam_set_primary_group()・pdb_default_set_unix_primary_group()・pdb_get_group_rid()・print_sam_info()・sam_query_user().
00184 { 00185 DOM_SID *gsid; 00186 struct passwd *pwd; 00187 00188 /* Return the cached group SID if we have that */ 00189 if ( sampass->group_sid ) { 00190 return sampass->group_sid; 00191 } 00192 00193 /* generate the group SID from the user's primary Unix group */ 00194 00195 if ( !(gsid = TALLOC_P( sampass, DOM_SID )) ) { 00196 return NULL; 00197 } 00198 00199 /* No algorithmic mapping, meaning that we have to figure out the 00200 primary group SID according to group mapping and the user SID must 00201 be a newly allocated one. We rely on the user's Unix primary gid. 00202 We have no choice but to fail if we can't find it. */ 00203 00204 if ( sampass->unix_pw ) { 00205 pwd = sampass->unix_pw; 00206 } else { 00207 pwd = Get_Pwnam_alloc( sampass, pdb_get_username(sampass) ); 00208 } 00209 00210 if ( !pwd ) { 00211 DEBUG(0,("pdb_get_group_sid: Failed to find Unix account for %s\n", pdb_get_username(sampass) )); 00212 return NULL; 00213 } 00214 00215 if ( pdb_gid_to_sid(pwd->pw_gid, gsid) ) { 00216 enum lsa_SidType type = SID_NAME_UNKNOWN; 00217 TALLOC_CTX *mem_ctx = talloc_init("pdb_get_group_sid"); 00218 BOOL lookup_ret; 00219 00220 if (!mem_ctx) { 00221 return NULL; 00222 } 00223 00224 /* Now check that it's actually a domain group and not something else */ 00225 00226 lookup_ret = lookup_sid(mem_ctx, gsid, NULL, NULL, &type); 00227 00228 TALLOC_FREE( mem_ctx ); 00229 00230 if ( lookup_ret && (type == SID_NAME_DOM_GRP) ) { 00231 sampass->group_sid = gsid; 00232 return sampass->group_sid; 00233 } 00234 00235 DEBUG(3, ("Primary group for user %s is a %s and not a domain group\n", 00236 pwd->pw_name, sid_type_lookup(type))); 00237 } 00238 00239 /* Just set it to the 'Domain Users' RID of 512 which will 00240 always resolve to a name */ 00241 00242 sid_copy( gsid, get_global_sam_sid() ); 00243 sid_append_rid( gsid, DOMAIN_GROUP_RID_USERS ); 00244 00245 sampass->group_sid = gsid; 00246 00247 return sampass->group_sid; 00248 }
enum pdb_value_state pdb_get_init_flags | ( | const struct samu * | sampass, | |
enum pdb_elements | element | |||
) |
Get flags showing what is initalised in the struct samu
sampass | the struct samu in question |
pdb_get_set.c の 256 行で定義されています。
参照先 bitmap_query()・samu::change_flags・PDB_CHANGED・PDB_DEFAULT・PDB_SET・samu::set_flags.
参照元 init_sam_from_ldap()・pdb_get_pass_can_change_time()・set_user_info_pw().
00257 { 00258 enum pdb_value_state ret = PDB_DEFAULT; 00259 00260 if (!sampass->change_flags || !sampass->set_flags) 00261 return ret; 00262 00263 if (bitmap_query(sampass->set_flags, element)) { 00264 DEBUG(11, ("element %d: SET\n", element)); 00265 ret = PDB_SET; 00266 } 00267 00268 if (bitmap_query(sampass->change_flags, element)) { 00269 DEBUG(11, ("element %d: CHANGED\n", element)); 00270 ret = PDB_CHANGED; 00271 } 00272 00273 if (ret == PDB_DEFAULT) { 00274 DEBUG(11, ("element %d: DEFAULT\n", element)); 00275 } 00276 00277 return ret; 00278 }
const char* pdb_get_username | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 280 行で定義されています。
参照先 samu::username.
参照元 _cleanup_failures()・_net_sam_logon_internal()・_samr_delete_dom_user()・_samr_query_usergroups()・change_lanman_password()・change_oem_password()・check_change_pw_access()・check_passwd_history()・check_sam_security()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・create_token_from_username()・fetch_account_info()・fetch_group_mem_info()・fix_users_list()・get_user_info_16()・get_user_info_18()・get_user_info_20()・get_user_info_21()・get_user_info_7()・get_user_info_9()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・ldapsam_add_sam_account()・ldapsam_delete_sam_account()・ldapsam_delete_user()・ldapsam_modify_entry()・ldapsam_rename_sam_account()・ldapsam_set_primary_group()・ldapsam_update_sam_account()・logon_hours_ok()・lookup_global_sam_rid()・main()・make_server_info_sam()・next_entry_users()・pam_sm_acct_mgmt()・pam_sm_chauthtok()・pdb_default_delete_user()・pdb_default_enum_group_memberships()・pdb_default_set_unix_primary_group()・pdb_get_group_sid()・pdb_nds_update_login_attempts()・pdb_update_autolock_flag()・print_sam_info()・sam_account_from_delta()・sam_account_ok()・sam_password_ok()・samu_correct()・set_user_info_21()・set_user_info_23()・set_user_info_pw()・tdb_delete_samacct_only()・tdb_update_ridrec_only()・tdb_update_sam()・tdb_update_samacct_only()・tdbsam_delete_sam_account()・tdbsam_rename_sam_account().
00281 { 00282 return sampass->username; 00283 }
const char* pdb_get_domain | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 285 行で定義されています。
参照先 samu::domain.
参照元 _net_sam_logon_internal()・init_buffer_from_sam_v3()・print_sam_info()・register_vuid().
00286 { 00287 return sampass->domain; 00288 }
const char* pdb_get_nt_username | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 290 行で定義されています。
参照先 samu::nt_username.
参照元 init_buffer_from_sam_v3()・init_ldap_from_sam()・login_cache_delentry()・login_cache_read()・login_cache_write()・print_sam_info()・sam_account_from_delta()・samu_correct().
00291 { 00292 return sampass->nt_username; 00293 }
const char* pdb_get_fullname | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 295 行で定義されています。
参照先 samu::full_name.
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・next_entry_users()・print_sam_info()・register_vuid()・sam_account_from_delta().
00296 { 00297 return sampass->full_name; 00298 }
const char* pdb_get_homedir | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 300 行で定義されています。
参照先 samu::home_dir.
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・register_vuid()・sam_account_from_delta()・samu_correct().
00301 { 00302 return sampass->home_dir; 00303 }
const char* pdb_get_unix_homedir | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 305 行で定義されています。
参照先 samu::unix_pw.
参照元 register_vuid().
00306 { 00307 if (sampass->unix_pw ) { 00308 return sampass->unix_pw->pw_dir; 00309 } 00310 return NULL; 00311 }
const char* pdb_get_dir_drive | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 313 行で定義されています。
参照先 samu::dir_drive.
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta().
00314 { 00315 return sampass->dir_drive; 00316 }
const char* pdb_get_logon_script | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 318 行で定義されています。
参照先 samu::logon_script.
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・register_vuid()・sam_account_from_delta()・samu_correct().
00319 { 00320 return sampass->logon_script; 00321 }
const char* pdb_get_profile_path | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 323 行で定義されています。
参照先 samu::profile_path.
参照元 _net_sam_logon_internal()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta()・samu_correct().
00324 { 00325 return sampass->profile_path; 00326 }
const char* pdb_get_acct_desc | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 328 行で定義されています。
参照先 samu::acct_desc.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・next_entry_users()・print_sam_info()・sam_account_from_delta().
00329 { 00330 return sampass->acct_desc; 00331 }
const char* pdb_get_workstations | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 333 行で定義されています。
参照先 samu::workstations.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta()・sam_account_ok().
00334 { 00335 return sampass->workstations; 00336 }
const char* pdb_get_comment | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 338 行で定義されています。
参照先 samu::comment.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd().
00339 { 00340 return sampass->comment; 00341 }
const char* pdb_get_munged_dial | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 343 行で定義されています。
参照先 samu::munged_dial.
参照元 copy_id20_to_sam_passwd()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_user_info20A()・init_sam_user_info21A()・print_sam_info()・sam_account_from_delta().
00344 { 00345 return sampass->munged_dial; 00346 }
uint16 pdb_get_bad_password_count | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 348 行で定義されています。
参照元 check_sam_security()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_ldap_from_sam()・init_sam_from_ldap()・init_sam_user_info21A()・pdb_increment_bad_password_count()・pdb_update_bad_password_count()・print_sam_info()・sam_account_from_delta().
00349 { 00350 return sampass->bad_password_count; 00351 }
uint16 pdb_get_logon_count | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 353 行で定義されています。
参照先 samu::logon_count.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_buffer_from_sam_v3()・init_sam_user_info21A()・sam_account_from_delta().
00354 { 00355 return sampass->logon_count; 00356 }
uint32 pdb_get_unknown_6 | ( | const struct samu * | sampass | ) |
pdb_get_set.c の 358 行で定義されています。
参照先 samu::unknown_6.
参照元 init_buffer_from_sam_v3()・sam_account_from_delta().
00359 { 00360 return sampass->unknown_6; 00361 }
void* pdb_get_backend_private_data | ( | const struct samu * | sampass, | |
const struct pdb_methods * | my_methods | |||
) |
pdb_get_set.c の 363 行で定義されています。
参照先 samu::backend_private_data・samu::backend_private_methods.
参照元 ldapsam_update_sam_account()・pdb_nds_update_login_attempts().
00364 { 00365 if (my_methods == sampass->backend_private_methods) { 00366 return sampass->backend_private_data; 00367 } else { 00368 return NULL; 00369 } 00370 }
BOOL pdb_set_acct_ctrl | ( | struct samu * | sampass, | |
uint32 | acct_ctrl, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 376 行で定義されています。
参照先 samu::acct_ctrl・PDB_ACCTCTRL・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・ldapsam_create_user()・local_password_change()・make_server_info_info3()・net_sam_set_userflag()・new_machine()・new_user()・pdb_default_create_user()・pdb_increment_bad_password_count()・pdb_update_autolock_flag()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info()・set_user_info_16()・update_smbpassword_file().
00377 { 00378 sampass->acct_ctrl = acct_ctrl; 00379 return pdb_set_init_flags(sampass, PDB_ACCTCTRL, flag); 00380 }
BOOL pdb_set_logon_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 382 行で定義されています。
参照先 samu::logon_time・PDB_LOGONTIME・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00383 { 00384 sampass->logon_time = mytime; 00385 return pdb_set_init_flags(sampass, PDB_LOGONTIME, flag); 00386 }
BOOL pdb_set_logoff_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 388 行で定義されています。
参照先 samu::logoff_time・PDB_LOGOFFTIME・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00389 { 00390 sampass->logoff_time = mytime; 00391 return pdb_set_init_flags(sampass, PDB_LOGOFFTIME, flag); 00392 }
BOOL pdb_set_kickoff_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 394 行で定義されています。
参照先 samu::kickoff_time・PDB_KICKOFFTIME・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00395 { 00396 sampass->kickoff_time = mytime; 00397 return pdb_set_init_flags(sampass, PDB_KICKOFFTIME, flag); 00398 }
BOOL pdb_set_bad_password_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 400 行で定義されています。
参照先 samu::bad_password_time・PDB_BAD_PASSWORD_TIME・pdb_set_init_flags().
参照元 check_sam_security()・copy_id21_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・pdb_increment_bad_password_count()・pdb_update_autolock_flag()・pdb_update_bad_password_count()・set_user_info().
00401 { 00402 sampass->bad_password_time = mytime; 00403 return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_TIME, flag); 00404 }
BOOL pdb_set_pass_can_change_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 406 行で定義されています。
参照先 samu::pass_can_change_time・PDB_CANCHANGETIME・pdb_set_init_flags().
参照元 init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・make_server_info_info3()・pdb_set_pass_can_change().
00407 { 00408 sampass->pass_can_change_time = mytime; 00409 return pdb_set_init_flags(sampass, PDB_CANCHANGETIME, flag); 00410 }
BOOL pdb_set_pass_must_change_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 412 行で定義されています。
参照先 samu::pass_must_change_time・PDB_MUSTCHANGETIME・pdb_set_init_flags().
参照元 init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・make_server_info_info3().
00413 { 00414 sampass->pass_must_change_time = mytime; 00415 return pdb_set_init_flags(sampass, PDB_MUSTCHANGETIME, flag); 00416 }
BOOL pdb_set_pass_last_set_time | ( | struct samu * | sampass, | |
time_t | mytime, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 418 行で定義されています。
参照先 samu::pass_last_set_time・PDB_PASSLASTSET・pdb_set_init_flags().
参照元 _net_srv_pwset()・change_lanman_password()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・make_server_info_info3()・net_sam_set_pwdmustchangenow()・pdb_set_plaintext_passwd()・sam_account_from_delta()・set_user_info_18()・set_user_info_pw().
00419 { 00420 sampass->pass_last_set_time = mytime; 00421 return pdb_set_init_flags(sampass, PDB_PASSLASTSET, flag); 00422 }
BOOL pdb_set_hours_len | ( | struct samu * | sampass, | |
uint32 | len, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 424 行で定義されています。
参照先 samu::hours_len・PDB_HOURSLEN・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00425 { 00426 sampass->hours_len = len; 00427 return pdb_set_init_flags(sampass, PDB_HOURSLEN, flag); 00428 }
BOOL pdb_set_logon_divs | ( | struct samu * | sampass, | |
uint16 | hours, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 430 行で定義されています。
参照先 samu::logon_divs・PDB_LOGONDIVS・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00431 { 00432 sampass->logon_divs = hours; 00433 return pdb_set_init_flags(sampass, PDB_LOGONDIVS, flag); 00434 }
BOOL pdb_set_init_flags | ( | struct samu * | sampass, | |
enum pdb_elements | element, | |||
enum pdb_value_state | value_flag | |||
) |
Set flags showing what is initalised in the struct samu
sampass | the struct samu in question | |
flag | The *new* flag to be set. Old flags preserved this flag is only added. |
pdb_get_set.c の 443 行で定義されています。
参照先 bitmap_clear()・bitmap_set()・bitmap_talloc()・samu::change_flags・PDB_CHANGED・PDB_COUNT・PDB_DEFAULT・PDB_SET・samu::set_flags.
参照元 pdb_set_acct_ctrl()・pdb_set_acct_desc()・pdb_set_backend_private_data()・pdb_set_bad_password_count()・pdb_set_bad_password_time()・pdb_set_comment()・pdb_set_dir_drive()・pdb_set_domain()・pdb_set_fullname()・pdb_set_group_sid()・pdb_set_homedir()・pdb_set_hours()・pdb_set_hours_len()・pdb_set_kickoff_time()・pdb_set_lanman_passwd()・pdb_set_logoff_time()・pdb_set_logon_count()・pdb_set_logon_divs()・pdb_set_logon_script()・pdb_set_logon_time()・pdb_set_munged_dial()・pdb_set_nt_passwd()・pdb_set_nt_username()・pdb_set_pass_can_change_time()・pdb_set_pass_last_set_time()・pdb_set_pass_must_change_time()・pdb_set_plaintext_pw_only()・pdb_set_profile_path()・pdb_set_pw_history()・pdb_set_unknown_6()・pdb_set_user_sid()・pdb_set_username()・pdb_set_workstations().
00444 { 00445 if (!sampass->set_flags) { 00446 if ((sampass->set_flags = 00447 bitmap_talloc(sampass, 00448 PDB_COUNT))==NULL) { 00449 DEBUG(0,("bitmap_talloc failed\n")); 00450 return False; 00451 } 00452 } 00453 if (!sampass->change_flags) { 00454 if ((sampass->change_flags = 00455 bitmap_talloc(sampass, 00456 PDB_COUNT))==NULL) { 00457 DEBUG(0,("bitmap_talloc failed\n")); 00458 return False; 00459 } 00460 } 00461 00462 switch(value_flag) { 00463 case PDB_CHANGED: 00464 if (!bitmap_set(sampass->change_flags, element)) { 00465 DEBUG(0,("Can't set flag: %d in change_flags.\n",element)); 00466 return False; 00467 } 00468 if (!bitmap_set(sampass->set_flags, element)) { 00469 DEBUG(0,("Can't set flag: %d in set_flags.\n",element)); 00470 return False; 00471 } 00472 DEBUG(11, ("element %d -> now CHANGED\n", element)); 00473 break; 00474 case PDB_SET: 00475 if (!bitmap_clear(sampass->change_flags, element)) { 00476 DEBUG(0,("Can't set flag: %d in change_flags.\n",element)); 00477 return False; 00478 } 00479 if (!bitmap_set(sampass->set_flags, element)) { 00480 DEBUG(0,("Can't set flag: %d in set_flags.\n",element)); 00481 return False; 00482 } 00483 DEBUG(11, ("element %d -> now SET\n", element)); 00484 break; 00485 case PDB_DEFAULT: 00486 default: 00487 if (!bitmap_clear(sampass->change_flags, element)) { 00488 DEBUG(0,("Can't set flag: %d in change_flags.\n",element)); 00489 return False; 00490 } 00491 if (!bitmap_clear(sampass->set_flags, element)) { 00492 DEBUG(0,("Can't set flag: %d in set_flags.\n",element)); 00493 return False; 00494 } 00495 DEBUG(11, ("element %d -> now DEFAULT\n", element)); 00496 break; 00497 } 00498 00499 return True; 00500 }
BOOL pdb_set_user_sid | ( | struct samu * | sampass, | |
const DOM_SID * | u_sid, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 502 行で定義されています。
参照先 pdb_set_init_flags()・PDB_USERSID・sid_copy()・sid_string_static()・samu::user_sid.
参照元 ldapsam_create_user()・make_server_info_info3()・new_user()・pdb_set_user_sid_from_rid()・pdb_set_user_sid_from_string()・samu_set_unix_internal()・set_user_info().
00503 { 00504 if (!u_sid) 00505 return False; 00506 00507 sid_copy(&sampass->user_sid, u_sid); 00508 00509 DEBUG(10, ("pdb_set_user_sid: setting user sid %s\n", 00510 sid_string_static(&sampass->user_sid))); 00511 00512 return pdb_set_init_flags(sampass, PDB_USERSID, flag); 00513 }
BOOL pdb_set_user_sid_from_string | ( | struct samu * | sampass, | |
fstring | u_sid, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 515 行で定義されています。
参照先 new_sid・pdb_set_user_sid()・string_to_sid().
参照元 init_sam_from_ldap().
00516 { 00517 DOM_SID new_sid; 00518 00519 if (!u_sid) 00520 return False; 00521 00522 DEBUG(10, ("pdb_set_user_sid_from_string: setting user sid %s\n", 00523 u_sid)); 00524 00525 if (!string_to_sid(&new_sid, u_sid)) { 00526 DEBUG(1, ("pdb_set_user_sid_from_string: %s isn't a valid SID!\n", u_sid)); 00527 return False; 00528 } 00529 00530 if (!pdb_set_user_sid(sampass, &new_sid, flag)) { 00531 DEBUG(1, ("pdb_set_user_sid_from_string: could not set sid %s on struct samu!\n", u_sid)); 00532 return False; 00533 } 00534 00535 return True; 00536 }
BOOL pdb_set_group_sid | ( | struct samu * | sampass, | |
const DOM_SID * | g_sid, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 546 行で定義されています。
参照先 get_global_sam_sid()・samu::group_sid・PDB_GROUPSID・pdb_set_init_flags()・sid_append_rid()・sid_copy()・sid_string_static()・sid_to_gid().
参照元 make_server_info_info3()・pdb_set_group_sid_from_rid()・samu_set_unix_internal().
00547 { 00548 gid_t gid; 00549 00550 if (!g_sid) 00551 return False; 00552 00553 if ( !(sampass->group_sid = TALLOC_P( sampass, DOM_SID )) ) { 00554 return False; 00555 } 00556 00557 /* if we cannot resolve the SID to gid, then just ignore it and 00558 store DOMAIN_USERS as the primary groupSID */ 00559 00560 if ( sid_to_gid( g_sid, &gid ) ) { 00561 sid_copy(sampass->group_sid, g_sid); 00562 } else { 00563 sid_copy( sampass->group_sid, get_global_sam_sid() ); 00564 sid_append_rid( sampass->group_sid, DOMAIN_GROUP_RID_USERS ); 00565 } 00566 00567 DEBUG(10, ("pdb_set_group_sid: setting group sid %s\n", 00568 sid_string_static(sampass->group_sid))); 00569 00570 return pdb_set_init_flags(sampass, PDB_GROUPSID, flag); 00571 }
BOOL pdb_set_username | ( | struct samu * | sampass, | |
const char * | username, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 577 行で定義されています。
参照先 pdb_set_init_flags()・PDB_USERNAME・talloc_strdup()・samu::username.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・ldapsam_create_user()・make_server_info_info3()・new_machine()・pdb_default_create_user()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info_21()・tdbsam_rename_sam_account().
00578 { 00579 if (username) { 00580 DEBUG(10, ("pdb_set_username: setting username %s, was %s\n", username, 00581 (sampass->username)?(sampass->username):"NULL")); 00582 00583 sampass->username = talloc_strdup(sampass, username); 00584 00585 if (!sampass->username) { 00586 DEBUG(0, ("pdb_set_username: talloc_strdup() failed!\n")); 00587 return False; 00588 } 00589 } else { 00590 sampass->username = PDB_NOT_QUITE_NULL; 00591 } 00592 00593 return pdb_set_init_flags(sampass, PDB_USERNAME, flag); 00594 }
BOOL pdb_set_domain | ( | struct samu * | sampass, | |
const char * | domain, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 600 行で定義されています。
参照先 samu::domain・PDB_DOMAIN・pdb_set_init_flags()・talloc_strdup().
参照元 init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・ldapsam_create_user()・make_server_info_info3()・reply_spnego_kerberos()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info().
00601 { 00602 if (domain) { 00603 DEBUG(10, ("pdb_set_domain: setting domain %s, was %s\n", domain, 00604 (sampass->domain)?(sampass->domain):"NULL")); 00605 00606 sampass->domain = talloc_strdup(sampass, domain); 00607 00608 if (!sampass->domain) { 00609 DEBUG(0, ("pdb_set_domain: talloc_strdup() failed!\n")); 00610 return False; 00611 } 00612 } else { 00613 sampass->domain = PDB_NOT_QUITE_NULL; 00614 } 00615 00616 return pdb_set_init_flags(sampass, PDB_DOMAIN, flag); 00617 }
BOOL pdb_set_nt_username | ( | struct samu * | sampass, | |
const char * | nt_username, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 623 行で定義されています。
参照先 samu::nt_username・PDB_NTUSERNAME・pdb_set_init_flags()・talloc_strdup().
参照元 init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・make_server_info_info3()・sam_account_from_delta().
00624 { 00625 if (nt_username) { 00626 DEBUG(10, ("pdb_set_nt_username: setting nt username %s, was %s\n", nt_username, 00627 (sampass->nt_username)?(sampass->nt_username):"NULL")); 00628 00629 sampass->nt_username = talloc_strdup(sampass, nt_username); 00630 00631 if (!sampass->nt_username) { 00632 DEBUG(0, ("pdb_set_nt_username: talloc_strdup() failed!\n")); 00633 return False; 00634 } 00635 } else { 00636 sampass->nt_username = PDB_NOT_QUITE_NULL; 00637 } 00638 00639 return pdb_set_init_flags(sampass, PDB_NTUSERNAME, flag); 00640 }
BOOL pdb_set_fullname | ( | struct samu * | sampass, | |
const char * | full_name, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 646 行で定義されています。
参照先 samu::full_name・PDB_FULLNAME・pdb_set_init_flags()・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・make_server_info_info3()・net_sam_set_fullname()・new_user()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info().
00647 { 00648 if (full_name) { 00649 DEBUG(10, ("pdb_set_full_name: setting full name %s, was %s\n", full_name, 00650 (sampass->full_name)?(sampass->full_name):"NULL")); 00651 00652 sampass->full_name = talloc_strdup(sampass, full_name); 00653 00654 if (!sampass->full_name) { 00655 DEBUG(0, ("pdb_set_fullname: talloc_strdup() failed!\n")); 00656 return False; 00657 } 00658 } else { 00659 sampass->full_name = PDB_NOT_QUITE_NULL; 00660 } 00661 00662 return pdb_set_init_flags(sampass, PDB_FULLNAME, flag); 00663 }
BOOL pdb_set_logon_script | ( | struct samu * | sampass, | |
const char * | logon_script, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 669 行で定義されています。
参照先 samu::logon_script・PDB_LOGONSCRIPT・pdb_set_init_flags()・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・make_server_info_info3()・net_sam_set_logonscript()・new_user()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info().
00670 { 00671 if (logon_script) { 00672 DEBUG(10, ("pdb_set_logon_script: setting logon script %s, was %s\n", logon_script, 00673 (sampass->logon_script)?(sampass->logon_script):"NULL")); 00674 00675 sampass->logon_script = talloc_strdup(sampass, logon_script); 00676 00677 if (!sampass->logon_script) { 00678 DEBUG(0, ("pdb_set_logon_script: talloc_strdup() failed!\n")); 00679 return False; 00680 } 00681 } else { 00682 sampass->logon_script = PDB_NOT_QUITE_NULL; 00683 } 00684 00685 return pdb_set_init_flags(sampass, PDB_LOGONSCRIPT, flag); 00686 }
BOOL pdb_set_profile_path | ( | struct samu * | sampass, | |
const char * | profile_path, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 692 行で定義されています。
参照先 PDB_PROFILE・pdb_set_init_flags()・samu::profile_path・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・make_server_info_info3()・net_sam_set_profilepath()・new_user()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info().
00693 { 00694 if (profile_path) { 00695 DEBUG(10, ("pdb_set_profile_path: setting profile path %s, was %s\n", profile_path, 00696 (sampass->profile_path)?(sampass->profile_path):"NULL")); 00697 00698 sampass->profile_path = talloc_strdup(sampass, profile_path); 00699 00700 if (!sampass->profile_path) { 00701 DEBUG(0, ("pdb_set_profile_path: talloc_strdup() failed!\n")); 00702 return False; 00703 } 00704 } else { 00705 sampass->profile_path = PDB_NOT_QUITE_NULL; 00706 } 00707 00708 return pdb_set_init_flags(sampass, PDB_PROFILE, flag); 00709 }
BOOL pdb_set_dir_drive | ( | struct samu * | sampass, | |
const char * | dir_drive, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 715 行で定義されています。
参照先 samu::dir_drive・PDB_DRIVE・pdb_set_init_flags()・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・make_server_info_info3()・net_sam_set_homedrive()・new_user()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info().
00716 { 00717 if (dir_drive) { 00718 DEBUG(10, ("pdb_set_dir_drive: setting dir drive %s, was %s\n", dir_drive, 00719 (sampass->dir_drive)?(sampass->dir_drive):"NULL")); 00720 00721 sampass->dir_drive = talloc_strdup(sampass, dir_drive); 00722 00723 if (!sampass->dir_drive) { 00724 DEBUG(0, ("pdb_set_dir_drive: talloc_strdup() failed!\n")); 00725 return False; 00726 } 00727 00728 } else { 00729 sampass->dir_drive = PDB_NOT_QUITE_NULL; 00730 } 00731 00732 return pdb_set_init_flags(sampass, PDB_DRIVE, flag); 00733 }
BOOL pdb_set_homedir | ( | struct samu * | sampass, | |
const char * | home_dir, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 739 行で定義されています。
参照先 samu::home_dir・pdb_set_init_flags()・PDB_SMBHOME・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・make_server_info_info3()・net_sam_set_homedir()・new_user()・sam_account_from_delta()・samu_set_unix_internal()・set_user_info().
00740 { 00741 if (home_dir) { 00742 DEBUG(10, ("pdb_set_homedir: setting home dir %s, was %s\n", home_dir, 00743 (sampass->home_dir)?(sampass->home_dir):"NULL")); 00744 00745 sampass->home_dir = talloc_strdup(sampass, home_dir); 00746 00747 if (!sampass->home_dir) { 00748 DEBUG(0, ("pdb_set_home_dir: talloc_strdup() failed!\n")); 00749 return False; 00750 } 00751 } else { 00752 sampass->home_dir = PDB_NOT_QUITE_NULL; 00753 } 00754 00755 return pdb_set_init_flags(sampass, PDB_SMBHOME, flag); 00756 }
BOOL pdb_set_acct_desc | ( | struct samu * | sampass, | |
const char * | acct_desc, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 762 行で定義されています。
参照先 samu::acct_desc・PDB_ACCTDESC・pdb_set_init_flags()・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・net_sam_set_comment()・sam_account_from_delta()・set_user_info().
00763 { 00764 if (acct_desc) { 00765 sampass->acct_desc = talloc_strdup(sampass, acct_desc); 00766 00767 if (!sampass->acct_desc) { 00768 DEBUG(0, ("pdb_set_acct_desc: talloc_strdup() failed!\n")); 00769 return False; 00770 } 00771 } else { 00772 sampass->acct_desc = PDB_NOT_QUITE_NULL; 00773 } 00774 00775 return pdb_set_init_flags(sampass, PDB_ACCTDESC, flag); 00776 }
BOOL pdb_set_workstations | ( | struct samu * | sampass, | |
const char * | workstations, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 782 行で定義されています。
参照先 pdb_set_init_flags()・PDB_WORKSTATIONS・talloc_strdup()・samu::workstations.
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・net_sam_set_workstations()・sam_account_from_delta().
00783 { 00784 if (workstations) { 00785 DEBUG(10, ("pdb_set_workstations: setting workstations %s, was %s\n", workstations, 00786 (sampass->workstations)?(sampass->workstations):"NULL")); 00787 00788 sampass->workstations = talloc_strdup(sampass, workstations); 00789 00790 if (!sampass->workstations) { 00791 DEBUG(0, ("pdb_set_workstations: talloc_strdup() failed!\n")); 00792 return False; 00793 } 00794 } else { 00795 sampass->workstations = PDB_NOT_QUITE_NULL; 00796 } 00797 00798 return pdb_set_init_flags(sampass, PDB_WORKSTATIONS, flag); 00799 }
BOOL pdb_set_comment | ( | struct samu * | sampass, | |
const char * | comment, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 804 行で定義されています。
参照先 samu::comment・PDB_COMMENT・pdb_set_init_flags()・talloc_strdup().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd().
00805 { 00806 if (comment) { 00807 sampass->comment = talloc_strdup(sampass, comment); 00808 00809 if (!sampass->comment) { 00810 DEBUG(0, ("pdb_set_comment: talloc_strdup() failed!\n")); 00811 return False; 00812 } 00813 } else { 00814 sampass->comment = PDB_NOT_QUITE_NULL; 00815 } 00816 00817 return pdb_set_init_flags(sampass, PDB_COMMENT, flag); 00818 }
BOOL pdb_set_munged_dial | ( | struct samu * | sampass, | |
const char * | munged_dial, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 824 行で定義されています。
参照先 samu::munged_dial・PDB_MUNGEDDIAL・pdb_set_init_flags()・talloc_strdup().
参照元 copy_id20_to_sam_passwd()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00825 { 00826 if (munged_dial) { 00827 sampass->munged_dial = talloc_strdup(sampass, munged_dial); 00828 00829 if (!sampass->munged_dial) { 00830 DEBUG(0, ("pdb_set_munged_dial: talloc_strdup() failed!\n")); 00831 return False; 00832 } 00833 } else { 00834 sampass->munged_dial = PDB_NOT_QUITE_NULL; 00835 } 00836 00837 return pdb_set_init_flags(sampass, PDB_MUNGEDDIAL, flag); 00838 }
BOOL pdb_set_nt_passwd | ( | struct samu * | sampass, | |
const uint8 | pwd[NT_HASH_LEN], | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 844 行で定義されています。
参照先 data_blob()・data_blob_clear_free()・data_blob_talloc()・samu::nt_pw・PDB_NTPASSWD・pdb_set_init_flags().
参照元 _net_srv_pwset()・change_lanman_password()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・pdb_set_plaintext_passwd()・sam_account_from_delta()・samr_clear_sam_passwd()・set_user_info_18().
00845 { 00846 data_blob_clear_free(&sampass->nt_pw); 00847 00848 if (pwd) { 00849 sampass->nt_pw = 00850 data_blob_talloc(sampass, pwd, NT_HASH_LEN); 00851 } else { 00852 sampass->nt_pw = data_blob(NULL, 0); 00853 } 00854 00855 return pdb_set_init_flags(sampass, PDB_NTPASSWD, flag); 00856 }
BOOL pdb_set_lanman_passwd | ( | struct samu * | sampass, | |
const uint8 | pwd[LM_HASH_LEN], | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 862 行で定義されています。
参照先 data_blob()・data_blob_clear_free()・data_blob_talloc()・samu::lm_pw・PDB_LMPASSWD・pdb_set_init_flags().
参照元 _net_srv_pwset()・change_lanman_password()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・pdb_set_plaintext_passwd()・sam_account_from_delta()・samr_clear_sam_passwd()・set_user_info_18().
00863 { 00864 data_blob_clear_free(&sampass->lm_pw); 00865 00866 /* on keep the password if we are allowing LANMAN authentication */ 00867 00868 if (pwd && lp_lanman_auth() ) { 00869 sampass->lm_pw = data_blob_talloc(sampass, pwd, LM_HASH_LEN); 00870 } else { 00871 sampass->lm_pw = data_blob(NULL, 0); 00872 } 00873 00874 return pdb_set_init_flags(sampass, PDB_LMPASSWD, flag); 00875 }
BOOL pdb_set_pw_history | ( | struct samu * | sampass, | |
const uint8 * | pwd, | |||
uint32 | historyLen, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 884 行で定義されています。
参照先 data_blob_talloc()・data_blob_::length・samu::nt_pw_his・PDB_PWHISTORY・pdb_set_init_flags().
参照元 init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・main()・pdb_set_plaintext_passwd().
00885 { 00886 if (historyLen && pwd){ 00887 sampass->nt_pw_his = data_blob_talloc(sampass, 00888 pwd, historyLen*PW_HISTORY_ENTRY_LEN); 00889 if (!sampass->nt_pw_his.length) { 00890 DEBUG(0, ("pdb_set_pw_history: data_blob_talloc() failed!\n")); 00891 return False; 00892 } 00893 } else { 00894 sampass->nt_pw_his = data_blob_talloc(sampass, NULL, 0); 00895 } 00896 00897 return pdb_set_init_flags(sampass, PDB_PWHISTORY, flag); 00898 }
BOOL pdb_set_plaintext_pw_only | ( | struct samu * | sampass, | |
const char * | password, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 905 行で定義されています。
参照先 PDB_PLAINTEXT_PW・pdb_set_init_flags()・samu::plaintext_pw・talloc_strdup().
参照元 pdb_set_plaintext_passwd().
00906 { 00907 if (password) { 00908 if (sampass->plaintext_pw!=NULL) 00909 memset(sampass->plaintext_pw,'\0',strlen(sampass->plaintext_pw)+1); 00910 00911 sampass->plaintext_pw = talloc_strdup(sampass, password); 00912 00913 if (!sampass->plaintext_pw) { 00914 DEBUG(0, ("pdb_set_unknown_str: talloc_strdup() failed!\n")); 00915 return False; 00916 } 00917 } else { 00918 sampass->plaintext_pw = NULL; 00919 } 00920 00921 return pdb_set_init_flags(sampass, PDB_PLAINTEXT_PW, flag); 00922 }
BOOL pdb_set_bad_password_count | ( | struct samu * | sampass, | |
uint16 | bad_password_count, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 924 行で定義されています。
参照先 samu::bad_password_count・PDB_BAD_PASSWORD_COUNT・pdb_set_init_flags().
参照元 check_sam_security()・copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・pdb_increment_bad_password_count()・pdb_update_autolock_flag()・pdb_update_bad_password_count()・sam_account_from_delta()・set_user_info().
00925 { 00926 sampass->bad_password_count = bad_password_count; 00927 return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_COUNT, flag); 00928 }
BOOL pdb_set_logon_count | ( | struct samu * | sampass, | |
uint16 | logon_count, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 930 行で定義されています。
参照先 samu::logon_count・PDB_LOGON_COUNT・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta().
00931 { 00932 sampass->logon_count = logon_count; 00933 return pdb_set_init_flags(sampass, PDB_LOGON_COUNT, flag); 00934 }
BOOL pdb_set_unknown_6 | ( | struct samu * | sampass, | |
uint32 | unkn, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 936 行で定義されています。
参照先 pdb_set_init_flags()・PDB_UNKNOWN6・samu::unknown_6.
参照元 init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・sam_account_from_delta().
00937 { 00938 sampass->unknown_6 = unkn; 00939 return pdb_set_init_flags(sampass, PDB_UNKNOWN6, flag); 00940 }
BOOL pdb_set_hours | ( | struct samu * | sampass, | |
const uint8 * | hours, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 942 行で定義されています。
参照先 samu::hours・PDB_HOURS・pdb_set_init_flags().
参照元 copy_id21_to_sam_passwd()・copy_id23_to_sam_passwd()・copy_id25_to_sam_passwd()・init_sam_from_buffer_v0()・init_sam_from_buffer_v1()・init_sam_from_buffer_v2()・init_sam_from_buffer_v3()・init_sam_from_ldap()・sam_account_from_delta()・set_user_info().
00943 { 00944 if (!hours) { 00945 memset ((char *)sampass->hours, 0, MAX_HOURS_LEN); 00946 } else { 00947 memcpy (sampass->hours, hours, MAX_HOURS_LEN); 00948 } 00949 00950 return pdb_set_init_flags(sampass, PDB_HOURS, flag); 00951 }
BOOL pdb_set_backend_private_data | ( | struct samu * | sampass, | |
void * | private_data, | |||
void(*)(void **) | free_fn, | |||
const struct pdb_methods * | my_methods, | |||
enum pdb_value_state | flag | |||
) |
pdb_get_set.c の 953 行で定義されています。
参照先 samu::backend_private_data・samu::backend_private_data_free_fn・samu::backend_private_methods・PDB_BACKEND_PRIVATE_DATA・pdb_set_init_flags().
参照元 ldapsam_getsampwnam()・ldapsam_getsampwsid()・ldapsam_update_sam_account()・pdb_nds_update_login_attempts().
00957 { 00958 if (sampass->backend_private_data && 00959 sampass->backend_private_data_free_fn) { 00960 sampass->backend_private_data_free_fn( 00961 &sampass->backend_private_data); 00962 } 00963 00964 sampass->backend_private_data = private_data; 00965 sampass->backend_private_data_free_fn = free_fn; 00966 sampass->backend_private_methods = my_methods; 00967 00968 return pdb_set_init_flags(sampass, PDB_BACKEND_PRIVATE_DATA, flag); 00969 }
pdb_get_set.c の 974 行で定義されています。
参照先 get_time_t_max()・PDB_CHANGED・pdb_set_pass_can_change_time().
参照元 _samr_set_sec_obj().
00975 { 00976 return pdb_set_pass_can_change_time(sampass, 00977 canchange ? 0 : get_time_t_max(), 00978 PDB_CHANGED); 00979 }
pdb_get_set.c の 987 行で定義されています。
参照先 E_deshash()・E_md4hash()・E_md5hash()・generate_random_buffer()・PDB_CHANGED・pdb_get_account_policy()・pdb_get_acct_ctrl()・pdb_get_pw_history()・pdb_set_lanman_passwd()・pdb_set_nt_passwd()・pdb_set_pass_last_set_time()・pdb_set_plaintext_pw_only()・pdb_set_pw_history().
参照元 change_oem_password()・local_password_change()・new_machine()・new_user()・set_user_info_23()・set_user_info_pw()・update_smbpassword_file().
00988 { 00989 uchar new_lanman_p16[LM_HASH_LEN]; 00990 uchar new_nt_p16[NT_HASH_LEN]; 00991 00992 if (!plaintext) 00993 return False; 00994 00995 /* Calculate the MD4 hash (NT compatible) of the password */ 00996 E_md4hash(plaintext, new_nt_p16); 00997 00998 if (!pdb_set_nt_passwd (sampass, new_nt_p16, PDB_CHANGED)) 00999 return False; 01000 01001 if (!E_deshash(plaintext, new_lanman_p16)) { 01002 /* E_deshash returns false for 'long' passwords (> 14 01003 DOS chars). This allows us to match Win2k, which 01004 does not store a LM hash for these passwords (which 01005 would reduce the effective password length to 14 */ 01006 01007 if (!pdb_set_lanman_passwd (sampass, NULL, PDB_CHANGED)) 01008 return False; 01009 } else { 01010 if (!pdb_set_lanman_passwd (sampass, new_lanman_p16, PDB_CHANGED)) 01011 return False; 01012 } 01013 01014 if (!pdb_set_plaintext_pw_only (sampass, plaintext, PDB_CHANGED)) 01015 return False; 01016 01017 if (!pdb_set_pass_last_set_time (sampass, time(NULL), PDB_CHANGED)) 01018 return False; 01019 01020 /* Store the password history. */ 01021 if (pdb_get_acct_ctrl(sampass) & ACB_NORMAL) { 01022 uchar *pwhistory; 01023 uint32 pwHistLen; 01024 pdb_get_account_policy(AP_PASSWORD_HISTORY, &pwHistLen); 01025 if (pwHistLen != 0){ 01026 uint32 current_history_len; 01027 /* We need to make sure we don't have a race condition here - the 01028 account policy history length can change between when the pw_history 01029 was first loaded into the struct samu struct and now.... JRA. */ 01030 pwhistory = (uchar *)pdb_get_pw_history(sampass, ¤t_history_len); 01031 01032 if (current_history_len != pwHistLen) { 01033 /* After closing and reopening struct samu the history 01034 values will sync up. We can't do this here. */ 01035 01036 /* current_history_len > pwHistLen is not a problem - we 01037 have more history than we need. */ 01038 01039 if (current_history_len < pwHistLen) { 01040 /* Ensure we have space for the needed history. */ 01041 uchar *new_history = (uchar *)TALLOC(sampass, 01042 pwHistLen*PW_HISTORY_ENTRY_LEN); 01043 if (!new_history) { 01044 return False; 01045 } 01046 01047 /* And copy it into the new buffer. */ 01048 if (current_history_len) { 01049 memcpy(new_history, pwhistory, 01050 current_history_len*PW_HISTORY_ENTRY_LEN); 01051 } 01052 /* Clearing out any extra space. */ 01053 memset(&new_history[current_history_len*PW_HISTORY_ENTRY_LEN], 01054 '\0', (pwHistLen-current_history_len)*PW_HISTORY_ENTRY_LEN); 01055 /* Finally replace it. */ 01056 pwhistory = new_history; 01057 } 01058 } 01059 if (pwhistory && pwHistLen){ 01060 /* Make room for the new password in the history list. */ 01061 if (pwHistLen > 1) { 01062 memmove(&pwhistory[PW_HISTORY_ENTRY_LEN], 01063 pwhistory, (pwHistLen -1)*PW_HISTORY_ENTRY_LEN ); 01064 } 01065 /* Create the new salt as the first part of the history entry. */ 01066 generate_random_buffer(pwhistory, PW_HISTORY_SALT_LEN); 01067 01068 /* Generate the md5 hash of the salt+new password as the second 01069 part of the history entry. */ 01070 01071 E_md5hash(pwhistory, new_nt_p16, &pwhistory[PW_HISTORY_SALT_LEN]); 01072 pdb_set_pw_history(sampass, pwhistory, pwHistLen, PDB_CHANGED); 01073 } else { 01074 DEBUG (10,("pdb_get_set.c: pdb_set_plaintext_passwd: pwhistory was NULL!\n")); 01075 } 01076 } else { 01077 /* Set the history length to zero. */ 01078 pdb_set_pw_history(sampass, NULL, 0, PDB_CHANGED); 01079 } 01080 } 01081 01082 return True; 01083 }
uint32 pdb_build_fields_present | ( | struct samu * | sampass | ) |