From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/passdb/login_cache.c | 10 ++-- source3/passdb/lookup_sid.c | 42 +++++++-------- source3/passdb/machine_sid.c | 8 +-- source3/passdb/passdb.c | 42 +++++++-------- source3/passdb/pdb_compat.c | 4 +- source3/passdb/pdb_get_set.c | 78 +++++++++++++-------------- source3/passdb/pdb_interface.c | 114 ++++++++++++++++++++-------------------- source3/passdb/pdb_ldap.c | 82 ++++++++++++++--------------- source3/passdb/pdb_nds.c | 4 +- source3/passdb/pdb_smbpasswd.c | 28 +++++----- source3/passdb/pdb_tdb.c | 50 +++++++++--------- source3/passdb/secrets.c | 58 ++++++++++---------- source3/passdb/util_builtin.c | 8 +-- source3/passdb/util_unixsids.c | 16 +++--- source3/passdb/util_wellknown.c | 8 +-- 15 files changed, 276 insertions(+), 276 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/login_cache.c b/source3/passdb/login_cache.c index 5dce09a0da..8222f77b95 100644 --- a/source3/passdb/login_cache.c +++ b/source3/passdb/login_cache.c @@ -28,7 +28,7 @@ static TDB_CONTEXT *cache; -BOOL login_cache_init(void) +bool login_cache_init(void) { char* cache_fname = NULL; @@ -54,7 +54,7 @@ BOOL login_cache_init(void) return (cache ? True : False); } -BOOL login_cache_shutdown(void) +bool login_cache_shutdown(void) { /* tdb_close routine returns -1 on error */ if (!cache) return False; @@ -111,11 +111,11 @@ LOGIN_CACHE * login_cache_read(struct samu *sampass) return entry; } -BOOL login_cache_write(const struct samu *sampass, LOGIN_CACHE entry) +bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry) { char *keystr; TDB_DATA databuf; - BOOL ret; + bool ret; if (!login_cache_init()) return False; @@ -161,7 +161,7 @@ BOOL login_cache_write(const struct samu *sampass, LOGIN_CACHE entry) return ret == 0; } -BOOL login_cache_delentry(const struct samu *sampass) +bool login_cache_delentry(const struct samu *sampass) { int ret; char *keystr; diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index 313a8c0a8b..e832779f3b 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -29,7 +29,7 @@ to do guesswork. *****************************************************************/ -BOOL lookup_name(TALLOC_CTX *mem_ctx, +bool lookup_name(TALLOC_CTX *mem_ctx, const char *full_name, int flags, const char **ret_domain, const char **ret_name, DOM_SID *ret_sid, enum lsa_SidType *ret_type) @@ -327,7 +327,7 @@ BOOL lookup_name(TALLOC_CTX *mem_ctx, and then "Unix Users"\foo (or "Unix Groups"\foo). ************************************************************************/ -BOOL lookup_name_smbconf(TALLOC_CTX *mem_ctx, +bool lookup_name_smbconf(TALLOC_CTX *mem_ctx, const char *full_name, int flags, const char **ret_domain, const char **ret_name, DOM_SID *ret_sid, enum lsa_SidType *ret_type) @@ -387,7 +387,7 @@ BOOL lookup_name_smbconf(TALLOC_CTX *mem_ctx, ret_sid, ret_type); } -static BOOL wb_lookup_rids(TALLOC_CTX *mem_ctx, +static bool wb_lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, int num_rids, uint32 *rids, const char **domain_name, @@ -438,7 +438,7 @@ static BOOL wb_lookup_rids(TALLOC_CTX *mem_ctx, return True; } -static BOOL lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, +static bool lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, int num_rids, uint32_t *rids, const char **domain_name, const char ***names, enum lsa_SidType **types) @@ -556,7 +556,7 @@ static BOOL lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, * Is the SID a domain as such? If yes, lookup its name. */ -static BOOL lookup_as_domain(const DOM_SID *sid, TALLOC_CTX *mem_ctx, +static bool lookup_as_domain(const DOM_SID *sid, TALLOC_CTX *mem_ctx, const char **name) { const char *tmp; @@ -634,7 +634,7 @@ static BOOL lookup_as_domain(const DOM_SID *sid, TALLOC_CTX *mem_ctx, * Level 6: Like 4 */ -static BOOL check_dom_sid_to_level(const DOM_SID *sid, int level) +static bool check_dom_sid_to_level(const DOM_SID *sid, int level) { int ret = False; @@ -893,14 +893,14 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids, *THE CANONICAL* convert SID to name function. *****************************************************************/ -BOOL lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, const char **ret_domain, const char **ret_name, enum lsa_SidType *ret_type) { struct lsa_dom_info *domain; struct lsa_name_info *name; TALLOC_CTX *tmp_ctx; - BOOL ret = False; + bool ret = False; if (!(tmp_ctx = talloc_new(mem_ctx))) { DEBUG(0, ("talloc_new failed\n")); @@ -979,7 +979,7 @@ static struct gid_sid_cache { Find a SID given a uid. *****************************************************************/ -static BOOL fetch_sid_from_uid_cache(DOM_SID *psid, uid_t uid) +static bool fetch_sid_from_uid_cache(DOM_SID *psid, uid_t uid) { struct uid_sid_cache *pc; @@ -999,7 +999,7 @@ static BOOL fetch_sid_from_uid_cache(DOM_SID *psid, uid_t uid) Find a uid given a SID. *****************************************************************/ -static BOOL fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid ) +static bool fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid ) { struct uid_sid_cache *pc; @@ -1056,7 +1056,7 @@ void store_uid_sid_cache(const DOM_SID *psid, uid_t uid) Find a SID given a gid. *****************************************************************/ -static BOOL fetch_sid_from_gid_cache(DOM_SID *psid, gid_t gid) +static bool fetch_sid_from_gid_cache(DOM_SID *psid, gid_t gid) { struct gid_sid_cache *pc; @@ -1076,7 +1076,7 @@ static BOOL fetch_sid_from_gid_cache(DOM_SID *psid, gid_t gid) Find a gid given a SID. *****************************************************************/ -static BOOL fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid) +static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid) { struct gid_sid_cache *pc; @@ -1140,7 +1140,7 @@ void store_gid_sid_cache(const DOM_SID *psid, gid_t gid) static void legacy_uid_to_sid(DOM_SID *psid, uid_t uid) { uint32 rid; - BOOL ret; + bool ret; ZERO_STRUCTP(psid); @@ -1173,7 +1173,7 @@ static void legacy_uid_to_sid(DOM_SID *psid, uid_t uid) static void legacy_gid_to_sid(DOM_SID *psid, gid_t gid) { - BOOL ret; + bool ret; ZERO_STRUCTP(psid); @@ -1202,14 +1202,14 @@ static void legacy_gid_to_sid(DOM_SID *psid, gid_t gid) *THE LEGACY* convert SID to uid function. *****************************************************************/ -static BOOL legacy_sid_to_uid(const DOM_SID *psid, uid_t *puid) +static bool legacy_sid_to_uid(const DOM_SID *psid, uid_t *puid) { enum lsa_SidType type; uint32 rid; if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) { union unid_t id; - BOOL ret; + bool ret; become_root(); ret = pdb_sid_to_id(psid, &id, &type); @@ -1245,7 +1245,7 @@ done: Group mapping is used for gids that maps to Wellknown SIDs *****************************************************************/ -static BOOL legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid) +static bool legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid) { uint32 rid; GROUP_MAP map; @@ -1254,7 +1254,7 @@ static BOOL legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid) if ((sid_check_is_in_builtin(psid) || sid_check_is_in_wellknown_domain(psid))) { - BOOL ret; + bool ret; become_root(); ret = pdb_getgrsid(&map, *psid); @@ -1269,7 +1269,7 @@ static BOOL legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid) } if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) { - BOOL ret; + bool ret; become_root(); ret = pdb_sid_to_id(psid, &id, &type); @@ -1364,7 +1364,7 @@ void gid_to_sid(DOM_SID *psid, gid_t gid) *THE CANONICAL* convert SID to uid function. *****************************************************************/ -BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid) +bool sid_to_uid(const DOM_SID *psid, uid_t *puid) { uint32 rid; gid_t gid; @@ -1413,7 +1413,7 @@ BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid) Group mapping is used for gids that maps to Wellknown SIDs *****************************************************************/ -BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid) +bool sid_to_gid(const DOM_SID *psid, gid_t *pgid) { uint32 rid; uid_t uid; diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c index 9921fdb096..d1599047a7 100644 --- a/source3/passdb/machine_sid.c +++ b/source3/passdb/machine_sid.c @@ -35,11 +35,11 @@ static DOM_SID *global_sam_sid=NULL; style of SID storage ****************************************************************************/ -static BOOL read_sid_from_file(const char *fname, DOM_SID *sid) +static bool read_sid_from_file(const char *fname, DOM_SID *sid) { char **lines; int numlines; - BOOL ret; + bool ret; lines = file_lines_load(fname, &numlines,0); @@ -203,7 +203,7 @@ void reset_global_sam_sid(void) Check if the SID is our domain SID (S-1-5-21-x-y-z). *****************************************************************/ -BOOL sid_check_is_domain(const DOM_SID *sid) +bool sid_check_is_domain(const DOM_SID *sid) { return sid_equal(sid, get_global_sam_sid()); } @@ -212,7 +212,7 @@ BOOL sid_check_is_domain(const DOM_SID *sid) Check if the SID is our domain SID (S-1-5-21-x-y-z). *****************************************************************/ -BOOL sid_check_is_in_our_domain(const DOM_SID *sid) +bool sid_check_is_in_our_domain(const DOM_SID *sid) { DOM_SID dom_sid; uint32 rid; diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 4556fdf4eb..9254aba715 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -129,7 +129,7 @@ struct samu *samu_new( TALLOC_CTX *ctx ) attributes and a user SID. *********************************************************************/ -static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *pwd, BOOL create) +static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *pwd, bool create) { const char *guest_account = lp_guestaccount(); const char *domain = global_myname(); @@ -298,7 +298,7 @@ char *pdb_encode_acct_ctrl(uint32 acct_ctrl, size_t length) uint32 pdb_decode_acct_ctrl(const char *p) { uint32 acct_ctrl = 0; - BOOL finished = False; + bool finished = False; /* * Check if the account type bits have been encoded after the @@ -356,7 +356,7 @@ void pdb_sethexpwd(char *p, const unsigned char *pwd, uint32 acct_ctrl) into a 16 byte array. **************************************************************/ -BOOL pdb_gethexpwd(const char *p, unsigned char *pwd) +bool pdb_gethexpwd(const char *p, unsigned char *pwd) { int i; unsigned char lonybble, hinybble; @@ -405,7 +405,7 @@ void pdb_sethexhours(char *p, const unsigned char *hours) into a 21 byte array. **************************************************************/ -BOOL pdb_gethexhours(const char *p, unsigned char *hours) +bool pdb_gethexhours(const char *p, unsigned char *hours) { int i; unsigned char lonybble, hinybble; @@ -518,7 +518,7 @@ uint32 algorithmic_pdb_gid_to_group_rid(gid_t gid) Decides if a RID is a well known RID. ********************************************************************/ -static BOOL rid_is_well_known(uint32 rid) +static bool rid_is_well_known(uint32 rid) { /* Not using rid_offset here, because this is the actual NT fixed value (1000) */ @@ -530,7 +530,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 rid) { if ( rid_is_well_known(rid) ) { /* @@ -549,11 +549,11 @@ BOOL algorithmic_pdb_rid_is_user(uint32 rid) Convert a name into a SID. Used in the lookup name rpc. ********************************************************************/ -BOOL lookup_global_sam_name(const char *name, int flags, uint32_t *rid, +bool lookup_global_sam_name(const char *name, int flags, uint32_t *rid, enum lsa_SidType *type) { GROUP_MAP map; - BOOL ret; + bool ret; /* Windows treats "MACHINE\None" as a special name for rid 513 on non-DCs. You cannot create a user or group @@ -822,7 +822,7 @@ NTSTATUS local_password_change(const char *user_name, int local_flags, /********************************************************************* *********************************************************************/ -BOOL init_sam_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 buflen) +bool init_sam_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 buflen) { /* times are stored as 32bit integer @@ -860,9 +860,9 @@ BOOL init_sam_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 buflen) uint32 len = 0; uint32 lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen; uint32 pwHistLen = 0; - BOOL ret = True; + bool ret = True; fstring tmpstring; - BOOL expand_explicit = lp_passdb_expand_explicit(); + bool expand_explicit = lp_passdb_expand_explicit(); if(sampass == NULL || buf == NULL) { DEBUG(0, ("init_sam_from_buffer_v3: NULL parameters found!\n")); @@ -1056,7 +1056,7 @@ done: /********************************************************************* *********************************************************************/ -uint32 init_buffer_from_sam_v3 (uint8 **buf, struct samu *sampass, BOOL size_only) +uint32 init_buffer_from_sam_v3 (uint8 **buf, struct samu *sampass, bool size_only) { size_t len, buflen; @@ -1326,7 +1326,7 @@ uint32 init_buffer_from_sam_v3 (uint8 **buf, struct samu *sampass, BOOL size_onl /********************************************************************* *********************************************************************/ -BOOL pdb_copy_sam_account(struct samu *dst, struct samu *src ) +bool pdb_copy_sam_account(struct samu *dst, struct samu *src ) { uint8 *buf = NULL; int len; @@ -1360,12 +1360,12 @@ BOOL pdb_copy_sam_account(struct samu *dst, struct samu *src ) Update the bad password count checking the AP_RESET_COUNT_TIME *********************************************************************/ -BOOL pdb_update_bad_password_count(struct samu *sampass, BOOL *updated) +bool pdb_update_bad_password_count(struct samu *sampass, bool *updated) { time_t LastBadPassword; uint16 BadPasswordCount; uint32 resettime; - BOOL res; + bool res; BadPasswordCount = pdb_get_bad_password_count(sampass); if (!BadPasswordCount) { @@ -1406,11 +1406,11 @@ BOOL pdb_update_bad_password_count(struct samu *sampass, BOOL *updated) Update the ACB_AUTOLOCK flag checking the AP_LOCK_ACCOUNT_DURATION *********************************************************************/ -BOOL pdb_update_autolock_flag(struct samu *sampass, BOOL *updated) +bool pdb_update_autolock_flag(struct samu *sampass, bool *updated) { uint32 duration; time_t LastBadPassword; - BOOL res; + bool res; if (!(pdb_get_acct_ctrl(sampass) & ACB_AUTOLOCK)) { DEBUG(9, ("pdb_update_autolock_flag: Account %s not autolocked, no check needed\n", @@ -1463,11 +1463,11 @@ BOOL pdb_update_autolock_flag(struct samu *sampass, BOOL *updated) Increment the bad_password_count *********************************************************************/ -BOOL pdb_increment_bad_password_count(struct samu *sampass) +bool pdb_increment_bad_password_count(struct samu *sampass) { uint32 account_policy_lockout; - BOOL autolock_updated = False, badpw_updated = False; - BOOL ret; + bool autolock_updated = False, badpw_updated = False; + bool ret; /* Retrieve the account lockout policy */ become_root(); @@ -1522,7 +1522,7 @@ BOOL pdb_increment_bad_password_count(struct samu *sampass) Wrapper around retrieving the trust account password *******************************************************************/ -BOOL get_trust_pw(const char *domain, uint8 ret_pwd[16], uint32 *channel) +bool get_trust_pw(const char *domain, uint8 ret_pwd[16], uint32 *channel) { DOM_SID sid; char *pwd; diff --git a/source3/passdb/pdb_compat.c b/source3/passdb/pdb_compat.c index a1603a3ff3..10fc170476 100644 --- a/source3/passdb/pdb_compat.c +++ b/source3/passdb/pdb_compat.c @@ -47,7 +47,7 @@ uint32 pdb_get_group_rid (struct samu *sampass) return (0); } -BOOL pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag) +bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag) { DOM_SID u_sid; const DOM_SID *global_sam_sid; @@ -74,7 +74,7 @@ BOOL pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value return True; } -BOOL pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag) +bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag) { DOM_SID g_sid; const DOM_SID *global_sam_sid; diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 693c0c9e54..aaba91620b 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -118,7 +118,7 @@ time_t pdb_get_pass_must_change_time(const struct samu *sampass) return sampass->pass_last_set_time + expire; } -BOOL pdb_get_pass_can_change(const struct samu *sampass) +bool pdb_get_pass_can_change(const struct samu *sampass) { if (sampass->pass_can_change_time == get_time_t_max() && sampass->pass_last_set_time != 0) @@ -214,7 +214,7 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass) if ( pdb_gid_to_sid(pwd->pw_gid, gsid) ) { enum lsa_SidType type = SID_NAME_UNKNOWN; TALLOC_CTX *mem_ctx = talloc_init("pdb_get_group_sid"); - BOOL lookup_ret; + bool lookup_ret; if (!mem_ctx) { return NULL; @@ -372,61 +372,61 @@ 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 acct_ctrl, enum pdb_value_state flag) { sampass->acct_ctrl = acct_ctrl; return pdb_set_init_flags(sampass, PDB_ACCTCTRL, flag); } -BOOL pdb_set_logon_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag) +bool pdb_set_logon_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag) { sampass->logon_time = mytime; return pdb_set_init_flags(sampass, PDB_LOGONTIME, flag); } -BOOL pdb_set_logoff_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) { sampass->logoff_time = mytime; return pdb_set_init_flags(sampass, PDB_LOGOFFTIME, flag); } -BOOL pdb_set_kickoff_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) { sampass->kickoff_time = mytime; return pdb_set_init_flags(sampass, PDB_KICKOFFTIME, flag); } -BOOL pdb_set_bad_password_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) { sampass->bad_password_time = mytime; return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_TIME, flag); } -BOOL pdb_set_pass_can_change_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) { sampass->pass_can_change_time = mytime; return pdb_set_init_flags(sampass, PDB_CANCHANGETIME, flag); } -BOOL pdb_set_pass_must_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) { sampass->pass_must_change_time = mytime; return pdb_set_init_flags(sampass, PDB_MUSTCHANGETIME, flag); } -BOOL pdb_set_pass_last_set_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) { sampass->pass_last_set_time = mytime; 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 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 hours, enum pdb_value_state flag) { sampass->logon_divs = hours; return pdb_set_init_flags(sampass, PDB_LOGONDIVS, flag); @@ -439,7 +439,7 @@ BOOL pdb_set_logon_divs(struct samu *sampass, uint16 hours, enum pdb_value_state * this flag is only added. **/ -BOOL pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag) +bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag) { if (!sampass->set_flags) { if ((sampass->set_flags = @@ -498,7 +498,7 @@ BOOL pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pd return True; } -BOOL pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag) +bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag) { if (!u_sid) return False; @@ -511,7 +511,7 @@ BOOL pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value return pdb_set_init_flags(sampass, PDB_USERSID, flag); } -BOOL pdb_set_user_sid_from_string(struct samu *sampass, fstring 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) { DOM_SID new_sid; @@ -542,7 +542,7 @@ BOOL pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_ have to allow the explicitly setting of a group SID here. ********************************************************************/ -BOOL pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag) +bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag) { gid_t gid; @@ -573,7 +573,7 @@ BOOL pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_valu Set the user's UNIX name. ********************************************************************/ -BOOL pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag) +bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag) { if (username) { DEBUG(10, ("pdb_set_username: setting username %s, was %s\n", username, @@ -596,7 +596,7 @@ BOOL pdb_set_username(struct samu *sampass, const char *username, enum pdb_value Set the domain name. ********************************************************************/ -BOOL pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag) +bool pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag) { if (domain) { DEBUG(10, ("pdb_set_domain: setting domain %s, was %s\n", domain, @@ -619,7 +619,7 @@ BOOL pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_sta Set the user's NT name. ********************************************************************/ -BOOL pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag) +bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag) { if (nt_username) { DEBUG(10, ("pdb_set_nt_username: setting nt username %s, was %s\n", nt_username, @@ -642,7 +642,7 @@ BOOL pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb Set the user's full name. ********************************************************************/ -BOOL pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_value_state flag) +bool pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_value_state flag) { if (full_name) { DEBUG(10, ("pdb_set_full_name: setting full name %s, was %s\n", full_name, @@ -665,7 +665,7 @@ BOOL pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_valu Set the user's logon script. ********************************************************************/ -BOOL pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum pdb_value_state flag) +bool pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum pdb_value_state flag) { if (logon_script) { DEBUG(10, ("pdb_set_logon_script: setting logon script %s, was %s\n", logon_script, @@ -688,7 +688,7 @@ BOOL pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum p Set the user's profile path. ********************************************************************/ -BOOL pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum pdb_value_state flag) +bool pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum pdb_value_state flag) { if (profile_path) { DEBUG(10, ("pdb_set_profile_path: setting profile path %s, was %s\n", profile_path, @@ -711,7 +711,7 @@ BOOL pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum p Set the user's directory drive. ********************************************************************/ -BOOL pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_value_state flag) +bool pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_value_state flag) { if (dir_drive) { DEBUG(10, ("pdb_set_dir_drive: setting dir drive %s, was %s\n", dir_drive, @@ -735,7 +735,7 @@ BOOL pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_val Set the user's home directory. ********************************************************************/ -BOOL pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_state flag) +bool pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_state flag) { if (home_dir) { DEBUG(10, ("pdb_set_homedir: setting home dir %s, was %s\n", home_dir, @@ -758,7 +758,7 @@ BOOL pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_ Set the user's account description. ********************************************************************/ -BOOL pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_value_state flag) +bool pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_value_state flag) { if (acct_desc) { sampass->acct_desc = talloc_strdup(sampass, acct_desc); @@ -778,7 +778,7 @@ BOOL pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_val Set the user's workstation allowed list. ********************************************************************/ -BOOL pdb_set_workstations(struct samu *sampass, const char *workstations, enum pdb_value_state flag) +bool pdb_set_workstations(struct samu *sampass, const char *workstations, enum pdb_value_state flag) { if (workstations) { DEBUG(10, ("pdb_set_workstations: setting workstations %s, was %s\n", workstations, @@ -800,7 +800,7 @@ BOOL pdb_set_workstations(struct samu *sampass, const char *workstations, enum p /********************************************************************* ********************************************************************/ -BOOL pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_state flag) +bool pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_state flag) { if (comment) { sampass->comment = talloc_strdup(sampass, comment); @@ -820,7 +820,7 @@ BOOL pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_s Set the user's dial string. ********************************************************************/ -BOOL pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb_value_state flag) +bool pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb_value_state flag) { if (munged_dial) { sampass->munged_dial = talloc_strdup(sampass, munged_dial); @@ -840,7 +840,7 @@ BOOL pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb Set the user's NT hash. ********************************************************************/ -BOOL pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum pdb_value_state flag) +bool pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum pdb_value_state flag) { data_blob_clear_free(&sampass->nt_pw); @@ -858,7 +858,7 @@ BOOL pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum Set the user's LM hash. ********************************************************************/ -BOOL pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_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) { data_blob_clear_free(&sampass->lm_pw); @@ -880,7 +880,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 historyLen, enum pdb_value_state flag) { if (historyLen && pwd){ sampass->nt_pw_his = data_blob_talloc(sampass, @@ -901,7 +901,7 @@ BOOL pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32 historyLe below) ********************************************************************/ -BOOL pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag) +bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag) { if (password) { if (sampass->plaintext_pw!=NULL) @@ -920,25 +920,25 @@ 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 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 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 unkn, enum pdb_value_state flag) { sampass->unknown_6 = unkn; return pdb_set_init_flags(sampass, PDB_UNKNOWN6, flag); } -BOOL pdb_set_hours(struct samu *sampass, const uint8 *hours, enum pdb_value_state flag) +bool pdb_set_hours(struct samu *sampass, const uint8 *hours, enum pdb_value_state flag) { if (!hours) { memset ((char *)sampass->hours, 0, MAX_HOURS_LEN); @@ -949,7 +949,7 @@ BOOL pdb_set_hours(struct samu *sampass, const uint8 *hours, enum pdb_value_stat return pdb_set_init_flags(sampass, PDB_HOURS, flag); } -BOOL pdb_set_backend_private_data(struct samu *sampass, void *private_data, +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) @@ -970,7 +970,7 @@ BOOL pdb_set_backend_private_data(struct samu *sampass, void *private_data, /* Helpful interfaces to the above */ -BOOL pdb_set_pass_can_change(struct samu *sampass, BOOL canchange) +bool pdb_set_pass_can_change(struct samu *sampass, bool canchange) { return pdb_set_pass_can_change_time(sampass, canchange ? 0 : get_time_t_max(), @@ -983,7 +983,7 @@ BOOL pdb_set_pass_can_change(struct samu *sampass, BOOL canchange) Also sets the last change time to NOW. ********************************************************************/ -BOOL pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) +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]; diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index f038522eed..0347ea8e56 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -35,7 +35,7 @@ static struct pdb_init_function_entry *backends = NULL; static void lazy_initialize_passdb(void) { - static BOOL initialized = False; + static bool initialized = False; if(initialized) { return; } @@ -43,7 +43,7 @@ static void lazy_initialize_passdb(void) initialized = True; } -static BOOL lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid, +static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name, enum lsa_SidType *psid_name_use, union unid_t *unix_id); @@ -175,7 +175,7 @@ NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected Return an already initialised pdn_methods structure *******************************************************************/ -static struct pdb_methods *pdb_get_methods_reload( BOOL reload ) +static struct pdb_methods *pdb_get_methods_reload( bool reload ) { static struct pdb_methods *pdb = NULL; @@ -210,7 +210,7 @@ static struct pdb_methods *pdb_get_methods(void) Backward compatibility functions for the original passdb interface *******************************************************************/ -BOOL pdb_setsampwent(BOOL update, uint16 acb_mask) +bool pdb_setsampwent(bool update, uint16 acb_mask) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb->setsampwent(pdb, update, acb_mask)); @@ -222,7 +222,7 @@ void pdb_endsampwent(void) pdb->endsampwent(pdb); } -BOOL pdb_getsampwent(struct samu *user) +bool pdb_getsampwent(struct samu *user) { struct pdb_methods *pdb = pdb_get_methods(); @@ -233,7 +233,7 @@ BOOL pdb_getsampwent(struct samu *user) return True; } -BOOL pdb_getsampwnam(struct samu *sam_acct, const char *username) +bool pdb_getsampwnam(struct samu *sam_acct, const char *username) { struct pdb_methods *pdb = pdb_get_methods(); @@ -261,7 +261,7 @@ BOOL pdb_getsampwnam(struct samu *sam_acct, const char *username) /********************************************************************** **********************************************************************/ -BOOL guest_user_info( struct samu *user ) +bool guest_user_info( struct samu *user ) { struct passwd *pwd; NTSTATUS result; @@ -283,7 +283,7 @@ BOOL guest_user_info( struct samu *user ) /********************************************************************** **********************************************************************/ -BOOL pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) +bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); uint32 rid; @@ -538,25 +538,25 @@ NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname) return status; } -NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, BOOL success) +NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->update_login_attempts(pdb, sam_acct, success); } -BOOL pdb_getgrsid(GROUP_MAP *map, DOM_SID sid) +bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb->getgrsid(pdb, map, sid)); } -BOOL pdb_getgrgid(GROUP_MAP *map, gid_t gid) +bool pdb_getgrgid(GROUP_MAP *map, gid_t gid) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb->getgrgid(pdb, map, gid)); } -BOOL pdb_getgrnam(GROUP_MAP *map, const char *name) +bool pdb_getgrnam(GROUP_MAP *map, const char *name) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb->getgrnam(pdb, map, name)); @@ -679,8 +679,8 @@ NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid) return pdb->delete_group_mapping_entry(pdb, sid); } -BOOL pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, - size_t *p_num_entries, BOOL unix_only) +bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, + size_t *p_num_entries, bool unix_only) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb-> enum_group_mapping(pdb, sid, sid_name_use, @@ -758,7 +758,7 @@ NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user) * fulfil. */ -static BOOL pdb_user_in_group(TALLOC_CTX *mem_ctx, struct samu *account, +static bool pdb_user_in_group(TALLOC_CTX *mem_ctx, struct samu *account, const DOM_SID *group_sid) { DOM_SID *sids; @@ -993,7 +993,7 @@ NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, } #endif -BOOL pdb_get_account_policy(int policy_index, uint32 *value) +bool pdb_get_account_policy(int policy_index, uint32 *value) { struct pdb_methods *pdb = pdb_get_methods(); NTSTATUS status; @@ -1005,7 +1005,7 @@ BOOL pdb_get_account_policy(int policy_index, uint32 *value) return NT_STATUS_IS_OK(status); } -BOOL pdb_set_account_policy(int policy_index, uint32 value) +bool pdb_set_account_policy(int policy_index, uint32 value) { struct pdb_methods *pdb = pdb_get_methods(); NTSTATUS status; @@ -1017,38 +1017,38 @@ BOOL pdb_set_account_policy(int policy_index, uint32 value) return NT_STATUS_IS_OK(status); } -BOOL pdb_get_seq_num(time_t *seq_num) +bool pdb_get_seq_num(time_t *seq_num) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb->get_seq_num(pdb, seq_num)); } -BOOL pdb_uid_to_rid(uid_t uid, uint32 *rid) +bool pdb_uid_to_rid(uid_t uid, uint32 *rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->uid_to_rid(pdb, uid, rid); } -BOOL pdb_uid_to_sid(uid_t uid, DOM_SID *sid) +bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->uid_to_sid(pdb, uid, sid); } -BOOL pdb_gid_to_sid(gid_t gid, DOM_SID *sid) +bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->gid_to_sid(pdb, gid, sid); } -BOOL pdb_sid_to_id(const DOM_SID *sid, union unid_t *id, +bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id, enum lsa_SidType *type) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->sid_to_id(pdb, sid, id, type); } -BOOL pdb_rid_algorithm(void) +bool pdb_rid_algorithm(void) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->rid_algorithm(pdb); @@ -1061,7 +1061,7 @@ BOOL pdb_rid_algorithm(void) with add RIDs (assigned from previous algorithmic mappings) ********************************************************************/ -BOOL pdb_new_rid(uint32 *rid) +bool pdb_new_rid(uint32 *rid) { struct pdb_methods *pdb = pdb_get_methods(); const char *name = NULL; @@ -1125,7 +1125,7 @@ BOOL pdb_new_rid(uint32 *rid) If uninitialised, context will auto-init on first use. ***************************************************************/ -BOOL initialize_password_db(BOOL reload, struct event_context *event_ctx) +bool initialize_password_db(bool reload, struct event_context *event_ctx) { pdb_event_ctx = event_ctx; return (pdb_get_methods_reload(reload) != NULL); @@ -1166,12 +1166,12 @@ static NTSTATUS pdb_default_rename_sam_account (struct pdb_methods *methods, str return NT_STATUS_NOT_IMPLEMENTED; } -static NTSTATUS pdb_default_update_login_attempts (struct pdb_methods *methods, struct samu *newpwd, BOOL success) +static NTSTATUS pdb_default_update_login_attempts (struct pdb_methods *methods, struct samu *newpwd, bool success) { return NT_STATUS_NOT_IMPLEMENTED; } -static NTSTATUS pdb_default_setsampwent(struct pdb_methods *methods, BOOL update, uint32 acb_mask) +static NTSTATUS pdb_default_setsampwent(struct pdb_methods *methods, bool update, uint32 acb_mask) { return NT_STATUS_NOT_IMPLEMENTED; } @@ -1202,12 +1202,12 @@ static NTSTATUS pdb_default_get_seq_num(struct pdb_methods *methods, time_t *seq return NT_STATUS_OK; } -static BOOL pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid, +static bool pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid, DOM_SID *sid) { struct samu *sampw = NULL; struct passwd *unix_pw; - BOOL ret; + bool ret; unix_pw = sys_getpwuid( uid ); @@ -1241,11 +1241,11 @@ static BOOL pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid, return True; } -static BOOL pdb_default_uid_to_rid(struct pdb_methods *methods, uid_t uid, +static bool pdb_default_uid_to_rid(struct pdb_methods *methods, uid_t uid, uint32 *rid) { DOM_SID sid; - BOOL ret; + bool ret; ret = pdb_default_uid_to_sid(methods, uid, &sid); if (!ret) { @@ -1262,7 +1262,7 @@ static BOOL pdb_default_uid_to_rid(struct pdb_methods *methods, uid_t uid, return ret; } -static BOOL pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid, +static bool pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid, DOM_SID *sid) { GROUP_MAP map; @@ -1275,12 +1275,12 @@ static BOOL pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid, return True; } -static BOOL pdb_default_sid_to_id(struct pdb_methods *methods, +static bool pdb_default_sid_to_id(struct pdb_methods *methods, const DOM_SID *sid, union unid_t *id, enum lsa_SidType *type) { TALLOC_CTX *mem_ctx; - BOOL ret = False; + bool ret = False; const char *name; uint32 rid; @@ -1349,7 +1349,7 @@ static BOOL pdb_default_sid_to_id(struct pdb_methods *methods, return ret; } -static BOOL add_uid_to_array_unique(TALLOC_CTX *mem_ctx, +static bool add_uid_to_array_unique(TALLOC_CTX *mem_ctx, uid_t uid, uid_t **pp_uids, size_t *p_num) { size_t i; @@ -1369,13 +1369,13 @@ static BOOL add_uid_to_array_unique(TALLOC_CTX *mem_ctx, return True; } -static BOOL get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size_t *p_num) +static bool get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size_t *p_num) { struct group *grp; char **gr; struct passwd *pwd; - BOOL winbind_env; - BOOL ret = False; + bool winbind_env; + bool ret = False; *pp_uids = NULL; *p_num = 0; @@ -1516,14 +1516,14 @@ 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 rid, const char **name, enum lsa_SidType *psid_name_use, union unid_t *unix_id) { struct samu *sam_account = NULL; GROUP_MAP map; - BOOL ret; + bool ret; DOM_SID sid; *psid_name_use = SID_NAME_UNKNOWN; @@ -1614,8 +1614,8 @@ static NTSTATUS pdb_default_lookup_rids(struct pdb_methods *methods, { int i; NTSTATUS result; - BOOL have_mapped = False; - BOOL have_unmapped = False; + bool have_mapped = False; + bool have_unmapped = False; if (sid_check_is_builtin(domain_sid)) { @@ -1678,8 +1678,8 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods, { int i; NTSTATUS result; - BOOL have_mapped = False; - BOOL have_unmapped = False; + bool have_mapped = False; + bool have_unmapped = False; if (sid_check_is_builtin(domain_sid)) { @@ -1784,12 +1784,12 @@ static void fill_displayentry(TALLOC_CTX *mem_ctx, uint32 rid, entry->description = ""; } -static BOOL user_search_in_progress = False; +static bool user_search_in_progress = False; struct user_search { uint16 acct_flags; }; -static BOOL next_entry_users(struct pdb_search *s, +static bool next_entry_users(struct pdb_search *s, struct samr_displayentry *entry) { struct user_search *state = (struct user_search *)s->private_data; @@ -1827,7 +1827,7 @@ static void search_end_users(struct pdb_search *search) user_search_in_progress = False; } -static BOOL pdb_default_search_users(struct pdb_methods *methods, +static bool pdb_default_search_users(struct pdb_methods *methods, struct pdb_search *search, uint32 acct_flags) { @@ -1864,7 +1864,7 @@ struct group_search { size_t num_groups, current_group; }; -static BOOL next_entry_groups(struct pdb_search *s, +static bool next_entry_groups(struct pdb_search *s, struct samr_displayentry *entry) { struct group_search *state = (struct group_search *)s->private_data; @@ -1890,7 +1890,7 @@ static void search_end_groups(struct pdb_search *search) SAFE_FREE(state->groups); } -static BOOL pdb_search_grouptype(struct pdb_search *search, +static bool pdb_search_grouptype(struct pdb_search *search, const DOM_SID *sid, enum lsa_SidType type) { struct group_search *state; @@ -1914,13 +1914,13 @@ static BOOL pdb_search_grouptype(struct pdb_search *search, return True; } -static BOOL pdb_default_search_groups(struct pdb_methods *methods, +static bool pdb_default_search_groups(struct pdb_methods *methods, struct pdb_search *search) { return pdb_search_grouptype(search, get_global_sam_sid(), SID_NAME_DOM_GRP); } -static BOOL pdb_default_search_aliases(struct pdb_methods *methods, +static bool pdb_default_search_aliases(struct pdb_methods *methods, struct pdb_search *search, const DOM_SID *sid) { @@ -2043,7 +2043,7 @@ void pdb_search_destroy(struct pdb_search *search) trustodm methods *******************************************************************/ -BOOL pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid, +bool pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid, time_t *pass_last_set_time) { struct pdb_methods *pdb = pdb_get_methods(); @@ -2051,14 +2051,14 @@ BOOL pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid, pass_last_set_time); } -BOOL pdb_set_trusteddom_pw(const char* domain, const char* pwd, +bool pdb_set_trusteddom_pw(const char* domain, const char* pwd, const DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->set_trusteddom_pw(pdb, domain, pwd, sid); } -BOOL pdb_del_trusteddom_pw(const char *domain) +bool pdb_del_trusteddom_pw(const char *domain) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->del_trusteddom_pw(pdb, domain); @@ -2077,7 +2077,7 @@ NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32 *num_domains, to be replaced by pdb_ldap. *******************************************************************/ -static BOOL pdb_default_get_trusteddom_pw(struct pdb_methods *methods, +static bool pdb_default_get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char** pwd, DOM_SID *sid, @@ -2088,7 +2088,7 @@ static BOOL pdb_default_get_trusteddom_pw(struct pdb_methods *methods, } -static BOOL pdb_default_set_trusteddom_pw(struct pdb_methods *methods, +static bool pdb_default_set_trusteddom_pw(struct pdb_methods *methods, const char* domain, const char* pwd, const DOM_SID *sid) @@ -2096,7 +2096,7 @@ static BOOL pdb_default_set_trusteddom_pw(struct pdb_methods *methods, return secrets_store_trusted_domain_password(domain, pwd, sid); } -static BOOL pdb_default_del_trusteddom_pw(struct pdb_methods *methods, +static bool pdb_default_del_trusteddom_pw(struct pdb_methods *methods, const char *domain) { return trusted_domain_password_delete(domain); diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index a945867967..53bca864d8 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -468,7 +468,7 @@ static time_t ldapsam_get_entry_timestamp( struct ldapsam_privates *ldap_state, (Based on init_sam_from_buffer in pdb_tdb.c) *********************************************************************/ -static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state, +static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, struct samu * sampass, LDAPMessage * entry) { @@ -494,7 +494,7 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state, uint32 user_rid; uint8 smblmpwd[LM_HASH_LEN], smbntpwd[NT_HASH_LEN]; - BOOL use_samba_attrs = True; + bool use_samba_attrs = True; uint32 acct_ctrl = 0; uint16 logon_divs; uint16 bad_password_count = 0, @@ -505,7 +505,7 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state, LOGIN_CACHE *cache_entry = NULL; uint32 pwHistLen; pstring tmpstring; - BOOL expand_explicit = lp_passdb_expand_explicit(); + bool expand_explicit = lp_passdb_expand_explicit(); /* * do a little initialization @@ -804,7 +804,7 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state, history_string, sizeof(history_string))) { /* leave as default - zeros */ } else { - BOOL hex_failed = False; + bool hex_failed = False; for (i = 0; i < pwHistLen; i++){ /* Get the 16 byte salt. */ if (!pdb_gethexpwd(&history_string[i*64], &pwhist[i*PW_HISTORY_ENTRY_LEN])) { @@ -937,10 +937,10 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state, (Based on init_buffer_from_sam in pdb_tdb.c) *********************************************************************/ -static BOOL init_ldap_from_sam (struct ldapsam_privates *ldap_state, +static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, LDAPMessage *existing, LDAPMod *** mods, struct samu * sampass, - BOOL (*need_update)(const struct samu *, + bool (*need_update)(const struct samu *, enum pdb_elements)) { pstring temp; @@ -1259,13 +1259,13 @@ static BOOL init_ldap_from_sam (struct ldapsam_privates *ldap_state, Connect to LDAP server for password enumeration. *********************************************************************/ -static NTSTATUS ldapsam_setsampwent(struct pdb_methods *my_methods, BOOL update, uint32 acb_mask) +static NTSTATUS ldapsam_setsampwent(struct pdb_methods *my_methods, bool update, uint32 acb_mask) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; int rc; pstring filter, suffix; const char **attr_list; - BOOL machine_mask = False, user_mask = False; + bool machine_mask = False, user_mask = False; pstr_sprintf( filter, "(&%s%s)", "(uid=%u)", get_objclass_filter(ldap_state->schema_ver)); @@ -1332,7 +1332,7 @@ static NTSTATUS ldapsam_getsampwent(struct pdb_methods *my_methods, NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; - BOOL bret = False; + bool bret = False; while (!bret) { if (!ldap_state->entry) @@ -1528,7 +1528,7 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, struct samu static NTSTATUS ldapsam_modify_entry(struct pdb_methods *my_methods, struct samu *newpwd, char *dn, LDAPMod **mods, int ldap_op, - BOOL (*need_update)(const struct samu *, enum pdb_elements)) + bool (*need_update)(const struct samu *, enum pdb_elements)) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; int rc; @@ -1732,7 +1732,7 @@ static NTSTATUS ldapsam_delete_sam_account(struct pdb_methods *my_methods, we need LDAP modification. *********************************************************************/ -static BOOL element_is_changed(const struct samu *sampass, +static bool element_is_changed(const struct samu *sampass, enum pdb_elements element) { return IS_SAM_CHANGED(sampass, element); @@ -1890,7 +1890,7 @@ static NTSTATUS ldapsam_rename_sam_account(struct pdb_methods *my_methods, we need LDAP modification. *********************************************************************/ -static BOOL element_is_set_or_changed(const struct samu *sampass, +static bool element_is_set_or_changed(const struct samu *sampass, enum pdb_elements element) { return (IS_SAM_SET(sampass, element) || @@ -2137,7 +2137,7 @@ static int ldapsam_search_one_group (struct ldapsam_privates *ldap_state, /********************************************************************** *********************************************************************/ -static BOOL init_group_from_ldap(struct ldapsam_privates *ldap_state, +static bool init_group_from_ldap(struct ldapsam_privates *ldap_state, GROUP_MAP *map, LDAPMessage *entry) { pstring temp; @@ -2316,7 +2316,7 @@ static NTSTATUS ldapsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, return ldapsam_getgroup(methods, filter, map); } -static BOOL ldapsam_extract_rid_from_entry(LDAP *ldap_struct, +static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct, LDAPMessage *entry, const DOM_SID *domain_sid, uint32 *rid) @@ -3077,7 +3077,7 @@ static NTSTATUS ldapsam_delete_group_mapping_entry(struct pdb_methods *methods, *********************************************************************/ static NTSTATUS ldapsam_setsamgrent(struct pdb_methods *my_methods, - BOOL update) + bool update) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; @@ -3131,7 +3131,7 @@ static NTSTATUS ldapsam_getsamgrent(struct pdb_methods *my_methods, NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; - BOOL bret = False; + bool bret = False; while (!bret) { if (!ldap_state->entry) @@ -3156,7 +3156,7 @@ static NTSTATUS ldapsam_enum_group_mapping(struct pdb_methods *methods, const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, - BOOL unix_only) + bool unix_only) { GROUP_MAP map; size_t entries = 0; @@ -3701,7 +3701,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods, NTSTATUS result = NT_STATUS_NO_MEMORY; TALLOC_CTX *mem_ctx; LDAP *ld; - BOOL is_builtin; + bool is_builtin; mem_ctx = talloc_new(NULL); if (mem_ctx == NULL) { @@ -3970,13 +3970,13 @@ struct ldap_search_state { void *pagedresults_cookie; LDAPMessage *entries, *current_entry; - BOOL (*ldap2displayentry)(struct ldap_search_state *state, + bool (*ldap2displayentry)(struct ldap_search_state *state, TALLOC_CTX *mem_ctx, LDAP *ld, LDAPMessage *entry, struct samr_displayentry *result); }; -static BOOL ldapsam_search_firstpage(struct pdb_search *search) +static bool ldapsam_search_firstpage(struct pdb_search *search) { struct ldap_search_state *state = (struct ldap_search_state *)search->private_data; @@ -4029,7 +4029,7 @@ static BOOL ldapsam_search_firstpage(struct pdb_search *search) return True; } -static BOOL ldapsam_search_nextpage(struct pdb_search *search) +static bool ldapsam_search_nextpage(struct pdb_search *search) { struct ldap_search_state *state = (struct ldap_search_state *)search->private_data; @@ -4059,12 +4059,12 @@ static BOOL ldapsam_search_nextpage(struct pdb_search *search) return True; } -static BOOL ldapsam_search_next_entry(struct pdb_search *search, +static bool ldapsam_search_next_entry(struct pdb_search *search, struct samr_displayentry *entry) { struct ldap_search_state *state = (struct ldap_search_state *)search->private_data; - BOOL result; + bool result; retry: if ((state->entries == NULL) && (state->pagedresults_cookie == NULL)) @@ -4127,7 +4127,7 @@ static void ldapsam_search_end(struct pdb_search *search) return; } -static BOOL ldapuser2displayentry(struct ldap_search_state *state, +static bool ldapuser2displayentry(struct ldap_search_state *state, TALLOC_CTX *mem_ctx, LDAP *ld, LDAPMessage *entry, struct samr_displayentry *result) @@ -4211,7 +4211,7 @@ static BOOL ldapuser2displayentry(struct ldap_search_state *state, } -static BOOL ldapsam_search_users(struct pdb_methods *methods, +static bool ldapsam_search_users(struct pdb_methods *methods, struct pdb_search *search, uint32 acct_flags) { @@ -4259,7 +4259,7 @@ static BOOL ldapsam_search_users(struct pdb_methods *methods, return ldapsam_search_firstpage(search); } -static BOOL ldapgroup2displayentry(struct ldap_search_state *state, +static bool ldapgroup2displayentry(struct ldap_search_state *state, TALLOC_CTX *mem_ctx, LDAP *ld, LDAPMessage *entry, struct samr_displayentry *result) @@ -4369,7 +4369,7 @@ static BOOL ldapgroup2displayentry(struct ldap_search_state *state, return True; } -static BOOL ldapsam_search_grouptype(struct pdb_methods *methods, +static bool ldapsam_search_grouptype(struct pdb_methods *methods, struct pdb_search *search, const DOM_SID *sid, enum lsa_SidType type) @@ -4414,20 +4414,20 @@ static BOOL ldapsam_search_grouptype(struct pdb_methods *methods, return ldapsam_search_firstpage(search); } -static BOOL ldapsam_search_groups(struct pdb_methods *methods, +static bool ldapsam_search_groups(struct pdb_methods *methods, struct pdb_search *search) { return ldapsam_search_grouptype(methods, search, get_global_sam_sid(), SID_NAME_DOM_GRP); } -static BOOL ldapsam_search_aliases(struct pdb_methods *methods, +static bool ldapsam_search_aliases(struct pdb_methods *methods, struct pdb_search *search, const DOM_SID *sid) { return ldapsam_search_grouptype(methods, search, sid, SID_NAME_ALIAS); } -static BOOL ldapsam_rid_algorithm(struct pdb_methods *methods) +static bool ldapsam_rid_algorithm(struct pdb_methods *methods) { return False; } @@ -4551,13 +4551,13 @@ 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 *rid) { NTSTATUS result = ldapsam_new_rid_internal(methods, rid); return NT_STATUS_IS_OK(result) ? True : False; } -static BOOL ldapsam_sid_to_id(struct pdb_methods *methods, +static bool ldapsam_sid_to_id(struct pdb_methods *methods, const DOM_SID *sid, union unid_t *id, enum lsa_SidType *type) { @@ -4568,7 +4568,7 @@ static BOOL ldapsam_sid_to_id(struct pdb_methods *methods, NULL }; LDAPMessage *result = NULL; LDAPMessage *entry = NULL; - BOOL ret = False; + bool ret = False; char *value; int rc; @@ -4668,8 +4668,8 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods, LDAPMessage *entry = NULL; LDAPMessage *result = NULL; uint32 num_result; - BOOL is_machine = False; - BOOL add_posix = False; + bool is_machine = False; + bool add_posix = False; LDAPMod **mods = NULL; struct samu *user; char *filter; @@ -4957,7 +4957,7 @@ static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods, LDAPMessage *entry = NULL; LDAPMessage *result = NULL; uint32 num_result; - BOOL is_new_entry = False; + bool is_new_entry = False; LDAPMod **mods = NULL; char *filter; char *groupsidstr; @@ -5482,7 +5482,7 @@ static char *trusteddom_dn(struct ldapsam_privates *ldap_state, ldap_state->domain_dn); } -static BOOL get_trusteddom_pw_int(struct ldapsam_privates *ldap_state, +static bool get_trusteddom_pw_int(struct ldapsam_privates *ldap_state, const char *domain, LDAPMessage **entry) { int rc; @@ -5535,7 +5535,7 @@ static BOOL get_trusteddom_pw_int(struct ldapsam_privates *ldap_state, return True; } -static BOOL ldapsam_get_trusteddom_pw(struct pdb_methods *methods, +static bool ldapsam_get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char** pwd, DOM_SID *sid, @@ -5599,7 +5599,7 @@ static BOOL ldapsam_get_trusteddom_pw(struct pdb_methods *methods, return True; } -static BOOL ldapsam_set_trusteddom_pw(struct pdb_methods *methods, +static bool ldapsam_set_trusteddom_pw(struct pdb_methods *methods, const char* domain, const char* pwd, const DOM_SID *sid) @@ -5661,7 +5661,7 @@ static BOOL ldapsam_set_trusteddom_pw(struct pdb_methods *methods, return True; } -static BOOL ldapsam_del_trusteddom_pw(struct pdb_methods *methods, +static bool ldapsam_del_trusteddom_pw(struct pdb_methods *methods, const char *domain) { int rc; @@ -6006,7 +6006,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location) get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_SID), domain_sid_string)) { - BOOL found_sid; + bool found_sid; if (!string_to_sid(&ldap_domain_sid, domain_sid_string)) { DEBUG(1, ("pdb_init_ldapsam: SID [%s] could not be " "read as a valid SID\n", domain_sid_string)); diff --git a/source3/passdb/pdb_nds.c b/source3/passdb/pdb_nds.c index 0c49b2d1f5..1edd665d54 100644 --- a/source3/passdb/pdb_nds.c +++ b/source3/passdb/pdb_nds.c @@ -740,7 +740,7 @@ int pdb_nds_set_password( *********************************************************************/ static NTSTATUS pdb_nds_update_login_attempts(struct pdb_methods *methods, - struct samu *sam_acct, BOOL success) + struct samu *sam_acct, bool success) { struct ldapsam_privates *ldap_state; @@ -763,7 +763,7 @@ static NTSTATUS pdb_nds_update_login_attempts(struct pdb_methods *methods, char clear_text_pw[512]; LDAP *ld = NULL; const char *username = pdb_get_username(sam_acct); - BOOL got_clear_text_pw = False; + bool got_clear_text_pw = False; DEBUG(5,("pdb_nds_update_login_attempts: %s login for %s\n", success ? "Successful" : "Failed", username)); diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 7d13dd2a8a..0cec76227b 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -79,7 +79,7 @@ static void gotalarm_sig(void) seconds. ****************************************************************/ -static BOOL do_file_lock(int fd, int waitsecs, int type) +static bool do_file_lock(int fd, int waitsecs, int type) { SMB_STRUCT_FLOCK lock; int ret; @@ -113,7 +113,7 @@ static BOOL do_file_lock(int fd, int waitsecs, int type) Lock an fd. Abandon after waitsecs seconds. ****************************************************************/ -static BOOL pw_file_lock(int fd, int type, int secs, int *plock_depth) +static bool pw_file_lock(int fd, int type, int secs, int *plock_depth) { if (fd < 0) { return False; @@ -136,9 +136,9 @@ static BOOL pw_file_lock(int fd, int type, int secs, int *plock_depth) Unlock an fd. Abandon after waitsecs seconds. ****************************************************************/ -static BOOL pw_file_unlock(int fd, int *plock_depth) +static bool pw_file_unlock(int fd, int *plock_depth) { - BOOL ret=True; + bool ret=True; if (fd == 0 || *plock_depth == 0) { return True; @@ -728,7 +728,7 @@ Error was %s. Password file may be corrupt ! Please examine by hand !\n", override = True, override XXXXXXXX'd out password or NO PASS ************************************************************************/ -static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, const struct smb_passwd* pwd) +static bool mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, const struct smb_passwd* pwd) { /* Static buffers we will return. */ pstring user_name; @@ -744,8 +744,8 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con FILE *fp; int lockfd; const char *pfile = smbpasswd_state->smbpasswd_file; - BOOL found_entry = False; - BOOL got_pass_last_set_time = False; + bool found_entry = False; + bool got_pass_last_set_time = False; SMB_OFF_T pwd_seekpos = 0; @@ -1088,7 +1088,7 @@ This is no longer supported.!\n", pwd->smb_name)); Routine to delete an entry in the smbpasswd file by name. *************************************************************************/ -static BOOL del_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, const char *name) +static bool del_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, const char *name) { const char *pfile = smbpasswd_state->smbpasswd_file; pstring pfile2; @@ -1191,7 +1191,7 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); should only stay around as long as the struct samu does. ********************************************************************/ -static BOOL build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampass) +static bool build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampass) { uint32 rid; @@ -1234,7 +1234,7 @@ static BOOL build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampas Create a struct samu from a smb_passwd struct ********************************************************************/ -static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state, +static bool build_sam_account(struct smbpasswd_privates *smbpasswd_state, struct samu *sam_pass, const struct smb_passwd *pw_buf) { struct passwd *pwfile; @@ -1272,7 +1272,7 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state, Functions to be implemented by the new passdb API ****************************************************************/ -static NTSTATUS smbpasswd_setsampwent (struct pdb_methods *my_methods, BOOL update, uint32 acb_mask) +static NTSTATUS smbpasswd_setsampwent (struct pdb_methods *my_methods, bool update, uint32 acb_mask) { struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data; @@ -1317,7 +1317,7 @@ static NTSTATUS smbpasswd_getsampwent(struct pdb_methods *my_methods, struct sam NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data; struct smb_passwd *pw_buf=NULL; - BOOL done = False; + bool done = False; DEBUG(5,("pdb_getsampwent\n")); @@ -1513,7 +1513,7 @@ static NTSTATUS smbpasswd_rename_sam_account (struct pdb_methods *my_methods, { pstring rename_script; struct samu *new_acct = NULL; - BOOL interim_account = False; + bool interim_account = False; NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; if (!*(lp_renameuser_script())) @@ -1574,7 +1574,7 @@ done: return (ret); } -static BOOL smbpasswd_rid_algorithm(struct pdb_methods *methods) +static bool smbpasswd_rid_algorithm(struct pdb_methods *methods) { return True; } diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index ec5ed4d89a..530660f48c 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -49,7 +49,7 @@ struct pwent_list { TDB_DATA key; }; static struct pwent_list *tdbsam_pwent_list; -static BOOL pwent_initialized; +static bool pwent_initialized; /* GLOBAL TDB SAM CONTEXT */ @@ -68,7 +68,7 @@ static pstring tdbsam_filename; /********************************************************************* *********************************************************************/ -static BOOL init_sam_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_sam_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 buflen) { /* times are stored as 32bit integer @@ -104,7 +104,7 @@ static BOOL init_sam_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 buf uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL; uint32 len = 0; uint32 lm_pw_len, nt_pw_len, hourslen; - BOOL ret = True; + bool ret = True; if(sampass == NULL || buf == NULL) { DEBUG(0, ("init_sam_from_buffer_v0: NULL parameters found!\n")); @@ -253,7 +253,7 @@ done: /********************************************************************* *********************************************************************/ -static BOOL init_sam_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_sam_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 buflen) { /* times are stored as 32bit integer @@ -290,7 +290,7 @@ static BOOL init_sam_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 buf uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL; uint32 len = 0; uint32 lm_pw_len, nt_pw_len, hourslen; - BOOL ret = True; + bool ret = True; if(sampass == NULL || buf == NULL) { DEBUG(0, ("init_sam_from_buffer_v1: NULL parameters found!\n")); @@ -442,7 +442,7 @@ done: return ret; } -BOOL init_sam_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen) +bool init_sam_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen) { /* times are stored as 32bit integer @@ -480,9 +480,9 @@ BOOL init_sam_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen) uint32 len = 0; uint32 lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen; uint32 pwHistLen = 0; - BOOL ret = True; + bool ret = True; fstring tmpstring; - BOOL expand_explicit = lp_passdb_expand_explicit(); + bool expand_explicit = lp_passdb_expand_explicit(); if(sampass == NULL || buf == NULL) { DEBUG(0, ("init_sam_from_buffer_v2: NULL parameters found!\n")); @@ -679,7 +679,7 @@ done: Intialize a struct samu struct from a BYTE buffer of size len *********************************************************************/ -static BOOL init_sam_from_buffer(struct samu *sampass, uint8 *buf, uint32 buflen) +static bool init_sam_from_buffer(struct samu *sampass, uint8 *buf, uint32 buflen) { return init_sam_from_buffer_v3(sampass, buf, buflen); } @@ -688,7 +688,7 @@ static BOOL init_sam_from_buffer(struct samu *sampass, uint8 *buf, uint32 buflen Intialize a BYTE buffer from a struct samu struct *********************************************************************/ -static uint32 init_buffer_from_sam (uint8 **buf, struct samu *sampass, BOOL size_only) +static uint32 init_buffer_from_sam (uint8 **buf, struct samu *sampass, bool size_only) { return init_buffer_from_sam_v3(buf, sampass, size_only); } @@ -697,13 +697,13 @@ static uint32 init_buffer_from_sam (uint8 **buf, struct samu *sampass, BOOL size Intialize a BYTE buffer from a struct samu struct *********************************************************************/ -static BOOL tdbsam_convert(int32 from) +static bool tdbsam_convert(int32 from) { const char *vstring = TDBSAM_VERSION_STRING; const char *prefix = USERPREFIX; TDB_DATA data, key, old_key; uint8 *buf = NULL; - BOOL ret; + bool ret; /* handle a Samba upgrade */ tdb_lock_bystring(tdbsam, vstring); @@ -808,7 +808,7 @@ static BOOL tdbsam_convert(int32 from) Uses a reference count to allow multiple open calls. *********************************************************************/ -static BOOL tdbsam_open( const char *name ) +static bool tdbsam_open( const char *name ) { int32 version; @@ -934,7 +934,7 @@ static int tdbsam_traverse_setpwent(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, Save a list of user keys for iteration. ****************************************************************/ -static NTSTATUS tdbsam_setsampwent(struct pdb_methods *my_methods, BOOL update, uint32 acb_mask) +static NTSTATUS tdbsam_setsampwent(struct pdb_methods *my_methods, bool update, uint32 acb_mask) { if ( !tdbsam_open( tdbsam_filename ) ) { DEBUG(0,("tdbsam_getsampwnam: failed to open %s!\n", tdbsam_filename)); @@ -1136,7 +1136,7 @@ static NTSTATUS tdbsam_getsampwsid(struct pdb_methods *my_methods, struct samu * return tdbsam_getsampwrid(my_methods, user, rid); } -static BOOL tdb_delete_samacct_only( struct samu *sam_pass ) +static bool tdb_delete_samacct_only( struct samu *sam_pass ) { fstring keystr; fstring name; @@ -1222,13 +1222,13 @@ static NTSTATUS tdbsam_delete_sam_account(struct pdb_methods *my_methods, struct Update the TDB SAM account record only Assumes that the tdbsam is already open ****************************************************************************/ -static BOOL tdb_update_samacct_only( struct samu* newpwd, int flag ) +static bool tdb_update_samacct_only( struct samu* newpwd, int flag ) { TDB_DATA data; uint8 *buf = NULL; fstring keystr; fstring name; - BOOL ret = True; + bool ret = True; /* copy the struct samu struct into a BYTE buffer for storage */ @@ -1271,7 +1271,7 @@ done: Update the TDB SAM RID record only Assumes that the tdbsam is already open ****************************************************************************/ -static BOOL tdb_update_ridrec_only( struct samu* newpwd, int flag ) +static bool tdb_update_ridrec_only( struct samu* newpwd, int flag ) { TDB_DATA data; fstring keystr; @@ -1302,9 +1302,9 @@ static BOOL tdb_update_ridrec_only( struct samu* newpwd, int flag ) Update the TDB SAM ****************************************************************************/ -static BOOL tdb_update_sam(struct pdb_methods *my_methods, struct samu* newpwd, int flag) +static bool tdb_update_sam(struct pdb_methods *my_methods, struct samu* newpwd, int flag) { - BOOL result = True; + bool result = True; /* invalidate the existing TDB iterator if it is open */ @@ -1380,7 +1380,7 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods, { struct samu *new_acct = NULL; pstring rename_script; - BOOL interim_account = False; + bool interim_account = False; int rename_ret; fstring oldname_lower; fstring newname_lower; @@ -1482,7 +1482,7 @@ done: return NT_STATUS_ACCESS_DENIED; } -static BOOL tdbsam_rid_algorithm(struct pdb_methods *methods) +static bool tdbsam_rid_algorithm(struct pdb_methods *methods) { return False; } @@ -1503,7 +1503,7 @@ static BOOL tdbsam_rid_algorithm(struct pdb_methods *methods) interested in the RID counter. *****************************************************************************/ -static BOOL init_idmap_tdb(TDB_CONTEXT *tdb) +static bool init_idmap_tdb(TDB_CONTEXT *tdb) { int32 version; @@ -1536,11 +1536,11 @@ static BOOL init_idmap_tdb(TDB_CONTEXT *tdb) return True; } -static BOOL tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid) +static bool tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid) { TDB_CONTEXT *tdb; uint32 rid; - BOOL ret = False; + bool ret = False; tdb = tdb_open_log(lock_path("winbindd_idmap.tdb"), 0, TDB_DEFAULT, O_RDWR | O_CREAT, 0644); diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 771adb96e3..512c3de9f0 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -30,7 +30,7 @@ static TDB_CONTEXT *tdb; /* Urrrg. global.... */ -BOOL global_machine_password_needs_changing; +bool global_machine_password_needs_changing; /** * Use a TDB to store an incrementing random seed. @@ -49,7 +49,7 @@ static void get_rand_seed(int *new_seed) } /* open up the secrets database */ -BOOL secrets_init(void) +bool secrets_init(void) { pstring fname; unsigned char dummy; @@ -98,7 +98,7 @@ void *secrets_fetch(const char *key, size_t *size) /* store a secrets entry */ -BOOL secrets_store(const char *key, const void *data, size_t size) +bool secrets_store(const char *key, const void *data, size_t size) { secrets_init(); if (!tdb) @@ -111,7 +111,7 @@ BOOL secrets_store(const char *key, const void *data, size_t size) /* delete a secets database entry */ -BOOL secrets_delete(const char *key) +bool secrets_delete(const char *key) { secrets_init(); if (!tdb) @@ -119,10 +119,10 @@ BOOL secrets_delete(const char *key) return tdb_trans_delete(tdb, string_tdb_data(key)) == 0; } -BOOL secrets_store_domain_sid(const char *domain, const DOM_SID *sid) +bool secrets_store_domain_sid(const char *domain, const DOM_SID *sid) { fstring key; - BOOL ret; + bool ret; slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_SID, domain); strupper_m(key); @@ -134,7 +134,7 @@ BOOL secrets_store_domain_sid(const char *domain, const DOM_SID *sid) return ret; } -BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid) +bool secrets_fetch_domain_sid(const char *domain, DOM_SID *sid) { DOM_SID *dyn_sid; fstring key; @@ -157,7 +157,7 @@ BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid) return True; } -BOOL secrets_store_domain_guid(const char *domain, struct GUID *guid) +bool secrets_store_domain_guid(const char *domain, struct GUID *guid) { fstring key; @@ -166,7 +166,7 @@ BOOL secrets_store_domain_guid(const char *domain, struct GUID *guid) return secrets_store(key, guid, sizeof(struct GUID)); } -BOOL secrets_fetch_domain_guid(const char *domain, struct GUID *guid) +bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid) { struct GUID *dyn_guid; fstring key; @@ -239,7 +239,7 @@ static char *trustdom_keystr(const char *domain) Lock the trust password entry. ************************************************************************/ -BOOL secrets_lock_trust_account_password(const char *domain, BOOL dolock) +bool secrets_lock_trust_account_password(const char *domain, bool dolock) { if (!tdb) return False; @@ -271,7 +271,7 @@ uint32 get_default_sec_channel(void) the above secrets_lock_trust_account_password(). ************************************************************************/ -BOOL secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16], +bool secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16], time_t *pass_last_set_time, uint32 *channel) { @@ -454,7 +454,7 @@ static size_t tdb_trusted_dom_pass_unpack(uint8 *pack_buf, int bufsize, Routine to get account password to trusted domain ************************************************************************/ -BOOL secrets_fetch_trusted_domain_password(const char *domain, char** pwd, +bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd, DOM_SID *sid, time_t *pass_last_set_time) { struct trusted_dom_pass pass; @@ -503,7 +503,7 @@ BOOL secrets_fetch_trusted_domain_password(const char *domain, char** pwd, Routine to set the trust account password for a domain. ************************************************************************/ -BOOL secrets_store_trust_account_password(const char *domain, uint8 new_pwd[16]) +bool secrets_store_trust_account_password(const char *domain, uint8 new_pwd[16]) { struct machine_acct_pass pass; @@ -523,7 +523,7 @@ BOOL secrets_store_trust_account_password(const char *domain, uint8 new_pwd[16]) * @return true if succeeded **/ -BOOL secrets_store_trusted_domain_password(const char* domain, const char* pwd, +bool secrets_store_trusted_domain_password(const char* domain, const char* pwd, const DOM_SID *sid) { smb_ucs2_t *uni_dom_name; @@ -566,10 +566,10 @@ BOOL secrets_store_trusted_domain_password(const char* domain, const char* pwd, the password is assumed to be a null terminated ascii string ************************************************************************/ -BOOL secrets_store_machine_password(const char *pass, const char *domain, uint32 sec_channel) +bool secrets_store_machine_password(const char *pass, const char *domain, uint32 sec_channel) { char *key = NULL; - BOOL ret; + bool ret; uint32 last_change_time; uint32 sec_channel_type; @@ -658,7 +658,7 @@ char *secrets_fetch_machine_password(const char *domain, Routine to delete the machine trust account password file for a domain. ************************************************************************/ -BOOL trust_password_delete(const char *domain) +bool trust_password_delete(const char *domain) { return secrets_delete(trust_keystr(domain)); } @@ -667,15 +667,15 @@ BOOL trust_password_delete(const char *domain) Routine to delete the password for trusted domain ************************************************************************/ -BOOL trusted_domain_password_delete(const char *domain) +bool trusted_domain_password_delete(const char *domain) { return secrets_delete(trustdom_keystr(domain)); } -BOOL secrets_store_ldap_pw(const char* dn, char* pw) +bool secrets_store_ldap_pw(const char* dn, char* pw) { char *key = NULL; - BOOL ret; + bool ret; if (asprintf(&key, "%s/%s", SECRETS_LDAP_BIND_PW, dn) < 0) { DEBUG(0, ("secrets_store_ldap_pw: asprintf failed!\n")); @@ -692,7 +692,7 @@ BOOL secrets_store_ldap_pw(const char* dn, char* pw) Find the ldap password. ******************************************************************/ -BOOL fetch_ldap_pw(char **dn, char** pw) +bool fetch_ldap_pw(char **dn, char** pw) { char *key = NULL; size_t size = 0; @@ -876,7 +876,7 @@ NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains, between smbd instances. *******************************************************************************/ -BOOL secrets_named_mutex(const char *name, unsigned int timeout) +bool secrets_named_mutex(const char *name, unsigned int timeout) { int ret = 0; @@ -904,7 +904,7 @@ void secrets_named_mutex_release(const char *name) Store a complete AFS keyfile into secrets.tdb. *******************************************************************************/ -BOOL secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile) +bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile) { fstring key; @@ -921,7 +921,7 @@ BOOL secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfi /******************************************************************************* Fetch the current (highest) AFS key from secrets.tdb *******************************************************************************/ -BOOL secrets_fetch_afs_key(const char *cell, struct afs_key *result) +bool secrets_fetch_afs_key(const char *cell, struct afs_key *result) { fstring key; struct afs_keyfile *keyfile; @@ -1047,13 +1047,13 @@ static TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx) Note we must be root here. *******************************************************************************/ -BOOL secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx, +bool secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx, const char *remote_machine, const struct dcinfo *pdc) { TDB_CONTEXT *tdb_sc = NULL; TDB_DATA value; - BOOL ret; + bool ret; char *keystr = talloc_asprintf(mem_ctx, "%s/%s", SECRETS_SCHANNEL_STATE, remote_machine); if (!keystr) { @@ -1114,7 +1114,7 @@ BOOL secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx, Note we must be root here. *******************************************************************************/ -BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx, +bool secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx, const char *remote_machine, struct dcinfo **ppdc) { @@ -1211,10 +1211,10 @@ BOOL secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx, return True; } -BOOL secrets_store_generic(const char *owner, const char *key, const char *secret) +bool secrets_store_generic(const char *owner, const char *key, const char *secret) { char *tdbkey = NULL; - BOOL ret; + bool ret; if (asprintf(&tdbkey, "SECRETS/GENERIC/%s/%s", owner, key) < 0) { DEBUG(0, ("asprintf failed!\n")); diff --git a/source3/passdb/util_builtin.c b/source3/passdb/util_builtin.c index 04e9d53ecf..dbddddd25d 100644 --- a/source3/passdb/util_builtin.c +++ b/source3/passdb/util_builtin.c @@ -41,7 +41,7 @@ static const struct rid_name_map builtin_aliases[] = { /******************************************************************* Look up a rid in the BUILTIN domain ********************************************************************/ -BOOL lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name) +bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name) { const struct rid_name_map *aliases = builtin_aliases; @@ -59,7 +59,7 @@ BOOL lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name) /******************************************************************* Look up a name in the BUILTIN domain ********************************************************************/ -BOOL lookup_builtin_name(const char *name, uint32 *rid) +bool lookup_builtin_name(const char *name, uint32 *rid) { const struct rid_name_map *aliases = builtin_aliases; @@ -87,7 +87,7 @@ const char *builtin_domain_name(void) Check if the SID is the builtin SID (S-1-5-32). *****************************************************************/ -BOOL sid_check_is_builtin(const DOM_SID *sid) +bool sid_check_is_builtin(const DOM_SID *sid) { return sid_equal(sid, &global_sid_Builtin); } @@ -96,7 +96,7 @@ BOOL sid_check_is_builtin(const DOM_SID *sid) Check if the SID is one of the builtin SIDs (S-1-5-32-a). *****************************************************************/ -BOOL sid_check_is_in_builtin(const DOM_SID *sid) +bool sid_check_is_in_builtin(const DOM_SID *sid) { DOM_SID dom_sid; uint32 rid; diff --git a/source3/passdb/util_unixsids.c b/source3/passdb/util_unixsids.c index 59ad4e708d..8c92f95778 100644 --- a/source3/passdb/util_unixsids.c +++ b/source3/passdb/util_unixsids.c @@ -19,12 +19,12 @@ #include "includes.h" -BOOL sid_check_is_unix_users(const DOM_SID *sid) +bool sid_check_is_unix_users(const DOM_SID *sid) { return sid_equal(sid, &global_sid_Unix_Users); } -BOOL sid_check_is_in_unix_users(const DOM_SID *sid) +bool sid_check_is_in_unix_users(const DOM_SID *sid) { DOM_SID dom_sid; uint32 rid; @@ -35,13 +35,13 @@ BOOL sid_check_is_in_unix_users(const DOM_SID *sid) return sid_check_is_unix_users(&dom_sid); } -BOOL uid_to_unix_users_sid(uid_t uid, DOM_SID *sid) +bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid) { sid_copy(sid, &global_sid_Unix_Users); return sid_append_rid(sid, uid); } -BOOL gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid) +bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid) { sid_copy(sid, &global_sid_Unix_Groups); return sid_append_rid(sid, gid); @@ -52,7 +52,7 @@ const char *unix_users_domain_name(void) return "Unix User"; } -BOOL lookup_unix_user_name(const char *name, DOM_SID *sid) +bool lookup_unix_user_name(const char *name, DOM_SID *sid) { struct passwd *pwd; @@ -68,12 +68,12 @@ BOOL lookup_unix_user_name(const char *name, DOM_SID *sid) return True; } -BOOL sid_check_is_unix_groups(const DOM_SID *sid) +bool sid_check_is_unix_groups(const DOM_SID *sid) { return sid_equal(sid, &global_sid_Unix_Groups); } -BOOL sid_check_is_in_unix_groups(const DOM_SID *sid) +bool sid_check_is_in_unix_groups(const DOM_SID *sid) { DOM_SID dom_sid; uint32 rid; @@ -89,7 +89,7 @@ const char *unix_groups_domain_name(void) return "Unix Group"; } -BOOL lookup_unix_group_name(const char *name, DOM_SID *sid) +bool lookup_unix_group_name(const char *name, DOM_SID *sid) { struct group *grp; diff --git a/source3/passdb/util_wellknown.c b/source3/passdb/util_wellknown.c index f4595709d8..3ac8c1453c 100644 --- a/source3/passdb/util_wellknown.c +++ b/source3/passdb/util_wellknown.c @@ -69,7 +69,7 @@ static struct sid_name_map_info special_domains[] = { { &global_sid_NT_Authority, "NT Authority", nt_authority_users }, { NULL, NULL, NULL }}; -BOOL sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name) +bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name) { int i; @@ -84,7 +84,7 @@ BOOL sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name) return False; } -BOOL sid_check_is_in_wellknown_domain(const DOM_SID *sid) +bool sid_check_is_in_wellknown_domain(const DOM_SID *sid) { DOM_SID dom_sid; uint32 rid; @@ -99,7 +99,7 @@ BOOL sid_check_is_in_wellknown_domain(const DOM_SID *sid) Looks up a known username from one of the known domains. ***************************************************************************/ -BOOL lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, const char **domain, const char **name) { int i; @@ -145,7 +145,7 @@ BOOL lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, Try and map a name to one of the well known SIDs. ***************************************************************************/ -BOOL lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name, +bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name, DOM_SID *sid, const char **domain) { int i, j; -- cgit