diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-05-21 10:38:04 +1000 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-21 10:24:55 +0200 |
commit | a92b653af964364ee438c6ee69a87eb7603ceab0 (patch) | |
tree | f4b97ac212fb19706b5fc89d7c5061b707f74a41 /source3 | |
parent | c8a23147fe12c693fd7944af7bb09b88393789d9 (diff) | |
download | samba-a92b653af964364ee438c6ee69a87eb7603ceab0.tar.gz samba-a92b653af964364ee438c6ee69a87eb7603ceab0.tar.xz samba-a92b653af964364ee438c6ee69a87eb7603ceab0.zip |
s3:passdb Remove use of uint8 uint16 and uint32 in favour of C99 types
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/passdb.h | 60 | ||||
-rw-r--r-- | source3/include/proto.h | 114 | ||||
-rw-r--r-- | source3/lib/time.c | 4 | ||||
-rw-r--r-- | source3/passdb/passdb.c | 206 | ||||
-rw-r--r-- | source3/passdb/pdb_get_set.c | 40 | ||||
-rw-r--r-- | source3/passdb/pdb_interface.c | 82 | ||||
-rw-r--r-- | source3/passdb/pdb_ldap.c | 120 | ||||
-rw-r--r-- | source3/passdb/pdb_smbpasswd.c | 10 | ||||
-rw-r--r-- | source3/utils/pdbedit.c | 12 |
9 files changed, 324 insertions, 324 deletions
diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 1d0f5c1abff..860eff9b20f 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -104,8 +104,8 @@ enum pdb_value_state { /* cache for bad password lockout data, to be used on replicated SAMs */ struct login_cache { time_t entry_timestamp; - uint32 acct_ctrl; - uint16 bad_password_count; + uint32_t acct_ctrl; + uint16_t bad_password_count; time_t bad_password_time; }; @@ -153,18 +153,18 @@ struct samu { DATA_BLOB nt_pw_his; /* nt hashed password history .data is Null if not available */ char* plaintext_pw; /* is Null if not available */ - uint32 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - uint32 fields_present; /* 0x00ff ffff */ + uint32_t acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32_t fields_present; /* 0x00ff ffff */ - uint16 logon_divs; /* 168 - number of hours in a week */ - uint32 hours_len; /* normally 21 bytes */ - uint8 hours[MAX_HOURS_LEN]; + uint16_t logon_divs; /* 168 - number of hours in a week */ + uint32_t hours_len; /* normally 21 bytes */ + uint8_t hours[MAX_HOURS_LEN]; /* Was unknown_5. */ - uint16 bad_password_count; - uint16 logon_count; + uint16_t bad_password_count; + uint16_t logon_count; - uint32 unknown_6; /* 0x0000 04ec */ + uint32_t unknown_6; /* 0x0000 04ec */ /* a tag for who added the private methods */ @@ -180,13 +180,13 @@ struct samu { struct acct_info { fstring acct_name; /* account name */ fstring acct_desc; /* account name */ - uint32 rid; /* domain-relative RID */ + uint32_t rid; /* domain-relative RID */ }; struct samr_displayentry { - uint32 idx; - uint32 rid; - uint32 acct_flags; + uint32_t idx; + uint32_t rid; + uint32_t acct_flags; const char *account_name; const char *fullname; const char *description; @@ -201,7 +201,7 @@ enum pdb_search_type { struct pdb_search { enum pdb_search_type type; struct samr_displayentry *cache; - uint32 num_entries; + uint32_t num_entries; ssize_t cache_size; bool search_ended; void *private_data; @@ -249,7 +249,7 @@ enum pdb_policy_type { * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in * the pdb module. Remove the latter, this might happen more often. VL. * changed to version 14 to move lookup_rids and lookup_names to return - * enum lsa_SidType rather than uint32. + * enum lsa_SidType rather than uint32_t. * Changed to 16 for access to the trusted domain passwords (obnox). * Changed to 17, the sampwent interface is gone. * Changed to 18, pdb_rid_algorithm -> pdb_capabilities @@ -270,8 +270,8 @@ struct pdb_methods NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid); NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, - const char *name, uint32 acct_flags, - uint32 *rid); + const char *name, uint32_t acct_flags, + uint32_t *rid); NTSTATUS (*delete_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, struct samu *sam_acct); @@ -294,10 +294,10 @@ struct pdb_methods NTSTATUS (*create_dom_group)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const char *name, - uint32 *rid); + uint32_t *rid); NTSTATUS (*delete_dom_group)(struct pdb_methods *methods, - TALLOC_CTX *mem_ctx, uint32 rid); + TALLOC_CTX *mem_ctx, uint32_t rid); NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, GROUP_MAP *map); @@ -316,7 +316,7 @@ struct pdb_methods NTSTATUS (*enum_group_members)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *group, - uint32 **pp_member_rids, + uint32_t **pp_member_rids, size_t *p_num_members); NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, @@ -331,14 +331,14 @@ struct pdb_methods NTSTATUS (*add_groupmem)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 group_rid, uint32 member_rid); + uint32_t group_rid, uint32_t member_rid); NTSTATUS (*del_groupmem)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 group_rid, uint32 member_rid); + uint32_t group_rid, uint32_t member_rid); NTSTATUS (*create_alias)(struct pdb_methods *methods, - const char *name, uint32 *rid); + const char *name, uint32_t *rid); NTSTATUS (*delete_alias)(struct pdb_methods *methods, const DOM_SID *sid); @@ -363,13 +363,13 @@ struct pdb_methods const DOM_SID *domain_sid, const DOM_SID *members, size_t num_members, - uint32 **pp_alias_rids, + uint32_t **pp_alias_rids, size_t *p_num_alias_rids); NTSTATUS (*lookup_rids)(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_rids, - uint32 *rids, + uint32_t *rids, const char **pp_names, enum lsa_SidType *attrs); @@ -377,7 +377,7 @@ struct pdb_methods const DOM_SID *domain_sid, int num_names, const char **pp_names, - uint32 *rids, + uint32_t *rids, enum lsa_SidType *attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, @@ -392,7 +392,7 @@ struct pdb_methods bool (*search_users)(struct pdb_methods *methods, struct pdb_search *search, - uint32 acct_flags); + uint32_t acct_flags); bool (*search_groups)(struct pdb_methods *methods, struct pdb_search *search); bool (*search_aliases)(struct pdb_methods *methods, @@ -407,7 +407,7 @@ struct pdb_methods union unid_t *id, enum lsa_SidType *type); uint32_t (*capabilities)(struct pdb_methods *methods); - bool (*new_rid)(struct pdb_methods *methods, uint32 *rid); + bool (*new_rid)(struct pdb_methods *methods, uint32_t *rid); bool (*get_trusteddom_pw)(struct pdb_methods *methods, @@ -419,7 +419,7 @@ struct pdb_methods bool (*del_trusteddom_pw)(struct pdb_methods *methods, const char *domain); NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods, - TALLOC_CTX *mem_ctx, uint32 *num_domains, + TALLOC_CTX *mem_ctx, uint32_t *num_domains, struct trustdom_info ***domains); void *private_data; /* Private data of some kind */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 1586592290d..da5cb0a6077 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1049,8 +1049,8 @@ void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset); time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset); time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset); time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset); -uint32 convert_time_t_to_uint32(time_t t); -time_t convert_uint32_to_time_t(uint32 u); +uint32_t convert_time_t_to_uint32_t(time_t t); +time_t convert_uint32_t_to_time_t(uint32_t u); bool nt_time_is_zero(const NTTIME *nt); time_t generalized_to_unix_time(const char *str); int get_server_zone_offset(void); @@ -4354,20 +4354,20 @@ const char *my_sam_name(void); struct samu *samu_new( TALLOC_CTX *ctx ); NTSTATUS samu_set_unix(struct samu *user, const struct passwd *pwd); NTSTATUS samu_alloc_rid_unix(struct samu *user, const struct passwd *pwd); -char *pdb_encode_acct_ctrl(uint32 acct_ctrl, size_t length); -uint32 pdb_decode_acct_ctrl(const char *p); -void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32 acct_ctrl); +char *pdb_encode_acct_ctrl(uint32_t acct_ctrl, size_t length); +uint32_t pdb_decode_acct_ctrl(const char *p); +void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32_t acct_ctrl); bool pdb_gethexpwd(const char *p, unsigned char *pwd); void pdb_sethexhours(char *p, const unsigned char *hours); bool pdb_gethexhours(const char *p, unsigned char *hours); int algorithmic_rid_base(void); -uid_t algorithmic_pdb_user_rid_to_uid(uint32 user_rid); +uid_t algorithmic_pdb_user_rid_to_uid(uint32_t user_rid); uid_t max_algorithmic_uid(void); -uint32 algorithmic_pdb_uid_to_user_rid(uid_t uid); -gid_t pdb_group_rid_to_gid(uint32 group_rid); +uint32_t algorithmic_pdb_uid_to_user_rid(uid_t uid); +gid_t pdb_group_rid_to_gid(uint32_t group_rid); gid_t max_algorithmic_gid(void); -uint32 algorithmic_pdb_gid_to_group_rid(gid_t gid); -bool algorithmic_pdb_rid_is_user(uint32 rid); +uint32_t algorithmic_pdb_gid_to_group_rid(gid_t gid); +bool algorithmic_pdb_rid_is_user(uint32_t rid); bool lookup_global_sam_name(const char *name, int flags, uint32_t *rid, enum lsa_SidType *type); NTSTATUS local_password_change(const char *user_name, @@ -4376,8 +4376,8 @@ NTSTATUS local_password_change(const char *user_name, char **pp_err_str, char **pp_msg_str); bool init_samu_from_buffer(struct samu *sampass, uint32_t level, - uint8 *buf, uint32 buflen); -uint32 init_buffer_from_samu (uint8 **buf, struct samu *sampass, bool size_only); + uint8_t *buf, uint32_t buflen); +uint32_t init_buffer_from_samu (uint8_t **buf, struct samu *sampass, bool size_only); bool pdb_copy_sam_account(struct samu *dst, struct samu *src ); bool pdb_update_bad_password_count(struct samu *sampass, bool *updated); bool pdb_update_autolock_flag(struct samu *sampass, bool *updated); @@ -4386,20 +4386,20 @@ bool is_dc_trusted_domain_situation(const char *domain_name); bool get_trust_pw_clear(const char *domain, char **ret_pwd, const char **account_name, enum netr_SchannelType *channel); -bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16], +bool get_trust_pw_hash(const char *domain, uint8_t ret_pwd[16], const char **account_name, enum netr_SchannelType *channel); /* The following definitions come from passdb/pdb_compat.c */ -uint32 pdb_get_user_rid (const struct samu *sampass); -uint32 pdb_get_group_rid (struct samu *sampass); -bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag); -bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag); +uint32_t pdb_get_user_rid (const struct samu *sampass); +uint32_t pdb_get_group_rid (struct samu *sampass); +bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32_t rid, enum pdb_value_state flag); +bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32_t grid, enum pdb_value_state flag); /* The following definitions come from passdb/pdb_get_set.c */ -uint32 pdb_get_acct_ctrl(const struct samu *sampass); +uint32_t 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); @@ -4409,12 +4409,12 @@ 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); +uint16_t pdb_get_logon_divs(const struct samu *sampass); +uint32_t pdb_get_hours_len(const struct samu *sampass); +const uint8_t *pdb_get_hours(const struct samu *sampass); +const uint8_t *pdb_get_nt_passwd(const struct samu *sampass); +const uint8_t *pdb_get_lanman_passwd(const struct samu *sampass); +const uint8_t *pdb_get_pw_history(const struct samu *sampass, uint32_t *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); @@ -4431,11 +4431,11 @@ 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); +uint16_t pdb_get_bad_password_count(const struct samu *sampass); +uint16_t pdb_get_logon_count(const struct samu *sampass); +uint32_t 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_acct_ctrl(struct samu *sampass, uint32_t 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); @@ -4443,8 +4443,8 @@ bool pdb_set_bad_password_time(struct samu *sampass, time_t mytime, enum pdb_val 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_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag); +bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag); bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag); 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); @@ -4461,21 +4461,21 @@ bool pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_val 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_nt_passwd(struct samu *sampass, const uint8_t pwd[NT_HASH_LEN], enum pdb_value_state flag); +bool pdb_set_lanman_passwd(struct samu *sampass, const uint8_t pwd[LM_HASH_LEN], enum pdb_value_state flag); +bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t 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_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag); +bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag); +bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag); +bool pdb_set_hours(struct samu *sampass, const uint8_t *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_t pdb_build_fields_present(struct samu *sampass); /* The following definitions come from passdb/pdb_interface.c */ @@ -4486,8 +4486,8 @@ NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx); bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ; bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ; -NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags, - uint32 *rid); +NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags, + uint32_t *rid); NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct); NTSTATUS pdb_add_sam_account(struct samu *sam_acct) ; NTSTATUS pdb_update_sam_account(struct samu *sam_acct) ; @@ -4498,8 +4498,8 @@ bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid); bool pdb_getgrgid(GROUP_MAP *map, gid_t gid); bool pdb_getgrnam(GROUP_MAP *map, const char *name); NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, - uint32 *rid); -NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32 rid); + uint32_t *rid); +NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid); NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map); NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map); NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid); @@ -4507,17 +4507,17 @@ bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, G size_t *p_num_entries, bool unix_only); NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - uint32 **pp_member_rids, + uint32_t **pp_member_rids, size_t *p_num_members); NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user, DOM_SID **pp_sids, gid_t **pp_gids, size_t *p_num_groups); NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user); -NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid, - uint32 member_rid); -NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid, - uint32 member_rid); -NTSTATUS pdb_create_alias(const char *name, uint32 *rid); +NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, + uint32_t member_rid); +NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, + uint32_t member_rid); +NTSTATUS pdb_create_alias(const char *name, uint32_t *rid); NTSTATUS pdb_delete_alias(const DOM_SID *sid); NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info); NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info); @@ -4528,17 +4528,17 @@ NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, const DOM_SID *members, size_t num_members, - uint32 **pp_alias_rids, + uint32_t **pp_alias_rids, size_t *p_num_alias_rids); NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid, int num_rids, - uint32 *rids, + uint32_t *rids, const char **names, enum lsa_SidType *attrs); NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, int num_names, const char **names, - uint32 *rids, + uint32_t *rids, enum lsa_SidType *attrs); bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value); bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value); @@ -4548,22 +4548,22 @@ bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid); bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id, enum lsa_SidType *type); uint32_t pdb_capabilities(void); -bool pdb_new_rid(uint32 *rid); +bool pdb_new_rid(uint32_t *rid); bool initialize_password_db(bool reload, struct event_context *event_ctx); struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx, enum pdb_search_type type); -struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32 acct_flags); +struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags); struct pdb_search *pdb_search_groups(TALLOC_CTX *mem_ctx); struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid); -uint32 pdb_search_entries(struct pdb_search *search, - uint32 start_idx, uint32 max_entries, +uint32_t pdb_search_entries(struct pdb_search *search, + uint32_t start_idx, uint32_t max_entries, struct samr_displayentry **result); bool pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid, time_t *pass_last_set_time); bool pdb_set_trusteddom_pw(const char* domain, const char* pwd, const DOM_SID *sid); bool pdb_del_trusteddom_pw(const char *domain); -NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32 *num_domains, +NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains, struct trustdom_info ***domains); NTSTATUS make_pdb_method( struct pdb_methods **methods ) ; @@ -4602,7 +4602,7 @@ NTSTATUS pdb_wbc_sam_init(void); /* The following definitions come from passdb/pdb_tdb.c */ -bool init_sam_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen); +bool init_sam_from_buffer_v2(struct samu *sampass, uint8_t *buf, uint32_t buflen); NTSTATUS pdb_tdbsam_init(void); /* The following definitions come from passdb/secrets.c */ diff --git a/source3/lib/time.c b/source3/lib/time.c index b965479957a..3a43a5b6cd9 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -50,7 +50,7 @@ NTTIME nttime_from_string(const char *s) preserve the "special" values. **************************************************************/ -uint32_t convert_time_t_to_uint32(time_t t) +uint32_t convert_time_t_to_uint32_t(time_t t) { #if (defined(SIZEOF_TIME_T) && (SIZEOF_TIME_T == 8)) /* time_t is 64-bit. */ @@ -63,7 +63,7 @@ uint32_t convert_time_t_to_uint32(time_t t) return (uint32_t)t; } -time_t convert_uint32_to_time_t(uint32_t u) +time_t convert_uint32_t_to_time_t(uint32_t u) { #if (defined(SIZEOF_TIME_T) && (SIZEOF_TIME_T == 8)) /* time_t is 64-bit. */ diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 08488f13c97..b6b3c530f88 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -145,7 +145,7 @@ static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *p const char *guest_account = lp_guestaccount(); const char *domain = global_myname(); char *fullname; - uint32 urid; + uint32_t urid; if ( !pwd ) { return NT_STATUS_NO_SUCH_USER; @@ -241,7 +241,7 @@ static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *p netr_SamInfo3 structure) */ if ( create && (pdb_capabilities() & PDB_CAP_STORE_RIDS)) { - uint32 user_rid; + uint32_t user_rid; DOM_SID user_sid; if ( !pdb_new_rid( &user_rid ) ) { @@ -371,7 +371,7 @@ uint32_t pdb_decode_acct_ctrl(const char *p) Routine to set 32 hex password characters from a 16 byte array. **************************************************************/ -void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32 acct_ctrl) +void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32_t acct_ctrl) { if (pwd != NULL) { int i; @@ -495,7 +495,7 @@ int algorithmic_rid_base(void) Converts NT user RID to a UNIX uid. ********************************************************************/ -uid_t algorithmic_pdb_user_rid_to_uid(uint32 user_rid) +uid_t algorithmic_pdb_user_rid_to_uid(uint32_t user_rid) { int rid_offset = algorithmic_rid_base(); return (uid_t)(((user_rid & (~USER_RID_TYPE)) - rid_offset)/RID_MULTIPLIER); @@ -510,17 +510,17 @@ uid_t max_algorithmic_uid(void) converts UNIX uid to an NT User RID. ********************************************************************/ -uint32 algorithmic_pdb_uid_to_user_rid(uid_t uid) +uint32_t algorithmic_pdb_uid_to_user_rid(uid_t uid) { int rid_offset = algorithmic_rid_base(); - return (((((uint32)uid)*RID_MULTIPLIER) + rid_offset) | USER_RID_TYPE); + return (((((uint32_t)uid)*RID_MULTIPLIER) + rid_offset) | USER_RID_TYPE); } /******************************************************************* Converts NT group RID to a UNIX gid. ********************************************************************/ -gid_t pdb_group_rid_to_gid(uint32 group_rid) +gid_t pdb_group_rid_to_gid(uint32_t group_rid) { int rid_offset = algorithmic_rid_base(); return (gid_t)(((group_rid & (~GROUP_RID_TYPE))- rid_offset)/RID_MULTIPLIER); @@ -539,17 +539,17 @@ gid_t max_algorithmic_gid(void) there is not anymore a direct link between the gid and the rid. ********************************************************************/ -uint32 algorithmic_pdb_gid_to_group_rid(gid_t gid) +uint32_t algorithmic_pdb_gid_to_group_rid(gid_t gid) { int rid_offset = algorithmic_rid_base(); - return (((((uint32)gid)*RID_MULTIPLIER) + rid_offset) | GROUP_RID_TYPE); + return (((((uint32_t)gid)*RID_MULTIPLIER) + rid_offset) | GROUP_RID_TYPE); } /******************************************************************* Decides if a RID is a well known RID. ********************************************************************/ -static bool rid_is_well_known(uint32 rid) +static bool rid_is_well_known(uint32_t rid) { /* Not using rid_offset here, because this is the actual NT fixed value (1000) */ @@ -561,7 +561,7 @@ static bool rid_is_well_known(uint32 rid) Decides if a RID is a user or group RID. ********************************************************************/ -bool algorithmic_pdb_rid_is_user(uint32 rid) +bool algorithmic_pdb_rid_is_user(uint32_t rid) { if ( rid_is_well_known(rid) ) { /* @@ -925,13 +925,13 @@ done: /********************************************************************* *********************************************************************/ -static bool init_samu_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_samu_from_buffer_v0(struct samu *sampass, uint8_t *buf, uint32_t buflen) { /* times are stored as 32bit integer take care on system with 64bit wide time_t --SSS */ - uint32 logon_time, + uint32_t logon_time, logoff_time, kickoff_time, pass_last_set_time, @@ -949,18 +949,18 @@ static bool init_samu_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 bu char *profile_path = NULL; char *acct_desc = NULL; char *workstations = NULL; - uint32 username_len, domain_len, nt_username_len, + uint32_t username_len, domain_len, nt_username_len, dir_drive_len, unknown_str_len, munged_dial_len, fullname_len, homedir_len, logon_script_len, profile_path_len, acct_desc_len, workstations_len; - uint32 user_rid, group_rid, remove_me, hours_len, unknown_6; - uint16 acct_ctrl, logon_divs; - uint16 bad_password_count, logon_count; - uint8 *hours = NULL; - uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL; - uint32 len = 0; - uint32 lm_pw_len, nt_pw_len, hourslen; + uint32_t user_rid, group_rid, remove_me, hours_len, unknown_6; + uint16_t acct_ctrl, logon_divs; + uint16_t bad_password_count, logon_count; + uint8_t *hours = NULL; + uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL; + uint32_t len = 0; + uint32_t lm_pw_len, nt_pw_len, hourslen; bool ret = True; if(sampass == NULL || buf == NULL) { @@ -1003,7 +1003,7 @@ static bool init_samu_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 bu &logon_count, /* w */ &unknown_6); /* d */ - if (len == (uint32) -1) { + if (len == (uint32_t) -1) { ret = False; goto done; } @@ -1110,13 +1110,13 @@ done: /********************************************************************* *********************************************************************/ -static bool init_samu_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_samu_from_buffer_v1(struct samu *sampass, uint8_t *buf, uint32_t buflen) { /* times are stored as 32bit integer take care on system with 64bit wide time_t --SSS */ - uint32 logon_time, + uint32_t logon_time, logoff_time, kickoff_time, bad_password_time, @@ -1135,18 +1135,18 @@ static bool init_samu_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 bu char *profile_path = NULL; char *acct_desc = NULL; char *workstations = NULL; - uint32 username_len, domain_len, nt_username_len, + uint32_t username_len, domain_len, nt_username_len, dir_drive_len, unknown_str_len, munged_dial_len, fullname_len, homedir_len, logon_script_len, profile_path_len, acct_desc_len, workstations_len; - uint32 user_rid, group_rid, remove_me, hours_len, unknown_6; - uint16 acct_ctrl, logon_divs; - uint16 bad_password_count, logon_count; - uint8 *hours = NULL; - uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL; - uint32 len = 0; - uint32 lm_pw_len, nt_pw_len, hourslen; + uint32_t user_rid, group_rid, remove_me, hours_len, unknown_6; + uint16_t acct_ctrl, logon_divs; + uint16_t bad_password_count, logon_count; + uint8_t *hours = NULL; + uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL; + uint32_t len = 0; + uint32_t lm_pw_len, nt_pw_len, hourslen; bool ret = True; if(sampass == NULL || buf == NULL) { @@ -1191,7 +1191,7 @@ static bool init_samu_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 bu &logon_count, /* w */ &unknown_6); /* d */ - if (len == (uint32) -1) { + if (len == (uint32_t) -1) { ret = False; goto done; } @@ -1299,13 +1299,13 @@ done: return ret; } -static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_samu_from_buffer_v2(struct samu *sampass, uint8_t *buf, uint32_t buflen) { /* times are stored as 32bit integer take care on system with 64bit wide time_t --SSS */ - uint32 logon_time, + uint32_t logon_time, logoff_time, kickoff_time, bad_password_time, @@ -1324,19 +1324,19 @@ static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 bu char *profile_path = NULL; char *acct_desc = NULL; char *workstations = NULL; - uint32 username_len, domain_len, nt_username_len, + uint32_t username_len, domain_len, nt_username_len, dir_drive_len, unknown_str_len, munged_dial_len, fullname_len, homedir_len, logon_script_len, profile_path_len, acct_desc_len, workstations_len; - uint32 user_rid, group_rid, hours_len, unknown_6; - uint16 acct_ctrl, logon_divs; - uint16 bad_password_count, logon_count; - uint8 *hours = NULL; - uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL; - uint32 len = 0; - uint32 lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen; - uint32 pwHistLen = 0; + uint32_t user_rid, group_rid, hours_len, unknown_6; + uint16_t acct_ctrl, logon_divs; + uint16_t bad_password_count, logon_count; + uint8_t *hours = NULL; + uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL; + uint32_t len = 0; + uint32_t lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen; + uint32_t pwHistLen = 0; bool ret = True; fstring tmp_string; bool expand_explicit = lp_passdb_expand_explicit(); @@ -1384,7 +1384,7 @@ static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 bu &logon_count, /* w */ &unknown_6); /* d */ - if (len == (uint32) -1) { + if (len == (uint32_t) -1) { ret = False; goto done; } @@ -1473,7 +1473,7 @@ static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 bu /* Change from V1 is addition of password history field. */ pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen); if (pwHistLen) { - uint8 *pw_hist = SMB_MALLOC_ARRAY(uint8, pwHistLen * PW_HISTORY_ENTRY_LEN); + uint8_t *pw_hist = SMB_MALLOC_ARRAY(uint8_t, pwHistLen * PW_HISTORY_ENTRY_LEN); if (!pw_hist) { ret = False; goto done; @@ -1534,13 +1534,13 @@ done: /********************************************************************* *********************************************************************/ -static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_samu_from_buffer_v3(struct samu *sampass, uint8_t *buf, uint32_t buflen) { /* times are stored as 32bit integer take care on system with 64bit wide time_t --SSS */ - uint32 logon_time, + uint32_t logon_time, logoff_time, kickoff_time, bad_password_time, @@ -1559,19 +1559,19 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu char *profile_path = NULL; char *acct_desc = NULL; char *workstations = NULL; - uint32 username_len, domain_len, nt_username_len, + uint32_t username_len, domain_len, nt_username_len, dir_drive_len, comment_len, munged_dial_len, fullname_len, homedir_len, logon_script_len, profile_path_len, acct_desc_len, workstations_len; - uint32 user_rid, group_rid, hours_len, unknown_6, acct_ctrl; - uint16 logon_divs; - uint16 bad_password_count, logon_count; - uint8 *hours = NULL; - uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL; - uint32 len = 0; - uint32 lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen; - uint32 pwHistLen = 0; + uint32_t user_rid, group_rid, hours_len, unknown_6, acct_ctrl; + uint16_t logon_divs; + uint16_t bad_password_count, logon_count; + uint8_t *hours = NULL; + uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL; + uint32_t len = 0; + uint32_t lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen; + uint32_t pwHistLen = 0; bool ret = True; fstring tmp_string; bool expand_explicit = lp_passdb_expand_explicit(); @@ -1610,7 +1610,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu &nt_pw_len, &nt_pw_ptr, /* B */ /* Change from V1 is addition of password history field. */ &nt_pw_hist_len, &nt_pw_hist_ptr, /* B */ - /* Change from V2 is the uint32 acb_mask */ + /* Change from V2 is the uint32_t acb_mask */ &acct_ctrl, /* d */ /* Also "remove_me" field was removed. */ &logon_divs, /* w */ @@ -1620,18 +1620,18 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu &logon_count, /* w */ &unknown_6); /* d */ - if (len == (uint32) -1) { + if (len == (uint32_t) -1) { ret = False; goto done; } - pdb_set_logon_time(sampass, convert_uint32_to_time_t(logon_time), PDB_SET); - pdb_set_logoff_time(sampass, convert_uint32_to_time_t(logoff_time), PDB_SET); - pdb_set_kickoff_time(sampass, convert_uint32_to_time_t(kickoff_time), PDB_SET); - pdb_set_bad_password_time(sampass, convert_uint32_to_time_t(bad_password_time), PDB_SET); - pdb_set_pass_can_change_time(sampass, convert_uint32_to_time_t(pass_can_change_time), PDB_SET); - pdb_set_pass_must_change_time(sampass, convert_uint32_to_time_t(pass_must_change_time), PDB_SET); - pdb_set_pass_last_set_time(sampass, convert_uint32_to_time_t(pass_last_set_time), PDB_SET); + pdb_set_logon_time(sampass, convert_uint32_t_to_time_t(logon_time), PDB_SET); + pdb_set_logoff_time(sampass, convert_uint32_t_to_time_t(logoff_time), PDB_SET); + pdb_set_kickoff_time(sampass, convert_uint32_t_to_time_t(kickoff_time), PDB_SET); + pdb_set_bad_password_time(sampass, convert_uint32_t_to_time_t(bad_password_time), PDB_SET); + pdb_set_pass_can_change_time(sampass, convert_uint32_t_to_time_t(pass_can_change_time), PDB_SET); + pdb_set_pass_must_change_time(sampass, convert_uint32_t_to_time_t(pass_must_change_time), PDB_SET); + pdb_set_pass_last_set_time(sampass, convert_uint32_t_to_time_t(pass_last_set_time), PDB_SET); pdb_set_username(sampass, username, PDB_SET); pdb_set_domain(sampass, domain, PDB_SET); @@ -1708,7 +1708,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen); if (pwHistLen) { - uint8 *pw_hist = (uint8 *)SMB_MALLOC(pwHistLen * PW_HISTORY_ENTRY_LEN); + uint8_t *pw_hist = (uint8_t *)SMB_MALLOC(pwHistLen * PW_HISTORY_ENTRY_LEN); if (!pw_hist) { ret = False; goto done; @@ -1739,7 +1739,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu pdb_set_bad_password_count(sampass, bad_password_count, PDB_SET); pdb_set_logon_count(sampass, logon_count, PDB_SET); pdb_set_unknown_6(sampass, unknown_6, PDB_SET); - /* Change from V2 is the uint32 acct_ctrl */ + /* Change from V2 is the uint32_t acct_ctrl */ pdb_set_acct_ctrl(sampass, acct_ctrl, PDB_SET); pdb_set_logon_divs(sampass, logon_divs, PDB_SET); pdb_set_hours(sampass, hours, PDB_SET); @@ -1769,14 +1769,14 @@ done: /********************************************************************* *********************************************************************/ -static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool size_only) +static uint32_t init_buffer_from_samu_v3 (uint8_t **buf, struct samu *sampass, bool size_only) { size_t len, buflen; /* times are stored as 32bit integer take care on system with 64bit wide time_t --SSS */ - uint32 logon_time, + uint32_t logon_time, logoff_time, kickoff_time, bad_password_time, @@ -1784,7 +1784,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool pass_can_change_time, pass_must_change_time; - uint32 user_rid, group_rid; + uint32_t user_rid, group_rid; const char *username; const char *domain; @@ -1798,29 +1798,29 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool const char *profile_path; const char *acct_desc; const char *workstations; - uint32 username_len, domain_len, nt_username_len, + uint32_t username_len, domain_len, nt_username_len, dir_drive_len, comment_len, munged_dial_len, fullname_len, homedir_len, logon_script_len, profile_path_len, acct_desc_len, workstations_len; - const uint8 *lm_pw; - const uint8 *nt_pw; - const uint8 *nt_pw_hist; - uint32 lm_pw_len = 16; - uint32 nt_pw_len = 16; - uint32 nt_pw_hist_len; - uint32 pwHistLen = 0; + const uint8_t *lm_pw; + const uint8_t *nt_pw; + const uint8_t *nt_pw_hist; + uint32_t lm_pw_len = 16; + uint32_t nt_pw_len = 16; + uint32_t nt_pw_hist_len; + uint32_t pwHistLen = 0; *buf = NULL; buflen = 0; - logon_time = convert_time_t_to_uint32(pdb_get_logon_time(sampass)); - logoff_time = convert_time_t_to_uint32(pdb_get_logoff_time(sampass)); - kickoff_time = convert_time_t_to_uint32(pdb_get_kickoff_time(sampass)); - bad_password_time = convert_time_t_to_uint32(pdb_get_bad_password_time(sampass)); - pass_can_change_time = convert_time_t_to_uint32(pdb_get_pass_can_change_time_noncalc(sampass)); - pass_must_change_time = convert_time_t_to_uint32(pdb_get_pass_must_change_time(sampass)); - pass_last_set_time = convert_time_t_to_uint32(pdb_get_pass_last_set_time(sampass)); + logon_time = convert_time_t_to_uint32_t(pdb_get_logon_time(sampass)); + logoff_time = convert_time_t_to_uint32_t(pdb_get_logoff_time(sampass)); + kickoff_time = convert_time_t_to_uint32_t(pdb_get_kickoff_time(sampass)); + bad_password_time = convert_time_t_to_uint32_t(pdb_get_bad_password_time(sampass)); + pass_can_change_time = convert_time_t_to_uint32_t(pdb_get_pass_can_change_time_noncalc(sampass)); + pass_must_change_time = convert_time_t_to_uint32_t(pdb_get_pass_must_change_time(sampass)); + pass_last_set_time = convert_time_t_to_uint32_t(pdb_get_pass_last_set_time(sampass)); user_rid = pdb_get_user_rid(sampass); group_rid = pdb_get_group_rid(sampass); @@ -1988,7 +1988,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool } /* malloc the space needed */ - if ( (*buf=(uint8*)SMB_MALLOC(len)) == NULL) { + if ( (*buf=(uint8_t*)SMB_MALLOC(len)) == NULL) { DEBUG(0,("init_buffer_from_samu_v3: Unable to malloc() memory for buffer!\n")); return (-1); } @@ -2039,13 +2039,13 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool return (buflen); } -static bool init_samu_from_buffer_v4(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_samu_from_buffer_v4(struct samu *sampass, uint8_t *buf, uint32_t buflen) { /* nothing changed between V3 and V4 */ return init_samu_from_buffer_v3(sampass, buf, buflen); } -static uint32 init_buffer_from_samu_v4(uint8 **buf, struct samu *sampass, bool size_only) +static uint32_t init_buffer_from_samu_v4(uint8_t **buf, struct samu *sampass, bool size_only) { /* nothing changed between V3 and V4 */ return init_buffer_from_samu_v3(buf, sampass, size_only); @@ -2056,7 +2056,7 @@ static uint32 init_buffer_from_samu_v4(uint8 **buf, struct samu *sampass, bool s *********************************************************************/ bool init_samu_from_buffer(struct samu *sampass, uint32_t level, - uint8 *buf, uint32 buflen) + uint8_t *buf, uint32_t buflen) { switch (level) { case SAMU_BUFFER_V0: @@ -2078,7 +2078,7 @@ bool init_samu_from_buffer(struct samu *sampass, uint32_t level, Intialize a BYTE buffer from a struct samu struct *********************************************************************/ -uint32 init_buffer_from_samu (uint8 **buf, struct samu *sampass, bool size_only) +uint32_t init_buffer_from_samu (uint8_t **buf, struct samu *sampass, bool size_only) { return init_buffer_from_samu_v4(buf, sampass, size_only); } @@ -2088,7 +2088,7 @@ uint32 init_buffer_from_samu (uint8 **buf, struct samu *sampass, bool size_only) bool pdb_copy_sam_account(struct samu *dst, struct samu *src ) { - uint8 *buf = NULL; + uint8_t *buf = NULL; int len; len = init_buffer_from_samu(&buf, src, False); @@ -2127,8 +2127,8 @@ bool pdb_copy_sam_account(struct samu *dst, struct samu *src ) bool pdb_update_bad_password_count(struct samu *sampass, bool *updated) { time_t LastBadPassword; - uint16 BadPasswordCount; - uint32 resettime; + uint16_t BadPasswordCount; + uint32_t resettime; bool res; BadPasswordCount = pdb_get_bad_password_count(sampass); @@ -2147,15 +2147,15 @@ bool pdb_update_bad_password_count(struct samu *sampass, bool *updated) } /* First, check if there is a reset time to compare */ - if ((resettime == (uint32) -1) || (resettime == 0)) { + if ((resettime == (uint32_t) -1) || (resettime == 0)) { DEBUG(9, ("No reset time, can't reset bad pw count\n")); return True; } LastBadPassword = pdb_get_bad_password_time(sampass); DEBUG(7, ("LastBadPassword=%d, resettime=%d, current time=%d.\n", - (uint32) LastBadPassword, resettime, (uint32)time(NULL))); - if (time(NULL) > (LastBadPassword + convert_uint32_to_time_t(resettime)*60)){ + (uint32_t) LastBadPassword, resettime, (uint32_t)time(NULL))); + if (time(NULL) > (LastBadPassword + convert_uint32_t_to_time_t(resettime)*60)){ pdb_set_bad_password_count(sampass, 0, PDB_CHANGED); pdb_set_bad_password_time(sampass, 0, PDB_CHANGED); if (updated) { @@ -2172,7 +2172,7 @@ bool pdb_update_bad_password_count(struct samu *sampass, bool *updated) bool pdb_update_autolock_flag(struct samu *sampass, bool *updated) { - uint32 duration; + uint32_t duration; time_t LastBadPassword; bool res; @@ -2192,14 +2192,14 @@ bool pdb_update_autolock_flag(struct samu *sampass, bool *updated) } /* First, check if there is a duration to compare */ - if ((duration == (uint32) -1) || (duration == 0)) { + if ((duration == (uint32_t) -1) || (duration == 0)) { DEBUG(9, ("pdb_update_autolock_flag: No reset duration, can't reset autolock\n")); return True; } LastBadPassword = pdb_get_bad_password_time(sampass); DEBUG(7, ("pdb_update_autolock_flag: Account %s, LastBadPassword=%d, duration=%d, current time =%d.\n", - pdb_get_username(sampass), (uint32)LastBadPassword, duration*60, (uint32)time(NULL))); + pdb_get_username(sampass), (uint32_t)LastBadPassword, duration*60, (uint32_t)time(NULL))); if (LastBadPassword == (time_t)0) { DEBUG(1,("pdb_update_autolock_flag: Account %s " @@ -2209,7 +2209,7 @@ bool pdb_update_autolock_flag(struct samu *sampass, bool *updated) return True; } - if ((time(NULL) > (LastBadPassword + convert_uint32_to_time_t(duration) * 60))) { + if ((time(NULL) > (LastBadPassword + convert_uint32_t_to_time_t(duration) * 60))) { pdb_set_acct_ctrl(sampass, pdb_get_acct_ctrl(sampass) & ~ACB_AUTOLOCK, PDB_CHANGED); @@ -2229,7 +2229,7 @@ bool pdb_update_autolock_flag(struct samu *sampass, bool *updated) bool pdb_increment_bad_password_count(struct samu *sampass) { - uint32 account_policy_lockout; + uint32_t account_policy_lockout; bool autolock_updated = False, badpw_updated = False; bool ret; @@ -2365,7 +2365,7 @@ bool get_trust_pw_clear(const char *domain, char **ret_pwd, appropriate account name is stored in account_name. *******************************************************************/ -bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16], +bool get_trust_pw_hash(const char *domain, uint8_t ret_pwd[16], const char **account_name, enum netr_SchannelType *channel) { diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 1416e287ac7..554e8127d24 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -40,7 +40,7 @@ Collection of get...() functions for struct samu. ********************************************************************/ -uint32 pdb_get_acct_ctrl(const struct samu *sampass) +uint32_t pdb_get_acct_ctrl(const struct samu *sampass) { return sampass->acct_ctrl; } @@ -72,7 +72,7 @@ time_t pdb_get_pass_last_set_time(const struct samu *sampass) time_t pdb_get_pass_can_change_time(const struct samu *sampass) { - uint32 allow; + uint32_t allow; /* if the last set time is zero, it means the user cannot change their password, and this time must be zero. jmcd @@ -104,7 +104,7 @@ 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) { - uint32 expire; + uint32_t expire; if (sampass->pass_last_set_time == 0) return (time_t) 0; @@ -113,7 +113,7 @@ time_t pdb_get_pass_must_change_time(const struct samu *sampass) return get_time_t_max(); if (!pdb_get_account_policy(PDB_POLICY_MAX_PASSWORD_AGE, &expire) - || expire == (uint32)-1 || expire == 0) + || expire == (uint32_t)-1 || expire == 0) return get_time_t_max(); return sampass->pass_last_set_time + expire; @@ -127,12 +127,12 @@ bool pdb_get_pass_can_change(const struct samu *sampass) return True; } -uint16 pdb_get_logon_divs(const struct samu *sampass) +uint16_t pdb_get_logon_divs(const struct samu *sampass) { return sampass->logon_divs; } -uint32 pdb_get_hours_len(const struct samu *sampass) +uint32_t pdb_get_hours_len(const struct samu *sampass) { return sampass->hours_len; } @@ -156,7 +156,7 @@ const uint8 *pdb_get_lanman_passwd(const struct samu *sampass) return (uint8 *)sampass->lm_pw.data; } -const uint8 *pdb_get_pw_history(const struct samu *sampass, uint32 *current_hist_len) +const uint8 *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len) { SMB_ASSERT((!sampass->nt_pw_his.data) || ((sampass->nt_pw_his.length % PW_HISTORY_ENTRY_LEN) == 0)); @@ -371,17 +371,17 @@ const char *pdb_get_munged_dial(const struct samu *sampass) return sampass->munged_dial; } -uint16 pdb_get_bad_password_count(const struct samu *sampass) +uint16_t pdb_get_bad_password_count(const struct samu *sampass) { return sampass->bad_password_count; } -uint16 pdb_get_logon_count(const struct samu *sampass) +uint16_t pdb_get_logon_count(const struct samu *sampass) { return sampass->logon_count; } -uint32 pdb_get_unknown_6(const struct samu *sampass) +uint32_t pdb_get_unknown_6(const struct samu *sampass) { return sampass->unknown_6; } @@ -399,7 +399,7 @@ void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_ Collection of set...() functions for struct samu. ********************************************************************/ -bool pdb_set_acct_ctrl(struct samu *sampass, uint32 acct_ctrl, enum pdb_value_state flag) +bool pdb_set_acct_ctrl(struct samu *sampass, uint32_t acct_ctrl, enum pdb_value_state flag) { sampass->acct_ctrl = acct_ctrl; return pdb_set_init_flags(sampass, PDB_ACCTCTRL, flag); @@ -447,13 +447,13 @@ bool pdb_set_pass_last_set_time(struct samu *sampass, time_t mytime, enum pdb_va return pdb_set_init_flags(sampass, PDB_PASSLASTSET, flag); } -bool pdb_set_hours_len(struct samu *sampass, uint32 len, enum pdb_value_state flag) +bool pdb_set_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag) { sampass->hours_len = len; return pdb_set_init_flags(sampass, PDB_HOURSLEN, flag); } -bool pdb_set_logon_divs(struct samu *sampass, uint16 hours, enum pdb_value_state flag) +bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag) { sampass->logon_divs = hours; return pdb_set_init_flags(sampass, PDB_LOGONDIVS, flag); @@ -911,7 +911,7 @@ bool pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_HASH_LEN], e in pwd. ********************************************************************/ -bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32 historyLen, enum pdb_value_state flag) +bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32_t historyLen, enum pdb_value_state flag) { if (historyLen && pwd){ data_blob_free(&(sampass->nt_pw_his)); @@ -952,19 +952,19 @@ bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum return pdb_set_init_flags(sampass, PDB_PLAINTEXT_PW, flag); } -bool pdb_set_bad_password_count(struct samu *sampass, uint16 bad_password_count, enum pdb_value_state flag) +bool pdb_set_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag) { sampass->bad_password_count = bad_password_count; return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_COUNT, flag); } -bool pdb_set_logon_count(struct samu *sampass, uint16 logon_count, enum pdb_value_state flag) +bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag) { sampass->logon_count = logon_count; return pdb_set_init_flags(sampass, PDB_LOGON_COUNT, flag); } -bool pdb_set_unknown_6(struct samu *sampass, uint32 unkn, enum pdb_value_state flag) +bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag) { sampass->unknown_6 = unkn; return pdb_set_init_flags(sampass, PDB_UNKNOWN6, flag); @@ -1020,8 +1020,8 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) uchar new_lanman_p16[LM_HASH_LEN]; uchar new_nt_p16[NT_HASH_LEN]; uchar *pwhistory; - uint32 pwHistLen; - uint32 current_history_len; + uint32_t pwHistLen; + uint32_t current_history_len; if (!plaintext) return False; @@ -1129,7 +1129,7 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) } /* check for any PDB_SET/CHANGED field and fill the appropriate mask bit */ -uint32 pdb_build_fields_present(struct samu *sampass) +uint32_t pdb_build_fields_present(struct samu *sampass) { /* value set to all for testing */ return 0x00ffffff; diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index abc023081ea..ac53e52d147 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -273,7 +273,7 @@ static bool guest_user_info( struct samu *user ) bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); - uint32 rid; + uint32_t rid; void *cache_data; /* hard code the Guest RID of 501 */ @@ -303,7 +303,7 @@ bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) static NTSTATUS pdb_default_create_user(struct pdb_methods *methods, TALLOC_CTX *tmp_ctx, const char *name, - uint32 acb_info, uint32 *rid) + uint32_t acb_info, uint32_t *rid) { struct samu *sam_pass; NTSTATUS status; @@ -389,8 +389,8 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods, return status; } -NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags, - uint32 *rid) +NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags, + uint32_t *rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->create_user(pdb, mem_ctx, name, flags, rid); @@ -558,7 +558,7 @@ bool pdb_getgrnam(GROUP_MAP *map, const char *name) static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const char *name, - uint32 *rid) + uint32_t *rid) { DOM_SID group_sid; struct group *grp; @@ -595,7 +595,7 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods, } NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, - uint32 *rid) + uint32_t *rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->create_dom_group(pdb, mem_ctx, name, rid); @@ -603,7 +603,7 @@ NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, static NTSTATUS pdb_default_delete_dom_group(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 rid) + uint32_t rid) { DOM_SID group_sid; GROUP_MAP map; @@ -652,7 +652,7 @@ static NTSTATUS pdb_default_delete_dom_group(struct pdb_methods *methods, return NT_STATUS_OK; } -NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32 rid) +NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->delete_dom_group(pdb, mem_ctx, rid); @@ -686,7 +686,7 @@ bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, G NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - uint32 **pp_member_rids, + uint32_t **pp_member_rids, size_t *p_num_members) { struct pdb_methods *pdb = pdb_get_methods(); @@ -698,7 +698,7 @@ NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, /* special check for rid 513 */ if ( !NT_STATUS_IS_OK( result ) ) { - uint32 rid; + uint32_t rid; sid_peek_rid( sid, &rid ); @@ -778,8 +778,8 @@ static bool pdb_user_in_group(TALLOC_CTX *mem_ctx, struct samu *account, static NTSTATUS pdb_default_add_groupmem(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 group_rid, - uint32 member_rid) + uint32_t group_rid, + uint32_t member_rid) { DOM_SID group_sid, member_sid; struct samu *account = NULL; @@ -834,8 +834,8 @@ static NTSTATUS pdb_default_add_groupmem(struct pdb_methods *methods, return NT_STATUS_OK; } -NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid, - uint32 member_rid) +NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, + uint32_t member_rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->add_groupmem(pdb, mem_ctx, group_rid, member_rid); @@ -843,8 +843,8 @@ NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid, static NTSTATUS pdb_default_del_groupmem(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 group_rid, - uint32 member_rid) + uint32_t group_rid, + uint32_t member_rid) { DOM_SID group_sid, member_sid; struct samu *account = NULL; @@ -896,14 +896,14 @@ static NTSTATUS pdb_default_del_groupmem(struct pdb_methods *methods, return NT_STATUS_OK; } -NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid, - uint32 member_rid) +NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, + uint32_t member_rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->del_groupmem(pdb, mem_ctx, group_rid, member_rid); } -NTSTATUS pdb_create_alias(const char *name, uint32 *rid) +NTSTATUS pdb_create_alias(const char *name, uint32_t *rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->create_alias(pdb, name, rid); @@ -950,7 +950,7 @@ NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, const DOM_SID *members, size_t num_members, - uint32 **pp_alias_rids, + uint32_t **pp_alias_rids, size_t *p_num_alias_rids) { struct pdb_methods *pdb = pdb_get_methods(); @@ -963,7 +963,7 @@ NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid, int num_rids, - uint32 *rids, + uint32_t *rids, const char **names, enum lsa_SidType *attrs) { @@ -986,7 +986,7 @@ NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid, NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, int num_names, const char **names, - uint32 *rids, + uint32_t *rids, enum lsa_SidType *attrs) { struct pdb_methods *pdb = pdb_get_methods(); @@ -1056,12 +1056,12 @@ uint32_t pdb_capabilities(void) with add RIDs (assigned from previous algorithmic mappings) ********************************************************************/ -bool pdb_new_rid(uint32 *rid) +bool pdb_new_rid(uint32_t *rid) { struct pdb_methods *pdb = pdb_get_methods(); const char *name = NULL; enum lsa_SidType type; - uint32 allocated_rid = 0; + uint32_t allocated_rid = 0; int i; TALLOC_CTX *ctx; @@ -1243,7 +1243,7 @@ static bool pdb_default_sid_to_id(struct pdb_methods *methods, TALLOC_CTX *mem_ctx; bool ret = False; const char *name; - uint32 rid; + uint32_t rid; mem_ctx = talloc_new(NULL); @@ -1368,7 +1368,7 @@ static bool get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *group, - uint32 **pp_member_rids, + uint32_t **pp_member_rids, size_t *p_num_members) { gid_t gid; @@ -1387,7 +1387,7 @@ static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods, if (num_uids == 0) return NT_STATUS_OK; - *pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_uids); + *pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_uids); for (i=0; i<num_uids; i++) { DOM_SID sid; @@ -1457,7 +1457,7 @@ static NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods, Look up a rid in the SAM we're responsible for (i.e. passdb) ********************************************************************/ -static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid, +static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32_t rid, const char **name, enum lsa_SidType *psid_name_use, union unid_t *unix_id) @@ -1549,7 +1549,7 @@ static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid, static NTSTATUS pdb_default_lookup_rids(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_rids, - uint32 *rids, + uint32_t *rids, const char **names, enum lsa_SidType *attrs) { @@ -1614,7 +1614,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_names, const char **names, - uint32 *rids, + uint32_t *rids, enum lsa_SidType *attrs) { int i; @@ -1625,7 +1625,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods, if (sid_check_is_builtin(domain_sid)) { for (i=0; i<num_names; i++) { - uint32 rid; + uint32_t rid; if (lookup_builtin_name(names[i], &rid)) { attrs[i] = SID_NAME_ALIAS; @@ -1703,8 +1703,8 @@ struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx, return result; } -static void fill_displayentry(TALLOC_CTX *mem_ctx, uint32 rid, - uint16 acct_flags, +static void fill_displayentry(TALLOC_CTX *mem_ctx, uint32_t rid, + uint16_t acct_flags, const char *account_name, const char *fullname, const char *description, @@ -1738,7 +1738,7 @@ static bool next_entry_groups(struct pdb_search *s, struct samr_displayentry *entry) { struct group_search *state = (struct group_search *)s->private_data; - uint32 rid; + uint32_t rid; GROUP_MAP *map = &state->groups[state->current_group]; if (state->current_group == state->num_groups) @@ -1798,7 +1798,7 @@ static bool pdb_default_search_aliases(struct pdb_methods *methods, } static struct samr_displayentry *pdb_search_getentry(struct pdb_search *search, - uint32 idx) + uint32_t idx) { if (idx < search->num_entries) return &search->cache[idx]; @@ -1823,7 +1823,7 @@ static struct samr_displayentry *pdb_search_getentry(struct pdb_search *search, return (search->num_entries > idx) ? &search->cache[idx] : NULL; } -struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32 acct_flags) +struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags) { struct pdb_methods *pdb = pdb_get_methods(); struct pdb_search *result; @@ -1876,12 +1876,12 @@ struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid) return result; } -uint32 pdb_search_entries(struct pdb_search *search, - uint32 start_idx, uint32 max_entries, +uint32_t pdb_search_entries(struct pdb_search *search, + uint32_t start_idx, uint32_t max_entries, struct samr_displayentry **result) { struct samr_displayentry *end_entry; - uint32 end_idx = start_idx+max_entries-1; + uint32_t end_idx = start_idx+max_entries-1; /* The first entry needs to be searched after the last. Otherwise the * first entry might have moved due to a realloc during the search for @@ -1924,7 +1924,7 @@ bool pdb_del_trusteddom_pw(const char *domain) return pdb->del_trusteddom_pw(pdb, domain); } -NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32 *num_domains, +NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains, struct trustdom_info ***domains) { struct pdb_methods *pdb = pdb_get_methods(); @@ -1964,7 +1964,7 @@ static bool pdb_default_del_trusteddom_pw(struct pdb_methods *methods, static NTSTATUS pdb_default_enum_trusteddoms(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 *num_domains, + uint32_t *num_domains, struct trustdom_info ***domains) { return secrets_trusted_domains(mem_ctx, num_domains, domains); diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index e3bd72a629c..32eacd1bc80 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -376,7 +376,7 @@ int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state, ******************************************************************/ static int ldapsam_search_suffix_by_rid (struct ldapsam_privates *ldap_state, - uint32 rid, LDAPMessage ** result, + uint32_t rid, LDAPMessage ** result, const char **attr) { char *filter = NULL; @@ -529,19 +529,19 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, *acct_desc = NULL, *workstations = NULL, *munged_dial = NULL; - uint32 user_rid; + uint32_t user_rid; uint8 smblmpwd[LM_HASH_LEN], smbntpwd[NT_HASH_LEN]; bool use_samba_attrs = True; - uint32 acct_ctrl = 0; - uint16 logon_divs; - uint16 bad_password_count = 0, + uint32_t acct_ctrl = 0; + uint16_t logon_divs; + uint16_t bad_password_count = 0, logon_count = 0; - uint32 hours_len; + uint32_t hours_len; uint8 hours[MAX_HOURS_LEN]; char *temp = NULL; struct login_cache cache_entry; - uint32 pwHistLen; + uint32_t pwHistLen; bool expand_explicit = lp_passdb_expand_explicit(); bool ret = false; TALLOC_CTX *ctx = talloc_init("init_sam_from_ldap"); @@ -604,7 +604,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_RID), ctx))!=NULL) { - user_rid = (uint32)atol(temp); + user_rid = (uint32_t)atol(temp); pdb_set_user_sid_from_rid(sampass, user_rid, PDB_SET); } } @@ -985,7 +985,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, LDAP_ATTR_BAD_PASSWORD_COUNT), ctx); if (temp) { - bad_password_count = (uint32) atol(temp); + bad_password_count = (uint32_t) atol(temp); pdb_set_bad_password_count(sampass, bad_password_count, PDB_SET); } @@ -1009,7 +1009,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, LDAP_ATTR_LOGON_COUNT), ctx); if (temp) { - logon_count = (uint32) atol(temp); + logon_count = (uint32_t) atol(temp); pdb_set_logon_count(sampass, logon_count, PDB_SET); } @@ -1172,7 +1172,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, enum pdb_elements)) { char *temp = NULL; - uint32 rid; + uint32_t rid; if (mods == NULL || sampass == NULL) { DEBUG(0, ("init_ldap_from_sam: NULL parameters found!\n")); @@ -1396,7 +1396,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, if (need_update(sampass, PDB_PWHISTORY)) { char *pwstr = NULL; - uint32 pwHistLen = 0; + uint32_t pwHistLen = 0; pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen); pwstr = SMB_MALLOC_ARRAY(char, 1024); @@ -1409,7 +1409,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, pwstr[64] = '\0'; } else { int i; - uint32 currHistLen = 0; + uint32_t currHistLen = 0; const uint8 *pwhist = pdb_get_pw_history(sampass, &currHistLen); if (pwhist != NULL) { /* We can only store (1024-1/64 password history entries. */ @@ -1471,9 +1471,9 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, if (need_update(sampass, PDB_BAD_PASSWORD_COUNT)) /* && need_update(sampass, PDB_BAD_PASSWORD_TIME)) */ { - uint16 badcount = pdb_get_bad_password_count(sampass); + uint16_t badcount = pdb_get_bad_password_count(sampass); time_t badtime = pdb_get_bad_password_time(sampass); - uint32 pol; + uint32_t pol; pdb_get_account_policy(PDB_POLICY_BAD_ATTEMPT_LOCKOUT, &pol); DEBUG(3, ("updating bad password fields, policy=%u, count=%u, time=%u\n", @@ -1628,7 +1628,7 @@ static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state, { int rc = -1; const char ** attr_list; - uint32 rid; + uint32_t rid; switch ( ldap_state->schema_ver ) { case SCHEMAVER_SAMBASAMACCOUNT: { @@ -2068,8 +2068,8 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, struc static NTSTATUS ldapsam_del_groupmem(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, - uint32 group_rid, - uint32 member_rid); + uint32_t group_rid, + uint32_t member_rid); static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, @@ -2175,7 +2175,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, struct s LDAPMessage *entry = NULL; LDAPMod **mods = NULL; int ldap_op = LDAP_MOD_REPLACE; - uint32 num_result; + uint32_t num_result; const char **attr_list; char *escape_user = NULL; const char *username = pdb_get_username(newpwd); @@ -2663,7 +2663,7 @@ static NTSTATUS ldapsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct, LDAPMessage *entry, const DOM_SID *domain_sid, - uint32 *rid) + uint32_t *rid) { fstring str; DOM_SID sid; @@ -2696,7 +2696,7 @@ static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct, static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *group, - uint32 **pp_member_rids, + uint32_t **pp_member_rids, size_t *p_num_members) { struct ldapsam_privates *ldap_state = @@ -2814,7 +2814,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, { char *sidstr; DOM_SID sid; - uint32 rid; + uint32_t rid; sidstr = smbldap_talloc_single_attribute(conn->ldap_struct, entry, "sambaSID", @@ -2865,7 +2865,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, entry != NULL; entry = ldap_next_entry(conn->ldap_struct, entry)) { - uint32 rid; + uint32_t rid; if (!ldapsam_extract_rid_from_entry(conn->ldap_struct, entry, @@ -3791,7 +3791,7 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods, const DOM_SID *domain_sid, const DOM_SID *members, size_t num_members, - uint32 **pp_alias_rids, + uint32_t **pp_alias_rids, size_t *p_num_alias_rids) { struct ldapsam_privates *ldap_state = @@ -3870,7 +3870,7 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods, { fstring sid_str; DOM_SID sid; - uint32 rid; + uint32_t rid; if (!smbldap_get_single_attribute(ldap_struct, entry, LDAP_ATTRIBUTE_SID, @@ -3907,7 +3907,7 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods, static NTSTATUS ldapsam_set_account_policy_in_ldap(struct pdb_methods *methods, enum pdb_policy_type type, - uint32 value) + uint32_t value) { NTSTATUS ntstatus = NT_STATUS_UNSUCCESSFUL; int rc; @@ -3963,7 +3963,7 @@ static NTSTATUS ldapsam_set_account_policy(struct pdb_methods *methods, static NTSTATUS ldapsam_get_account_policy_from_ldap(struct pdb_methods *methods, enum pdb_policy_type type, - uint32 *value) + uint32_t *value) { NTSTATUS ntstatus = NT_STATUS_UNSUCCESSFUL; LDAPMessage *result = NULL; @@ -4022,7 +4022,7 @@ static NTSTATUS ldapsam_get_account_policy_from_ldap(struct pdb_methods *methods goto out; } - *value = (uint32)atol(vals[0]); + *value = (uint32_t)atol(vals[0]); ntstatus = NT_STATUS_OK; @@ -4100,7 +4100,7 @@ static NTSTATUS ldapsam_get_account_policy(struct pdb_methods *methods, static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_rids, - uint32 *rids, + uint32_t *rids, const char **names, enum lsa_SidType *attrs) { @@ -4181,7 +4181,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods, for (entry = ldap_first_entry(ld, msg); entry != NULL; entry = ldap_next_entry(ld, entry)) { - uint32 rid; + uint32_t rid; int rid_index; const char *name; @@ -4255,7 +4255,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods, entry != NULL; entry = ldap_next_entry(ld, entry)) { - uint32 rid; + uint32_t rid; int rid_index; const char *attr; enum lsa_SidType type; @@ -4379,8 +4379,8 @@ const char **talloc_attrs(TALLOC_CTX *mem_ctx, ...) struct ldap_search_state { struct smbldap_state *connection; - uint32 acct_flags; - uint16 group_type; + uint32_t acct_flags; + uint16_t group_type; const char *base; int scope; @@ -4558,7 +4558,7 @@ static bool ldapuser2displayentry(struct ldap_search_state *state, char **vals; size_t converted_size; DOM_SID sid; - uint32 acct_flags; + uint32_t acct_flags; vals = ldap_get_values(ld, entry, "sambaAcctFlags"); if ((vals == NULL) || (vals[0] == NULL)) { @@ -4650,7 +4650,7 @@ static bool ldapuser2displayentry(struct ldap_search_state *state, static bool ldapsam_search_users(struct pdb_methods *methods, struct pdb_search *search, - uint32 acct_flags) + uint32_t acct_flags) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)methods->private_data; @@ -4704,7 +4704,7 @@ static bool ldapgroup2displayentry(struct ldap_search_state *state, char **vals; size_t converted_size; DOM_SID sid; - uint16 group_type; + uint16_t group_type; result->account_name = ""; result->fullname = ""; @@ -4885,7 +4885,7 @@ static uint32_t ldapsam_capabilities(struct pdb_methods *methods) } static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv, - uint32 *rid) + uint32_t *rid) { struct smbldap_state *smbldap_state = priv->smbldap_state; @@ -4895,7 +4895,7 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv, NTSTATUS status; char *value; int rc; - uint32 nextRid = 0; + uint32_t nextRid = 0; const char *dn; TALLOC_CTX *mem_ctx; @@ -4932,21 +4932,21 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv, value = smbldap_talloc_single_attribute(priv2ld(priv), entry, "sambaNextRid", mem_ctx); if (value != NULL) { - uint32 tmp = (uint32)strtoul(value, NULL, 10); + uint32_t tmp = (uint32_t)strtoul(value, NULL, 10); nextRid = MAX(nextRid, tmp); } value = smbldap_talloc_single_attribute(priv2ld(priv), entry, "sambaNextUserRid", mem_ctx); if (value != NULL) { - uint32 tmp = (uint32)strtoul(value, NULL, 10); + uint32_t tmp = (uint32_t)strtoul(value, NULL, 10); nextRid = MAX(nextRid, tmp); } value = smbldap_talloc_single_attribute(priv2ld(priv), entry, "sambaNextGroupRid", mem_ctx); if (value != NULL) { - uint32 tmp = (uint32)strtoul(value, NULL, 10); + uint32_t tmp = (uint32_t)strtoul(value, NULL, 10); nextRid = MAX(nextRid, tmp); } @@ -4981,7 +4981,7 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv, return status; } -static NTSTATUS ldapsam_new_rid_internal(struct pdb_methods *methods, uint32 *rid) +static NTSTATUS ldapsam_new_rid_internal(struct pdb_methods *methods, uint32_t *rid) { int i; @@ -5003,7 +5003,7 @@ static NTSTATUS ldapsam_new_rid_internal(struct pdb_methods *methods, uint32 *ri return NT_STATUS_ACCESS_DENIED; } -static bool ldapsam_new_rid(struct pdb_methods *methods, uint32 *rid) +static bool ldapsam_new_rid(struct pdb_methods *methods, uint32_t *rid) { NTSTATUS result = ldapsam_new_rid_internal(methods, rid); return NT_STATUS_IS_OK(result) ? True : False; @@ -5261,12 +5261,12 @@ static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid, static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, const char *name, - uint32 acb_info, uint32 *rid) + uint32_t acb_info, uint32_t *rid) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; LDAPMessage *entry = NULL; LDAPMessage *result = NULL; - uint32 num_result; + uint32_t num_result; bool is_machine = False; bool add_posix = False; LDAPMod **mods = NULL; @@ -5583,13 +5583,13 @@ static NTSTATUS ldapsam_delete_user(struct pdb_methods *my_methods, TALLOC_CTX * static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, const char *name, - uint32 *rid) + uint32_t *rid) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; NTSTATUS ret; LDAPMessage *entry = NULL; LDAPMessage *result = NULL; - uint32 num_result; + uint32_t num_result; bool is_new_entry = False; LDAPMod **mods = NULL; char *filter; @@ -5735,7 +5735,7 @@ static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods, return NT_STATUS_OK; } -static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, uint32 rid) +static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, uint32_t rid) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; LDAPMessage *result = NULL; @@ -5831,14 +5831,14 @@ static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, - uint32 group_rid, - uint32 member_rid, + uint32_t group_rid, + uint32_t member_rid, int modop) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; LDAPMessage *entry = NULL; LDAPMessage *result = NULL; - uint32 num_result; + uint32_t num_result; LDAPMod **mods = NULL; char *filter; char *uidstr; @@ -5993,15 +5993,15 @@ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods, static NTSTATUS ldapsam_add_groupmem(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, - uint32 group_rid, - uint32 member_rid) + uint32_t group_rid, + uint32_t member_rid) { return ldapsam_change_groupmem(my_methods, tmp_ctx, group_rid, member_rid, LDAP_MOD_ADD); } static NTSTATUS ldapsam_del_groupmem(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, - uint32 group_rid, - uint32 member_rid) + uint32_t group_rid, + uint32_t member_rid) { return ldapsam_change_groupmem(my_methods, tmp_ctx, group_rid, member_rid, LDAP_MOD_DELETE); } @@ -6013,7 +6013,7 @@ static NTSTATUS ldapsam_set_primary_group(struct pdb_methods *my_methods, struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; LDAPMessage *entry = NULL; LDAPMessage *result = NULL; - uint32 num_result; + uint32_t num_result; LDAPMod **mods = NULL; char *filter; char *escape_username; @@ -6128,7 +6128,7 @@ static bool get_trusteddom_pw_int(struct ldapsam_privates *ldap_state, int attrsonly = 0; /* 0: return values too */ LDAPMessage *result = NULL; char *trusted_dn; - uint32 num_result; + uint32_t num_result; filter = talloc_asprintf(talloc_tos(), "(&(objectClass=%s)(sambaDomainName=%s))", @@ -6339,7 +6339,7 @@ static bool ldapsam_del_trusteddom_pw(struct pdb_methods *methods, static NTSTATUS ldapsam_enum_trusteddoms(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - uint32 *num_domains, + uint32_t *num_domains, struct trustdom_info ***domains) { int rc; @@ -6556,7 +6556,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location) { NTSTATUS nt_status; struct ldapsam_privates *ldap_state = NULL; - uint32 alg_rid_base; + uint32_t alg_rid_base; char *alg_rid_base_string = NULL; LDAPMessage *result = NULL; LDAPMessage *entry = NULL; @@ -6688,7 +6688,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location) LDAP_ATTR_ALGORITHMIC_RID_BASE ), talloc_tos()); if (alg_rid_base_string) { - alg_rid_base = (uint32)atol(alg_rid_base_string); + alg_rid_base = (uint32_t)atol(alg_rid_base_string); if (alg_rid_base != algorithmic_rid_base()) { DEBUG(0, ("The value of 'algorithmic RID base' has " "changed since the LDAP\n" diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 17c7f333d23..78bd0e75614 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -39,7 +39,7 @@ struct smb_passwd const unsigned char *smb_passwd; /* Null if no password */ const unsigned char *smb_nt_passwd; /* Null if no password */ - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint16_t acct_ctrl; /* account info (ACB_xxxx bit-mask) */ time_t pass_last_set_time; /* password last set time */ }; @@ -614,7 +614,7 @@ static char *format_new_smbpasswd_entry(const struct smb_passwd *newpwd) /* Add the account encoding and the last change time. */ slprintf((char *)p, new_entry_length - 1 - (p - new_entry), "%s:LCT-%08X:\n", pdb_encode_acct_ctrl(newpwd->acct_ctrl, NEW_PW_FORMAT_SPACE_PADDED_LEN), - (uint32)newpwd->pass_last_set_time); + (uint32_t)newpwd->pass_last_set_time); return new_entry; } @@ -1003,7 +1003,7 @@ This is no longer supported.!\n", pwd->smb_name)); slprintf(&ascii_p16[strlen(ascii_p16)], sizeof(ascii_p16)-(strlen(ascii_p16)+1), "%s:LCT-%08X:", - encode_bits, (uint32)pwd->pass_last_set_time ); + encode_bits, (uint32_t)pwd->pass_last_set_time ); wr_len = strlen(ascii_p16); } @@ -1185,7 +1185,7 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); static bool build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampass) { - uint32 rid; + uint32_t rid; if (sampass == NULL) return False; @@ -1323,7 +1323,7 @@ static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct sam struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data; struct smb_passwd *smb_pw; FILE *fp = NULL; - uint32 rid; + uint32_t rid; DEBUG(10, ("smbpasswd_getsampwrid: search by sid: %s\n", sid_string_dbg(sid))); diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index ac41dc0ad07..4fc10e24238 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -201,7 +201,7 @@ static int reinit_account_policies (void) int i; for (i=1; decode_account_policy_name(i) != NULL; i++) { - uint32 policy_value; + uint32_t policy_value; if (!account_policy_get_default(i, &policy_value)) { fprintf(stderr, "Can't get default account policy\n"); return -1; @@ -225,7 +225,7 @@ static int export_account_policies (struct pdb_methods *in, struct pdb_methods * int i; for ( i=1; decode_account_policy_name(i) != NULL; i++ ) { - uint32 policy_value; + uint32_t policy_value; NTSTATUS status; status = in->get_account_policy(in, i, &policy_value); @@ -261,7 +261,7 @@ static int print_sam_info (struct samu *sam_pwent, bool verbosity, bool smbpwdst if (verbosity) { char temp[44]; - const uint8 *hours; + const uint8_t *hours; printf ("Unix username: %s\n", pdb_get_username(sam_pwent)); printf ("NT username: %s\n", pdb_get_nt_username(sam_pwent)); @@ -328,7 +328,7 @@ static int print_sam_info (struct samu *sam_pwent, bool verbosity, bool smbpwdst lm_passwd, nt_passwd, pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sam_pwent),NEW_PW_FORMAT_SPACE_PADDED_LEN), - (uint32)convert_time_t_to_uint32(pdb_get_pass_last_set_time(sam_pwent))); + (uint32)convert_time_t_to_uint32_t(pdb_get_pass_last_set_time(sam_pwent))); } else { uid = nametouid(pdb_get_username(sam_pwent)); printf ("%s:%lu:%s\n", pdb_get_username(sam_pwent), (unsigned long)uid, @@ -592,7 +592,7 @@ static int set_user_info(const char *username, const char *fullname, return -1; } - value = convert_uint32_to_time_t(num); + value = convert_uint32_t_to_time_t(num); } pdb_set_kickoff_time(sam_pwent, value, PDB_CHANGED); @@ -1132,7 +1132,7 @@ int main (int argc, char **argv) /* account policy operations */ if ((checkparms & BIT_ACCPOLICY) && !(checkparms & ~(BIT_ACCPOLICY + BIT_ACCPOLVAL))) { - uint32 value; + uint32_t value; enum pdb_policy_type field = account_policy_name_to_typenum(account_policy); if (field == 0) { const char **names; |