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/smbd/trans2.c | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'source3/smbd/trans2.c') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index ce038e719a..7f38d5caa8 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -94,7 +94,7 @@ SMB_BIG_UINT get_allocation_size(connection_struct *conn, files_struct *fsp, con Refuse to allow clients to overwrite our private xattrs. ****************************************************************************/ -static BOOL samba_private_attr_name(const char *unix_ea_name) +static bool samba_private_attr_name(const char *unix_ea_name) { static const char *prohibited_ea_names[] = { SAMBA_POSIX_INHERITANCE_EA_NAME, @@ -115,7 +115,7 @@ static BOOL samba_private_attr_name(const char *unix_ea_name) Get one EA value. Fill in a struct ea_struct. ****************************************************************************/ -static BOOL get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, +static bool get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, const char *fname, char *ea_name, struct ea_struct *pea) { /* Get the value of this xattr. Max size is 64k. */ @@ -597,7 +597,7 @@ void send_trans2_replies(struct smb_request *req, int params_sent_thistime, data_sent_thistime, total_sent_thistime; int alignment_offset = 1; /* JRA. This used to be 3. Set to 1 to make netmon parse ok. */ int data_alignment_offset = 0; - BOOL overflow = False; + bool overflow = False; /* Modify the data_to_send and datasize and set the error if we're trying to send more than max_data_bytes. We still send @@ -774,9 +774,9 @@ static void call_trans2open(connection_struct *conn, char *pdata = *ppdata; int deny_mode; int32 open_attr; - BOOL oplock_request; + bool oplock_request; #if 0 - BOOL return_additional_info; + bool return_additional_info; int16 open_sattr; time_t open_time; #endif @@ -1008,7 +1008,7 @@ static void call_trans2open(connection_struct *conn, Case can be significant or not. **********************************************************/ -static BOOL exact_match(connection_struct *conn, +static bool exact_match(connection_struct *conn, const char *str, const char *mask) { @@ -1136,25 +1136,25 @@ static NTSTATUS unix_perms_from_wire( connection_struct *conn, Get a level dependent lanman2 dir entry. ****************************************************************************/ -static BOOL get_lanman2_dir_entry(TALLOC_CTX *ctx, +static bool get_lanman2_dir_entry(TALLOC_CTX *ctx, connection_struct *conn, uint16 flags2, const char *path_mask, uint32 dirtype, int info_level, int requires_resume_key, - BOOL dont_descend, + bool dont_descend, char **ppdata, char *base_data, char *end_data, int space_remaining, - BOOL *out_of_space, - BOOL *got_exact_match, + bool *out_of_space, + bool *got_exact_match, int *last_entry_off, struct ea_list *name_list) { const char *dname; - BOOL found = False; + bool found = False; SMB_STRUCT_STAT sbuf; const char *mask = NULL; char *pathreal = NULL; @@ -1170,10 +1170,10 @@ static BOOL get_lanman2_dir_entry(TALLOC_CTX *ctx, time_t mdate = (time_t)0, adate = (time_t)0, create_date = (time_t)0; char *nameptr; char *last_entry_ptr; - BOOL was_8_3; + bool was_8_3; uint32 nt_extmode; /* Used for NT connections instead of mode */ - BOOL needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/'); - BOOL check_mangled_names = lp_manglednames(conn->params); + bool needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/'); + bool check_mangled_names = lp_manglednames(conn->params); char mangled_name[13]; /* mangled 8.3 name. */ *out_of_space = False; @@ -1199,8 +1199,8 @@ static BOOL get_lanman2_dir_entry(TALLOC_CTX *ctx, } while (!found) { - BOOL got_match; - BOOL ms_dfs_link = False; + bool got_match; + bool ms_dfs_link = False; /* Needed if we run out of space */ long curr_dirpos = prev_dirpos = dptr_TellDir(conn->dirptr); @@ -1262,7 +1262,7 @@ static BOOL get_lanman2_dir_entry(TALLOC_CTX *ctx, } if (got_match) { - BOOL isdots = (ISDOT(dname) || ISDOTDOT(dname)); + bool isdots = (ISDOT(dname) || ISDOTDOT(dname)); if (dont_descend && !isdots) { continue; @@ -1782,9 +1782,9 @@ static void call_trans2findfirst(connection_struct *conn, uint32 dirtype; int maxentries; uint16 findfirst_flags; - BOOL close_after_first; - BOOL close_if_end; - BOOL requires_resume_key; + bool close_after_first; + bool close_if_end; + bool requires_resume_key; int info_level; char *directory = NULL; const char *mask = NULL; @@ -1793,11 +1793,11 @@ static void call_trans2findfirst(connection_struct *conn, int dptr_num = -1; int numentries = 0; int i; - BOOL finished = False; - BOOL dont_descend = False; - BOOL out_of_space = False; + bool finished = False; + bool dont_descend = False; + bool out_of_space = False; int space_remaining; - BOOL mask_contains_wcard = False; + bool mask_contains_wcard = False; SMB_STRUCT_STAT sbuf; struct ea_list *ea_list = NULL; NTSTATUS ntstatus = NT_STATUS_OK; @@ -1984,7 +1984,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd out_of_space = False; for (i=0;(i