diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-18 17:40:25 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-10-18 17:40:25 -0700 |
commit | 30191d1a5704ad2b158386b511558972d539ce47 (patch) | |
tree | 4f46e5c4f28f672ab661aa18f45745860970a88c /source3/winbindd | |
parent | 789856f63ff73fec66298e95c91c60db7bdaf14e (diff) | |
download | samba-30191d1a5704ad2b158386b511558972d539ce47.tar.gz samba-30191d1a5704ad2b158386b511558972d539ce47.tar.bz2 samba-30191d1a5704ad2b158386b511558972d539ce47.zip |
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)
Diffstat (limited to 'source3/winbindd')
24 files changed, 308 insertions, 308 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 022a2291a3..9800e32505 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -45,7 +45,7 @@ struct idmap_cache_ctx; struct idmap_alloc_context { const char *params; struct idmap_alloc_methods *methods; - BOOL initialized; + bool initialized; }; static TALLOC_CTX *idmap_ctx = NULL; @@ -104,7 +104,7 @@ static struct idmap_alloc_methods *get_alloc_methods( return NULL; } -BOOL idmap_is_offline(void) +bool idmap_is_offline(void) { return ( lp_winbind_offline_logon() && get_global_winbindd_state_offline() ); @@ -287,8 +287,8 @@ NTSTATUS idmap_init(void) const char **dom_list = NULL; const char *default_domain = NULL; char *alloc_backend = NULL; - BOOL default_already_defined = False; - BOOL pri_dom_is_in_list = False; + bool default_already_defined = False; + bool pri_dom_is_in_list = False; int compat = 0; int i; diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index b2d41e436c..0d190eb4a1 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -58,7 +58,7 @@ static ADS_STRUCT *ad_idmap_cached_connection_internal(void) { ADS_STRUCT *ads; ADS_STATUS status; - BOOL local = False; + bool local = False; fstring dc_name; struct in_addr dc_ip; diff --git a/source3/winbindd/idmap_cache.c b/source3/winbindd/idmap_cache.c index 4f01cb1392..6455f5ee69 100644 --- a/source3/winbindd/idmap_cache.c +++ b/source3/winbindd/idmap_cache.c @@ -301,7 +301,7 @@ failed: return NT_STATUS_INTERNAL_DB_CORRUPTION; } -BOOL idmap_cache_is_negative(const char *val) +bool idmap_cache_is_negative(const char *val) { if ( ! strcmp("IDMAP/NEGATIVE", val)) { return True; diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c index 9daf084ce1..a980d54bbe 100644 --- a/source3/winbindd/idmap_ldap.c +++ b/source3/winbindd/idmap_ldap.c @@ -39,7 +39,7 @@ struct idmap_ldap_context { char *suffix; char *user_dn; uint32_t filter_low_id, filter_high_id; /* Filter range */ - BOOL anon; + bool anon; }; struct idmap_ldap_alloc_context { @@ -78,7 +78,7 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx, char *secret = NULL; const char *tmp = NULL; char *user_dn = NULL; - BOOL anon = False; + bool anon = False; /* assume anonymous if we don't have a specified user */ @@ -897,7 +897,7 @@ static NTSTATUS idmap_ldap_unixids_to_sids(struct idmap_domain *dom, const char *gidNumber; const char **attr_list; char *filter = NULL; - BOOL multi = False; + bool multi = False; int idx = 0; int bidx = 0; int count; @@ -1127,7 +1127,7 @@ static NTSTATUS idmap_ldap_sids_to_unixids(struct idmap_domain *dom, const char *gidNumber; const char **attr_list; char *filter = NULL; - BOOL multi = False; + bool multi = False; int idx = 0; int bidx = 0; int count; diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c index 5bb2389c93..fa9f2c9681 100644 --- a/source3/winbindd/idmap_nss.c +++ b/source3/winbindd/idmap_nss.c @@ -59,7 +59,7 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma struct group *gr; const char *name; enum lsa_SidType type; - BOOL ret; + bool ret; switch (ids[i]->xid.type) { case ID_TYPE_UID: @@ -150,7 +150,7 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma enum lsa_SidType type; const char *dom_name = NULL; const char *name = NULL; - BOOL ret; + bool ret; /* by default calls to winbindd are disabled the following call will not recurse so this is safe */ diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index 97000689fa..881377bda6 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -54,7 +54,7 @@ static int convert_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA data, void *state fstring keystr; fstring dom_name; TDB_DATA key2; - BOOL *failed = (BOOL *)state; + bool *failed = (bool *)state; DEBUG(10,("Converting %s\n", (const char *)key.dptr)); @@ -114,11 +114,11 @@ static int convert_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA data, void *state Convert the idmap database from an older version. *****************************************************************************/ -static BOOL idmap_tdb_upgrade(const char *idmap_name) +static bool idmap_tdb_upgrade(const char *idmap_name) { int32 vers; - BOOL bigendianheader; - BOOL failed = False; + bool bigendianheader; + bool failed = False; TDB_CONTEXT *idmap_tdb; DEBUG(0, ("Upgrading winbindd_idmap.tdb from an old version\n")); @@ -205,7 +205,7 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx, TDB_CONTEXT **tdbctx) SMB_STRUCT_STAT stbuf; char *tdbfile = NULL; int32 version; - BOOL tdb_is_new = False; + bool tdb_is_new = False; if (idmap_tdb_open_ref_count) { /* the tdb has already been opened */ idmap_tdb_open_ref_count++; @@ -284,7 +284,7 @@ done: /* NEVER use tdb_close() except for the conversion routines that are guaranteed * to run only when the database is opened the first time, always use this function. */ -BOOL idmap_tdb_tdb_close(TDB_CONTEXT *tdbctx) +bool idmap_tdb_tdb_close(TDB_CONTEXT *tdbctx) { if (tdbctx != idmap_tdb_common_ctx) { DEBUG(0, ("ERROR: Invalid tdb context!")); @@ -408,7 +408,7 @@ static NTSTATUS idmap_tdb_alloc_init( const char *params ) static NTSTATUS idmap_tdb_allocate_id(struct unixid *xid) { - BOOL ret; + bool ret; const char *hwmkey; const char *hwmtype; uint32_t high_hwm; diff --git a/source3/winbindd/nss_info.c b/source3/winbindd/nss_info.c index ea51e9dde8..daa3dd037d 100644 --- a/source3/winbindd/nss_info.c +++ b/source3/winbindd/nss_info.c @@ -82,7 +82,7 @@ static struct nss_function_entry *nss_get_backend(const char *name ) /******************************************************************** *******************************************************************/ -static BOOL parse_nss_parm( const char *config, char **backend, char **domain ) +static bool parse_nss_parm( const char *config, char **backend, char **domain ) { char *p; char *q; diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 81f07c4c8c..97bbe063ba 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -28,10 +28,10 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -BOOL opt_nocache = False; -static BOOL interactive = False; +bool opt_nocache = False; +static bool interactive = False; -extern BOOL override_logfile; +extern bool override_logfile; struct event_context *winbind_event_context(void) { @@ -56,9 +56,9 @@ struct messaging_context *winbind_messaging_context(void) /* Reload configuration */ -static BOOL reload_services_file(void) +static bool reload_services_file(void) { - BOOL ret; + bool ret; if (lp_loaded()) { pstring fname; @@ -153,7 +153,7 @@ static void terminate(void) exit(0); } -static BOOL do_sigterm; +static bool do_sigterm; static void termination_handler(int signum) { @@ -161,7 +161,7 @@ static void termination_handler(int signum) sys_select_signal(signum); } -static BOOL do_sigusr2; +static bool do_sigusr2; static void sigusr2_handler(int signum) { @@ -169,7 +169,7 @@ static void sigusr2_handler(int signum) sys_select_signal(SIGUSR2); } -static BOOL do_sighup; +static bool do_sighup; static void sighup_handler(int signum) { @@ -177,7 +177,7 @@ static void sighup_handler(int signum) sys_select_signal(SIGHUP); } -static BOOL do_sigchld; +static bool do_sigchld; static void sigchld_handler(int signum) { @@ -478,7 +478,7 @@ static void rw_callback(struct fd_event *event, int flags) */ void setup_async_read(struct fd_event *event, void *data, size_t length, - void (*finished)(void *private_data, BOOL success), + void (*finished)(void *private_data, bool success), void *private_data) { SMB_ASSERT(event->flags == 0); @@ -492,7 +492,7 @@ void setup_async_read(struct fd_event *event, void *data, size_t length, } void setup_async_write(struct fd_event *event, void *data, size_t length, - void (*finished)(void *private_data, BOOL success), + void (*finished)(void *private_data, bool success), void *private_data) { SMB_ASSERT(event->flags == 0); @@ -515,15 +515,15 @@ void setup_async_write(struct fd_event *event, void *data, size_t length, * to call request_finished which schedules sending the response. */ -static void request_len_recv(void *private_data, BOOL success); -static void request_recv(void *private_data, BOOL success); -static void request_main_recv(void *private_data, BOOL success); +static void request_len_recv(void *private_data, bool success); +static void request_recv(void *private_data, bool success); +static void request_main_recv(void *private_data, bool success); static void request_finished(struct winbindd_cli_state *state); -void request_finished_cont(void *private_data, BOOL success); -static void response_main_sent(void *private_data, BOOL success); -static void response_extra_sent(void *private_data, BOOL success); +void request_finished_cont(void *private_data, bool success); +static void response_main_sent(void *private_data, bool success); +static void response_extra_sent(void *private_data, bool success); -static void response_extra_sent(void *private_data, BOOL success) +static void response_extra_sent(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -545,7 +545,7 @@ static void response_extra_sent(void *private_data, BOOL success) request_len_recv, state); } -static void response_main_sent(void *private_data, BOOL success) +static void response_main_sent(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -591,7 +591,7 @@ void request_ok(struct winbindd_cli_state *state) request_finished(state); } -void request_finished_cont(void *private_data, BOOL success) +void request_finished_cont(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -602,7 +602,7 @@ void request_finished_cont(void *private_data, BOOL success) request_error(state); } -static void request_len_recv(void *private_data, BOOL success) +static void request_len_recv(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -624,7 +624,7 @@ static void request_len_recv(void *private_data, BOOL success) request_main_recv, state); } -static void request_main_recv(void *private_data, BOOL success) +static void request_main_recv(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -665,7 +665,7 @@ static void request_main_recv(void *private_data, BOOL success) state->request.extra_len, request_recv, state); } -static void request_recv(void *private_data, BOOL success) +static void request_recv(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -680,7 +680,7 @@ static void request_recv(void *private_data, BOOL success) /* Process a new connection by adding it to the client connection list */ -static void new_connection(int listen_sock, BOOL privileged) +static void new_connection(int listen_sock, bool privileged) { struct sockaddr_un sunaddr; struct winbindd_cli_state *state; @@ -764,7 +764,7 @@ static void remove_client(struct winbindd_cli_state *state) /* Shutdown client connection which has been idle for the longest time */ -static BOOL remove_idle_client(void) +static bool remove_idle_client(void) { struct winbindd_cli_state *state, *remove_state = NULL; time_t last_access = 0; @@ -984,10 +984,10 @@ static void process_loop(void) int main(int argc, char **argv, char **envp) { pstring logfile; - static BOOL is_daemon = False; - static BOOL Fork = True; - static BOOL log_stdout = False; - static BOOL no_process_group = False; + static bool is_daemon = False; + static bool Fork = True; + static bool log_stdout = False; + static bool no_process_group = False; struct poptOption long_options[] = { POPT_AUTOHELP { "stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" }, diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h index ebede0f007..5fc083f7a9 100644 --- a/source3/winbindd/winbindd.h +++ b/source3/winbindd/winbindd.h @@ -49,13 +49,13 @@ struct fd_event { void (*handler)(struct fd_event *fde, int flags); void *data; size_t length, done; - void (*finished)(void *private_data, BOOL success); + void (*finished)(void *private_data, bool success); void *private_data; }; struct sid_ctr { DOM_SID *sid; - BOOL finished; + bool finished; const char *domain; const char *name; enum lsa_SidType type; @@ -66,17 +66,17 @@ struct winbindd_cli_state { int sock; /* Open socket from client */ struct fd_event fd_event; pid_t pid; /* pid of client */ - BOOL finished; /* Can delete from list */ - BOOL write_extra_data; /* Write extra_data field */ + bool finished; /* Can delete from list */ + bool write_extra_data; /* Write extra_data field */ time_t last_access; /* Time of last access (read or write) */ - BOOL privileged; /* Is the client 'privileged' */ + bool privileged; /* Is the client 'privileged' */ TALLOC_CTX *mem_ctx; /* memory per request */ struct winbindd_request request; /* Request from client */ struct winbindd_response response; /* Respose to client */ - BOOL getpwent_initialized; /* Has getpwent_state been + bool getpwent_initialized; /* Has getpwent_state been * initialized? */ - BOOL getgrent_initialized; /* Has getgrent_state been + bool getgrent_initialized; /* Has getgrent_state been * initialized? */ struct getent_state *getpwent_state; /* State for getpwent() */ struct getent_state *getgrent_state; /* State for getgrent() */ @@ -88,7 +88,7 @@ struct getent_state { struct getent_state *prev, *next; void *sam_entries; uint32 sam_entry_index, num_sam_entries; - BOOL got_sam_entries; + bool got_sam_entries; fstring domain_name; }; @@ -156,14 +156,14 @@ struct winbindd_domain { uint32 domain_flags; /* Domain flags from rpc_ds.h */ uint32 domain_type; /* Domain type from rpc_ds.h */ uint32 domain_trust_attribs; /* Trust attribs from rpc_ds.h */ - BOOL initialized; /* Did we already ask for the domain mode? */ - BOOL native_mode; /* is this a win2k domain in native mode ? */ - BOOL active_directory; /* is this a win2k active directory ? */ - BOOL primary; /* is this our primary domain ? */ - BOOL internal; /* BUILTIN and member SAM */ - BOOL online; /* is this domain available ? */ + bool initialized; /* Did we already ask for the domain mode? */ + bool native_mode; /* is this a win2k domain in native mode ? */ + bool active_directory; /* is this a win2k active directory ? */ + bool primary; /* is this our primary domain ? */ + bool internal; /* BUILTIN and member SAM */ + bool online; /* is this domain available ? */ time_t startup_time; /* When we set "startup" true. */ - BOOL startup; /* are we in the first 30 seconds after startup_time ? */ + bool startup; /* are we in the first 30 seconds after startup_time ? */ /* Lookup methods for this domain (LDAP or RPC) */ struct winbindd_methods *methods; @@ -209,7 +209,7 @@ struct winbindd_domain { struct winbindd_methods { /* does this backend provide a consistent view of the data? (ie. is the primary group always correct) */ - BOOL consistent; + bool consistent; /* get a list of users, returning a WINBIND_USERINFO for each one */ NTSTATUS (*query_user_list)(struct winbindd_domain *domain, @@ -318,16 +318,16 @@ typedef struct { /* Filled out by IDMAP backends */ struct winbindd_idmap_methods { /* Called when backend is first loaded */ - BOOL (*init)(void); + bool (*init)(void); - BOOL (*get_sid_from_uid)(uid_t uid, DOM_SID *sid); - BOOL (*get_sid_from_gid)(gid_t gid, DOM_SID *sid); + bool (*get_sid_from_uid)(uid_t uid, DOM_SID *sid); + bool (*get_sid_from_gid)(gid_t gid, DOM_SID *sid); - BOOL (*get_uid_from_sid)(DOM_SID *sid, uid_t *uid); - BOOL (*get_gid_from_sid)(DOM_SID *sid, gid_t *gid); + bool (*get_uid_from_sid)(DOM_SID *sid, uid_t *uid); + bool (*get_gid_from_sid)(DOM_SID *sid, gid_t *gid); /* Called when backend is unloaded */ - BOOL (*close)(void); + bool (*close)(void); /* Called to dump backend status */ void (*status)(void); }; diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 488967ed09..3f3f06e3fd 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -273,7 +273,7 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain, LDAPMessage *msg = NULL; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; const char *filter; - BOOL enum_dom_local_groups = False; + bool enum_dom_local_groups = False; *num_entries = 0; diff --git a/source3/winbindd/winbindd_async.c b/source3/winbindd/winbindd_async.c index 5d31ff0a41..ae549d0fcf 100644 --- a/source3/winbindd/winbindd_async.c +++ b/source3/winbindd/winbindd_async.c @@ -42,13 +42,13 @@ struct do_async_state { struct winbindd_request request; struct winbindd_response response; void (*cont)(TALLOC_CTX *mem_ctx, - BOOL success, + bool success, struct winbindd_response *response, void *c, void *private_data); void *c, *private_data; }; -static void do_async_recv(void *private_data, BOOL success) +static void do_async_recv(void *private_data, bool success) { struct do_async_state *state = talloc_get_type_abort(private_data, struct do_async_state); @@ -59,7 +59,7 @@ static void do_async_recv(void *private_data, BOOL success) static void do_async(TALLOC_CTX *mem_ctx, struct winbindd_child *child, const struct winbindd_request *request, - void (*cont)(TALLOC_CTX *mem_ctx, BOOL success, + void (*cont)(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data), void *c, void *private_data) @@ -86,7 +86,7 @@ static void do_async(TALLOC_CTX *mem_ctx, struct winbindd_child *child, void do_async_domain(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, const struct winbindd_request *request, - void (*cont)(TALLOC_CTX *mem_ctx, BOOL success, + void (*cont)(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data), void *c, void *private_data) @@ -111,11 +111,11 @@ void do_async_domain(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, &state->response, do_async_recv, state); } -static void winbindd_set_mapping_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_set_mapping_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ) = (void (*)(void *, BOOL))c; + void (*cont)(void *priv, bool succ) = (void (*)(void *, bool))c; if (!success) { DEBUG(5, ("Could not trigger idmap_set_mapping\n")); @@ -133,7 +133,7 @@ static void winbindd_set_mapping_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_set_mapping_async(TALLOC_CTX *mem_ctx, const struct id_map *map, - void (*cont)(void *private_data, BOOL success), + void (*cont)(void *private_data, bool success), void *private_data) { struct winbindd_request request; @@ -168,11 +168,11 @@ enum winbindd_result winbindd_dual_set_mapping(struct winbindd_domain *domain, return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR; } -static void winbindd_set_hwm_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_set_hwm_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ) = (void (*)(void *, BOOL))c; + void (*cont)(void *priv, bool succ) = (void (*)(void *, bool))c; if (!success) { DEBUG(5, ("Could not trigger idmap_set_hwm\n")); @@ -190,7 +190,7 @@ static void winbindd_set_hwm_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_set_hwm_async(TALLOC_CTX *mem_ctx, const struct unixid *xid, - void (*cont)(void *private_data, BOOL success), + void (*cont)(void *private_data, bool success), void *private_data) { struct winbindd_request request; @@ -227,12 +227,12 @@ enum winbindd_result winbindd_dual_set_hwm(struct winbindd_domain *domain, return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR; } -static void winbindd_sids2xids_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_sids2xids_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, void *, int) = - (void (*)(void *, BOOL, void *, int))c; + void (*cont)(void *priv, bool succ, void *, int) = + (void (*)(void *, bool, void *, int))c; if (!success) { DEBUG(5, ("Could not trigger sids2xids\n")); @@ -250,7 +250,7 @@ static void winbindd_sids2xids_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_sids2xids_async(TALLOC_CTX *mem_ctx, void *sids, int size, - void (*cont)(void *private_data, BOOL success, void *data, int len), + void (*cont)(void *private_data, bool success, void *data, int len), void *private_data) { struct winbindd_request request; @@ -329,12 +329,12 @@ enum winbindd_result winbindd_dual_sids2xids(struct winbindd_domain *domain, return WINBINDD_OK; } -static void winbindd_sid2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_sid2uid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, uid_t uid) = - (void (*)(void *, BOOL, uid_t))c; + void (*cont)(void *priv, bool succ, uid_t uid) = + (void (*)(void *, bool, uid_t))c; if (!success) { DEBUG(5, ("Could not trigger sid2uid\n")); @@ -352,7 +352,7 @@ static void winbindd_sid2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - void (*cont)(void *private_data, BOOL success, uid_t uid), + void (*cont)(void *private_data, bool success, uid_t uid), void *private_data) { struct winbindd_request request; @@ -386,12 +386,12 @@ enum winbindd_result winbindd_dual_sid2uid(struct winbindd_domain *domain, } #if 0 /* not used */ -static void uid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void uid2name_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data); void winbindd_uid2name_async(TALLOC_CTX *mem_ctx, uid_t uid, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, const char *name), void *private_data) { @@ -424,12 +424,12 @@ enum winbindd_result winbindd_dual_uid2name(struct winbindd_domain *domain, } #if 0 /* not used */ -static void uid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void uid2name_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *name) = - (void (*)(void *, BOOL, const char *))c; + void (*cont)(void *priv, bool succ, const char *name) = + (void (*)(void *, bool, const char *))c; if (!success) { DEBUG(5, ("Could not trigger uid2name\n")); @@ -446,12 +446,12 @@ static void uid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, cont(private_data, True, response->data.name.name); } -static void name2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void name2uid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data); static void winbindd_name2uid_async(TALLOC_CTX *mem_ctx, const char *name, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, uid_t uid), void *private_data) { @@ -486,12 +486,12 @@ enum winbindd_result winbindd_dual_name2uid(struct winbindd_domain *domain, } #if 0 /* not used */ -static void name2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void name2uid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, uid_t uid) = - (void (*)(void *, BOOL, uid_t))c; + void (*cont)(void *priv, bool succ, uid_t uid) = + (void (*)(void *, bool, uid_t))c; if (!success) { DEBUG(5, ("Could not trigger name2uid\n")); @@ -509,12 +509,12 @@ static void name2uid_recv(TALLOC_CTX *mem_ctx, BOOL success, } #endif /* not used */ -static void winbindd_sid2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_sid2gid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, gid_t gid) = - (void (*)(void *, BOOL, gid_t))c; + void (*cont)(void *priv, bool succ, gid_t gid) = + (void (*)(void *, bool, gid_t))c; if (!success) { DEBUG(5, ("Could not trigger sid2gid\n")); @@ -532,7 +532,7 @@ static void winbindd_sid2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - void (*cont)(void *private_data, BOOL success, gid_t gid), + void (*cont)(void *private_data, bool success, gid_t gid), void *private_data) { struct winbindd_request request; @@ -571,12 +571,12 @@ enum winbindd_result winbindd_dual_sid2gid(struct winbindd_domain *domain, return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR; } -static void gid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void gid2name_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *name) = - (void (*)(void *, BOOL, const char *))c; + void (*cont)(void *priv, bool succ, const char *name) = + (void (*)(void *, bool, const char *))c; if (!success) { DEBUG(5, ("Could not trigger gid2name\n")); @@ -594,7 +594,7 @@ static void gid2name_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_gid2name_async(TALLOC_CTX *mem_ctx, gid_t gid, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, const char *name), void *private_data) { @@ -623,12 +623,12 @@ enum winbindd_result winbindd_dual_gid2name(struct winbindd_domain *domain, } #if 0 /* not used */ -static void name2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void name2gid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data); static void winbindd_name2gid_async(TALLOC_CTX *mem_ctx, const char *name, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, gid_t gid), void *private_data) { @@ -663,12 +663,12 @@ enum winbindd_result winbindd_dual_name2gid(struct winbindd_domain *domain, } #if 0 /* not used */ -static void name2gid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void name2gid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, gid_t gid) = - (void (*)(void *, BOOL, gid_t))c; + void (*cont)(void *priv, bool succ, gid_t gid) = + (void (*)(void *, bool, gid_t))c; if (!success) { DEBUG(5, ("Could not trigger name2gid\n")); @@ -692,13 +692,13 @@ struct lookupsid_state { }; -static void lookupsid_recv2(TALLOC_CTX *mem_ctx, BOOL success, +static void lookupsid_recv2(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *dom_name, + void (*cont)(void *priv, bool succ, const char *dom_name, const char *name, enum lsa_SidType type) = - (void (*)(void *, BOOL, const char *, const char *, + (void (*)(void *, bool, const char *, const char *, enum lsa_SidType))c; struct lookupsid_state *s = talloc_get_type_abort(private_data, struct lookupsid_state); @@ -720,13 +720,13 @@ static void lookupsid_recv2(TALLOC_CTX *mem_ctx, BOOL success, (enum lsa_SidType)response->data.name.type); } -static void lookupsid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void lookupsid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *dom_name, + void (*cont)(void *priv, bool succ, const char *dom_name, const char *name, enum lsa_SidType type) = - (void (*)(void *, BOOL, const char *, const char *, + (void (*)(void *, bool, const char *, const char *, enum lsa_SidType))c; struct lookupsid_state *s = talloc_get_type_abort(private_data, struct lookupsid_state); @@ -764,7 +764,7 @@ static void lookupsid_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, const char *dom_name, const char *name, enum lsa_SidType type), @@ -850,13 +850,13 @@ struct lookupname_state { }; -static void lookupname_recv2(TALLOC_CTX *mem_ctx, BOOL success, +static void lookupname_recv2(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const DOM_SID *sid, + void (*cont)(void *priv, bool succ, const DOM_SID *sid, enum lsa_SidType type) = - (void (*)(void *, BOOL, const DOM_SID *, enum lsa_SidType))c; + (void (*)(void *, bool, const DOM_SID *, enum lsa_SidType))c; DOM_SID sid; struct lookupname_state *s = talloc_get_type_abort( private_data, struct lookupname_state ); @@ -889,13 +889,13 @@ static void lookupname_recv2(TALLOC_CTX *mem_ctx, BOOL success, This is the first callback after contacting our own domain ********************************************************************/ -static void lookupname_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void lookupname_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const DOM_SID *sid, + void (*cont)(void *priv, bool succ, const DOM_SID *sid, enum lsa_SidType type) = - (void (*)(void *, BOOL, const DOM_SID *, enum lsa_SidType))c; + (void (*)(void *, bool, const DOM_SID *, enum lsa_SidType))c; DOM_SID sid; struct lookupname_state *s = talloc_get_type_abort( private_data, struct lookupname_state ); @@ -948,7 +948,7 @@ static void lookupname_recv(TALLOC_CTX *mem_ctx, BOOL success, void winbindd_lookupname_async(TALLOC_CTX *mem_ctx, const char *dom_name, const char *name, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type), enum winbindd_cmd orig_cmd, @@ -1024,7 +1024,7 @@ enum winbindd_result winbindd_dual_lookupname(struct winbindd_domain *domain, return WINBINDD_OK; } -BOOL print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids, +bool print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids, size_t num_sids, char **result, ssize_t *len) { size_t i; @@ -1044,7 +1044,7 @@ BOOL print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids, return True; } -static BOOL parse_sidlist(TALLOC_CTX *mem_ctx, char *sidstr, +static bool parse_sidlist(TALLOC_CTX *mem_ctx, char *sidstr, DOM_SID **sids, size_t *num_sids) { char *p, *q; @@ -1074,7 +1074,7 @@ static BOOL parse_sidlist(TALLOC_CTX *mem_ctx, char *sidstr, return True; } -static BOOL parse_ridlist(TALLOC_CTX *mem_ctx, char *ridstr, +static bool parse_ridlist(TALLOC_CTX *mem_ctx, char *ridstr, uint32 **rids, size_t *num_rids) { char *p; @@ -1158,13 +1158,13 @@ enum winbindd_result winbindd_dual_lookuprids(struct winbindd_domain *domain, return WINBINDD_OK; } -static void getsidaliases_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void getsidaliases_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, + void (*cont)(void *priv, bool succ, DOM_SID *aliases, size_t num_aliases) = - (void (*)(void *, BOOL, DOM_SID *, size_t))c; + (void (*)(void *, bool, DOM_SID *, size_t))c; char *aliases_str; DOM_SID *sids = NULL; size_t num_sids = 0; @@ -1204,7 +1204,7 @@ void winbindd_getsidaliases_async(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const DOM_SID *sids, size_t num_sids, void (*cont)(void *private_data, - BOOL success, + bool success, const DOM_SID *aliases, size_t num_aliases), void *private_data) @@ -1324,20 +1324,20 @@ struct gettoken_state { struct winbindd_domain *builtin_domain; DOM_SID *sids; size_t num_sids; - void (*cont)(void *private_data, BOOL success, DOM_SID *sids, size_t num_sids); + void (*cont)(void *private_data, bool success, DOM_SID *sids, size_t num_sids); void *private_data; }; -static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, +static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data); -static void gettoken_recvaliases(void *private_data, BOOL success, +static void gettoken_recvaliases(void *private_data, bool success, const DOM_SID *aliases, size_t num_aliases); void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, DOM_SID *sids, size_t num_sids), void *private_data) { @@ -1376,7 +1376,7 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, NULL, state); } -static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, +static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { @@ -1434,7 +1434,7 @@ static void gettoken_recvdomgroups(TALLOC_CTX *mem_ctx, BOOL success, gettoken_recvaliases, state); } -static void gettoken_recvaliases(void *private_data, BOOL success, +static void gettoken_recvaliases(void *private_data, bool success, const DOM_SID *aliases, size_t num_aliases) { @@ -1479,14 +1479,14 @@ static void gettoken_recvaliases(void *private_data, BOOL success, state->cont(state->private_data, True, state->sids, state->num_sids); } -static void query_user_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void query_user_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *acct_name, + void (*cont)(void *priv, bool succ, const char *acct_name, const char *full_name, const char *homedir, const char *shell, uint32 gid, uint32 group_rid) = - (void (*)(void *, BOOL, const char *, const char *, + (void (*)(void *, bool, const char *, const char *, const char *, const char *, uint32, uint32))c; if (!success) { @@ -1511,7 +1511,7 @@ static void query_user_recv(TALLOC_CTX *mem_ctx, BOOL success, void query_user_async(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, const DOM_SID *sid, - void (*cont)(void *private_data, BOOL success, + void (*cont)(void *private_data, bool success, const char *acct_name, const char *full_name, const char *homedir, @@ -1531,12 +1531,12 @@ void query_user_async(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, /* The following uid2sid/gid2sid functions has been contributed by * Keith Reynolds <Keith.Reynolds@centrify.com> */ -static void winbindd_uid2sid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_uid2sid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *sid) = - (void (*)(void *, BOOL, const char *))c; + void (*cont)(void *priv, bool succ, const char *sid) = + (void (*)(void *, bool, const char *))c; if (!success) { DEBUG(5, ("Could not trigger uid2sid\n")); @@ -1554,7 +1554,7 @@ static void winbindd_uid2sid_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_uid2sid_async(TALLOC_CTX *mem_ctx, uid_t uid, - void (*cont)(void *private_data, BOOL success, const char *sid), + void (*cont)(void *private_data, bool success, const char *sid), void *private_data) { struct winbindd_request request; @@ -1588,12 +1588,12 @@ enum winbindd_result winbindd_dual_uid2sid(struct winbindd_domain *domain, return WINBINDD_ERROR; } -static void winbindd_gid2sid_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_gid2sid_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *sid) = - (void (*)(void *, BOOL, const char *))c; + void (*cont)(void *priv, bool succ, const char *sid) = + (void (*)(void *, bool, const char *))c; if (!success) { DEBUG(5, ("Could not trigger gid2sid\n")); @@ -1611,7 +1611,7 @@ static void winbindd_gid2sid_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_gid2sid_async(TALLOC_CTX *mem_ctx, gid_t gid, - void (*cont)(void *private_data, BOOL success, const char *sid), + void (*cont)(void *private_data, bool success, const char *sid), void *private_data) { struct winbindd_request request; @@ -1648,12 +1648,12 @@ enum winbindd_result winbindd_dual_gid2sid(struct winbindd_domain *domain, return WINBINDD_ERROR; } -static void winbindd_dump_id_maps_recv(TALLOC_CTX *mem_ctx, BOOL success, +static void winbindd_dump_id_maps_recv(TALLOC_CTX *mem_ctx, bool success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ) = - (void (*)(void *, BOOL))c; + void (*cont)(void *priv, bool succ) = + (void (*)(void *, bool))c; if (!success) { DEBUG(5, ("Could not trigger a map dump\n")); @@ -1671,7 +1671,7 @@ static void winbindd_dump_id_maps_recv(TALLOC_CTX *mem_ctx, BOOL success, } void winbindd_dump_maps_async(TALLOC_CTX *mem_ctx, void *data, int size, - void (*cont)(void *private_data, BOOL success), + void (*cont)(void *private_data, bool success), void *private_data) { struct winbindd_request request; diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index e5090dfacf..f3aa0fce42 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -33,7 +33,7 @@ #define WINBINDD_CACHE_VERSION_KEYSTR "WINBINDD_CACHE_VERSION" extern struct winbindd_methods reconnect_methods; -extern BOOL opt_nocache; +extern bool opt_nocache; #ifdef HAVE_ADS extern struct winbindd_methods ads_methods; #endif @@ -57,7 +57,7 @@ static const char *non_centry_keys[] = { Is this key a non-centry type ? ************************************************************************/ -static BOOL is_non_centry_key(TDB_DATA kbuf) +static bool is_non_centry_key(TDB_DATA kbuf) { int i; @@ -80,7 +80,7 @@ static BOOL is_non_centry_key(TDB_DATA kbuf) and sets this to true if the first query fails and there's an entry in the cache tdb telling us to stay offline. */ -static BOOL global_winbindd_offline_state; +static bool global_winbindd_offline_state; struct winbind_cache { TDB_CONTEXT *tdb; @@ -204,7 +204,7 @@ static void centry_free(struct cache_entry *centry) free(centry); } -static BOOL centry_check_bytes(struct cache_entry *centry, size_t nbytes) +static bool centry_check_bytes(struct cache_entry *centry, size_t nbytes) { if (centry->len - centry->ofs < nbytes) { DEBUG(0,("centry corruption? needed %u bytes, have %d\n", @@ -343,7 +343,7 @@ static char *centry_hash16(struct cache_entry *centry, TALLOC_CTX *mem_ctx) /* pull a sid from a cache entry, using the supplied talloc context */ -static BOOL centry_sid(struct cache_entry *centry, TALLOC_CTX *mem_ctx, DOM_SID *sid) +static bool centry_sid(struct cache_entry *centry, TALLOC_CTX *mem_ctx, DOM_SID *sid) { char *sid_string; sid_string = centry_string(centry, mem_ctx); @@ -367,9 +367,9 @@ static NTSTATUS centry_ntstatus(struct cache_entry *centry) /* the server is considered down if it can't give us a sequence number */ -static BOOL wcache_server_down(struct winbindd_domain *domain) +static bool wcache_server_down(struct winbindd_domain *domain) { - BOOL ret; + bool ret; if (!wcache->tdb) return False; @@ -458,7 +458,7 @@ static NTSTATUS store_cache_seqnum( struct winbindd_domain *domain ) then always refresh it, no matter how recently we fetched it */ -static void refresh_sequence_number(struct winbindd_domain *domain, BOOL force) +static void refresh_sequence_number(struct winbindd_domain *domain, bool force) { NTSTATUS status; unsigned time_diff; @@ -532,7 +532,7 @@ done: /* decide if a cache entry has expired */ -static BOOL centry_expired(struct winbindd_domain *domain, const char *keystr, struct cache_entry *centry) +static bool centry_expired(struct winbindd_domain *domain, const char *keystr, struct cache_entry *centry) { /* If we've been told to be offline - stay in that state... */ if (lp_winbind_offline_logon() && global_winbindd_offline_state) { @@ -1525,8 +1525,8 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain, struct winbind_cache *cache = get_cache(domain); size_t i; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - BOOL have_mapped; - BOOL have_unmapped; + bool have_mapped; + bool have_unmapped; *domain_name = NULL; *names = NULL; @@ -2263,7 +2263,7 @@ void wcache_invalidate_cache(void) } } -BOOL init_wcache(void) +bool init_wcache(void) { if (wcache == NULL) { wcache = SMB_XMALLOC_P(struct winbind_cache); @@ -2293,9 +2293,9 @@ BOOL init_wcache(void) only opener. ************************************************************************/ -BOOL initialize_winbindd_cache(void) +bool initialize_winbindd_cache(void) { - BOOL cache_bad = True; + bool cache_bad = True; uint32 vers; if (!init_wcache()) { @@ -2382,7 +2382,7 @@ void cache_store_response(pid_t pid, struct winbindd_response *response) return; } -BOOL cache_retrieve_response(pid_t pid, struct winbindd_response * response) +bool cache_retrieve_response(pid_t pid, struct winbindd_response * response) { TDB_DATA data; fstring key_str; @@ -2451,7 +2451,7 @@ void cache_cleanup_response(pid_t pid) } -BOOL lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, char **domain_name, char **name, enum lsa_SidType *type) { @@ -2487,7 +2487,7 @@ BOOL lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, return NT_STATUS_IS_OK(status); } -BOOL lookup_cached_name(TALLOC_CTX *mem_ctx, +bool lookup_cached_name(TALLOC_CTX *mem_ctx, const char *domain_name, const char *name, DOM_SID *sid, @@ -2498,7 +2498,7 @@ BOOL lookup_cached_name(TALLOC_CTX *mem_ctx, struct cache_entry *centry = NULL; NTSTATUS status; fstring uname; - BOOL original_online_state; + bool original_online_state; domain = find_lookup_domain_from_name(domain_name); if (domain == NULL) { @@ -2744,7 +2744,7 @@ done: } /* Change the global online/offline state. */ -BOOL set_global_winbindd_state_offline(void) +bool set_global_winbindd_state_offline(void) { TDB_DATA data; @@ -2805,7 +2805,7 @@ void set_global_winbindd_state_online(void) tdb_delete_bystring(wcache->tdb, "WINBINDD_OFFLINE"); } -BOOL get_global_winbindd_state_offline(void) +bool get_global_winbindd_state_offline(void) { return global_winbindd_offline_state; } @@ -3413,14 +3413,14 @@ int winbindd_validate_cache_nobackup(void) /********************************************************************* ********************************************************************/ -static BOOL add_wbdomain_to_tdc_array( struct winbindd_domain *new_dom, +static bool add_wbdomain_to_tdc_array( struct winbindd_domain *new_dom, struct winbindd_tdc_domain **domains, size_t *num_domains ) { struct winbindd_tdc_domain *list = NULL; size_t idx; int i; - BOOL set_only = False; + bool set_only = False; /* don't allow duplicates */ @@ -3622,7 +3622,7 @@ static size_t unpack_tdc_domains( unsigned char *buf, int buflen, /********************************************************************* ********************************************************************/ -static BOOL wcache_tdc_store_list( struct winbindd_tdc_domain *domains, size_t num_domains ) +static bool wcache_tdc_store_list( struct winbindd_tdc_domain *domains, size_t num_domains ) { TDB_DATA key = make_tdc_key( lp_workgroup() ); TDB_DATA data = { NULL, 0 }; @@ -3657,7 +3657,7 @@ static BOOL wcache_tdc_store_list( struct winbindd_tdc_domain *domains, size_t n /********************************************************************* ********************************************************************/ -BOOL wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains ) +bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains ) { TDB_DATA key = make_tdc_key( lp_workgroup() ); TDB_DATA data = { NULL, 0 }; @@ -3688,11 +3688,11 @@ BOOL wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_do /********************************************************************* ********************************************************************/ -BOOL wcache_tdc_add_domain( struct winbindd_domain *domain ) +bool wcache_tdc_add_domain( struct winbindd_domain *domain ) { struct winbindd_tdc_domain *dom_list = NULL; size_t num_domains = 0; - BOOL ret = False; + bool ret = False; DEBUG(10,("wcache_tdc_add_domain: Adding domain %s (%s), SID %s, " "flags = 0x%x, attributes = 0x%x, type = 0x%x\n", diff --git a/source3/winbindd/winbindd_ccache_access.c b/source3/winbindd/winbindd_ccache_access.c index 99c5c0c4d1..a696db1031 100644 --- a/source3/winbindd/winbindd_ccache_access.c +++ b/source3/winbindd/winbindd_ccache_access.c @@ -27,7 +27,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -static BOOL client_can_access_ccache_entry(uid_t client_uid, +static bool client_can_access_ccache_entry(uid_t client_uid, struct WINBINDD_MEMORY_CREDS *entry) { if (client_uid == entry->uid || client_uid == 0) { @@ -122,7 +122,7 @@ done: return status; } -static BOOL check_client_uid(struct winbindd_cli_state *state, uid_t uid) +static bool check_client_uid(struct winbindd_cli_state *state, uid_t uid) { int ret; uid_t ret_uid; diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 4ff9fce96f..055563d815 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -70,11 +70,11 @@ struct dc_name_ip { }; extern struct winbindd_methods reconnect_methods; -extern BOOL override_logfile; +extern bool override_logfile; static NTSTATUS init_dc_connection_network(struct winbindd_domain *domain); static void set_dc_type_and_flags( struct winbindd_domain *domain ); -static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, +static bool get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, struct dc_name_ip **dcs, int *num_dcs); /**************************************************************** @@ -166,7 +166,7 @@ static void msg_try_to_go_online(struct messaging_context *msg, parent. ****************************************************************/ -static BOOL fork_child_dc_connect(struct winbindd_domain *domain) +static bool fork_child_dc_connect(struct winbindd_domain *domain) { struct dc_name_ip *dcs = NULL; int num_dcs = 0; @@ -558,7 +558,7 @@ static void cm_get_ipc_userpass(char **username, char **domain, char **password) } } -static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain, +static bool get_dc_name_via_netlogon(const struct winbindd_domain *domain, fstring dcname, struct in_addr *dc_ip) { struct winbindd_domain *our_domain = NULL; @@ -641,12 +641,12 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, const int sockfd, const char *controller, struct cli_state **cli, - BOOL *retry) + bool *retry) { char *machine_password, *machine_krb5_principal, *machine_account; char *ipc_username, *ipc_domain, *ipc_password; - BOOL got_mutex; + bool got_mutex; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; @@ -890,7 +890,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, return result; } -static BOOL add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name, +static bool add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name, const char *dcname, struct in_addr ip, struct dc_name_ip **dcs, int *num) { @@ -910,7 +910,7 @@ static BOOL add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name, return True; } -static BOOL add_sockaddr_to_array(TALLOC_CTX *mem_ctx, +static bool add_sockaddr_to_array(TALLOC_CTX *mem_ctx, struct in_addr ip, uint16 port, struct sockaddr_in **addrs, int *num) { @@ -934,7 +934,7 @@ static void mailslot_name(struct in_addr dc_ip, fstring name) fstr_sprintf(name, "\\MAILSLOT\\NET\\GETDC%X", dc_ip.s_addr); } -static BOOL send_getdc_request(struct in_addr dc_ip, +static bool send_getdc_request(struct in_addr dc_ip, const char *domain_name, const DOM_SID *sid) { @@ -988,7 +988,7 @@ static BOOL send_getdc_request(struct in_addr dc_ip, dc_ip); } -static BOOL receive_getdc_response(struct in_addr dc_ip, +static bool receive_getdc_response(struct in_addr dc_ip, const char *domain_name, fstring dc_name) { @@ -1060,7 +1060,7 @@ static BOOL receive_getdc_response(struct in_addr dc_ip, convert an ip to a name *******************************************************************/ -static BOOL dcip_to_name(const struct winbindd_domain *domain, struct in_addr ip, fstring name ) +static bool dcip_to_name(const struct winbindd_domain *domain, struct in_addr ip, fstring name ) { struct ip_service ip_list; @@ -1148,7 +1148,7 @@ static BOOL dcip_to_name(const struct winbindd_domain *domain, struct in_addr ip the dcs[] with results. *******************************************************************/ -static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, +static bool get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, struct dc_name_ip **dcs, int *num_dcs) { fstring dcname; @@ -1156,7 +1156,7 @@ static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, struct ip_service *ip_list = NULL; int iplist_size = 0; int i; - BOOL is_our_domain; + bool is_our_domain; enum security_types sec = (enum security_types)lp_security(); is_our_domain = strequal(domain->name, lp_workgroup()); @@ -1231,7 +1231,7 @@ static BOOL get_dcs(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, return True; } -static BOOL find_new_dc(TALLOC_CTX *mem_ctx, +static bool find_new_dc(TALLOC_CTX *mem_ctx, const struct winbindd_domain *domain, fstring dcname, struct sockaddr_in *addr, int *fd) { @@ -1358,7 +1358,7 @@ static NTSTATUS cm_open_connection(struct winbindd_domain *domain, for (retries = 0; retries < 3; retries++) { int fd = -1; - BOOL retry = False; + bool retry = False; result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND; @@ -1492,7 +1492,7 @@ void close_conns_after_fork(void) } } -static BOOL connection_ok(struct winbindd_domain *domain) +static bool connection_ok(struct winbindd_domain *domain) { if (domain->conn.cli == NULL) { DEBUG(8, ("connection_ok: Connection to %s for domain %s has NULL " @@ -1566,7 +1566,7 @@ NTSTATUS init_dc_connection(struct winbindd_domain *domain) Set the trust flags (direction and forest location) for a domain ******************************************************************************/ -static BOOL set_dc_type_and_flags_trustinfo( struct winbindd_domain *domain ) +static bool set_dc_type_and_flags_trustinfo( struct winbindd_domain *domain ) { struct winbindd_domain *our_domain; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; @@ -1848,7 +1848,7 @@ static void set_dc_type_and_flags( struct winbindd_domain *domain ) /********************************************************************** ***********************************************************************/ -static BOOL cm_get_schannel_dcinfo(struct winbindd_domain *domain, +static bool cm_get_schannel_dcinfo(struct winbindd_domain *domain, struct dcinfo **ppdc) { NTSTATUS result; diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c index 65dcbe5a00..311b1d1822 100644 --- a/source3/winbindd/winbindd_cred_cache.c +++ b/source3/winbindd/winbindd_cred_cache.c @@ -284,7 +284,7 @@ static void krb5_ticket_gain_handler(struct event_context *event_ctx, Check if an ccache entry exists. ****************************************************************/ -BOOL ccache_entry_exists(const char *username) +bool ccache_entry_exists(const char *username) { struct WINBINDD_CCACHE_ENTRY *entry = get_ccache_by_username(username); return (entry != NULL); @@ -294,7 +294,7 @@ BOOL ccache_entry_exists(const char *username) Ensure we're changing the correct entry. ****************************************************************/ -BOOL ccache_entry_identical(const char *username, +bool ccache_entry_identical(const char *username, uid_t uid, const char *ccname) { @@ -327,7 +327,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name, time_t create_time, time_t ticket_end, time_t renew_until, - BOOL postponed_request) + bool postponed_request) { struct WINBINDD_CCACHE_ENTRY *entry = NULL; struct timeval t; diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index d9a42c31dc..932fc328cf 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -33,7 +33,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -extern BOOL override_logfile; +extern bool override_logfile; /* Read some data from a client connection */ @@ -94,22 +94,22 @@ struct winbindd_async_request { struct winbindd_child *child; struct winbindd_request *request; struct winbindd_response *response; - void (*continuation)(void *private_data, BOOL success); + void (*continuation)(void *private_data, bool success); struct timed_event *reply_timeout_event; pid_t child_pid; /* pid of the child we're waiting on. Used to detect a restart of the child (child->pid != child_pid). */ void *private_data; }; -static void async_main_request_sent(void *private_data, BOOL success); -static void async_request_sent(void *private_data, BOOL success); -static void async_reply_recv(void *private_data, BOOL success); +static void async_main_request_sent(void *private_data, bool success); +static void async_request_sent(void *private_data, bool success); +static void async_reply_recv(void *private_data, bool success); static void schedule_async_request(struct winbindd_child *child); void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child, struct winbindd_request *request, struct winbindd_response *response, - void (*continuation)(void *private_data, BOOL success), + void (*continuation)(void *private_data, bool success), void *private_data) { struct winbindd_async_request *state; @@ -138,7 +138,7 @@ void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child, return; } -static void async_main_request_sent(void *private_data, BOOL success) +static void async_main_request_sent(void *private_data, bool success) { struct winbindd_async_request *state = talloc_get_type_abort(private_data, struct winbindd_async_request); @@ -211,7 +211,7 @@ static void async_request_fail(struct winbindd_async_request *state) state->continuation(state->private_data, False); } -static void async_request_sent(void *private_data_data, BOOL success) +static void async_request_sent(void *private_data_data, bool success) { struct winbindd_async_request *state = talloc_get_type_abort(private_data_data, struct winbindd_async_request); @@ -247,7 +247,7 @@ static void async_request_sent(void *private_data_data, BOOL success) } } -static void async_reply_recv(void *private_data, BOOL success) +static void async_reply_recv(void *private_data, bool success) { struct winbindd_async_request *state = talloc_get_type_abort(private_data, struct winbindd_async_request); @@ -278,7 +278,7 @@ static void async_reply_recv(void *private_data, BOOL success) state->continuation(state->private_data, True); } -static BOOL fork_domain_child(struct winbindd_child *child); +static bool fork_domain_child(struct winbindd_child *child); static void schedule_async_request(struct winbindd_child *child) { @@ -319,17 +319,17 @@ struct domain_request_state { struct winbindd_domain *domain; struct winbindd_request *request; struct winbindd_response *response; - void (*continuation)(void *private_data_data, BOOL success); + void (*continuation)(void *private_data_data, bool success); void *private_data_data; }; -static void domain_init_recv(void *private_data_data, BOOL success); +static void domain_init_recv(void *private_data_data, bool success); void async_domain_request(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, struct winbindd_request *request, struct winbindd_response *response, - void (*continuation)(void *private_data_data, BOOL success), + void (*continuation)(void *private_data_data, bool success), void *private_data_data) { struct domain_request_state *state; @@ -357,7 +357,7 @@ void async_domain_request(TALLOC_CTX *mem_ctx, init_child_connection(domain, domain_init_recv, state); } -static void domain_init_recv(void *private_data_data, BOOL success) +static void domain_init_recv(void *private_data_data, bool success) { struct domain_request_state *state = talloc_get_type_abort(private_data_data, struct domain_request_state); @@ -373,7 +373,7 @@ static void domain_init_recv(void *private_data_data, BOOL success) state->continuation, state->private_data_data); } -static void recvfrom_child(void *private_data_data, BOOL success) +static void recvfrom_child(void *private_data_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data_data, struct winbindd_cli_state); @@ -920,7 +920,7 @@ static void child_msg_dump_event_list(struct messaging_context *msg, } -static BOOL fork_domain_child(struct winbindd_child *child) +static bool fork_domain_child(struct winbindd_child *child) { int fdpair[2]; struct winbindd_cli_state state; diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c index 9a4b02f734..30e274ff86 100644 --- a/source3/winbindd/winbindd_group.c +++ b/source3/winbindd/winbindd_group.c @@ -25,7 +25,7 @@ #include "includes.h" #include "winbindd.h" -extern BOOL opt_nocache; +extern bool opt_nocache; #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND @@ -142,7 +142,7 @@ static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t *p_nu return; } -static BOOL fill_passdb_alias_grmem(struct winbindd_domain *domain, +static bool fill_passdb_alias_grmem(struct winbindd_domain *domain, DOM_SID *group_sid, size_t *num_gr_mem, char **gr_mem, size_t *gr_mem_len) { @@ -177,7 +177,7 @@ static BOOL fill_passdb_alias_grmem(struct winbindd_domain *domain, /* Fill a grent structure from various other information */ -static BOOL fill_grent(struct winbindd_gr *gr, const char *dom_name, +static bool fill_grent(struct winbindd_gr *gr, const char *dom_name, const char *gr_name, gid_t unix_gid) { fstring full_group_name; @@ -203,7 +203,7 @@ static BOOL fill_grent(struct winbindd_gr *gr, const char *dom_name, if neccessaey, or parameterize the group list we do this for. ***********************************************************************/ -static BOOL fill_grent_mem_domusers( TALLOC_CTX *mem_ctx, +static bool fill_grent_mem_domusers( TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, struct winbindd_cli_state *state, DOM_SID *group_sid, @@ -215,7 +215,7 @@ static BOOL fill_grent_mem_domusers( TALLOC_CTX *mem_ctx, DOM_SID *pquerying_user_sid = NULL; uint32 num_groups = 0; DOM_SID *user_sids = NULL; - BOOL u_in_group = False; + bool u_in_group = False; NTSTATUS status; int i; unsigned int buf_len = 0; @@ -437,7 +437,7 @@ static NTSTATUS expand_groups( TALLOC_CTX *ctx, if ( name_types[j] == SID_NAME_DOM_GRP || name_types[j] == SID_NAME_ALIAS ) { - BOOL ret; + bool ret; ret = add_sid_to_array_unique( ctx, &sid_mem[j], @@ -468,7 +468,7 @@ static NTSTATUS expand_groups( TALLOC_CTX *ctx, Fill in the group membership field of a NT group given by group_sid ***********************************************************************/ -static BOOL fill_grent_mem(struct winbindd_domain *domain, +static bool fill_grent_mem(struct winbindd_domain *domain, struct winbindd_cli_state *state, DOM_SID *group_sid, enum lsa_SidType group_name_type, @@ -477,7 +477,7 @@ static BOOL fill_grent_mem(struct winbindd_domain *domain, uint32 num_names = 0; unsigned int buf_len = 0, buf_ndx = 0, i; char **names = NULL, *buf = NULL; - BOOL result = False; + bool result = False; TALLOC_CTX *mem_ctx; uint32 group_rid; DOM_SID *glist = NULL; @@ -642,7 +642,7 @@ done: static void winbindd_getgrsid( struct winbindd_cli_state *state, DOM_SID group_sid ); -static void getgrnam_recv( void *private_data, BOOL success, const DOM_SID *sid, +static void getgrnam_recv( void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type ) { struct winbindd_cli_state *state = (struct winbindd_cli_state*)private_data; @@ -729,7 +729,7 @@ struct getgrsid_state { DOM_SID group_sid; }; -static void getgrsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid) +static void getgrsid_sid2gid_recv(void *private_data, bool success, gid_t gid) { struct getgrsid_state *s = (struct getgrsid_state *)private_data; @@ -782,7 +782,7 @@ static void getgrsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid) request_ok(s->state); } -static void getgrsid_lookupsid_recv( void *private_data, BOOL success, +static void getgrsid_lookupsid_recv( void *private_data, bool success, const char *dom_name, const char *name, enum lsa_SidType name_type ) { @@ -848,7 +848,7 @@ static void winbindd_getgrsid( struct winbindd_cli_state *state, const DOM_SID g } -static void getgrgid_recv(void *private_data, BOOL success, const char *sid) +static void getgrgid_recv(void *private_data, bool success, const char *sid) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); enum lsa_SidType name_type; @@ -895,7 +895,7 @@ void winbindd_getgrgid(struct winbindd_cli_state *state) /* "Rewind" file pointer for group database enumeration */ -static BOOL winbindd_setgrent_internal(struct winbindd_cli_state *state) +static bool winbindd_setgrent_internal(struct winbindd_cli_state *state) { struct winbindd_domain *domain; @@ -974,13 +974,13 @@ void winbindd_endgrent(struct winbindd_cli_state *state) The dispinfo_ndx field is incremented to the index of the next group to fetch. Return True if some groups were returned, False otherwise. */ -static BOOL get_sam_group_entries(struct getent_state *ent) +static bool get_sam_group_entries(struct getent_state *ent) { NTSTATUS status; uint32 num_entries; struct acct_info *name_list = NULL; TALLOC_CTX *mem_ctx; - BOOL result = False; + bool result = False; struct acct_info *sam_grp_entries = NULL; struct winbindd_domain *domain; @@ -1443,11 +1443,11 @@ struct getgroups_state { size_t num_token_gids; }; -static void getgroups_usersid_recv(void *private_data, BOOL success, +static void getgroups_usersid_recv(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type); -static void getgroups_tokensids_recv(void *private_data, BOOL success, +static void getgroups_tokensids_recv(void *private_data, bool success, DOM_SID *token_sids, size_t num_token_sids); -static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid); +static void getgroups_sid2gid_recv(void *private_data, bool success, gid_t gid); void winbindd_getgroups(struct winbindd_cli_state *state) { @@ -1515,7 +1515,7 @@ void winbindd_getgroups(struct winbindd_cli_state *state) getgroups_usersid_recv, WINBINDD_GETGROUPS, s); } -static void getgroups_usersid_recv(void *private_data, BOOL success, +static void getgroups_usersid_recv(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type) { struct getgroups_state *s = @@ -1533,7 +1533,7 @@ static void getgroups_usersid_recv(void *private_data, BOOL success, getgroups_tokensids_recv, s); } -static void getgroups_tokensids_recv(void *private_data, BOOL success, +static void getgroups_tokensids_recv(void *private_data, bool success, DOM_SID *token_sids, size_t num_token_sids) { struct getgroups_state *s = @@ -1557,7 +1557,7 @@ static void getgroups_tokensids_recv(void *private_data, BOOL success, getgroups_sid2gid_recv(s, False, 0); } -static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid) +static void getgroups_sid2gid_recv(void *private_data, bool success, gid_t gid) { struct getgroups_state *s = (struct getgroups_state *)private_data; @@ -1603,7 +1603,7 @@ static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid) results. */ -static void getusersids_recv(void *private_data, BOOL success, DOM_SID *sids, +static void getusersids_recv(void *private_data, bool success, DOM_SID *sids, size_t num_sids); void winbindd_getusersids(struct winbindd_cli_state *state) @@ -1631,7 +1631,7 @@ void winbindd_getusersids(struct winbindd_cli_state *state) state); } -static void getusersids_recv(void *private_data, BOOL success, DOM_SID *sids, +static void getusersids_recv(void *private_data, bool success, DOM_SID *sids, size_t num_sids) { struct winbindd_cli_state *state = diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index 366f58a403..dc2e35884e 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -145,7 +145,7 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain * int extra_data_len = 0; char *extra_data; NTSTATUS result; - BOOL have_own_domain = False; + bool have_own_domain = False; DEBUG(3, ("[%5lu]: list trusted domains\n", (unsigned long)state->pid)); @@ -362,7 +362,7 @@ struct sequence_state { char *extra_data; }; -static void sequence_recv(void *private_data, BOOL success); +static void sequence_recv(void *private_data, bool success); void winbindd_show_sequence(struct winbindd_cli_state *state) { @@ -422,7 +422,7 @@ void winbindd_show_sequence(struct winbindd_cli_state *state) sequence_recv, seq); } -static void sequence_recv(void *private_data, BOOL success) +static void sequence_recv(void *private_data, bool success) { struct sequence_state *state = (struct sequence_state *)private_data; @@ -489,7 +489,7 @@ struct domain_info_state { struct winbindd_cli_state *cli_state; }; -static void domain_info_init_recv(void *private_data, BOOL success); +static void domain_info_init_recv(void *private_data, bool success); void winbindd_domain_info(struct winbindd_cli_state *state) { @@ -542,7 +542,7 @@ void winbindd_domain_info(struct winbindd_cli_state *state) request_ok(state); } -static void domain_info_init_recv(void *private_data, BOOL success) +static void domain_info_init_recv(void *private_data, bool success) { struct domain_info_state *istate = (struct domain_info_state *)private_data; diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index 78128521c4..640eb5a519 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -444,7 +444,7 @@ static NTSTATUS get_pwd_properties(struct winbindd_domain *domain, static const char *generate_krb5_ccache(TALLOC_CTX *mem_ctx, const char *type, uid_t uid, - BOOL *internal_ccache) + bool *internal_ccache) { /* accept FILE and WRFILE as krb5_cc_type from the client and then * build the full ccname string based on the user's uid here - @@ -545,7 +545,7 @@ static NTSTATUS winbindd_raw_kerberos_login(struct winbindd_domain *domain, uid_t uid = -1; ADS_STRUCT *ads; time_t time_offset = 0; - BOOL internal_ccache = True; + bool internal_ccache = True; ZERO_STRUCTP(info3); @@ -695,7 +695,7 @@ failed: /**************************************************************** ****************************************************************/ -static BOOL check_request_flags(uint32_t flags) +static bool check_request_flags(uint32_t flags) { uint32_t flags_edata = WBFLAG_PAM_AFS_TOKEN | WBFLAG_PAM_UNIX_NAME | @@ -846,7 +846,7 @@ NTSTATUS winbindd_dual_pam_auth_cached(struct winbindd_domain *domain, const uint8 *cached_salt; NET_USER_INFO_3 *my_info3; time_t kickoff_time, must_change_time; - BOOL password_good = False; + bool password_good = False; #ifdef HAVE_KRB5 struct winbindd_tdc_domain *tdc_domain = NULL; #endif @@ -967,7 +967,7 @@ NTSTATUS winbindd_dual_pam_auth_cached(struct winbindd_domain *domain, char *realm = NULL; const char *principal_s = NULL; const char *service = NULL; - BOOL internal_ccache = False; + bool internal_ccache = False; uid = get_uid_from_state(state); if (uid == -1) { @@ -1161,7 +1161,7 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain, unsigned char local_nt_response[24]; struct winbindd_domain *contact_domain; fstring name_domain, name_user; - BOOL retry; + bool retry; NTSTATUS result; NET_USER_INFO_3 *my_info3; @@ -1707,7 +1707,7 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain, const char *workstation; struct winbindd_domain *contact_domain; int attempts = 0; - BOOL retry; + bool retry; DATA_BLOB lm_resp, nt_resp; @@ -1927,7 +1927,7 @@ enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact char *newpass = NULL; POLICY_HND dom_pol; struct rpc_pipe_client *cli; - BOOL got_info = False; + bool got_info = False; SAM_UNK_INFO_1 info; SAMR_CHANGE_REJECT reject; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c index 5c36c0c327..cfb934eb60 100644 --- a/source3/winbindd/winbindd_passdb.c +++ b/source3/winbindd/winbindd_passdb.c @@ -322,7 +322,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, /* find the sequence number for a domain */ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq) { - BOOL result; + bool result; time_t seq_num; result = pdb_get_seq_num(&seq_num); diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index 283b4f36e9..7035f6bffb 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -869,7 +869,7 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32 *seq) SAM_UNK_CTR ctr; NTSTATUS result; POLICY_HND dom_pol; - BOOL got_seq_num = False; + bool got_seq_num = False; struct rpc_pipe_client *cli; DEBUG(10,("rpc: fetch sequence_number for %s\n", domain->name)); diff --git a/source3/winbindd/winbindd_sid.c b/source3/winbindd/winbindd_sid.c index 48e84d35e5..f405f36d1b 100644 --- a/source3/winbindd/winbindd_sid.c +++ b/source3/winbindd/winbindd_sid.c @@ -27,7 +27,7 @@ /* Convert a string */ -static void lookupsid_recv(void *private_data, BOOL success, +static void lookupsid_recv(void *private_data, bool success, const char *dom_name, const char *name, enum lsa_SidType type); @@ -50,7 +50,7 @@ void winbindd_lookupsid(struct winbindd_cli_state *state) winbindd_lookupsid_async(state->mem_ctx, &sid, lookupsid_recv, state); } -static void lookupsid_recv(void *private_data, BOOL success, +static void lookupsid_recv(void *private_data, bool success, const char *dom_name, const char *name, enum lsa_SidType type) { @@ -73,7 +73,7 @@ static void lookupsid_recv(void *private_data, BOOL success, * Look up the SID for a qualified name. **/ -static void lookupname_recv(void *private_data, BOOL success, +static void lookupname_recv(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type); void winbindd_lookupname(struct winbindd_cli_state *state) @@ -106,7 +106,7 @@ void winbindd_lookupname(struct winbindd_cli_state *state) state); } -static void lookupname_recv(void *private_data, BOOL success, +static void lookupname_recv(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type) { struct winbindd_cli_state *state = @@ -167,7 +167,7 @@ struct winbindd_child *idmap_child(void) /* Convert a sid to a uid. We assume we only have one rid attached to the sid. */ -static void sid2uid_recv(void *private_data, BOOL success, uid_t uid) +static void sid2uid_recv(void *private_data, bool success, uid_t uid) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -183,7 +183,7 @@ static void sid2uid_recv(void *private_data, BOOL success, uid_t uid) request_ok(state); } -static void sid2uid_lookupsid_recv( void *private_data, BOOL success, +static void sid2uid_lookupsid_recv( void *private_data, bool success, const char *domain_name, const char *name, enum lsa_SidType type) @@ -244,7 +244,7 @@ void winbindd_sid_to_uid(struct winbindd_cli_state *state) /* Convert a sid to a gid. We assume we only have one rid attached to the sid.*/ -static void sid2gid_recv(void *private_data, BOOL success, gid_t gid) +static void sid2gid_recv(void *private_data, bool success, gid_t gid) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -260,7 +260,7 @@ static void sid2gid_recv(void *private_data, BOOL success, gid_t gid) request_ok(state); } -static void sid2gid_lookupsid_recv( void *private_data, BOOL success, +static void sid2gid_lookupsid_recv( void *private_data, bool success, const char *domain_name, const char *name, enum lsa_SidType type) @@ -321,7 +321,7 @@ void winbindd_sid_to_gid(struct winbindd_cli_state *state) winbindd_lookupsid_async( state->mem_ctx, &sid, sid2gid_lookupsid_recv, state ); } -static void sids2xids_recv(void *private_data, BOOL success, void *data, int len) +static void sids2xids_recv(void *private_data, bool success, void *data, int len) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -347,7 +347,7 @@ void winbindd_sids_to_unixids(struct winbindd_cli_state *state) sids2xids_recv, state); } -static void set_mapping_recv(void *private_data, BOOL success) +static void set_mapping_recv(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -389,7 +389,7 @@ void winbindd_set_mapping(struct winbindd_cli_state *state) set_mapping_recv, state); } -static void set_hwm_recv(void *private_data, BOOL success) +static void set_hwm_recv(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); @@ -423,7 +423,7 @@ void winbindd_set_hwm(struct winbindd_cli_state *state) /* Convert a uid to a sid */ -static void uid2sid_recv(void *private_data, BOOL success, const char *sid) +static void uid2sid_recv(void *private_data, bool success, const char *sid) { struct winbindd_cli_state *state = (struct winbindd_cli_state *)private_data; @@ -452,7 +452,7 @@ void winbindd_uid_to_sid(struct winbindd_cli_state *state) /* Convert a gid to a sid */ -static void gid2sid_recv(void *private_data, BOOL success, const char *sid) +static void gid2sid_recv(void *private_data, bool success, const char *sid) { struct winbindd_cli_state *state = (struct winbindd_cli_state *)private_data; @@ -528,7 +528,7 @@ enum winbindd_result winbindd_dual_allocate_gid(struct winbindd_domain *domain, return WINBINDD_OK; } -static void dump_maps_recv(void *private_data, BOOL success) +static void dump_maps_recv(void *private_data, bool success) { struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); diff --git a/source3/winbindd/winbindd_user.c b/source3/winbindd/winbindd_user.c index fac2832f56..01cdd0a9d3 100644 --- a/source3/winbindd/winbindd_user.c +++ b/source3/winbindd/winbindd_user.c @@ -27,7 +27,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -static BOOL fillup_pw_field(const char *lp_template, +static bool fillup_pw_field(const char *lp_template, const char *username, const char *domname, uid_t uid, @@ -67,7 +67,7 @@ static BOOL fillup_pw_field(const char *lp_template, } /* Fill a pwent structure with information we have obtained */ -static BOOL winbindd_fill_pwent(char *dom_name, char *user_name, +static bool winbindd_fill_pwent(char *dom_name, char *user_name, DOM_SID *user_sid, DOM_SID *group_sid, char *full_name, char *homedir, char *shell, struct winbindd_pw *pw) @@ -178,15 +178,15 @@ struct getpwsid_state { gid_t gid; }; -static void getpwsid_queryuser_recv(void *private_data, BOOL success, +static void getpwsid_queryuser_recv(void *private_data, bool success, const char *acct_name, const char *full_name, const char *homedir, const char *shell, uint32 gid, uint32 group_rid); -static void getpwsid_sid2uid_recv(void *private_data, BOOL success, uid_t uid); -static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid); +static void getpwsid_sid2uid_recv(void *private_data, bool success, uid_t uid); +static void getpwsid_sid2gid_recv(void *private_data, bool success, gid_t gid); static void winbindd_getpwsid(struct winbindd_cli_state *state, const DOM_SID *sid) @@ -217,7 +217,7 @@ static void winbindd_getpwsid(struct winbindd_cli_state *state, request_error(state); } -static void getpwsid_queryuser_recv(void *private_data, BOOL success, +static void getpwsid_queryuser_recv(void *private_data, bool success, const char *acct_name, const char *full_name, const char *homedir, @@ -282,7 +282,7 @@ static void getpwsid_queryuser_recv(void *private_data, BOOL success, getpwsid_sid2uid_recv, s); } -static void getpwsid_sid2uid_recv(void *private_data, BOOL success, uid_t uid) +static void getpwsid_sid2uid_recv(void *private_data, bool success, uid_t uid) { struct getpwsid_state *s = talloc_get_type_abort(private_data, struct getpwsid_state); @@ -299,7 +299,7 @@ static void getpwsid_sid2uid_recv(void *private_data, BOOL success, uid_t uid) getpwsid_sid2gid_recv, s); } -static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid) +static void getpwsid_sid2gid_recv(void *private_data, bool success, gid_t gid) { struct getpwsid_state *s = talloc_get_type_abort(private_data, struct getpwsid_state); @@ -357,7 +357,7 @@ static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid) /* Return a password structure from a username. */ -static void getpwnam_name2sid_recv(void *private_data, BOOL success, +static void getpwnam_name2sid_recv(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type); void winbindd_getpwnam(struct winbindd_cli_state *state) @@ -409,7 +409,7 @@ void winbindd_getpwnam(struct winbindd_cli_state *state) state); } -static void getpwnam_name2sid_recv(void *private_data, BOOL success, +static void getpwnam_name2sid_recv(void *private_data, bool success, const DOM_SID *sid, enum lsa_SidType type) { struct winbindd_cli_state *state = @@ -438,7 +438,7 @@ static void getpwnam_name2sid_recv(void *private_data, BOOL success, winbindd_getpwsid(state, sid); } -static void getpwuid_recv(void *private_data, BOOL success, const char *sid) +static void getpwuid_recv(void *private_data, bool success, const char *sid) { struct winbindd_cli_state *state = (struct winbindd_cli_state *)private_data; @@ -475,7 +475,7 @@ void winbindd_getpwuid(struct winbindd_cli_state *state) /* Rewind file pointer for ntdom passwd database */ -static BOOL winbindd_setpwent_internal(struct winbindd_cli_state *state) +static bool winbindd_setpwent_internal(struct winbindd_cli_state *state) { struct winbindd_domain *domain; @@ -568,7 +568,7 @@ void winbindd_endpwent(struct winbindd_cli_state *state) field is incremented to the index of the next user to fetch. Return True if some users were returned, False otherwise. */ -static BOOL get_sam_user_entries(struct getent_state *ent, TALLOC_CTX *mem_ctx) +static bool get_sam_user_entries(struct getent_state *ent, TALLOC_CTX *mem_ctx) { NTSTATUS status; uint32 num_entries; diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index c2fe09eead..54bb5a24b7 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -77,7 +77,7 @@ void free_domain_list(void) } } -static BOOL is_internal_domain(const DOM_SID *sid) +static bool is_internal_domain(const DOM_SID *sid) { if (sid == NULL) return False; @@ -88,7 +88,7 @@ static BOOL is_internal_domain(const DOM_SID *sid) return (sid_check_is_domain(sid) || sid_check_is_builtin(sid)); } -static BOOL is_in_internal_domain(const DOM_SID *sid) +static bool is_in_internal_domain(const DOM_SID *sid) { if (sid == NULL) return False; @@ -204,12 +204,12 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const struct trustdom_state { TALLOC_CTX *mem_ctx; - BOOL primary; - BOOL forest_root; + bool primary; + bool forest_root; struct winbindd_response *response; }; -static void trustdom_recv(void *private_data, BOOL success); +static void trustdom_recv(void *private_data, bool success); static void rescan_forest_root_trusts( void ); static void rescan_forest_trusts( void ); @@ -253,7 +253,7 @@ static void add_trusted_domains( struct winbindd_domain *domain ) trustdom_recv, state); } -static void trustdom_recv(void *private_data, BOOL success) +static void trustdom_recv(void *private_data, bool success) { struct trustdom_state *state = talloc_get_type_abort(private_data, struct trustdom_state); @@ -518,16 +518,16 @@ struct init_child_state { struct winbindd_domain *domain; struct winbindd_request *request; struct winbindd_response *response; - void (*continuation)(void *private_data, BOOL success); + void (*continuation)(void *private_data, bool success); void *private_data; }; -static void init_child_recv(void *private_data, BOOL success); -static void init_child_getdc_recv(void *private_data, BOOL success); +static void init_child_recv(void *private_data, bool success); +static void init_child_getdc_recv(void *private_data, bool success); enum winbindd_result init_child_connection(struct winbindd_domain *domain, void (*continuation)(void *private_data, - BOOL success), + bool success), void *private_data) { TALLOC_CTX *mem_ctx; @@ -585,7 +585,7 @@ enum winbindd_result init_child_connection(struct winbindd_domain *domain, return WINBINDD_PENDING; } -static void init_child_getdc_recv(void *private_data, BOOL success) +static void init_child_getdc_recv(void *private_data, bool success) { struct init_child_state *state = talloc_get_type_abort(private_data, struct init_child_state); @@ -607,7 +607,7 @@ static void init_child_getdc_recv(void *private_data, BOOL success) init_child_recv, state); } -static void init_child_recv(void *private_data, BOOL success) +static void init_child_recv(void *private_data, bool success) { struct init_child_state *state = talloc_get_type_abort(private_data, struct init_child_state); @@ -681,7 +681,7 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai } /* Look up global info for the winbind daemon */ -BOOL init_domain_list(void) +bool init_domain_list(void) { struct winbindd_domain *domain; int role = lp_server_role(); @@ -951,7 +951,7 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name) /* Lookup a sid in a domain from a name */ -BOOL winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx, +bool winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx, enum winbindd_cmd orig_cmd, struct winbindd_domain *domain, const char *domain_name, @@ -983,7 +983,7 @@ BOOL winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx, * @retval True if the name exists, in which case @p name and @p type * are set, otherwise False. **/ -BOOL winbindd_lookup_name_by_sid(TALLOC_CTX *mem_ctx, +bool winbindd_lookup_name_by_sid(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain, DOM_SID *sid, char **dom_name, @@ -1036,7 +1036,7 @@ void free_getent_state(struct getent_state *state) /* Is this a domain which we may assume no DOMAIN\ prefix? */ -static BOOL assume_domain(const char *domain) +static bool assume_domain(const char *domain) { /* never assume the domain on a standalone server */ @@ -1064,7 +1064,7 @@ static BOOL assume_domain(const char *domain) /* Parse a string of the form DOMAIN\user into a domain and a user */ -BOOL parse_domain_user(const char *domuser, fstring domain, fstring user) +bool parse_domain_user(const char *domuser, fstring domain, fstring user) { char *p = strchr(domuser,*lp_winbind_separator()); @@ -1089,7 +1089,7 @@ BOOL parse_domain_user(const char *domuser, fstring domain, fstring user) return True; } -BOOL parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser, +bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser, char **domain, char **user) { fstring fstr_domain, fstr_user; @@ -1110,7 +1110,7 @@ BOOL parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser, really should be changed to use this instead of doing things by hand. JRA. */ -BOOL canonicalize_username(fstring username_inout, fstring domain, fstring user) +bool canonicalize_username(fstring username_inout, fstring domain, fstring user) { if (!parse_domain_user(username_inout, domain, user)) { return False; @@ -1135,7 +1135,7 @@ BOOL canonicalize_username(fstring username_inout, fstring domain, fstring user) We always canonicalize as UPPERCASE DOMAIN, lowercase username. */ -void fill_domain_username(fstring name, const char *domain, const char *user, BOOL can_assume) +void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume) { fstring tmp_user; @@ -1376,7 +1376,7 @@ void ws_name_return( char *name, char replace ) /********************************************************************* ********************************************************************/ -BOOL winbindd_can_contact_domain( struct winbindd_domain *domain ) +bool winbindd_can_contact_domain( struct winbindd_domain *domain ) { /* We can contact the domain if it is our primary domain */ @@ -1406,7 +1406,7 @@ BOOL winbindd_can_contact_domain( struct winbindd_domain *domain ) /********************************************************************* ********************************************************************/ -BOOL winbindd_internal_child(struct winbindd_child *child) +bool winbindd_internal_child(struct winbindd_child *child) { if ((child == idmap_child()) || (child == locator_child())) { return True; |