summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
committerJeremy Allison <jra@samba.org>2007-10-18 17:40:25 -0700
commit30191d1a5704ad2b158386b511558972d539ce47 (patch)
tree4f46e5c4f28f672ab661aa18f45745860970a88c /source3/smbd
parent789856f63ff73fec66298e95c91c60db7bdaf14e (diff)
downloadsamba-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/smbd')
-rw-r--r--source3/smbd/aio.c24
-rw-r--r--source3/smbd/blocking.c30
-rw-r--r--source3/smbd/chgpasswd.c40
-rw-r--r--source3/smbd/close.c8
-rw-r--r--source3/smbd/conn.c4
-rw-r--r--source3/smbd/connection.c18
-rw-r--r--source3/smbd/dfree.c6
-rw-r--r--source3/smbd/dir.c54
-rw-r--r--source3/smbd/dmapi.c4
-rw-r--r--source3/smbd/dosmode.c8
-rw-r--r--source3/smbd/error.c6
-rw-r--r--source3/smbd/fileio.c10
-rw-r--r--source3/smbd/filename.c20
-rw-r--r--source3/smbd/ipc.c6
-rw-r--r--source3/smbd/lanman.c100
-rw-r--r--source3/smbd/mangle.c14
-rw-r--r--source3/smbd/mangle_hash.c28
-rw-r--r--source3/smbd/mangle_hash2.c38
-rw-r--r--source3/smbd/map_username.c8
-rw-r--r--source3/smbd/msdfs.c56
-rw-r--r--source3/smbd/negprot.c8
-rw-r--r--source3/smbd/noquotas.c2
-rw-r--r--source3/smbd/notify.c8
-rw-r--r--source3/smbd/notify_inotify.c2
-rw-r--r--source3/smbd/ntquotas.c2
-rw-r--r--source3/smbd/nttrans.c28
-rw-r--r--source3/smbd/open.c42
-rw-r--r--source3/smbd/oplock.c24
-rw-r--r--source3/smbd/oplock_irix.c6
-rw-r--r--source3/smbd/oplock_linux.c6
-rw-r--r--source3/smbd/password.c16
-rw-r--r--source3/smbd/pipes.c4
-rw-r--r--source3/smbd/posix_acls.c102
-rw-r--r--source3/smbd/process.c18
-rw-r--r--source3/smbd/quotas.c34
-rw-r--r--source3/smbd/reply.c104
-rw-r--r--source3/smbd/sec_ctx.c10
-rw-r--r--source3/smbd/server.c30
-rw-r--r--source3/smbd/service.c18
-rw-r--r--source3/smbd/session.c6
-rw-r--r--source3/smbd/sesssetup.c34
-rw-r--r--source3/smbd/share_access.c12
-rw-r--r--source3/smbd/statcache.c8
-rw-r--r--source3/smbd/trans2.c90
-rw-r--r--source3/smbd/uid.c20
-rw-r--r--source3/smbd/utmp.c10
-rw-r--r--source3/smbd/vfs.c22
47 files changed, 574 insertions, 574 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 6ee0fe16e1..994b10d6a8 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -35,7 +35,7 @@ struct aio_extra {
struct aio_extra *next, *prev;
SMB_STRUCT_AIOCB acb;
files_struct *fsp;
- BOOL read_req;
+ bool read_req;
uint16 mid;
char *inbuf;
char *outbuf;
@@ -163,7 +163,7 @@ static void signal_handler(int sig, siginfo_t *info, void *unused)
Is there a signal waiting ?
*****************************************************************************/
-BOOL aio_finished(void)
+bool aio_finished(void)
{
return (signals_received != 0);
}
@@ -192,7 +192,7 @@ void initialize_async_io_handler(void)
Set up an aio request from a SMBreadX call.
*****************************************************************************/
-BOOL schedule_aio_read_and_X(connection_struct *conn,
+bool schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *req,
files_struct *fsp, SMB_OFF_T startpos,
size_t smb_maxcnt)
@@ -272,7 +272,7 @@ BOOL schedule_aio_read_and_X(connection_struct *conn,
Set up an aio request from a SMBwriteX call.
*****************************************************************************/
-BOOL schedule_aio_write_and_X(connection_struct *conn,
+bool schedule_aio_write_and_X(connection_struct *conn,
struct smb_request *req,
files_struct *fsp, char *data,
SMB_OFF_T startpos,
@@ -281,7 +281,7 @@ BOOL schedule_aio_write_and_X(connection_struct *conn,
struct aio_extra *aio_ex;
SMB_STRUCT_AIOCB *a;
size_t inbufsize, outbufsize;
- BOOL write_through = BITSETW(req->inbuf+smb_vwv7,0);
+ bool write_through = BITSETW(req->inbuf+smb_vwv7,0);
size_t min_aio_write_size = lp_aio_write_size(SNUM(conn));
if (!min_aio_write_size || (numtowrite < min_aio_write_size)) {
@@ -495,7 +495,7 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
UNIXERROR(ERRHRD,ERRdiskfull);
ret = errno;
} else {
- BOOL write_through = BITSETW(aio_ex->inbuf+smb_vwv7,0);
+ bool write_through = BITSETW(aio_ex->inbuf+smb_vwv7,0);
NTSTATUS status;
SSVAL(outbuf,smb_vwv2,nwritten);
@@ -534,7 +534,7 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
was non-zero), False if not.
*****************************************************************************/
-static BOOL handle_aio_completed(struct aio_extra *aio_ex, int *perr)
+static bool handle_aio_completed(struct aio_extra *aio_ex, int *perr)
{
int err;
@@ -747,7 +747,7 @@ void cancel_aio_by_fsp(files_struct *fsp)
}
#else
-BOOL aio_finished(void)
+bool aio_finished(void)
{
return False;
}
@@ -761,7 +761,7 @@ int process_aio_queue(void)
return False;
}
-BOOL schedule_aio_read_and_X(connection_struct *conn,
+bool schedule_aio_read_and_X(connection_struct *conn,
struct smb_request *req,
files_struct *fsp, SMB_OFF_T startpos,
size_t smb_maxcnt)
@@ -769,7 +769,7 @@ BOOL schedule_aio_read_and_X(connection_struct *conn,
return False;
}
-BOOL schedule_aio_write_and_X(connection_struct *conn,
+bool schedule_aio_write_and_X(connection_struct *conn,
struct smb_request *req,
files_struct *fsp, char *data,
SMB_OFF_T startpos,
@@ -782,8 +782,8 @@ void cancel_aio_by_fsp(files_struct *fsp)
{
}
-BOOL wait_for_aio_completion(files_struct *fsp)
+int wait_for_aio_completion(files_struct *fsp)
{
- return True;
+ return ENOSYS;
}
#endif
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index ef70829f74..66a61449a1 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -66,7 +66,7 @@ static void free_blocking_lock_record(blocking_lock_record *blr)
Determine if this is a secondary element of a chained SMB.
**************************************************************************/
-static BOOL in_chained_smb(void)
+static bool in_chained_smb(void)
{
return (chain_size != 0);
}
@@ -97,7 +97,7 @@ static void brl_timeout_fn(struct event_context *event_ctx,
next processing.
****************************************************************************/
-static BOOL recalc_brl_timeout(void)
+static bool recalc_brl_timeout(void)
{
blocking_lock_record *brl;
struct timeval next_timeout;
@@ -148,7 +148,7 @@ static BOOL recalc_brl_timeout(void)
Function to push a blocking lock request onto the lock queue.
****************************************************************************/
-BOOL push_blocking_lock_request( struct byte_range_lock *br_lck,
+bool push_blocking_lock_request( struct byte_range_lock *br_lck,
const char *inbuf, int length,
files_struct *fsp,
int lock_timeout,
@@ -160,7 +160,7 @@ BOOL push_blocking_lock_request( struct byte_range_lock *br_lck,
SMB_BIG_UINT count,
uint32 blocking_pid)
{
- static BOOL set_lock_msg;
+ static bool set_lock_msg;
blocking_lock_record *blr;
NTSTATUS status;
@@ -327,7 +327,7 @@ static void reply_lockingX_error(blocking_lock_record *blr, NTSTATUS status)
SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT) 0;
uint32 lock_pid;
unsigned char locktype = CVAL(inbuf,smb_vwv3);
- BOOL large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
+ bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
char *data;
int i;
@@ -345,7 +345,7 @@ static void reply_lockingX_error(blocking_lock_record *blr, NTSTATUS status)
*/
for(i = blr->lock_num - 1; i >= 0; i--) {
- BOOL err;
+ bool err;
lock_pid = get_lock_pid( data, i, large_file_format);
count = get_lock_count( data, i, large_file_format);
@@ -404,7 +404,7 @@ static void blocking_lock_reply_error(blocking_lock_record *blr, NTSTATUS status
Returns True if we want to be removed from the list.
*****************************************************************************/
-static BOOL process_lockingX(blocking_lock_record *blr)
+static bool process_lockingX(blocking_lock_record *blr)
{
char *inbuf = blr->inbuf;
unsigned char locktype = CVAL(inbuf,smb_vwv3);
@@ -413,7 +413,7 @@ static BOOL process_lockingX(blocking_lock_record *blr)
uint16 num_locks = SVAL(inbuf,smb_vwv7);
SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT)0;
uint32 lock_pid;
- BOOL large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
+ bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
char *data;
NTSTATUS status = NT_STATUS_OK;
@@ -426,7 +426,7 @@ static BOOL process_lockingX(blocking_lock_record *blr)
for(; blr->lock_num < num_locks; blr->lock_num++) {
struct byte_range_lock *br_lck = NULL;
- BOOL err;
+ bool err;
lock_pid = get_lock_pid( data, blr->lock_num, large_file_format);
count = get_lock_count( data, blr->lock_num, large_file_format);
@@ -494,7 +494,7 @@ Waiting....\n",
Returns True if we want to be removed from the list.
*****************************************************************************/
-static BOOL process_trans2(blocking_lock_record *blr)
+static bool process_trans2(blocking_lock_record *blr)
{
struct smb_request *req;
char params[2];
@@ -546,7 +546,7 @@ static BOOL process_trans2(blocking_lock_record *blr)
Returns True if we want to be removed from the list.
*****************************************************************************/
-static BOOL blocking_lock_record_process(blocking_lock_record *blr)
+static bool blocking_lock_record_process(blocking_lock_record *blr)
{
switch(blr->com_type) {
case SMBlockingX:
@@ -639,7 +639,7 @@ file %s fnum = %d\n", blr->com_type, fsp->fsp_name, fsp->fnum ));
Is this mid a blocking lock request on the queue ?
*****************************************************************************/
-BOOL blocking_lock_was_deferred(int mid)
+bool blocking_lock_was_deferred(int mid)
{
blocking_lock_record *blr, *next = NULL;
@@ -674,7 +674,7 @@ static void process_blocking_lock_queue(void)
{
struct timeval tv_curr = timeval_current();
blocking_lock_record *blr, *next = NULL;
- BOOL recalc_timeout = False;
+ bool recalc_timeout = False;
/*
* Go through the queue and see if we can get any of the locks.
@@ -861,7 +861,7 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
Send ourselves a blocking lock cancelled message. Handled asynchronously above.
*****************************************************************************/
-BOOL blocking_lock_cancel(files_struct *fsp,
+bool blocking_lock_cancel(files_struct *fsp,
uint32 lock_pid,
SMB_BIG_UINT offset,
SMB_BIG_UINT count,
@@ -869,7 +869,7 @@ BOOL blocking_lock_cancel(files_struct *fsp,
unsigned char locktype,
NTSTATUS err)
{
- static BOOL initialized;
+ static bool initialized;
char msg[MSG_BLOCKING_LOCK_CANCEL_SIZE];
blocking_lock_record *blr;
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 242f0e0753..fb6e6c0f09 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -119,7 +119,7 @@ static int findpty(char **slave)
}
static int dochild(int master, const char *slavedev, const struct passwd *pass,
- const char *passwordprogram, BOOL as_root)
+ const char *passwordprogram, bool as_root)
{
int slave;
struct termios stermios;
@@ -233,7 +233,7 @@ static int expect(int master, char *issue, char *expected)
{
pstring buffer;
int attempts, timeout, nread, len;
- BOOL match = False;
+ bool match = False;
for (attempts = 0; attempts < 2; attempts++) {
if (!strequal(issue, ".")) {
@@ -331,14 +331,14 @@ static int talktochild(int master, const char *seq)
return (count > 0);
}
-static BOOL chat_with_program(char *passwordprogram, const struct passwd *pass,
- char *chatsequence, BOOL as_root)
+static bool chat_with_program(char *passwordprogram, const struct passwd *pass,
+ char *chatsequence, bool as_root)
{
char *slavedev;
int master;
pid_t pid, wpid;
int wstat;
- BOOL chstat = False;
+ bool chstat = False;
if (pass == NULL) {
DEBUG(0, ("chat_with_program: user doesn't exist in the UNIX password database.\n"));
@@ -446,8 +446,8 @@ while we were waiting\n", WTERMSIG(wstat)));
return (chstat);
}
-BOOL chgpasswd(const char *name, const struct passwd *pass,
- const char *oldpass, const char *newpass, BOOL as_root)
+bool chgpasswd(const char *name, const struct passwd *pass,
+ const char *oldpass, const char *newpass, bool as_root)
{
pstring passwordprogram;
pstring chatsequence;
@@ -496,7 +496,7 @@ BOOL chgpasswd(const char *name, const struct passwd *pass,
#ifdef WITH_PAM
if (lp_pam_password_change()) {
- BOOL ret;
+ bool ret;
if (as_root)
become_root();
@@ -557,8 +557,8 @@ the string %%u, and the given string %s does not.\n", passwordprogram ));
#else /* ALLOW_CHANGE_PASSWORD */
-BOOL chgpasswd(const char *name, const struct passwd *pass,
- const char *oldpass, const char *newpass, BOOL as_root)
+bool chgpasswd(const char *name, const struct passwd *pass,
+ const char *oldpass, const char *newpass, bool as_root)
{
DEBUG(0, ("chgpasswd: Unix Password changing not compiled in (user=%s)\n", name));
return (False);
@@ -569,7 +569,7 @@ BOOL chgpasswd(const char *name, const struct passwd *pass,
Code to check the lanman hashed password.
************************************************************/
-BOOL check_lanman_password(char *user, uchar * pass1,
+bool check_lanman_password(char *user, uchar * pass1,
uchar * pass2, struct samu **hnd)
{
uchar unenc_new_pw[16];
@@ -577,7 +577,7 @@ BOOL check_lanman_password(char *user, uchar * pass1,
struct samu *sampass = NULL;
uint32 acct_ctrl;
const uint8 *lanman_pw;
- BOOL ret;
+ bool ret;
if ( !(sampass = samu_new(NULL)) ) {
DEBUG(0, ("samu_new() failed!\n"));
@@ -641,11 +641,11 @@ BOOL check_lanman_password(char *user, uchar * pass1,
is correct before calling. JRA.
************************************************************/
-BOOL change_lanman_password(struct samu *sampass, uchar *pass2)
+bool change_lanman_password(struct samu *sampass, uchar *pass2)
{
static uchar null_pw[16];
uchar unenc_new_pw[16];
- BOOL ret;
+ bool ret;
uint32 acct_ctrl;
const uint8 *pwd;
@@ -766,10 +766,10 @@ static NTSTATUS check_oem_password(const char *user,
uchar new_lm_hash[16];
uchar verifier[16];
char no_pw[2];
- BOOL ret;
+ bool ret;
- BOOL nt_pass_set = (password_encrypted_with_nt_hash && old_nt_hash_encrypted);
- BOOL lm_pass_set = (password_encrypted_with_lm_hash && old_lm_hash_encrypted);
+ bool nt_pass_set = (password_encrypted_with_nt_hash && old_nt_hash_encrypted);
+ bool lm_pass_set = (password_encrypted_with_lm_hash && old_lm_hash_encrypted);
*hnd = NULL;
@@ -948,13 +948,13 @@ static NTSTATUS check_oem_password(const char *user,
found in the history list.
************************************************************/
-static BOOL check_passwd_history(struct samu *sampass, const char *plaintext)
+static bool check_passwd_history(struct samu *sampass, const char *plaintext)
{
uchar new_nt_p16[NT_HASH_LEN];
uchar zero_md5_nt_pw[SALTED_MD5_HASH_LEN];
const uint8 *nt_pw;
const uint8 *pwhistory;
- BOOL found = False;
+ bool found = False;
int i;
uint32 pwHisLen, curr_pwHisLen;
@@ -1015,7 +1015,7 @@ static BOOL check_passwd_history(struct samu *sampass, const char *plaintext)
is correct before calling. JRA.
************************************************************/
-NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, BOOL as_root, uint32 *samr_reject_reason)
+NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, bool as_root, uint32 *samr_reject_reason)
{
uint32 min_len;
uint32 refuse;
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index ae45aaa6da..d2ee73d09d 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -162,7 +162,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
enum file_close_type close_type)
{
connection_struct *conn = fsp->conn;
- BOOL delete_file = False;
+ bool delete_file = False;
struct share_mode_lock *lck;
SMB_STRUCT_STAT sbuf;
NTSTATUS status = NT_STATUS_OK;
@@ -189,7 +189,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
}
if (fsp->initial_delete_on_close && (lck->delete_token == NULL)) {
- BOOL became_user = False;
+ bool became_user = False;
/* Initial delete on close was set and no one else
* wrote a real delete on close. */
@@ -432,7 +432,7 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_type)
{
struct share_mode_lock *lck = 0;
- BOOL delete_dir = False;
+ bool delete_dir = False;
NTSTATUS status = NT_STATUS_OK;
/*
@@ -452,7 +452,7 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
}
if (fsp->initial_delete_on_close) {
- BOOL became_user = False;
+ bool became_user = False;
/* Initial delete on close was set - for
* directories we don't care if anyone else
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index 50a71edf9d..5aedadc56b 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -52,7 +52,7 @@ int conn_num_open(void)
/****************************************************************************
check if a snum is in use
****************************************************************************/
-BOOL conn_snum_used(int snum)
+bool conn_snum_used(int snum)
{
connection_struct *conn;
for (conn=Connections;conn;conn=conn->next) {
@@ -186,7 +186,7 @@ void conn_close_all(void)
Idle inactive connections.
****************************************************************************/
-BOOL conn_idle_all(time_t t)
+bool conn_idle_all(time_t t)
{
int deadtime = lp_deadtime()*60;
pipes_struct *plist = NULL;
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 65b7c352c5..e9f1b82fbf 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -23,7 +23,7 @@
Delete a connection record.
****************************************************************************/
-BOOL yield_connection(connection_struct *conn, const char *name)
+bool yield_connection(connection_struct *conn, const char *name)
{
struct db_record *rec;
NTSTATUS status;
@@ -50,7 +50,7 @@ struct count_stat {
pid_t mypid;
int curr_connections;
const char *name;
- BOOL Clear;
+ bool Clear;
};
/****************************************************************************
@@ -94,7 +94,7 @@ static int count_fn(struct db_record *rec,
Claim an entry in the connections database.
****************************************************************************/
-int count_current_connections( const char *sharename, BOOL clear )
+int count_current_connections( const char *sharename, bool clear )
{
struct count_stat cs;
@@ -121,7 +121,7 @@ int count_current_connections( const char *sharename, BOOL clear )
Claim an entry in the connections database.
****************************************************************************/
-BOOL claim_connection(connection_struct *conn, const char *name,
+bool claim_connection(connection_struct *conn, const char *name,
uint32 msg_flags)
{
struct db_record *rec;
@@ -170,7 +170,7 @@ BOOL claim_connection(connection_struct *conn, const char *name,
return True;
}
-BOOL register_message_flags(BOOL doreg, uint32 msg_flags)
+bool register_message_flags(bool doreg, uint32 msg_flags)
{
struct db_record *rec;
struct connections_data *pcrec;
@@ -255,13 +255,13 @@ static void fill_pipe_open_rec( struct pipe_open_rec *prec, smb_np_struct *p )
/*********************************************************************
*********************************************************************/
-BOOL store_pipe_opendb( smb_np_struct *p )
+bool store_pipe_opendb( smb_np_struct *p )
{
struct db_record *dbrec;
struct pipe_open_rec *prec;
TDB_DATA *key;
TDB_DATA data;
- BOOL ret = False;
+ bool ret = False;
if ( (prec = TALLOC_P( NULL, struct pipe_open_rec)) == NULL ) {
DEBUG(0,("store_pipe_opendb: talloc failed!\n"));
@@ -291,12 +291,12 @@ done:
/*********************************************************************
*********************************************************************/
-BOOL delete_pipe_opendb( smb_np_struct *p )
+bool delete_pipe_opendb( smb_np_struct *p )
{
struct db_record *dbrec;
struct pipe_open_rec *prec;
TDB_DATA *key;
- BOOL ret = False;
+ bool ret = False;
if ( (prec = TALLOC_P( NULL, struct pipe_open_rec)) == NULL ) {
DEBUG(0,("store_pipe_opendb: talloc failed!\n"));
diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c
index 9439468600..31eb9fbd60 100644
--- a/source3/smbd/dfree.c
+++ b/source3/smbd/dfree.c
@@ -23,7 +23,7 @@
Normalise for DOS usage.
****************************************************************************/
-static void disk_norm(BOOL small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
{
/* check if the disk is beyond the max disk size */
SMB_BIG_UINT maxdisksize = lp_maxdisksize();
@@ -62,7 +62,7 @@ static void disk_norm(BOOL small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,
Return number of 1K blocks available on a path and total number.
****************************************************************************/
-SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, BOOL small_query,
+SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small_query,
SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
{
SMB_BIG_UINT dfree_retval;
@@ -176,7 +176,7 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, BOOL small
SMB_BIG_UINT get_dfree_info(connection_struct *conn,
const char *path,
- BOOL small_query,
+ bool small_query,
SMB_BIG_UINT *bsize,
SMB_BIG_UINT *dfree,
SMB_BIG_UINT *dsize)
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index a7b1b020b8..f6a8b27ab4 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -55,12 +55,12 @@ struct dptr_struct {
uint16 spid;
struct connection_struct *conn;
struct smb_Dir *dir_hnd;
- BOOL expect_close;
+ bool expect_close;
char *wcard;
uint32 attr;
char *path;
- BOOL has_wild; /* Set to true if the wcard entry has MS wildcard characters in it. */
- BOOL did_stat; /* Optimisation for non-wcard searches. */
+ bool has_wild; /* Set to true if the wcard entry has MS wildcard characters in it. */
+ bool did_stat; /* Optimisation for non-wcard searches. */
};
static struct bitmap *dptr_bmap;
@@ -73,14 +73,14 @@ static int dirhandles_open = 0;
Make a dir struct.
****************************************************************************/
-BOOL make_dir_struct(TALLOC_CTX *ctx,
+bool make_dir_struct(TALLOC_CTX *ctx,
char *buf,
const char *mask,
const char *fname,
SMB_OFF_T size,
uint32 mode,
time_t date,
- BOOL uc)
+ bool uc)
{
char *p;
char *mask2 = talloc_strdup(ctx, mask);
@@ -121,7 +121,7 @@ BOOL make_dir_struct(TALLOC_CTX *ctx,
void init_dptrs(void)
{
- static BOOL dptrs_init=False;
+ static bool dptrs_init=False;
if (dptrs_init)
return;
@@ -182,7 +182,7 @@ static void dptr_idleoldest(void)
Get the struct dptr_struct for a dir index.
****************************************************************************/
-static struct dptr_struct *dptr_get(int key, BOOL forclose)
+static struct dptr_struct *dptr_get(int key, bool forclose)
{
struct dptr_struct *dptr;
@@ -354,7 +354,7 @@ void dptr_closepath(char *path,uint16 spid)
finished with that one.
****************************************************************************/
-static void dptr_close_oldest(BOOL old)
+static void dptr_close_oldest(bool old)
{
struct dptr_struct *dptr;
@@ -393,8 +393,8 @@ static void dptr_close_oldest(BOOL old)
wcard must not be zero.
****************************************************************************/
-NTSTATUS dptr_create(connection_struct *conn, const char *path, BOOL old_handle, BOOL expect_close,uint16 spid,
- const char *wcard, BOOL wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret)
+NTSTATUS dptr_create(connection_struct *conn, const char *path, bool old_handle, bool expect_close,uint16 spid,
+ const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret)
{
struct dptr_struct *dptr = NULL;
struct smb_Dir *dir_hnd;
@@ -546,7 +546,7 @@ long dptr_TellDir(struct dptr_struct *dptr)
return TellDir(dptr->dir_hnd);
}
-BOOL dptr_has_wild(struct dptr_struct *dptr)
+bool dptr_has_wild(struct dptr_struct *dptr)
{
return dptr->has_wild;
}
@@ -663,7 +663,7 @@ const char *dptr_ReadDirName(TALLOC_CTX *ctx,
Search for a file by name, skipping veto'ed and not visible files.
****************************************************************************/
-BOOL dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst)
+bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst)
{
SET_STAT_INVALID(*pst);
@@ -689,7 +689,7 @@ void dptr_DirCacheAdd(struct dptr_struct *dptr, const char *name, long offset)
Fill the 5 byte server reserved dptr field.
****************************************************************************/
-BOOL dptr_fill(char *buf1,unsigned int key)
+bool dptr_fill(char *buf1,unsigned int key)
{
unsigned char *buf = (unsigned char *)buf1;
struct dptr_struct *dptr = dptr_get(key, False);
@@ -754,7 +754,7 @@ struct dptr_struct *dptr_fetch_lanman2(int dptr_num)
Check that a file matches a particular file type.
****************************************************************************/
-BOOL dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype)
+bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype)
{
uint32 mask;
@@ -776,7 +776,7 @@ BOOL dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype)
return True;
}
-static BOOL mangle_mask_match(connection_struct *conn,
+static bool mangle_mask_match(connection_struct *conn,
const char *filename,
const char *mask)
{
@@ -792,7 +792,7 @@ static BOOL mangle_mask_match(connection_struct *conn,
Get an 8.3 directory entry.
****************************************************************************/
-BOOL get_dir_entry(TALLOC_CTX *ctx,
+bool get_dir_entry(TALLOC_CTX *ctx,
connection_struct *conn,
const char *mask,
uint32 dirtype,
@@ -800,14 +800,14 @@ BOOL get_dir_entry(TALLOC_CTX *ctx,
SMB_OFF_T *size,
uint32 *mode,
time_t *date,
- BOOL check_descend)
+ bool check_descend)
{
const char *dname = NULL;
- BOOL found = False;
+ bool found = False;
SMB_STRUCT_STAT sbuf;
char *pathreal = NULL;
const char *filename = NULL;
- BOOL needslash;
+ bool needslash;
*pp_fname_out = NULL;
@@ -908,7 +908,7 @@ BOOL get_dir_entry(TALLOC_CTX *ctx,
use it for anything security sensitive.
********************************************************************/
-static BOOL user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
+static bool user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
{
SEC_DESC *psd = NULL;
size_t sd_size;
@@ -971,7 +971,7 @@ static BOOL user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_S
use it for anything security sensitive.
********************************************************************/
-static BOOL user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
+static bool user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
{
SEC_DESC *psd = NULL;
size_t sd_size;
@@ -1030,7 +1030,7 @@ static BOOL user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_
Is a file a "special" type ?
********************************************************************/
-static BOOL file_is_special(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
+static bool file_is_special(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
{
/*
* If user is a member of the Admin group
@@ -1054,11 +1054,11 @@ static BOOL file_is_special(connection_struct *conn, char *name, SMB_STRUCT_STAT
Should the file be seen by the client ?
********************************************************************/
-BOOL is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, BOOL use_veto)
+bool is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, bool use_veto)
{
- BOOL hide_unreadable = lp_hideunreadable(SNUM(conn));
- BOOL hide_unwriteable = lp_hideunwriteable_files(SNUM(conn));
- BOOL hide_special = lp_hide_special_files(SNUM(conn));
+ bool hide_unreadable = lp_hideunreadable(SNUM(conn));
+ bool hide_unwriteable = lp_hideunwriteable_files(SNUM(conn));
+ bool hide_special = lp_hide_special_files(SNUM(conn));
SET_STAT_INVALID(*pst);
@@ -1309,7 +1309,7 @@ void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset)
Don't check for veto or invisible files.
********************************************************************/
-BOOL SearchDir(struct smb_Dir *dirp, const char *name, long *poffset)
+bool SearchDir(struct smb_Dir *dirp, const char *name, long *poffset)
{
int i;
const char *entry;
diff --git a/source3/smbd/dmapi.c b/source3/smbd/dmapi.c
index 127d1627cf..05e9138ea9 100644
--- a/source3/smbd/dmapi.c
+++ b/source3/smbd/dmapi.c
@@ -27,7 +27,7 @@
int dmapi_init_session(void) { return -1; }
uint32 dmapi_file_flags(const char * const path) { return 0; }
-BOOL dmapi_have_session(void) { return False; }
+bool dmapi_have_session(void) { return False; }
#else /* USE_DMAPI */
@@ -73,7 +73,7 @@ static int init_dmapi_service(void)
return 0;
}
-BOOL dmapi_have_session(void)
+bool dmapi_have_session(void)
{
return dmapi_session != DM_NO_SESSION;
}
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index b4ab0ca226..ed622d3730 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -200,7 +200,7 @@ static uint32 dos_mode_from_sbuf(connection_struct *conn, const char *path, SMB_
Get DOS attributes from an EA.
****************************************************************************/
-static BOOL get_ea_dos_attribute(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf, uint32 *pattr)
+static bool get_ea_dos_attribute(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf, uint32 *pattr)
{
ssize_t sizeret;
fstring attrstr;
@@ -256,11 +256,11 @@ static BOOL get_ea_dos_attribute(connection_struct *conn, const char *path,SMB_S
Set DOS attributes in an EA.
****************************************************************************/
-static BOOL set_ea_dos_attribute(connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf, uint32 dosmode)
+static bool set_ea_dos_attribute(connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf, uint32 dosmode)
{
fstring attrstr;
files_struct *fsp = NULL;
- BOOL ret = False;
+ bool ret = False;
if (!lp_store_dos_attributes(SNUM(conn))) {
return False;
@@ -587,7 +587,7 @@ int file_ntimes(connection_struct *conn, const char *fname, const struct timespe
Change a filetime - possibly allowing DOS semantics.
*******************************************************************/
-BOOL set_filetime(connection_struct *conn, const char *fname,
+bool set_filetime(connection_struct *conn, const char *fname,
const struct timespec mtime)
{
struct timespec ts[2];
diff --git a/source3/smbd/error.c b/source3/smbd/error.c
index 6cb63f0c49..12eff42023 100644
--- a/source3/smbd/error.c
+++ b/source3/smbd/error.c
@@ -52,7 +52,7 @@ int unix_error_packet(char *outbuf,int def_class,uint32 def_code, NTSTATUS def_s
return error_packet(outbuf,eclass,ecode,ntstatus,line,file);
}
-BOOL use_nt_status(void)
+bool use_nt_status(void)
{
return lp_nt_status_support() && (global_client_caps & CAP_STATUS32);
}
@@ -66,8 +66,8 @@ BOOL use_nt_status(void)
void error_packet_set(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file)
{
- BOOL force_nt_status = False;
- BOOL force_dos_status = False;
+ bool force_nt_status = False;
+ bool force_dos_status = False;
if (eclass == (uint8)-1) {
force_nt_status = True;
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 76b29ec998..14056ddc80 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -21,13 +21,13 @@
#include "includes.h"
-static BOOL setup_write_cache(files_struct *, SMB_OFF_T);
+static bool setup_write_cache(files_struct *, SMB_OFF_T);
/****************************************************************************
Read from write cache if we can.
****************************************************************************/
-static BOOL read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
+static bool read_from_write_cache(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
{
write_cache *wcp = fsp->wcp;
@@ -297,7 +297,7 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n",
*/
if (wcp->data_size) {
- BOOL cache_flush_needed = False;
+ bool cache_flush_needed = False;
if ((pos >= wcp->offset) && (pos <= wcp->offset + wcp->data_size)) {
@@ -739,7 +739,7 @@ void delete_write_cache(files_struct *fsp)
Setup the write cache structure.
****************************************************************************/
-static BOOL setup_write_cache(files_struct *fsp, SMB_OFF_T file_size)
+static bool setup_write_cache(files_struct *fsp, SMB_OFF_T file_size)
{
ssize_t alloc_size = lp_write_cache_size(SNUM(fsp->conn));
write_cache *wcp;
@@ -845,7 +845,7 @@ ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason)
sync a file
********************************************************************/
-NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, BOOL write_through)
+NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_through)
{
if (fsp->fh->fd == -1)
return NT_STATUS_INVALID_HANDLE;
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index fb8ed07ee8..dc733d4568 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -26,14 +26,14 @@
#include "includes.h"
-static BOOL scan_directory(connection_struct *conn, const char *path,
+static bool scan_directory(connection_struct *conn, const char *path,
char *name, char **found_name);
/****************************************************************************
Mangle the 2nd name and check if it is then equal to the first name.
****************************************************************************/
-static BOOL mangled_equal(const char *name1,
+static bool mangled_equal(const char *name1,
const char *name2,
const struct share_params *p)
{
@@ -50,7 +50,7 @@ static BOOL mangled_equal(const char *name1,
****************************************************************************/
static NTSTATUS determine_path_error(const char *name,
- BOOL allow_wcard_last_component)
+ bool allow_wcard_last_component)
{
const char *p;
@@ -110,7 +110,7 @@ for nlinks = 0, which can never be true for any file).
NTSTATUS unix_convert(TALLOC_CTX *ctx,
connection_struct *conn,
const char *orig_path,
- BOOL allow_wcard_last_component,
+ bool allow_wcard_last_component,
char **pp_conv_path,
char **pp_saved_last_component,
SMB_STRUCT_STAT *pst)
@@ -119,8 +119,8 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
char *start, *end;
char *dirpath = NULL;
char *name = NULL;
- BOOL component_was_mangled = False;
- BOOL name_has_wildcard = False;
+ bool component_was_mangled = False;
+ bool name_has_wildcard = False;
NTSTATUS result;
SET_STAT_INVALID(*pst);
@@ -702,8 +702,8 @@ NTSTATUS check_name(connection_struct *conn, const char *name)
This needs to be careful about whether we are case sensitive.
****************************************************************************/
-static BOOL fname_equal(const char *name1, const char *name2,
- BOOL case_sensitive)
+static bool fname_equal(const char *name1, const char *name2,
+ bool case_sensitive)
{
/* Normal filename handling */
if (case_sensitive) {
@@ -718,12 +718,12 @@ static BOOL fname_equal(const char *name1, const char *name2,
If the name looks like a mangled name then try via the mangling functions
****************************************************************************/
-static BOOL scan_directory(connection_struct *conn, const char *path,
+static bool scan_directory(connection_struct *conn, const char *path,
char *name, char **found_name)
{
struct smb_Dir *cur_dir;
const char *dname;
- BOOL mangled;
+ bool mangled;
char *unmangled_name = NULL;
long curpos;
TALLOC_CTX *ctx = talloc_tos();
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 0709acc756..0360417c56 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -84,7 +84,7 @@ static void copy_trans_params_and_data(char *outbuf, int align,
void send_trans_reply(struct smb_request *req,
char *rparam, int rparam_len,
char *rdata, int rdata_len,
- BOOL buffer_too_large)
+ bool buffer_too_large)
{
int this_ldata,this_lparam;
int tot_data_sent = 0;
@@ -190,7 +190,7 @@ void send_trans_reply(struct smb_request *req,
static void api_rpc_trans_reply(struct smb_request *req, smb_np_struct *p)
{
- BOOL is_data_outstanding;
+ bool is_data_outstanding;
char *rdata = (char *)SMB_MALLOC(p->max_trans_reply);
int data_len;
@@ -294,7 +294,7 @@ static void api_fd_reply(connection_struct *conn, uint16 vuid,
int suwcnt, int tdscnt, int tpscnt,
int mdrcnt, int mprcnt)
{
- BOOL reply = False;
+ bool reply = False;
smb_np_struct *p = NULL;
int pnum;
int subcommand;
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 87cbc9183e..440b928ef0 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -64,14 +64,14 @@ static char *smb_realloc_limit(void *ptr, size_t size)
return val;
}
-static BOOL api_Unsupported(connection_struct *conn, uint16 vuid,
+static bool api_Unsupported(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt, int mprcnt,
char **rdata, char **rparam,
int *rdata_len, int *rparam_len);
-static BOOL api_TooSmall(connection_struct *conn, uint16 vuid, char *param, char *data,
+static bool api_TooSmall(connection_struct *conn, uint16 vuid, char *param, char *data,
int mdrcnt, int mprcnt,
char **rdata, char **rparam,
int *rdata_len, int *rparam_len);
@@ -146,7 +146,7 @@ static char *Expand(connection_struct *conn, int snum, char *s)
Check a API string for validity when we only need to check the prefix.
******************************************************************/
-static BOOL prefix_ok(const char *str, const char *prefix)
+static bool prefix_ok(const char *str, const char *prefix)
{
return(strncmp(str,prefix,strlen(prefix)) == 0);
}
@@ -221,7 +221,7 @@ static int getlen(const char *p)
return n;
}
-static BOOL init_package(struct pack_desc *p, int count, int subcount)
+static bool init_package(struct pack_desc *p, int count, int subcount)
{
int n = p->buflen;
int i;
@@ -572,10 +572,10 @@ static void fill_printjob_info(connection_struct *conn, int snum, int uLevel,
Returns True if from tdb, False otherwise.
********************************************************************/
-static BOOL get_driver_name(int snum, pstring drivername)
+static bool get_driver_name(int snum, pstring drivername)
{
NT_PRINTER_INFO_LEVEL *info = NULL;
- BOOL in_tdb = False;
+ bool in_tdb = False;
get_a_printer (NULL, &info, 2, lp_servicename(snum));
if (info != NULL) {
@@ -787,7 +787,7 @@ static int get_printerdrivernumber(int snum)
return result;
}
-static BOOL api_DosPrintQGetInfo(connection_struct *conn, uint16 vuid,
+static bool api_DosPrintQGetInfo(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -915,7 +915,7 @@ static BOOL api_DosPrintQGetInfo(connection_struct *conn, uint16 vuid,
View list of all print jobs on all queues.
****************************************************************************/
-static BOOL api_DosPrintQEnum(connection_struct *conn, uint16 vuid,
+static bool api_DosPrintQEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt, int mprcnt,
@@ -1060,7 +1060,7 @@ static BOOL api_DosPrintQEnum(connection_struct *conn, uint16 vuid,
Get info level for a server list query.
****************************************************************************/
-static BOOL check_server_info(int uLevel, char* id)
+static bool check_server_info(int uLevel, char* id)
{
switch( uLevel ) {
case 0:
@@ -1084,7 +1084,7 @@ struct srv_info_struct {
uint32 type;
fstring comment;
fstring domain;
- BOOL server_added;
+ bool server_added;
};
/*******************************************************************
@@ -1099,7 +1099,7 @@ static int get_server_info(uint32 servertype,
int count=0;
int alloced=0;
char **lines;
- BOOL local_list_only;
+ bool local_list_only;
int i;
lines = file_lines_load(lock_path(SERVER_LIST), NULL, 0);
@@ -1121,7 +1121,7 @@ static int get_server_info(uint32 servertype,
fstring stype;
struct srv_info_struct *s;
const char *ptr = lines[i];
- BOOL ok = True;
+ bool ok = True;
if (!*ptr) {
continue;
@@ -1280,7 +1280,7 @@ static int fill_srv_info(struct srv_info_struct *service,
}
-static BOOL srv_comp(struct srv_info_struct *s1,struct srv_info_struct *s2)
+static bool srv_comp(struct srv_info_struct *s1,struct srv_info_struct *s2)
{
return(strcmp(s1->name,s2->name));
}
@@ -1290,7 +1290,7 @@ static BOOL srv_comp(struct srv_info_struct *s1,struct srv_info_struct *s2)
extracted from lists saved by nmbd on the local host.
****************************************************************************/
-static BOOL api_RNetServerEnum(connection_struct *conn, uint16 vuid,
+static bool api_RNetServerEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt, int mprcnt, char **rdata,
@@ -1309,8 +1309,8 @@ static BOOL api_RNetServerEnum(connection_struct *conn, uint16 vuid,
int counted=0,total=0;
int i,missed;
fstring domain;
- BOOL domain_request;
- BOOL local_request;
+ bool domain_request;
+ bool local_request;
if (!str1 || !str2 || !p) {
return False;
@@ -1445,7 +1445,7 @@ static BOOL api_RNetServerEnum(connection_struct *conn, uint16 vuid,
command 0x34 - suspected of being a "Lookup Names" stub api
****************************************************************************/
-static BOOL api_RNetGroupGetUsers(connection_struct *conn, uint16 vuid,
+static bool api_RNetGroupGetUsers(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt, int mprcnt, char **rdata,
@@ -1490,7 +1490,7 @@ static BOOL api_RNetGroupGetUsers(connection_struct *conn, uint16 vuid,
get info about a share
****************************************************************************/
-static BOOL check_share_info(int uLevel, char* id)
+static bool check_share_info(int uLevel, char* id)
{
switch( uLevel ) {
case 0:
@@ -1634,7 +1634,7 @@ static int fill_share_info(connection_struct *conn, int snum, int uLevel,
return len;
}
-static BOOL api_RNetShareGetInfo(connection_struct *conn,uint16 vuid,
+static bool api_RNetShareGetInfo(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -1697,7 +1697,7 @@ static BOOL api_RNetShareGetInfo(connection_struct *conn,uint16 vuid,
Share names longer than 12 bytes must be skipped.
****************************************************************************/
-static BOOL api_RNetShareEnum( connection_struct *conn, uint16 vuid,
+static bool api_RNetShareEnum( connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,
@@ -1715,7 +1715,7 @@ static BOOL api_RNetShareEnum( connection_struct *conn, uint16 vuid,
char *p2;
int count = 0;
int total=0,counted=0;
- BOOL missed = False;
+ bool missed = False;
int i;
int data_len, fixed_len, string_len;
int f_len = 0, s_len = 0;
@@ -1804,7 +1804,7 @@ static BOOL api_RNetShareEnum( connection_struct *conn, uint16 vuid,
Add a share
****************************************************************************/
-static BOOL api_RNetShareAdd(connection_struct *conn,uint16 vuid,
+static bool api_RNetShareAdd(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -1942,7 +1942,7 @@ static BOOL api_RNetShareAdd(connection_struct *conn,uint16 vuid,
view list of groups available
****************************************************************************/
-static BOOL api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
+static bool api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2048,7 +2048,7 @@ static BOOL api_RNetGroupEnum(connection_struct *conn,uint16 vuid,
Get groups that a user is a member of.
******************************************************************/
-static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid,
+static bool api_NetUserGetGroups(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2063,7 +2063,7 @@ static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid,
const char *level_string;
int count=0;
struct samu *sampw = NULL;
- BOOL ret = False;
+ bool ret = False;
DOM_SID *sids;
gid_t *gids;
size_t num_groups;
@@ -2188,7 +2188,7 @@ done:
Get all users.
******************************************************************/
-static BOOL api_RNetUserEnum(connection_struct *conn, uint16 vuid,
+static bool api_RNetUserEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2292,7 +2292,7 @@ static BOOL api_RNetUserEnum(connection_struct *conn, uint16 vuid,
Get the time of day info.
****************************************************************************/
-static BOOL api_NetRemoteTOD(connection_struct *conn,uint16 vuid,
+static bool api_NetRemoteTOD(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2350,7 +2350,7 @@ static BOOL api_NetRemoteTOD(connection_struct *conn,uint16 vuid,
Set the user password.
*****************************************************************************/
-static BOOL api_SetUserPassword(connection_struct *conn,uint16 vuid,
+static bool api_SetUserPassword(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2461,7 +2461,7 @@ static BOOL api_SetUserPassword(connection_struct *conn,uint16 vuid,
Set the user password (SamOEM version - gets plaintext).
****************************************************************************/
-static BOOL api_SamOEMChangePassword(connection_struct *conn,uint16 vuid,
+static bool api_SamOEMChangePassword(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2539,7 +2539,7 @@ static BOOL api_SamOEMChangePassword(connection_struct *conn,uint16 vuid,
Form: <W> <>
****************************************************************************/
-static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid,
+static bool api_RDosPrintJobDel(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2622,7 +2622,7 @@ static BOOL api_RDosPrintJobDel(connection_struct *conn,uint16 vuid,
Purge a print queue - or pause or resume it.
****************************************************************************/
-static BOOL api_WPrintQueueCtrl(connection_struct *conn,uint16 vuid,
+static bool api_WPrintQueueCtrl(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2714,7 +2714,7 @@ static int check_printjob_info(struct pack_desc* desc,
return True;
}
-static BOOL api_PrintJobInfo(connection_struct *conn, uint16 vuid,
+static bool api_PrintJobInfo(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2802,7 +2802,7 @@ static BOOL api_PrintJobInfo(connection_struct *conn, uint16 vuid,
Get info about the server.
****************************************************************************/
-static BOOL api_RNetServerGetInfo(connection_struct *conn,uint16 vuid,
+static bool api_RNetServerGetInfo(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -2943,7 +2943,7 @@ static BOOL api_RNetServerGetInfo(connection_struct *conn,uint16 vuid,
Get info about the server.
****************************************************************************/
-static BOOL api_NetWkstaGetInfo(connection_struct *conn,uint16 vuid,
+static bool api_NetWkstaGetInfo(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3211,7 +3211,7 @@ There is no auxiliary data in the response.
#define AF_OP_ACCOUNTS 3
-static BOOL api_RNetUserGetInfo(connection_struct *conn, uint16 vuid,
+static bool api_RNetUserGetInfo(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3431,7 +3431,7 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn, uint16 vuid,
return(True);
}
-static BOOL api_WWkstaUserLogon(connection_struct *conn,uint16 vuid,
+static bool api_WWkstaUserLogon(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3534,7 +3534,7 @@ static BOOL api_WWkstaUserLogon(connection_struct *conn,uint16 vuid,
api_WAccessGetUserPerms
****************************************************************************/
-static BOOL api_WAccessGetUserPerms(connection_struct *conn,uint16 vuid,
+static bool api_WAccessGetUserPerms(connection_struct *conn,uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3579,7 +3579,7 @@ static BOOL api_WAccessGetUserPerms(connection_struct *conn,uint16 vuid,
api_WPrintJobEnumerate
****************************************************************************/
-static BOOL api_WPrintJobGetInfo(connection_struct *conn, uint16 vuid,
+static bool api_WPrintJobGetInfo(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3678,7 +3678,7 @@ static BOOL api_WPrintJobGetInfo(connection_struct *conn, uint16 vuid,
return True;
}
-static BOOL api_WPrintJobEnumerate(connection_struct *conn, uint16 vuid,
+static bool api_WPrintJobEnumerate(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3835,7 +3835,7 @@ static void fill_printdest_info(connection_struct *conn, int snum, int uLevel,
}
}
-static BOOL api_WPrintDestGetInfo(connection_struct *conn, uint16 vuid,
+static bool api_WPrintDestGetInfo(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3915,7 +3915,7 @@ static BOOL api_WPrintDestGetInfo(connection_struct *conn, uint16 vuid,
return True;
}
-static BOOL api_WPrintDestEnum(connection_struct *conn, uint16 vuid,
+static bool api_WPrintDestEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -3996,7 +3996,7 @@ static BOOL api_WPrintDestEnum(connection_struct *conn, uint16 vuid,
return True;
}
-static BOOL api_WPrintDriverEnum(connection_struct *conn, uint16 vuid,
+static bool api_WPrintDriverEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -4059,7 +4059,7 @@ static BOOL api_WPrintDriverEnum(connection_struct *conn, uint16 vuid,
return True;
}
-static BOOL api_WPrintQProcEnum(connection_struct *conn, uint16 vuid,
+static bool api_WPrintQProcEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -4122,7 +4122,7 @@ static BOOL api_WPrintQProcEnum(connection_struct *conn, uint16 vuid,
return True;
}
-static BOOL api_WPrintPortEnum(connection_struct *conn, uint16 vuid,
+static bool api_WPrintPortEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -4191,7 +4191,7 @@ static BOOL api_WPrintPortEnum(connection_struct *conn, uint16 vuid,
List open sessions
****************************************************************************/
-static BOOL api_RNetSessionEnum(connection_struct *conn, uint16 vuid,
+static bool api_RNetSessionEnum(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt,int mprcnt,
@@ -4276,7 +4276,7 @@ static BOOL api_RNetSessionEnum(connection_struct *conn, uint16 vuid,
The buffer was too small.
****************************************************************************/
-static BOOL api_TooSmall(connection_struct *conn,uint16 vuid, char *param, char *data,
+static bool api_TooSmall(connection_struct *conn,uint16 vuid, char *param, char *data,
int mdrcnt, int mprcnt,
char **rdata, char **rparam,
int *rdata_len, int *rparam_len)
@@ -4300,7 +4300,7 @@ static BOOL api_TooSmall(connection_struct *conn,uint16 vuid, char *param, char
The request is not supported.
****************************************************************************/
-static BOOL api_Unsupported(connection_struct *conn, uint16 vuid,
+static bool api_Unsupported(connection_struct *conn, uint16 vuid,
char *param, int tpscnt,
char *data, int tdscnt,
int mdrcnt, int mprcnt,
@@ -4326,11 +4326,11 @@ static BOOL api_Unsupported(connection_struct *conn, uint16 vuid,
static const struct {
const char *name;
int id;
- BOOL (*fn)(connection_struct *, uint16,
+ bool (*fn)(connection_struct *, uint16,
char *, int,
char *, int,
int,int,char **,char **,int *,int *);
- BOOL auth_user; /* Deny anonymous access? */
+ bool auth_user; /* Deny anonymous access? */
} api_commands[] = {
{"RNetShareEnum", RAP_WshareEnum, api_RNetShareEnum, True},
{"RNetShareGetInfo", RAP_WshareGetInfo, api_RNetShareGetInfo},
@@ -4390,7 +4390,7 @@ void api_reply(connection_struct *conn, uint16 vuid,
const char *name2 = NULL;
int rdata_len = 0;
int rparam_len = 0;
- BOOL reply=False;
+ bool reply=False;
int i;
if (!params) {
diff --git a/source3/smbd/mangle.c b/source3/smbd/mangle.c
index 4c00f6d14a..360692c546 100644
--- a/source3/smbd/mangle.c
+++ b/source3/smbd/mangle.c
@@ -80,7 +80,7 @@ void mangle_change_to_posix(void)
/*
see if a filename has come out of our mangling code
*/
-BOOL mangle_is_mangled(const char *s, const struct share_params *p)
+bool mangle_is_mangled(const char *s, const struct share_params *p)
{
return mangle_fns->is_mangled(s, p);
}
@@ -88,19 +88,19 @@ BOOL mangle_is_mangled(const char *s, const struct share_params *p)
/*
see if a filename matches the rules of a 8.3 filename
*/
-BOOL mangle_is_8_3(const char *fname, BOOL check_case,
+bool mangle_is_8_3(const char *fname, bool check_case,
const struct share_params *p)
{
return mangle_fns->is_8_3(fname, check_case, False, p);
}
-BOOL mangle_is_8_3_wildcards(const char *fname, BOOL check_case,
+bool mangle_is_8_3_wildcards(const char *fname, bool check_case,
const struct share_params *p)
{
return mangle_fns->is_8_3(fname, check_case, True, p);
}
-BOOL mangle_must_mangle(const char *fname,
+bool mangle_must_mangle(const char *fname,
const struct share_params *p)
{
if (!lp_manglednames(p)) {
@@ -115,7 +115,7 @@ BOOL mangle_must_mangle(const char *fname,
looking for a matching name if it doesn't. It should succeed most of the time
or there will be a huge performance penalty
*/
-BOOL mangle_lookup_name_from_8_3(TALLOC_CTX *ctx,
+bool mangle_lookup_name_from_8_3(TALLOC_CTX *ctx,
const char *in,
char **out, /* talloced on the given context. */
const struct share_params *p)
@@ -130,9 +130,9 @@ BOOL mangle_lookup_name_from_8_3(TALLOC_CTX *ctx,
JRA.
*/
-BOOL name_to_8_3(const char *in,
+bool name_to_8_3(const char *in,
char out[13],
- BOOL cache83,
+ bool cache83,
const struct share_params *p)
{
memset(out,'\0',13);
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index d63a980cfb..44fbe8a9e8 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -58,7 +58,7 @@ static char basechars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_-!@#$%";
#define MANGLE_BASE (sizeof(basechars)/sizeof(char)-1)
static unsigned char chartest[256] = { 0 };
-static BOOL ct_initialized = False;
+static bool ct_initialized = False;
#define mangle(V) ((char)(basechars[(V) % MANGLE_BASE]))
#define BASECHAR_MASK 0xf0
@@ -68,7 +68,7 @@ static TDB_CONTEXT *tdb_mangled_cache;
/* -------------------------------------------------------------------- */
-static NTSTATUS has_valid_83_chars(const smb_ucs2_t *s, BOOL allow_wildcards)
+static NTSTATUS has_valid_83_chars(const smb_ucs2_t *s, bool allow_wildcards)
{
if (!*s) {
return NT_STATUS_INVALID_PARAMETER;
@@ -88,7 +88,7 @@ static NTSTATUS has_valid_83_chars(const smb_ucs2_t *s, BOOL allow_wildcards)
return NT_STATUS_OK;
}
-static NTSTATUS has_illegal_chars(const smb_ucs2_t *s, BOOL allow_wildcards)
+static NTSTATUS has_illegal_chars(const smb_ucs2_t *s, bool allow_wildcards)
{
if (!allow_wildcards && ms_has_wild_w(s)) {
return NT_STATUS_UNSUCCESSFUL;
@@ -117,7 +117,7 @@ static NTSTATUS has_illegal_chars(const smb_ucs2_t *s, BOOL allow_wildcards)
*/
static NTSTATUS mangle_get_prefix(const smb_ucs2_t *ucs2_string, smb_ucs2_t **prefix,
- smb_ucs2_t **extension, BOOL allow_wildcards)
+ smb_ucs2_t **extension, bool allow_wildcards)
{
size_t ext_len;
smb_ucs2_t *p;
@@ -155,7 +155,7 @@ static NTSTATUS mangle_get_prefix(const smb_ucs2_t *ucs2_string, smb_ucs2_t **pr
* ************************************************************************** **
*/
-static NTSTATUS is_valid_name(const smb_ucs2_t *fname, BOOL allow_wildcards, BOOL only_8_3)
+static NTSTATUS is_valid_name(const smb_ucs2_t *fname, bool allow_wildcards, bool only_8_3)
{
smb_ucs2_t *str, *p;
size_t num_ucs2_chars;
@@ -234,7 +234,7 @@ static NTSTATUS is_valid_name(const smb_ucs2_t *fname, BOOL allow_wildcards, BOO
return ret;
}
-static NTSTATUS is_8_3_w(const smb_ucs2_t *fname, BOOL allow_wildcards)
+static NTSTATUS is_8_3_w(const smb_ucs2_t *fname, bool allow_wildcards)
{
smb_ucs2_t *pref = 0, *ext = 0;
size_t plen;
@@ -275,7 +275,7 @@ done:
return ret;
}
-static BOOL is_8_3(const char *fname, BOOL check_case, BOOL allow_wildcards,
+static bool is_8_3(const char *fname, bool check_case, bool allow_wildcards,
const struct share_params *p)
{
const char *f;
@@ -361,7 +361,7 @@ static void init_chartest( void )
* ************************************************************************** **
*/
-static BOOL is_mangled(const char *s, const struct share_params *p)
+static bool is_mangled(const char *s, const struct share_params *p)
{
char *magic;
@@ -461,7 +461,7 @@ static void cache_mangled_name( const char mangled_name[13],
* ************************************************************************** **
*/
-static BOOL lookup_name_from_8_3(TALLOC_CTX *ctx,
+static bool lookup_name_from_8_3(TALLOC_CTX *ctx,
const char *in,
char **out, /* talloced on the given context. */
const struct share_params *p)
@@ -526,7 +526,7 @@ static BOOL lookup_name_from_8_3(TALLOC_CTX *ctx,
Do the actual mangling to 8.3 format.
*****************************************************************************/
-static BOOL to_8_3(const char *in, char out[13], int default_case)
+static bool to_8_3(const char *in, char out[13], int default_case)
{
int csum;
char *p;
@@ -545,7 +545,7 @@ static BOOL to_8_3(const char *in, char out[13], int default_case)
p = strrchr(s,'.');
if( p && (strlen(p+1) < (size_t)4) ) {
- BOOL all_normal = ( strisnormal(p+1, default_case) ); /* XXXXXXXXX */
+ bool all_normal = ( strisnormal(p+1, default_case) ); /* XXXXXXXXX */
if( all_normal && p[1] != 0 ) {
*p = 0;
@@ -599,7 +599,7 @@ static BOOL to_8_3(const char *in, char out[13], int default_case)
return True;
}
-static BOOL must_mangle(const char *name,
+static bool must_mangle(const char *name,
const struct share_params *p)
{
smb_ucs2_t *name_ucs2 = NULL;
@@ -630,9 +630,9 @@ static BOOL must_mangle(const char *name,
* ****************************************************************************
*/
-static BOOL hash_name_to_8_3(const char *in,
+static bool hash_name_to_8_3(const char *in,
char out[13],
- BOOL cache83,
+ bool cache83,
int default_case,
const struct share_params *p)
{
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index 73f81fe9ae..7066c2a4e5 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -150,7 +150,7 @@ static unsigned int mangle_hash(const char *key, unsigned int length)
/*
initialise (ie. allocate) the prefix cache
*/
-static BOOL cache_init(void)
+static bool cache_init(void)
{
if (prefix_cache) {
return True;
@@ -208,7 +208,7 @@ static const char *cache_lookup(unsigned int hash)
In this algorithm, mangled names use only pure ascii characters (no
multi-byte) so we can avoid doing a UCS2 conversion
*/
-static BOOL is_mangled_component(const char *name, size_t len)
+static bool is_mangled_component(const char *name, size_t len)
{
unsigned int i;
@@ -268,7 +268,7 @@ static BOOL is_mangled_component(const char *name, size_t len)
directory separators. It should return true if any component is
mangled
*/
-static BOOL is_mangled(const char *name, const struct share_params *parm)
+static bool is_mangled(const char *name, const struct share_params *parm)
{
const char *p;
const char *s;
@@ -293,7 +293,7 @@ static BOOL is_mangled(const char *name, const struct share_params *parm)
simplifies things greatly (it means that we know the string won't
get larger when converted from UNIX to DOS formats)
*/
-static BOOL is_8_3(const char *name, BOOL check_case, BOOL allow_wildcards, const struct share_params *p)
+static bool is_8_3(const char *name, bool check_case, bool allow_wildcards, const struct share_params *p)
{
int len, i;
char *dot_p;
@@ -370,7 +370,7 @@ static void mangle_reset(void)
try to find a 8.3 name in the cache, and if found then
replace the string with the original long name.
*/
-static BOOL lookup_name_from_8_3(TALLOC_CTX *ctx,
+static bool lookup_name_from_8_3(TALLOC_CTX *ctx,
const char *name,
char **pp_out, /* talloced on the given context. */
const struct share_params *p)
@@ -432,7 +432,7 @@ static BOOL lookup_name_from_8_3(TALLOC_CTX *ctx,
/*
look for a DOS reserved name
*/
-static BOOL is_reserved_name(const char *name)
+static bool is_reserved_name(const char *name)
{
if (FLAG_CHECK(name[0], FLAG_POSSIBLE1) &&
FLAG_CHECK(name[1], FLAG_POSSIBLE2) &&
@@ -459,10 +459,10 @@ static BOOL is_reserved_name(const char *name)
A filename ending in ' ' is not legal either. See bug id #2769.
*/
-static BOOL is_legal_name(const char *name)
+static bool is_legal_name(const char *name)
{
const char *dot_pos = NULL;
- BOOL alldots = True;
+ bool alldots = True;
size_t numdots = 0;
while (*name) {
@@ -510,7 +510,7 @@ static BOOL is_legal_name(const char *name)
return True;
}
-static BOOL must_mangle(const char *name,
+static bool must_mangle(const char *name,
const struct share_params *p)
{
if (is_reserved_name(name)) {
@@ -526,9 +526,9 @@ static BOOL must_mangle(const char *name,
if cache83 is not set then we don't cache the result
*/
-static BOOL hash2_name_to_8_3(const char *name,
+static bool hash2_name_to_8_3(const char *name,
char new_name[13],
- BOOL cache83,
+ bool cache83,
int default_case,
const struct share_params *p)
{
@@ -738,25 +738,25 @@ struct mangle_fns *mangle_hash2_init(void)
static void posix_mangle_reset(void)
{;}
-static BOOL posix_is_mangled(const char *s, const struct share_params *p)
+static bool posix_is_mangled(const char *s, const struct share_params *p)
{
return False;
}
-static BOOL posix_must_mangle(const char *s, const struct share_params *p)
+static bool posix_must_mangle(const char *s, const struct share_params *p)
{
return False;
}
-static BOOL posix_is_8_3(const char *fname,
- BOOL check_case,
- BOOL allow_wildcards,
+static bool posix_is_8_3(const char *fname,
+ bool check_case,
+ bool allow_wildcards,
const struct share_params *p)
{
return False;
}
-static BOOL posix_lookup_name_from_8_3(TALLOC_CTX *ctx,
+static bool posix_lookup_name_from_8_3(TALLOC_CTX *ctx,
const char *in,
char **out, /* talloced on the given context. */
const struct share_params *p)
@@ -764,9 +764,9 @@ static BOOL posix_lookup_name_from_8_3(TALLOC_CTX *ctx,
return False;
}
-static BOOL posix_name_to_8_3(const char *in,
+static bool posix_name_to_8_3(const char *in,
char out[13],
- BOOL cache83,
+ bool cache83,
int default_case,
const struct share_params *p)
{
diff --git a/source3/smbd/map_username.c b/source3/smbd/map_username.c
index 38881b3b2d..d9ad81a3e1 100644
--- a/source3/smbd/map_username.c
+++ b/source3/smbd/map_username.c
@@ -32,15 +32,15 @@
Returns True if username was changed, false otherwise.
********************************************************************/
-BOOL map_username(fstring user)
+bool map_username(fstring user)
{
- static BOOL initialised=False;
+ static bool initialised=False;
static fstring last_from,last_to;
XFILE *f;
char *mapfile = lp_username_map();
char *s;
pstring buf;
- BOOL mapped_user = False;
+ bool mapped_user = False;
char *cmd = lp_username_map_script();
if (!*user)
@@ -113,7 +113,7 @@ BOOL map_username(fstring user)
char *unixname = s;
char *dosname = strchr_m(unixname,'=');
char **dosuserlist;
- BOOL return_if_mapped = False;
+ bool return_if_mapped = False;
if (!dosname)
continue;
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index ff55904b81..cca1e0a428 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -43,9 +43,9 @@ extern uint32 global_client_caps;
**********************************************************************/
static NTSTATUS parse_dfs_path(const char *pathname,
- BOOL allow_wcards,
+ bool allow_wcards,
struct dfs_path *pdp, /* MUST BE TALLOCED */
- BOOL *ppath_contains_wcard)
+ bool *ppath_contains_wcard)
{
char *pathname_local;
char *p,*temp;
@@ -268,7 +268,7 @@ static NTSTATUS create_conn_struct(connection_struct *conn,
server we're referring to understands posix paths.
**********************************************************************/
-static BOOL parse_msdfs_symlink(TALLOC_CTX *ctx,
+static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
const char *target,
struct referral **preflist,
int *refcount)
@@ -349,7 +349,7 @@ static BOOL parse_msdfs_symlink(TALLOC_CTX *ctx,
returns the target string from inside the link.
**********************************************************************/
-static BOOL is_msdfs_link_internal(TALLOC_CTX *ctx,
+static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
connection_struct *conn,
const char *path,
char **pp_link_target,
@@ -418,7 +418,7 @@ static BOOL is_msdfs_link_internal(TALLOC_CTX *ctx,
Returns true if the unix path is a valid msdfs symlink.
**********************************************************************/
-BOOL is_msdfs_link(connection_struct *conn,
+bool is_msdfs_link(connection_struct *conn,
const char *path,
SMB_STRUCT_STAT *sbufp)
{
@@ -449,7 +449,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
const char *dfspath, /* Incoming complete dfs path */
const struct dfs_path *pdp, /* Parsed out
server+share+extrapath. */
- BOOL search_flag, /* Called from a findfirst ? */
+ bool search_flag, /* Called from a findfirst ? */
int *consumedcntp,
char **pp_targetpath)
{
@@ -587,9 +587,9 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
connection_struct *conn,
const char *path_in,
- BOOL search_wcard_flag,
+ bool search_wcard_flag,
char **pp_path_out,
- BOOL *ppath_contains_wcard)
+ bool *ppath_contains_wcard)
{
NTSTATUS status;
struct dfs_path *pdp = TALLOC_P(ctx, struct dfs_path);
@@ -687,7 +687,7 @@ static NTSTATUS self_ref(TALLOC_CTX *ctx,
const char *dfs_path,
struct junction_map *jucn,
int *consumedcntp,
- BOOL *self_referralp)
+ bool *self_referralp)
{
struct referral *ref;
@@ -718,14 +718,14 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
const char *dfs_path,
struct junction_map *jucn,
int *consumedcntp,
- BOOL *self_referralp)
+ bool *self_referralp)
{
struct connection_struct conns;
struct connection_struct *conn = &conns;
char *targetpath = NULL;
int snum;
NTSTATUS status = NT_STATUS_NOT_FOUND;
- BOOL dummy;
+ bool dummy;
struct dfs_path *pdp = TALLOC_P(ctx, struct dfs_path);
if (!pdp) {
@@ -884,7 +884,7 @@ static int setup_ver2_dfs_referral(const char *pathname,
char **ppdata,
struct junction_map *junction,
int consumedcnt,
- BOOL self_referral)
+ bool self_referral)
{
char* pdata = *ppdata;
@@ -993,7 +993,7 @@ static int setup_ver3_dfs_referral(const char *pathname,
char **ppdata,
struct junction_map *junction,
int consumedcnt,
- BOOL self_referral)
+ bool self_referral)
{
char *pdata = *ppdata;
@@ -1095,7 +1095,7 @@ int setup_dfs_referral(connection_struct *orig_conn,
{
struct junction_map *junction = NULL;
int consumedcnt = 0;
- BOOL self_referral = False;
+ bool self_referral = False;
int reply_size = 0;
char *pathnamep = NULL;
char *local_dfs_path = NULL;
@@ -1209,12 +1209,12 @@ int setup_dfs_referral(connection_struct *orig_conn,
Creates a junction structure from a DFS pathname
**********************************************************************/
-BOOL create_junction(TALLOC_CTX *ctx,
+bool create_junction(TALLOC_CTX *ctx,
const char *dfs_path,
struct junction_map *jucn)
{
int snum;
- BOOL dummy;
+ bool dummy;
struct dfs_path *pdp = TALLOC_P(ctx,struct dfs_path);
NTSTATUS status;
@@ -1260,7 +1260,7 @@ BOOL create_junction(TALLOC_CTX *ctx,
Forms a valid Unix pathname from the junction
**********************************************************************/
-static BOOL junction_to_local_path(const struct junction_map *jucn,
+static bool junction_to_local_path(const struct junction_map *jucn,
char **pp_path_out,
connection_struct *conn_out)
{
@@ -1285,16 +1285,16 @@ static BOOL junction_to_local_path(const struct junction_map *jucn,
return True;
}
-BOOL create_msdfs_link(const struct junction_map *jucn,
- BOOL exists)
+bool create_msdfs_link(const struct junction_map *jucn,
+ bool exists)
{
char *path = NULL;
char *msdfs_link = NULL;
connection_struct conns;
connection_struct *conn = &conns;
int i=0;
- BOOL insert_comma = False;
- BOOL ret = False;
+ bool insert_comma = False;
+ bool ret = False;
ZERO_STRUCT(conns);
@@ -1360,12 +1360,12 @@ out:
return ret;
}
-BOOL remove_msdfs_link(const struct junction_map *jucn)
+bool remove_msdfs_link(const struct junction_map *jucn)
{
char *path = NULL;
connection_struct conns;
connection_struct *conn = &conns;
- BOOL ret = False;
+ bool ret = False;
ZERO_STRUCT(conns);
@@ -1604,12 +1604,12 @@ struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn)
NTSTATUS resolve_dfspath(TALLOC_CTX *ctx,
connection_struct *conn,
- BOOL dfs_pathnames,
+ bool dfs_pathnames,
const char *name_in,
char **pp_name_out)
{
NTSTATUS status = NT_STATUS_OK;
- BOOL dummy;
+ bool dummy;
if (dfs_pathnames) {
status = dfs_redirect(ctx,
conn,
@@ -1630,17 +1630,17 @@ NTSTATUS resolve_dfspath(TALLOC_CTX *ctx,
/******************************************************************************
Core function to resolve a dfs pathname possibly containing a wildcard.
- This function is identical to the above except for the BOOL param to
+ This function is identical to the above except for the bool param to
dfs_redirect but I need this to be separate so it's really clear when
we're allowing wildcards and when we're not. JRA.
******************************************************************************/
NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
connection_struct *conn,
- BOOL dfs_pathnames,
+ bool dfs_pathnames,
const char *name_in,
char **pp_name_out,
- BOOL *ppath_contains_wcard)
+ bool *ppath_contains_wcard)
{
NTSTATUS status = NT_STATUS_OK;
if (dfs_pathnames) {
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 98109a2149..02f752fd67 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -24,8 +24,8 @@ extern fstring remote_proto;
extern enum protocol_types Protocol;
extern int max_recv;
-BOOL global_encrypted_passwords_negotiated = False;
-BOOL global_spnego_negotiated = False;
+bool global_encrypted_passwords_negotiated = False;
+bool global_spnego_negotiated = False;
struct auth_context *negprot_global_auth_context = NULL;
static void get_challenge(uint8 buff[8])
@@ -252,7 +252,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
int secword=0;
char *p, *q;
- BOOL negotiate_spnego = False;
+ bool negotiate_spnego = False;
time_t t = time(NULL);
ssize_t ret;
@@ -517,7 +517,7 @@ void reply_negprot(connection_struct *conn, struct smb_request *req)
char **cliprotos;
int i;
- static BOOL done_negprot = False;
+ static bool done_negprot = False;
START_PROFILE(SMBnegprot);
diff --git a/source3/smbd/noquotas.c b/source3/smbd/noquotas.c
index 0c23bb6f06..c8ff8edf62 100644
--- a/source3/smbd/noquotas.c
+++ b/source3/smbd/noquotas.c
@@ -23,7 +23,7 @@
* Needed for auto generation of proto.h.
*/
-BOOL disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
{
(*bsize) = 512; /* This value should be ignored */
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index b8c5085b41..ecb7d9dce8 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -46,7 +46,7 @@ struct notify_mid_map {
uint16 mid;
};
-static BOOL notify_change_record_identical(struct notify_change *c1,
+static bool notify_change_record_identical(struct notify_change *c1,
struct notify_change *c2)
{
/* Note this is deliberately case sensitive. */
@@ -57,7 +57,7 @@ static BOOL notify_change_record_identical(struct notify_change *c1,
return False;
}
-static BOOL notify_marshall_changes(int num_changes,
+static bool notify_marshall_changes(int num_changes,
uint32 max_offset,
struct notify_change *changes,
prs_struct *ps)
@@ -210,7 +210,7 @@ static void notify_callback(void *private_data, const struct notify_event *e)
}
NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
- BOOL recursive)
+ bool recursive)
{
char *fullpath;
struct notify_entry e;
@@ -243,7 +243,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
}
NTSTATUS change_notify_add_request(const uint8 *inbuf, uint32 max_param,
- uint32 filter, BOOL recursive,
+ uint32 filter, bool recursive,
struct files_struct *fsp)
{
struct notify_change_request *request = NULL;
diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c
index f332e4b3d2..73cee440d4 100644
--- a/source3/smbd/notify_inotify.c
+++ b/source3/smbd/notify_inotify.c
@@ -95,7 +95,7 @@ static int inotify_destructor(struct inotify_private *in)
see if a particular event from inotify really does match a requested
notify event in SMB
*/
-static BOOL filter_match(struct inotify_watch_context *w,
+static bool filter_match(struct inotify_watch_context *w,
struct inotify_event *e)
{
DEBUG(10, ("filter_match: e->mask=%x, w->mask=%x, w->filter=%x\n",
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c
index 4fbf0384a4..96ca2bc656 100644
--- a/source3/smbd/ntquotas.c
+++ b/source3/smbd/ntquotas.c
@@ -140,7 +140,7 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
return ret;
}
-static BOOL allready_in_quota_list(SMB_NTQUOTA_LIST *qt_list, uid_t uid)
+static bool allready_in_quota_list(SMB_NTQUOTA_LIST *qt_list, uid_t uid)
{
SMB_NTQUOTA_LIST *tmp_list = NULL;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index e69fd86995..bbbde06619 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -271,7 +271,7 @@ void send_nt_replies(struct smb_request *req, NTSTATUS nt_error,
Is it an NTFS stream name ?
****************************************************************************/
-BOOL is_ntfs_stream_name(const char *fname)
+bool is_ntfs_stream_name(const char *fname)
{
if (lp_posix_pathnames()) {
return False;
@@ -281,9 +281,9 @@ BOOL is_ntfs_stream_name(const char *fname)
struct case_semantics_state {
connection_struct *conn;
- BOOL case_sensitive;
- BOOL case_preserve;
- BOOL short_case_preserve;
+ bool case_sensitive;
+ bool case_preserve;
+ bool short_case_preserve;
};
/****************************************************************************
@@ -516,7 +516,7 @@ void reply_ntcreate_and_X(connection_struct *conn,
struct timespec c_timespec;
struct timespec a_timespec;
struct timespec m_timespec;
- BOOL extended_oplock_granted = False;
+ bool extended_oplock_granted = False;
NTSTATUS status;
struct case_semantics_state *case_state = NULL;
TALLOC_CTX *ctx = talloc_tos();
@@ -1271,7 +1271,7 @@ static void call_nt_transact_create(connection_struct *conn,
int info = 0;
files_struct *fsp = NULL;
char *p = NULL;
- BOOL extended_oplock_granted = False;
+ bool extended_oplock_granted = False;
uint32 flags;
uint32 access_mask;
uint32 file_attributes;
@@ -1994,8 +1994,8 @@ void reply_ntrename(connection_struct *conn, struct smb_request *req)
char *newname = NULL;
char *p;
NTSTATUS status;
- BOOL src_has_wcard = False;
- BOOL dest_has_wcard = False;
+ bool src_has_wcard = False;
+ bool dest_has_wcard = False;
uint32 attrs;
uint16 rename_type;
TALLOC_CTX *ctx = talloc_tos();
@@ -2149,7 +2149,7 @@ static void call_nt_transact_notify_change(connection_struct *conn,
files_struct *fsp;
uint32 filter;
NTSTATUS status;
- BOOL recursive;
+ bool recursive;
if(setup_count < 6) {
reply_doserror(req, ERRDOS, ERRbadfunc);
@@ -2245,8 +2245,8 @@ static void call_nt_transact_rename(connection_struct *conn,
char *params = *ppparams;
char *new_name = NULL;
files_struct *fsp = NULL;
- BOOL replace_if_exists = False;
- BOOL dest_has_wcard = False;
+ bool replace_if_exists = False;
+ bool dest_has_wcard = False;
NTSTATUS status;
TALLOC_CTX *ctx = talloc_tos();
@@ -2514,7 +2514,7 @@ static void call_nt_transact_ioctl(connection_struct *conn,
files_struct *fsp;
uint8 isFSctl;
uint8 compfilter;
- static BOOL logged_message;
+ static bool logged_message;
char *pdata = *ppdata;
if (setup_count != 8) {
@@ -2606,7 +2606,7 @@ static void call_nt_transact_ioctl(connection_struct *conn,
*/
SHADOW_COPY_DATA *shadow_data = NULL;
TALLOC_CTX *shadow_mem_ctx = NULL;
- BOOL labels = False;
+ bool labels = False;
uint32 labels_data_count = 0;
uint32 i;
char *cur_pdata;
@@ -2810,7 +2810,7 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
uint16 level = 0;
size_t sid_len;
DOM_SID sid;
- BOOL start_enum = True;
+ bool start_enum = True;
SMB_NTQUOTA_STRUCT qt;
SMB_NTQUOTA_LIST *tmp_list;
SMB_NTQUOTA_HANDLE *qt_handle = NULL;
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index fbc6f9ab64..4ed3a70411 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -24,10 +24,10 @@
extern const struct generic_mapping file_generic_mapping;
extern struct current_user current_user;
extern userdom_struct current_user_info;
-extern BOOL global_client_failed_oplock_break;
+extern bool global_client_failed_oplock_break;
struct deferred_open_record {
- BOOL delayed_for_oplocks;
+ bool delayed_for_oplocks;
struct file_id id;
};
@@ -226,7 +226,7 @@ static NTSTATUS open_file(files_struct *fsp,
NTSTATUS status = NT_STATUS_OK;
int accmode = (flags & O_ACCMODE);
int local_flags = flags;
- BOOL file_existed = VALID_STAT(*psbuf);
+ bool file_existed = VALID_STAT(*psbuf);
fsp->fh->fd = -1;
errno = EPERM;
@@ -409,7 +409,7 @@ static NTSTATUS open_file(files_struct *fsp,
Return True if the filename is one of the special executable types.
********************************************************************/
-static BOOL is_executable(const char *fname)
+static bool is_executable(const char *fname)
{
if ((fname = strrchr_m(fname,'.'))) {
if (strequal(fname,".com") ||
@@ -427,7 +427,7 @@ static BOOL is_executable(const char *fname)
Returns True if conflict, False if not.
****************************************************************************/
-static BOOL share_conflict(struct share_mode_entry *entry,
+static bool share_conflict(struct share_mode_entry *entry,
uint32 access_mask,
uint32 share_access)
{
@@ -571,7 +571,7 @@ static void validate_my_share_entries(int num,
}
#endif
-static BOOL is_stat_open(uint32 access_mask)
+static bool is_stat_open(uint32 access_mask)
{
return (access_mask &&
((access_mask & ~(SYNCHRONIZE_ACCESS| FILE_READ_ATTRIBUTES|
@@ -592,7 +592,7 @@ static NTSTATUS open_mode_check(connection_struct *conn,
uint32 access_mask,
uint32 share_access,
uint32 create_options,
- BOOL *file_existed)
+ bool *file_existed)
{
int i;
@@ -646,7 +646,7 @@ static NTSTATUS open_mode_check(connection_struct *conn,
return NT_STATUS_OK;
}
-static BOOL is_delete_request(files_struct *fsp) {
+static bool is_delete_request(files_struct *fsp) {
return ((fsp->access_mask == DELETE_ACCESS) &&
(fsp->oplock_type == NO_OPLOCK));
}
@@ -661,7 +661,7 @@ static BOOL is_delete_request(files_struct *fsp) {
* 3) Only level2 around: Grant level2 and do nothing else.
*/
-static BOOL delay_for_oplocks(struct share_mode_lock *lck,
+static bool delay_for_oplocks(struct share_mode_lock *lck,
files_struct *fsp,
uint16 mid,
int pass_number,
@@ -669,9 +669,9 @@ static BOOL delay_for_oplocks(struct share_mode_lock *lck,
{
int i;
struct share_mode_entry *exclusive = NULL;
- BOOL valid_entry = False;
- BOOL delay_it = False;
- BOOL have_level2 = False;
+ bool valid_entry = False;
+ bool delay_it = False;
+ bool have_level2 = False;
NTSTATUS status;
char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE];
@@ -772,7 +772,7 @@ static BOOL delay_for_oplocks(struct share_mode_lock *lck,
return True;
}
-static BOOL request_timed_out(struct timeval request_time,
+static bool request_timed_out(struct timeval request_time,
struct timeval timeout)
{
struct timeval now, end_time;
@@ -838,7 +838,7 @@ static void defer_open(struct share_mode_lock *lck,
On overwrite open ensure that the attributes match.
****************************************************************************/
-static BOOL open_match_attributes(connection_struct *conn,
+static bool open_match_attributes(connection_struct *conn,
const char *path,
uint32 old_dos_attr,
uint32 new_dos_attr,
@@ -950,7 +950,7 @@ static files_struct *fcb_or_dos_open(connection_struct *conn,
Open a file with a share mode - old openX method - map into NTCreate.
****************************************************************************/
-BOOL map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func,
+bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func,
uint32 *paccess_mask,
uint32 *pshare_mode,
uint32 *pcreate_disposition,
@@ -1142,10 +1142,10 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
{
int flags=0;
int flags2=0;
- BOOL file_existed = VALID_STAT(*psbuf);
- BOOL def_acl = False;
- BOOL posix_open = False;
- BOOL new_file_created = False;
+ bool file_existed = VALID_STAT(*psbuf);
+ bool def_acl = False;
+ bool posix_open = False;
+ bool new_file_created = False;
struct file_id id;
NTSTATUS fsp_open = NT_STATUS_ACCESS_DENIED;
files_struct *fsp = NULL;
@@ -1504,7 +1504,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (!NT_STATUS_IS_OK(status)) {
uint32 can_access_mask;
- BOOL can_access = True;
+ bool can_access = True;
SMB_ASSERT(NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION));
@@ -2084,7 +2084,7 @@ NTSTATUS open_directory(connection_struct *conn,
files_struct **result)
{
files_struct *fsp = NULL;
- BOOL dir_existed = VALID_STAT(*psbuf) ? True : False;
+ bool dir_existed = VALID_STAT(*psbuf) ? True : False;
struct share_mode_lock *lck = NULL;
NTSTATUS status;
int info = 0;
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 9ac9d76284..a84a9dbcb9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -25,7 +25,7 @@
/* Current number of oplocks we have outstanding. */
static int32 exclusive_oplocks_open = 0;
static int32 level_II_oplocks_open = 0;
-BOOL global_client_failed_oplock_break = False;
+bool global_client_failed_oplock_break = False;
extern uint32 global_client_caps;
extern int smb_read_error;
@@ -45,7 +45,7 @@ int32 get_number_of_exclusive_open_oplocks(void)
Return True if an oplock message is pending.
****************************************************************************/
-BOOL oplock_message_waiting(fd_set *fds)
+bool oplock_message_waiting(fd_set *fds)
{
if (koplocks && koplocks->msg_waiting(fds)) {
return True;
@@ -103,7 +103,7 @@ void process_kernel_oplocks(struct messaging_context *msg_ctx, fd_set *pfds)
disabled (just sets flags). Returns True if oplock set.
****************************************************************************/
-BOOL set_file_oplock(files_struct *fsp, int oplock_type)
+bool set_file_oplock(files_struct *fsp, int oplock_type)
{
if (koplocks && !koplocks->set_oplock(fsp, oplock_type)) {
return False;
@@ -176,9 +176,9 @@ static void downgrade_file_oplock(files_struct *fsp)
to none even if a "break-to-level II" was sent.
****************************************************************************/
-BOOL remove_oplock(files_struct *fsp)
+bool remove_oplock(files_struct *fsp)
{
- BOOL ret;
+ bool ret;
struct share_mode_lock *lck;
/* Remove the oplock flag from the sharemode. */
@@ -202,9 +202,9 @@ BOOL remove_oplock(files_struct *fsp)
/*
* Deal with a reply when a break-to-level II was sent.
*/
-BOOL downgrade_oplock(files_struct *fsp)
+bool downgrade_oplock(files_struct *fsp)
{
- BOOL ret;
+ bool ret;
struct share_mode_lock *lck;
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
@@ -389,7 +389,7 @@ static void process_oplock_async_level2_break_message(struct messaging_context *
struct share_mode_entry msg;
files_struct *fsp;
char *break_msg;
- BOOL sign_state;
+ bool sign_state;
if (data->data == NULL) {
DEBUG(0, ("Got NULL buffer\n"));
@@ -476,8 +476,8 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
struct share_mode_entry msg;
files_struct *fsp;
char *break_msg;
- BOOL break_to_level2 = False;
- BOOL sign_state;
+ bool break_to_level2 = False;
+ bool sign_state;
if (data->data == NULL) {
DEBUG(0, ("Got NULL buffer\n"));
@@ -588,7 +588,7 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx,
unsigned long file_id;
files_struct *fsp;
char *break_msg;
- BOOL sign_state;
+ bool sign_state;
if (data->data == NULL) {
DEBUG(0, ("Got NULL buffer\n"));
@@ -862,7 +862,7 @@ void message_to_share_mode_entry(struct share_mode_entry *e, char *msg)
Setup oplocks for this process.
****************************************************************************/
-BOOL init_oplocks(struct messaging_context *msg_ctx)
+bool init_oplocks(struct messaging_context *msg_ctx)
{
DEBUG(3,("init_oplocks: initializing messages.\n"));
diff --git a/source3/smbd/oplock_irix.c b/source3/smbd/oplock_irix.c
index 9f81a960f5..8dd4e27973 100644
--- a/source3/smbd/oplock_irix.c
+++ b/source3/smbd/oplock_irix.c
@@ -29,7 +29,7 @@ static int oplock_pipe_read = -1;
Test to see if IRIX kernel oplocks work.
****************************************************************************/
-static BOOL irix_oplocks_available(void)
+static bool irix_oplocks_available(void)
{
int fd;
int pfd[2];
@@ -175,7 +175,7 @@ static files_struct *irix_oplock_receive_message(fd_set *fds)
Attempt to set an kernel oplock on a file.
****************************************************************************/
-static BOOL irix_set_kernel_oplock(files_struct *fsp, int oplock_type)
+static bool irix_set_kernel_oplock(files_struct *fsp, int oplock_type)
{
if (sys_fcntl_long(fsp->fh->fd, F_OPLKREG, oplock_pipe_write) == -1) {
if(errno != EAGAIN) {
@@ -244,7 +244,7 @@ static void irix_release_kernel_oplock(files_struct *fsp)
Note that fds MAY BE NULL ! If so we must do our own select.
****************************************************************************/
-static BOOL irix_oplock_msg_waiting(fd_set *fds)
+static bool irix_oplock_msg_waiting(fd_set *fds)
{
int selrtn;
fd_set myfds;
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index b07c2644a9..086f105b89 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -162,7 +162,7 @@ static files_struct *linux_oplock_receive_message(fd_set *fds)
Attempt to set an kernel oplock on a file.
****************************************************************************/
-static BOOL linux_set_kernel_oplock(files_struct *fsp, int oplock_type)
+static bool linux_set_kernel_oplock(files_struct *fsp, int oplock_type)
{
if ( SMB_VFS_LINUX_SETLEASE(fsp,fsp->fh->fd, F_WRLCK) == -1) {
DEBUG(3,("linux_set_kernel_oplock: Refused oplock on file %s, "
@@ -218,7 +218,7 @@ static void linux_release_kernel_oplock(files_struct *fsp)
See if a oplock message is waiting.
****************************************************************************/
-static BOOL linux_oplock_msg_waiting(fd_set *fds)
+static bool linux_oplock_msg_waiting(fd_set *fds)
{
return signals_received != 0;
}
@@ -227,7 +227,7 @@ static BOOL linux_oplock_msg_waiting(fd_set *fds)
See if the kernel supports oplocks.
****************************************************************************/
-static BOOL linux_oplocks_available(void)
+static bool linux_oplocks_available(void)
{
int fd, ret;
fd = open("/dev/null", O_RDONLY);
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index a1590f2a58..995abbf663 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -81,7 +81,7 @@ user_struct *get_valid_user_struct(uint16 vuid)
SERVER_ALLOCATED_REQUIRED_YES);
}
-BOOL is_partial_auth_vuid(uint16 vuid)
+bool is_partial_auth_vuid(uint16 vuid)
{
if (vuid == UID_FIELD_INVALID) {
return False;
@@ -453,7 +453,7 @@ const char *get_session_workgroup(void)
try lower case.
****************************************************************************/
-BOOL user_in_netgroup(const char *user, const char *ngname)
+bool user_in_netgroup(const char *user, const char *ngname)
{
#ifdef HAVE_NETGROUP
static char *mydomain = NULL;
@@ -500,7 +500,7 @@ BOOL user_in_netgroup(const char *user, const char *ngname)
and netgroup lists.
****************************************************************************/
-BOOL user_in_list(const char *user,const char **list)
+bool user_in_list(const char *user,const char **list)
{
if (!list || !*list)
return False;
@@ -581,10 +581,10 @@ BOOL user_in_list(const char *user,const char **list)
Check if a username is valid.
****************************************************************************/
-static BOOL user_ok(const char *user, int snum)
+static bool user_ok(const char *user, int snum)
{
char **valid, **invalid;
- BOOL ret;
+ bool ret;
valid = invalid = NULL;
ret = True;
@@ -730,10 +730,10 @@ static char *validate_group(char *group, DATA_BLOB password,int snum)
Note this is *NOT* used when logging on using sessionsetup_and_X.
****************************************************************************/
-BOOL authorise_login(int snum, fstring user, DATA_BLOB password,
- BOOL *guest)
+bool authorise_login(int snum, fstring user, DATA_BLOB password,
+ bool *guest)
{
- BOOL ok = False;
+ bool ok = False;
#ifdef DEBUG_PASSWORD
DEBUG(100,("authorise_login: checking authorisation on "
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index da43a29767..0ddc00c767 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -196,7 +196,7 @@ void reply_pipe_write_and_X(struct smb_request *req)
size_t numtowrite = SVAL(req->inbuf,smb_vwv10);
int nwritten = -1;
int smb_doff = SVAL(req->inbuf, smb_vwv11);
- BOOL pipe_start_message_raw =
+ bool pipe_start_message_raw =
((SVAL(req->inbuf, smb_vwv7)
& (PIPE_START_MESSAGE|PIPE_RAW_MODE))
== (PIPE_START_MESSAGE|PIPE_RAW_MODE));
@@ -266,7 +266,7 @@ void reply_pipe_read_and_X(struct smb_request *req)
int smb_mincnt = SVAL(req->inbuf,smb_vwv6);
int nread = -1;
char *data;
- BOOL unused;
+ bool unused;
/* we don't use the offset given to use for pipe reads. This
is deliberate, instead we always return the next lump of
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 116917d7eb..b8afbb8710 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -47,7 +47,7 @@ typedef struct canon_ace {
enum ace_owner owner_type;
enum ace_attribute attr;
posix_id unix_ug;
- BOOL inherited;
+ bool inherited;
} canon_ace;
#define ALL_ACE_PERMS (S_IRUSR|S_IWUSR|S_IXUSR)
@@ -83,7 +83,7 @@ struct pai_entry {
};
struct pai_val {
- BOOL pai_protected;
+ bool pai_protected;
unsigned int num_entries;
struct pai_entry *entry_list;
unsigned int num_def_entries;
@@ -148,7 +148,7 @@ static unsigned int num_inherited_entries(canon_ace *ace_list)
Create the on-disk format. Caller must free.
************************************************************************/
-static char *create_pai_buf(canon_ace *file_ace_list, canon_ace *dir_ace_list, BOOL pai_protected, size_t *store_size)
+static char *create_pai_buf(canon_ace *file_ace_list, canon_ace *dir_ace_list, bool pai_protected, size_t *store_size)
{
char *pai_buf = NULL;
canon_ace *ace_list = NULL;
@@ -212,7 +212,7 @@ static char *create_pai_buf(canon_ace *file_ace_list, canon_ace *dir_ace_list, B
************************************************************************/
static void store_inheritance_attributes(files_struct *fsp, canon_ace *file_ace_list,
- canon_ace *dir_ace_list, BOOL pai_protected)
+ canon_ace *dir_ace_list, bool pai_protected)
{
int ret;
size_t store_size;
@@ -275,7 +275,7 @@ static void free_inherited_info(struct pai_val *pal)
Was this ACL protected ?
************************************************************************/
-static BOOL get_protected_flag(struct pai_val *pal)
+static bool get_protected_flag(struct pai_val *pal)
{
if (!pal)
return False;
@@ -286,7 +286,7 @@ static BOOL get_protected_flag(struct pai_val *pal)
Was this ACE inherited ?
************************************************************************/
-static BOOL get_inherited_flag(struct pai_val *pal, canon_ace *ace_entry, BOOL default_ace)
+static bool get_inherited_flag(struct pai_val *pal, canon_ace *ace_entry, bool default_ace)
{
struct pai_entry *paie;
@@ -306,7 +306,7 @@ static BOOL get_inherited_flag(struct pai_val *pal, canon_ace *ace_entry, BOOL d
Ensure an attribute just read is valid.
************************************************************************/
-static BOOL check_pai_ok(char *pai_buf, size_t pai_buf_data_size)
+static bool check_pai_ok(char *pai_buf, size_t pai_buf_data_size)
{
uint16 num_entries;
uint16 num_def_entries;
@@ -672,7 +672,7 @@ static void create_file_sids(SMB_STRUCT_STAT *psbuf, DOM_SID *powner_sid, DOM_SI
Is the identity in two ACEs equal ? Check both SID and uid/gid.
****************************************************************************/
-static BOOL identity_in_ace_equal(canon_ace *ace1, canon_ace *ace2)
+static bool identity_in_ace_equal(canon_ace *ace1, canon_ace *ace2)
{
if (sid_equal(&ace1->trustee, &ace2->trustee)) {
return True;
@@ -807,7 +807,7 @@ static void merge_aces( canon_ace **pp_list_head )
Check if we need to return NT4.x compatible ACL entries.
****************************************************************************/
-static BOOL nt4_compatible_acls(void)
+static bool nt4_compatible_acls(void)
{
int compat = lp_acl_compatibility();
@@ -830,7 +830,7 @@ static BOOL nt4_compatible_acls(void)
static SEC_ACCESS map_canon_ace_perms(int snum,
int *pacl_type,
mode_t perms,
- BOOL directory_ace)
+ bool directory_ace)
{
SEC_ACCESS sa;
uint32 nt_mask = 0;
@@ -1045,7 +1045,7 @@ static void apply_default_perms(const files_struct *fsp, canon_ace *pace, mode_t
expensive and will need optimisation. A *lot* of optimisation :-). JRA.
****************************************************************************/
-static BOOL uid_entry_in_group( canon_ace *uid_ace, canon_ace *group_ace )
+static bool uid_entry_in_group( canon_ace *uid_ace, canon_ace *group_ace )
{
const char *u_name = NULL;
@@ -1077,17 +1077,17 @@ static BOOL uid_entry_in_group( canon_ace *uid_ace, canon_ace *group_ace )
type.
****************************************************************************/
-static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
+static bool ensure_canon_entry_valid(canon_ace **pp_ace,
const files_struct *fsp,
const DOM_SID *pfile_owner_sid,
const DOM_SID *pfile_grp_sid,
SMB_STRUCT_STAT *pst,
- BOOL setting_acl)
+ bool setting_acl)
{
canon_ace *pace;
- BOOL got_user = False;
- BOOL got_grp = False;
- BOOL got_other = False;
+ bool got_user = False;
+ bool got_grp = False;
+ bool got_other = False;
canon_ace *pace_other = NULL;
for (pace = *pp_ace; pace; pace = pace->next) {
@@ -1137,7 +1137,7 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
/* See if the owning user is in any of the other groups in
the ACE. If so, OR in the permissions from that group. */
- BOOL group_matched = False;
+ bool group_matched = False;
canon_ace *pace_iter;
for (pace_iter = *pp_ace; pace_iter; pace_iter = pace_iter->next) {
@@ -1223,7 +1223,7 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
static void check_owning_objs(canon_ace *ace, DOM_SID *pfile_owner_sid, DOM_SID *pfile_grp_sid)
{
- BOOL got_user_obj, got_group_obj;
+ bool got_user_obj, got_group_obj;
canon_ace *current_ace;
int i, entries;
@@ -1264,18 +1264,18 @@ static void check_owning_objs(canon_ace *ace, DOM_SID *pfile_owner_sid, DOM_SID
Unpack a SEC_DESC into two canonical ace lists.
****************************************************************************/
-static BOOL create_canon_ace_lists(files_struct *fsp, SMB_STRUCT_STAT *pst,
+static bool create_canon_ace_lists(files_struct *fsp, SMB_STRUCT_STAT *pst,
DOM_SID *pfile_owner_sid,
DOM_SID *pfile_grp_sid,
canon_ace **ppfile_ace, canon_ace **ppdir_ace,
SEC_ACL *dacl)
{
- BOOL all_aces_are_inherit_only = (fsp->is_directory ? True : False);
+ bool all_aces_are_inherit_only = (fsp->is_directory ? True : False);
canon_ace *file_ace = NULL;
canon_ace *dir_ace = NULL;
canon_ace *current_ace = NULL;
- BOOL got_dir_allow = False;
- BOOL got_file_allow = False;
+ bool got_dir_allow = False;
+ bool got_file_allow = False;
int i, j;
*ppfile_ace = NULL;
@@ -1905,7 +1905,7 @@ static void process_deny_list( canon_ace **pp_ace_list )
no user/group/world entries.
****************************************************************************/
-static mode_t create_default_mode(files_struct *fsp, BOOL interitable_mode)
+static mode_t create_default_mode(files_struct *fsp, bool interitable_mode)
{
int snum = SNUM(fsp->conn);
mode_t and_bits = (mode_t)0;
@@ -1939,7 +1939,7 @@ static mode_t create_default_mode(files_struct *fsp, BOOL interitable_mode)
succeeding.
****************************************************************************/
-static BOOL unpack_canon_ace(files_struct *fsp,
+static bool unpack_canon_ace(files_struct *fsp,
SMB_STRUCT_STAT *pst,
DOM_SID *pfile_owner_sid,
DOM_SID *pfile_grp_sid,
@@ -2270,7 +2270,7 @@ static canon_ace *canonicalise_acl( const files_struct *fsp, SMB_ACL_T posix_acl
Check if the current user group list contains a given group.
****************************************************************************/
-static BOOL current_user_in_group(gid_t gid)
+static bool current_user_in_group(gid_t gid)
{
int i;
@@ -2288,7 +2288,7 @@ static BOOL current_user_in_group(gid_t gid)
and 'dos filemode'
****************************************************************************/
-static BOOL acl_group_override(connection_struct *conn, gid_t prim_gid)
+static bool acl_group_override(connection_struct *conn, gid_t prim_gid)
{
if ( (errno == EACCES || errno == EPERM)
&& (lp_acl_group_control(SNUM(conn)) || lp_dos_filemode(SNUM(conn)))
@@ -2304,18 +2304,18 @@ static BOOL acl_group_override(connection_struct *conn, gid_t prim_gid)
Attempt to apply an ACL to a file or directory.
****************************************************************************/
-static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL default_ace, gid_t prim_gid, BOOL *pacl_set_support)
+static bool set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, bool default_ace, gid_t prim_gid, bool *pacl_set_support)
{
connection_struct *conn = fsp->conn;
- BOOL ret = False;
+ bool ret = False;
SMB_ACL_T the_acl = SMB_VFS_SYS_ACL_INIT(conn, (int)count_canon_ace_list(the_ace) + 1);
canon_ace *p_ace;
int i;
SMB_ACL_ENTRY_T mask_entry;
- BOOL got_mask_entry = False;
+ bool got_mask_entry = False;
SMB_ACL_PERMSET_T mask_permset;
SMB_ACL_TYPE_T the_acl_type = (default_ace ? SMB_ACL_TYPE_DEFAULT : SMB_ACL_TYPE_ACCESS);
- BOOL needs_mask = False;
+ bool needs_mask = False;
mode_t mask_perms = 0;
#if defined(POSIX_ACL_NEEDS_MASK)
@@ -2586,7 +2586,7 @@ SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl)
#define MAP_PERM(p,mask,result) (((p) & (mask)) ? (result) : 0 )
-static BOOL convert_canon_ace_to_posix_perms( files_struct *fsp, canon_ace *file_ace_list, mode_t *posix_perms)
+static bool convert_canon_ace_to_posix_perms( files_struct *fsp, canon_ace *file_ace_list, mode_t *posix_perms)
{
int snum = SNUM(fsp->conn);
size_t ace_count = count_canon_ace_list(file_ace_list);
@@ -2670,8 +2670,8 @@ static size_t merge_default_aces( SEC_ACE *nt_ace_list, size_t num_aces)
for (j = i+1; j < num_aces; j++) {
uint32 i_flags_ni = (nt_ace_list[i].flags & ~SEC_ACE_FLAG_INHERITED_ACE);
uint32 j_flags_ni = (nt_ace_list[j].flags & ~SEC_ACE_FLAG_INHERITED_ACE);
- BOOL i_inh = (nt_ace_list[i].flags & SEC_ACE_FLAG_INHERITED_ACE) ? True : False;
- BOOL j_inh = (nt_ace_list[j].flags & SEC_ACE_FLAG_INHERITED_ACE) ? True : False;
+ bool i_inh = (nt_ace_list[i].flags & SEC_ACE_FLAG_INHERITED_ACE) ? True : False;
+ bool j_inh = (nt_ace_list[j].flags & SEC_ACE_FLAG_INHERITED_ACE) ? True : False;
/* We know the lower number ACE's are file entries. */
if ((nt_ace_list[i].type == nt_ace_list[j].type) &&
@@ -3059,9 +3059,9 @@ int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
/* Case (2) / (3) */
if (lp_enable_privileges()) {
- BOOL has_take_ownership_priv = user_has_privileges(current_user.nt_user_token,
+ bool has_take_ownership_priv = user_has_privileges(current_user.nt_user_token,
&se_take_ownership);
- BOOL has_restore_priv = user_has_privileges(current_user.nt_user_token,
+ bool has_restore_priv = user_has_privileges(current_user.nt_user_token,
&se_restore);
/* Case (2) */
@@ -3316,7 +3316,7 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
DOM_SID file_grp_sid;
canon_ace *file_ace_list = NULL;
canon_ace *dir_ace_list = NULL;
- BOOL acl_perms = False;
+ bool acl_perms = False;
mode_t orig_mode = (mode_t)0;
NTSTATUS status;
@@ -3428,8 +3428,8 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
if((security_info_sent & DACL_SECURITY_INFORMATION) && (psd->dacl != NULL)) {
- BOOL acl_set_support = False;
- BOOL ret = False;
+ bool acl_set_support = False;
+ bool ret = False;
/*
* Try using the POSIX ACL set first. Fall back to chmod if
@@ -3732,10 +3732,10 @@ int fchmod_acl(files_struct *fsp, int fd, mode_t mode)
Check for an existing default POSIX ACL on a directory.
****************************************************************************/
-BOOL directory_has_default_acl(connection_struct *conn, const char *fname)
+bool directory_has_default_acl(connection_struct *conn, const char *fname)
{
SMB_ACL_T def_acl = SMB_VFS_SYS_ACL_GET_FILE( conn, fname, SMB_ACL_TYPE_DEFAULT);
- BOOL has_acl = False;
+ bool has_acl = False;
SMB_ACL_ENTRY_T entry;
if (def_acl != NULL && (SMB_VFS_SYS_ACL_GET_ENTRY(conn, def_acl, SMB_ACL_FIRST_ENTRY, &entry) == 1)) {
@@ -3752,7 +3752,7 @@ BOOL directory_has_default_acl(connection_struct *conn, const char *fname)
Map from wire type to permset.
****************************************************************************/
-static BOOL unix_ex_wire_to_permset(connection_struct *conn, unsigned char wire_perm, SMB_ACL_PERMSET_T *p_permset)
+static bool unix_ex_wire_to_permset(connection_struct *conn, unsigned char wire_perm, SMB_ACL_PERMSET_T *p_permset)
{
if (wire_perm & ~(SMB_POSIX_ACL_READ|SMB_POSIX_ACL_WRITE|SMB_POSIX_ACL_EXECUTE)) {
return False;
@@ -3784,7 +3784,7 @@ static BOOL unix_ex_wire_to_permset(connection_struct *conn, unsigned char wire_
Map from wire type to tagtype.
****************************************************************************/
-static BOOL unix_ex_wire_to_tagtype(unsigned char wire_tt, SMB_ACL_TAG_T *p_tt)
+static bool unix_ex_wire_to_tagtype(unsigned char wire_tt, SMB_ACL_TAG_T *p_tt)
{
switch (wire_tt) {
case SMB_POSIX_ACL_USER_OBJ:
@@ -3907,7 +3907,7 @@ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, uint16 num_
on the directory.
****************************************************************************/
-BOOL set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf,
+bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf,
uint16 num_def_acls, const char *pdata)
{
SMB_ACL_T def_acl = NULL;
@@ -3952,12 +3952,12 @@ BOOL set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_
FIXME ! How does the share mask/mode fit into this.... ?
****************************************************************************/
-static BOOL remove_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname)
+static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname)
{
SMB_ACL_T file_acl = NULL;
int entry_id = SMB_ACL_FIRST_ENTRY;
SMB_ACL_ENTRY_T entry;
- BOOL ret = False;
+ bool ret = False;
/* Create a new ACL with only 3 entries, u/g/w. */
SMB_ACL_T new_file_acl = SMB_VFS_SYS_ACL_INIT(conn, 3);
SMB_ACL_ENTRY_T user_ent = NULL;
@@ -4090,7 +4090,7 @@ static BOOL remove_posix_acl(connection_struct *conn, files_struct *fsp, const c
except SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ, SMB_ACL_OTHER.
****************************************************************************/
-BOOL set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata)
+bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata)
{
SMB_ACL_T file_acl = NULL;
@@ -4136,8 +4136,8 @@ static int check_posix_acl_group_access(connection_struct *conn, const char *fna
int entry_id = SMB_ACL_FIRST_ENTRY;
SMB_ACL_ENTRY_T entry;
int i;
- BOOL seen_mask = False;
- BOOL seen_owning_group = False;
+ bool seen_mask = False;
+ bool seen_owning_group = False;
int ret = -1;
gid_t cu_gid;
@@ -4418,7 +4418,7 @@ static int check_posix_acl_group_access(connection_struct *conn, const char *fna
this to successfully return ACCESS_DENIED on a file open for delete access.
****************************************************************************/
-BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname)
+bool can_delete_file_in_directory(connection_struct *conn, const char *fname)
{
SMB_STRUCT_STAT sbuf;
TALLOC_CTX *ctx = talloc_tos();
@@ -4491,7 +4491,7 @@ BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname)
Note this doesn't take into account share write permissions.
****************************************************************************/
-BOOL can_access_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint32 access_mask)
+bool can_access_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint32 access_mask)
{
int ret;
@@ -4562,7 +4562,7 @@ BOOL can_access_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT
Note this doesn't take into account share write permissions.
****************************************************************************/
-BOOL can_write_to_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf)
+bool can_write_to_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf)
{
return can_access_file(conn, fname, psbuf, FILE_WRITE_DATA);
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 7faf26af25..ed1bf762e9 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -41,7 +41,7 @@ extern int last_message;
extern int smb_read_error;
SIG_ATOMIC_T reload_after_sighup = 0;
SIG_ATOMIC_T got_sig_term = 0;
-extern BOOL global_machine_password_needs_changing;
+extern bool global_machine_password_needs_changing;
extern int max_send;
/*
@@ -95,7 +95,7 @@ static struct pending_message_list *deferred_open_queue;
for processing.
****************************************************************************/
-static BOOL push_queued_message(struct smb_request *req,
+static bool push_queued_message(struct smb_request *req,
struct timeval request_time,
struct timeval end_time,
char *private_data, size_t private_len)
@@ -191,7 +191,7 @@ void schedule_deferred_open_smb_message(uint16 mid)
Return true if this mid is on the deferred queue.
****************************************************************************/
-BOOL open_was_deferred(uint16 mid)
+bool open_was_deferred(uint16 mid)
{
struct pending_message_list *pml;
@@ -224,7 +224,7 @@ struct pending_message_list *get_open_deferred_message(uint16 mid)
messages ready for processing.
****************************************************************************/
-BOOL push_deferred_smb_message(struct smb_request *req,
+bool push_deferred_smb_message(struct smb_request *req,
struct timeval request_time,
struct timeval timeout,
char *private_data, size_t priv_len)
@@ -247,7 +247,7 @@ struct idle_event {
struct timed_event *te;
struct timeval interval;
char *name;
- BOOL (*handler)(const struct timeval *now, void *private_data);
+ bool (*handler)(const struct timeval *now, void *private_data);
void *private_data;
};
@@ -280,7 +280,7 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
TALLOC_CTX *mem_ctx,
struct timeval interval,
const char *name,
- BOOL (*handler)(const struct timeval *now,
+ bool (*handler)(const struct timeval *now,
void *private_data),
void *private_data)
{
@@ -382,7 +382,7 @@ static int select_on_fd(int fd, int maxfd, fd_set *fds)
The timeout is in milliseconds
****************************************************************************/
-static BOOL receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
+static bool receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
size_t *buffer_len, int timeout)
{
fd_set r_fds, w_fds;
@@ -415,7 +415,7 @@ static BOOL receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
* and it's time to schedule.
*/
if(deferred_open_queue != NULL) {
- BOOL pop_message = False;
+ bool pop_message = False;
struct pending_message_list *msg = deferred_open_queue;
if (timeval_is_zero(&msg->end_time)) {
@@ -1515,7 +1515,7 @@ void check_reload(time_t t)
Process any timeout housekeeping. Return False if the caller should exit.
****************************************************************************/
-static BOOL timeout_processing(int *select_timeout,
+static bool timeout_processing(int *select_timeout,
time_t *last_timeout_processing_time)
{
time_t t;
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index cb31763a9f..ac6ad9d470 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -45,7 +45,7 @@
* Declare here, define at end: reduces likely "include" interaction problems.
* David Lee <T.D.Lee@durham.ac.uk>
*/
-BOOL disk_quotas_vxfs(const pstring name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+bool disk_quotas_vxfs(const pstring name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
#endif /* VXFS_QUOTA */
@@ -205,7 +205,7 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
Try to get the disk space from disk quotas (LINUX version).
****************************************************************************/
-BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
int r;
SMB_STRUCT_STAT S;
@@ -306,7 +306,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
try to get the disk space from disk quotas (CRAY VERSION)
****************************************************************************/
-BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
struct mntent *mnt;
FILE *fd;
@@ -467,7 +467,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
}
/* Restricted to SUNOS5 for the moment, I haven`t access to others to test. */
-static BOOL nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
uid_t uid = euser_id;
struct dqblk D;
@@ -479,7 +479,7 @@ static BOOL nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
int len;
static struct timeval timeout = {2,0};
enum clnt_stat clnt_stat;
- BOOL ret = True;
+ bool ret = True;
*bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
@@ -587,7 +587,7 @@ try to get the disk space from disk quotas (SunOS & Solaris2 version)
Quota code by Peter Urbanec (amiga@cse.unsw.edu.au).
****************************************************************************/
-BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
uid_t euser_id;
int ret;
@@ -670,7 +670,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
#if defined(SUNOS5)
if ( strcmp( mnt.mnt_fstype, "nfs" ) == 0) {
- BOOL retval;
+ bool retval;
DEBUG(5,("disk_quotas: looking for mountpath (NFS) \"%s\"\n", mnt.mnt_special));
retval = nfs_quotas(mnt.mnt_special, euser_id, bsize, dfree, dsize);
unbecome_root();
@@ -702,7 +702,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
set_effective_uid(euser_id);
DEBUG(5,("disk_quotas: mount type \"%s\"\n", mnt.mnt_fstype));
if ( 0 == strcmp ( mnt.mnt_fstype, "vxfs" )) {
- BOOL retval;
+ bool retval;
retval = disk_quotas_vxfs(name, path, bsize, dfree, dsize);
return(retval);
}
@@ -748,7 +748,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
try to get the disk space from disk quotas - OSF1 version
****************************************************************************/
-BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
int r, save_errno;
struct dqblk D;
@@ -814,7 +814,7 @@ try to get the disk space from disk quotas (IRIX 6.2 version)
#include <sys/quota.h>
#include <mntent.h>
-BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
uid_t euser_id;
int r;
@@ -1007,7 +1007,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
}
/* Works on FreeBSD, too. :-) */
-static BOOL nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
uid_t uid = euser_id;
struct dqblk D;
@@ -1019,7 +1019,7 @@ static BOOL nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
int len;
static struct timeval timeout = {2,0};
enum clnt_stat clnt_stat;
- BOOL ret = True;
+ bool ret = True;
*bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
@@ -1132,7 +1132,7 @@ static BOOL nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
try to get the disk space from disk quotas - default version
****************************************************************************/
-BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
int r;
struct dqblk D;
@@ -1199,7 +1199,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
#if defined(__FreeBSD__) || defined(__DragonFly__)
if (strcmp(mnts[i].f_fstypename,"nfs") == 0) {
- BOOL retval;
+ bool retval;
retval = nfs_quotas(mnts[i].f_mntfromname,euser_id,bsize,dfree,dsize);
unbecome_root();
return retval;
@@ -1351,7 +1351,7 @@ Hints for porting:
#include <sys/fs/vx_aioctl.h>
#include <sys/fs/vx_ioctl.h>
-BOOL disk_quotas_vxfs(const pstring name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas_vxfs(const pstring name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
uid_t user_id, euser_id;
int ret;
@@ -1432,7 +1432,7 @@ BOOL disk_quotas_vxfs(const pstring name, char *path, SMB_BIG_UINT *bsize, SMB_B
#else /* WITH_QUOTAS */
-BOOL disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
{
(*bsize) = 512; /* This value should be ignored */
@@ -1450,7 +1450,7 @@ BOOL disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BI
/* wrapper to the new sys_quota interface
this file should be removed later
*/
-BOOL disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
{
int r;
SMB_DISK_QUOTA D;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 7c44216aea..38ce797eeb 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -33,7 +33,7 @@ unsigned int smb_echo_count = 0;
extern uint32 global_client_caps;
extern struct current_user current_user;
-extern BOOL global_encrypted_passwords_negotiated;
+extern bool global_encrypted_passwords_negotiated;
/****************************************************************************
Ensure we check the path in *exactly* the same way as W2K for a findfirst/findnext
@@ -47,13 +47,13 @@ extern BOOL global_encrypted_passwords_negotiated;
#define IS_PATH_SEP(c,posix_only) ((c) == '/' || (!(posix_only) && (c) == '\\'))
static NTSTATUS check_path_syntax_internal(char *path,
- BOOL posix_path,
- BOOL *p_last_component_contains_wcard)
+ bool posix_path,
+ bool *p_last_component_contains_wcard)
{
char *d = path;
const char *s = path;
NTSTATUS ret = NT_STATUS_OK;
- BOOL start_of_name_component = True;
+ bool start_of_name_component = True;
*p_last_component_contains_wcard = False;
@@ -177,7 +177,7 @@ static NTSTATUS check_path_syntax_internal(char *path,
NTSTATUS check_path_syntax(char *path)
{
- BOOL ignore;
+ bool ignore;
return check_path_syntax_internal(path, False, &ignore);
}
@@ -187,7 +187,7 @@ NTSTATUS check_path_syntax(char *path)
a wildcard.
****************************************************************************/
-NTSTATUS check_path_syntax_wcard(char *path, BOOL *p_contains_wcard)
+NTSTATUS check_path_syntax_wcard(char *path, bool *p_contains_wcard)
{
return check_path_syntax_internal(path, False, p_contains_wcard);
}
@@ -200,7 +200,7 @@ NTSTATUS check_path_syntax_wcard(char *path, BOOL *p_contains_wcard)
NTSTATUS check_path_syntax_posix(char *path)
{
- BOOL ignore;
+ bool ignore;
return check_path_syntax_internal(path, True, &ignore);
}
@@ -216,7 +216,7 @@ size_t srvstr_get_path_wcard(TALLOC_CTX *ctx,
size_t src_len,
int flags,
NTSTATUS *err,
- BOOL *contains_wcard)
+ bool *contains_wcard)
{
size_t ret;
@@ -325,7 +325,7 @@ size_t srvstr_get_path(TALLOC_CTX *ctx,
Check if we have a correct fsp pointing to a file. Basic check for open fsp.
****************************************************************************/
-BOOL check_fsp_open(connection_struct *conn, struct smb_request *req,
+bool check_fsp_open(connection_struct *conn, struct smb_request *req,
files_struct *fsp, struct current_user *user)
{
if (!(fsp) || !(conn)) {
@@ -344,7 +344,7 @@ BOOL check_fsp_open(connection_struct *conn, struct smb_request *req,
CHECK_FSP macro.
****************************************************************************/
-BOOL check_fsp(connection_struct *conn, struct smb_request *req,
+bool check_fsp(connection_struct *conn, struct smb_request *req,
files_struct *fsp, struct current_user *user)
{
if (!check_fsp_open(conn, req, fsp, user)) {
@@ -366,7 +366,7 @@ BOOL check_fsp(connection_struct *conn, struct smb_request *req,
Check if we have a correct fsp. Replacement for the FSP_BELONGS_CONN macro
****************************************************************************/
-BOOL fsp_belongs_conn(connection_struct *conn, struct smb_request *req,
+bool fsp_belongs_conn(connection_struct *conn, struct smb_request *req,
files_struct *fsp, struct current_user *user)
{
if ((fsp) && (conn) && ((conn)==(fsp)->conn)
@@ -396,7 +396,7 @@ void reply_special(char *inbuf)
*/
char outbuf[smb_size];
- static BOOL already_got_session = False;
+ static bool already_got_session = False;
*name1 = *name2 = 0;
@@ -1202,17 +1202,17 @@ void reply_search(connection_struct *conn, struct smb_request *req)
uint32 dirtype;
unsigned int numentries = 0;
unsigned int maxentries = 0;
- BOOL finished = False;
+ bool finished = False;
char *p;
int status_len;
char *path = NULL;
char status[21];
int dptr_num= -1;
- BOOL check_descend = False;
- BOOL expect_close = False;
+ bool check_descend = False;
+ bool expect_close = False;
NTSTATUS nt_status;
- BOOL mask_contains_wcard = False;
- BOOL allow_long_path_components = (req->flags2 & FLAGS2_LONG_PATH_COMPONENTS) ? True : False;
+ bool mask_contains_wcard = False;
+ bool allow_long_path_components = (req->flags2 & FLAGS2_LONG_PATH_COMPONENTS) ? True : False;
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBsearch);
@@ -1501,7 +1501,7 @@ void reply_fclose(connection_struct *conn, struct smb_request *req)
char *p;
char *path = NULL;
NTSTATUS err;
- BOOL path_contains_wcard = False;
+ bool path_contains_wcard = False;
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBfclose);
@@ -2379,7 +2379,7 @@ static NTSTATUS do_unlink(connection_struct *conn,
****************************************************************************/
NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
- uint32 dirtype, const char *name_in, BOOL has_wild)
+ uint32 dirtype, const char *name_in, bool has_wild)
{
const char *directory = NULL;
char *mask = NULL;
@@ -2543,7 +2543,7 @@ void reply_unlink(connection_struct *conn, struct smb_request *req)
char *name = NULL;
uint32 dirtype;
NTSTATUS status;
- BOOL path_contains_wcard = False;
+ bool path_contains_wcard = False;
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBunlink);
@@ -3288,7 +3288,7 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req)
files_struct *fsp;
SMB_OFF_T startpos;
size_t smb_maxcnt;
- BOOL big_readX = False;
+ bool big_readX = False;
#if 0
size_t smb_mincnt = SVAL(req->inbuf,smb_vwv6);
#endif
@@ -3422,7 +3422,7 @@ void reply_writebraw(connection_struct *conn, struct smb_request *req)
size_t tcount;
SMB_OFF_T startpos;
char *data=NULL;
- BOOL write_through;
+ bool write_through;
files_struct *fsp;
NTSTATUS status;
@@ -3849,12 +3849,12 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req)
files_struct *fsp;
SMB_OFF_T startpos;
size_t numtowrite;
- BOOL write_through;
+ bool write_through;
ssize_t nwritten;
unsigned int smb_doff;
unsigned int smblen;
char *data;
- BOOL large_writeX;
+ bool large_writeX;
NTSTATUS status;
START_PROFILE(SMBwriteX);
@@ -4825,12 +4825,12 @@ void reply_mkdir(connection_struct *conn, struct smb_request *req)
tree recursively. Return True on ok, False on fail.
****************************************************************************/
-static BOOL recursive_rmdir(TALLOC_CTX *ctx,
+static bool recursive_rmdir(TALLOC_CTX *ctx,
connection_struct *conn,
char *directory)
{
const char *dname = NULL;
- BOOL ret = True;
+ bool ret = True;
long offset = 0;
struct smb_Dir *dir_hnd = OpenDir(conn, directory, NULL, 0);
@@ -5079,7 +5079,7 @@ void reply_rmdir(connection_struct *conn, struct smb_request *req)
Resolve wildcards in a filename rename.
********************************************************************/
-static BOOL resolve_wildcards(TALLOC_CTX *ctx,
+static bool resolve_wildcards(TALLOC_CTX *ctx,
const char *name1,
const char *name2,
char **pp_newname)
@@ -5212,7 +5212,7 @@ static void rename_open_files(connection_struct *conn,
const char *newname)
{
files_struct *fsp;
- BOOL did_rename = False;
+ bool did_rename = False;
for(fsp = file_find_di_first(lck->id); fsp;
fsp = file_find_di_next(fsp)) {
@@ -5251,7 +5251,7 @@ static void rename_open_files(connection_struct *conn,
report from <AndyLiebman@aol.com>.
****************************************************************************/
-static BOOL rename_path_prefix_equal(const char *src, const char *dest)
+static bool rename_path_prefix_equal(const char *src, const char *dest)
{
const char *psrc = src;
const char *pdst = dest;
@@ -5273,7 +5273,7 @@ static BOOL rename_path_prefix_equal(const char *src, const char *dest)
* Do the notify calls from a rename
*/
-static void notify_rename(connection_struct *conn, BOOL is_dir,
+static void notify_rename(connection_struct *conn, bool is_dir,
const char *oldpath, const char *newpath)
{
char *olddir, *newdir;
@@ -5320,13 +5320,13 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
char *newname,
const char *newname_last_component,
uint32 attrs,
- BOOL replace_if_exists)
+ bool replace_if_exists)
{
TALLOC_CTX *ctx = talloc_tos();
SMB_STRUCT_STAT sbuf, sbuf1;
NTSTATUS status = NT_STATUS_OK;
struct share_mode_lock *lck = NULL;
- BOOL dst_exists;
+ bool dst_exists;
ZERO_STRUCT(sbuf);
@@ -5508,9 +5508,9 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
const char *name_in,
const char *newname_in,
uint32 attrs,
- BOOL replace_if_exists,
- BOOL src_has_wild,
- BOOL dest_has_wild)
+ bool replace_if_exists,
+ bool src_has_wild,
+ bool dest_has_wild)
{
char *directory = NULL;
char *mask = NULL;
@@ -5593,7 +5593,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
/*
* No wildcards - just process the one file.
*/
- BOOL is_short_name = mangle_is_8_3(name, True, conn->params);
+ bool is_short_name = mangle_is_8_3(name, True, conn->params);
/* Add a terminating '/' to the directory name. */
directory = talloc_asprintf_append(directory,
@@ -5696,7 +5696,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
files_struct *fsp = NULL;
char *fname = NULL;
char *destname = NULL;
- BOOL sysdir_entry = False;
+ bool sysdir_entry = False;
/* Quick check for "." and ".." */
if (ISDOT(dname) || ISDOTDOT(dname)) {
@@ -5801,8 +5801,8 @@ void reply_mv(connection_struct *conn, struct smb_request *req)
char *p;
uint32 attrs;
NTSTATUS status;
- BOOL src_has_wcard = False;
- BOOL dest_has_wcard = False;
+ bool src_has_wcard = False;
+ bool dest_has_wcard = False;
TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBmv);
@@ -5903,7 +5903,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
const char *dest1,
int ofun,
int count,
- BOOL target_is_directory)
+ bool target_is_directory)
{
SMB_STRUCT_STAT src_sbuf, sbuf2;
SMB_OFF_T ret=-1;
@@ -6038,9 +6038,9 @@ void reply_copy(connection_struct *conn, struct smb_request *req)
int tid2;
int ofun;
int flags;
- BOOL target_is_directory=False;
- BOOL source_has_wild = False;
- BOOL dest_has_wild = False;
+ bool target_is_directory=False;
+ bool source_has_wild = False;
+ bool dest_has_wild = False;
SMB_STRUCT_STAT sbuf1, sbuf2;
NTSTATUS status;
TALLOC_CTX *ctx = talloc_tos();
@@ -6355,7 +6355,7 @@ void reply_copy(connection_struct *conn, struct smb_request *req)
Get a lock pid, dealing with large count requests.
****************************************************************************/
-uint32 get_lock_pid( char *data, int data_offset, BOOL large_file_format)
+uint32 get_lock_pid( char *data, int data_offset, bool large_file_format)
{
if(!large_file_format)
return (uint32)SVAL(data,SMB_LPID_OFFSET(data_offset));
@@ -6367,7 +6367,7 @@ uint32 get_lock_pid( char *data, int data_offset, BOOL large_file_format)
Get a lock count, dealing with large count requests.
****************************************************************************/
-SMB_BIG_UINT get_lock_count( char *data, int data_offset, BOOL large_file_format)
+SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format)
{
SMB_BIG_UINT count = 0;
@@ -6439,7 +6439,7 @@ static uint32 map_lock_offset(uint32 high, uint32 low)
Get a lock offset, dealing with large offset requests.
****************************************************************************/
-SMB_BIG_UINT get_lock_offset( char *data, int data_offset, BOOL large_file_format, BOOL *err)
+SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
{
SMB_BIG_UINT offset = 0;
@@ -6500,8 +6500,8 @@ void reply_lockingX(connection_struct *conn, struct smb_request *req)
int32 lock_timeout;
int i;
char *data;
- BOOL large_file_format;
- BOOL err;
+ bool large_file_format;
+ bool err;
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
START_PROFILE(SMBlockingX);
@@ -6541,8 +6541,8 @@ void reply_lockingX(connection_struct *conn, struct smb_request *req)
*/
if ((locktype & LOCKING_ANDX_OPLOCK_RELEASE)) {
/* Client can insist on breaking to none. */
- BOOL break_to_none = (oplocklevel == 0);
- BOOL result;
+ bool break_to_none = (oplocklevel == 0);
+ bool result;
DEBUG(5,("reply_lockingX: oplock break reply (%u) from client "
"for fnum = %d\n", (unsigned int)oplocklevel,
@@ -6720,8 +6720,8 @@ void reply_lockingX(connection_struct *conn, struct smb_request *req)
offset,
WINDOWS_LOCK);
} else {
- BOOL blocking_lock = lock_timeout ? True : False;
- BOOL defer_lock = False;
+ bool blocking_lock = lock_timeout ? True : False;
+ bool defer_lock = False;
struct byte_range_lock *br_lck;
uint32 block_smbpid;
diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c
index 08d522cdd7..6edcc36764 100644
--- a/source3/smbd/sec_ctx.c
+++ b/source3/smbd/sec_ctx.c
@@ -36,7 +36,7 @@ static int sec_ctx_stack_ndx;
Become the specified uid.
****************************************************************************/
-static BOOL become_uid(uid_t uid)
+static bool become_uid(uid_t uid)
{
/* Check for dodgy uid values */
@@ -63,7 +63,7 @@ static BOOL become_uid(uid_t uid)
Become the specified gid.
****************************************************************************/
-static BOOL become_gid(gid_t gid)
+static bool become_gid(gid_t gid)
{
/* Check for dodgy gid values */
@@ -88,7 +88,7 @@ static BOOL become_gid(gid_t gid)
Become the specified uid and gid.
****************************************************************************/
-static BOOL become_id(uid_t uid, gid_t gid)
+static bool become_id(uid_t uid, gid_t gid)
{
return become_gid(gid) && become_uid(uid);
}
@@ -183,7 +183,7 @@ fail:
one. User changes are done using the set_sec_ctx() function.
****************************************************************************/
-BOOL push_sec_ctx(void)
+bool push_sec_ctx(void)
{
struct sec_ctx *ctx_p;
@@ -367,7 +367,7 @@ void set_root_sec_ctx(void)
Pop a security context from the stack.
****************************************************************************/
-BOOL pop_sec_ctx(void)
+bool pop_sec_ctx(void)
{
struct sec_ctx *ctx_p;
struct sec_ctx *prev_ctx_p;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 8c92c91577..05bb3504c7 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -169,7 +169,7 @@ static void msg_sam_sync(struct messaging_context *msg,
Open the socket communication - inetd.
****************************************************************************/
-static BOOL open_sockets_inetd(void)
+static bool open_sockets_inetd(void)
{
/* Started from inetd. fd 0 is the socket. */
/* We will abort gracefully when the client or remote system
@@ -282,7 +282,7 @@ static void remove_child_pid(pid_t pid)
Have we reached the process limit ?
****************************************************************************/
-static BOOL allowable_number_of_smbd_processes(void)
+static bool allowable_number_of_smbd_processes(void)
{
int max_processes = lp_max_smbd_processes();
@@ -296,7 +296,7 @@ static BOOL allowable_number_of_smbd_processes(void)
Open the socket communication.
****************************************************************************/
-static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ports)
+static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ports)
{
int num_interfaces = iface_count();
int num_sockets = 0;
@@ -681,9 +681,9 @@ void reload_printers(void)
Reload the services file.
**************************************************************************/
-BOOL reload_services(BOOL test)
+bool reload_services(bool test)
{
- BOOL ret;
+ bool ret;
if (lp_loaded()) {
pstring fname;
@@ -816,7 +816,7 @@ void exit_server_fault(void)
Initialise connect, service and file structs.
****************************************************************************/
-static BOOL init_structs(void )
+static bool init_structs(void )
{
/*
* Set the machine NETBIOS name if not already
@@ -843,7 +843,7 @@ static BOOL init_structs(void )
/*
* Send keepalive packets to our client
*/
-static BOOL keepalive_fn(const struct timeval *now, void *private_data)
+static bool keepalive_fn(const struct timeval *now, void *private_data)
{
if (!send_keepalive(smbd_server_fd())) {
DEBUG( 2, ( "Keepalive failed - exiting.\n" ) );
@@ -855,7 +855,7 @@ static BOOL keepalive_fn(const struct timeval *now, void *private_data)
/*
* Do the recurring check if we're idle
*/
-static BOOL deadtime_fn(const struct timeval *now, void *private_data)
+static bool deadtime_fn(const struct timeval *now, void *private_data)
{
if ((conn_num_open() == 0)
|| (conn_idle_all(now->tv_sec))) {
@@ -877,21 +877,21 @@ static BOOL deadtime_fn(const struct timeval *now, void *private_data)
mkproto.h. Mixing $(builddir) and $(srcdir) source files in the current
prototype generation system is too complicated. */
-extern void build_options(BOOL screen);
+extern void build_options(bool screen);
int main(int argc,const char *argv[])
{
/* shall I run as a daemon */
- static BOOL is_daemon = False;
- static BOOL interactive = False;
- static BOOL Fork = True;
- static BOOL no_process_group = False;
- static BOOL log_stdout = False;
+ static bool is_daemon = False;
+ static bool interactive = False;
+ static bool Fork = True;
+ static bool no_process_group = False;
+ static bool log_stdout = False;
static char *ports = NULL;
static char *profile_level = NULL;
int opt;
poptContext pc;
- BOOL print_build_options = False;
+ bool print_build_options = False;
struct poptOption long_options[] = {
POPT_AUTOHELP
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 1c46e3776c..bb279b701f 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -21,7 +21,7 @@
extern userdom_struct current_user_info;
-static BOOL canonicalize_path(connection_struct *conn, pstring path)
+static bool canonicalize_path(connection_struct *conn, pstring path)
{
#ifdef REALPATH_TAKES_NULL
char *resolved_name = SMB_VFS_REALPATH(conn,path,NULL);
@@ -57,7 +57,7 @@ void set_conn_connectpath(connection_struct *conn, const char *connectpath)
pstring destname;
char *d = destname;
const char *s = connectpath;
- BOOL start_of_name_component = True;
+ bool start_of_name_component = True;
*d++ = '/'; /* Always start with root. */
@@ -161,7 +161,7 @@ void set_conn_connectpath(connection_struct *conn, const char *connectpath)
Load parameters specific to a connection/service.
****************************************************************************/
-BOOL set_current_service(connection_struct *conn, uint16 flags, BOOL do_chdir)
+bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir)
{
static connection_struct *last_conn;
static uint16 last_flags;
@@ -503,7 +503,7 @@ static NTSTATUS share_sanity_checks(int snum, fstring dev)
return NT_STATUS_OK;
}
-static NTSTATUS find_forced_user(connection_struct *conn, BOOL vuser_is_guest, fstring username)
+static NTSTATUS find_forced_user(connection_struct *conn, bool vuser_is_guest, fstring username)
{
int snum = conn->params->service;
char *fuser, *found_username;
@@ -535,7 +535,7 @@ static NTSTATUS find_forced_user(connection_struct *conn, BOOL vuser_is_guest, f
* one found.
*/
-static NTSTATUS find_forced_group(BOOL force_user,
+static NTSTATUS find_forced_group(bool force_user,
int snum, const char *username,
DOM_SID *pgroup_sid,
gid_t *pgid)
@@ -545,7 +545,7 @@ static NTSTATUS find_forced_group(BOOL force_user,
DOM_SID group_sid;
enum lsa_SidType type;
char *groupname;
- BOOL user_must_be_member = False;
+ bool user_must_be_member = False;
gid_t gid;
ZERO_STRUCTP(pgroup_sid);
@@ -636,7 +636,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
NTSTATUS *status)
{
struct passwd *pass = NULL;
- BOOL guest = False;
+ bool guest = False;
connection_struct *conn;
SMB_STRUCT_STAT st;
fstring user;
@@ -773,7 +773,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
* insensitive for now. */
conn->case_sensitive = False;
} else {
- conn->case_sensitive = (BOOL)lp_casesensitive(snum);
+ conn->case_sensitive = (bool)lp_casesensitive(snum);
}
conn->case_preserve = lp_preservecase(snum);
@@ -908,7 +908,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
*/
{
- BOOL can_write = False;
+ bool can_write = False;
NT_USER_TOKEN *token = conn->nt_user_token ?
conn->nt_user_token :
(vuser ? vuser->nt_user_token : NULL);
diff --git a/source3/smbd/session.c b/source3/smbd/session.c
index 54d2ddf721..ebbb40eb5a 100644
--- a/source3/smbd/session.c
+++ b/source3/smbd/session.c
@@ -44,7 +44,7 @@ static struct db_context *session_db_ctx(void)
return ctx;
}
-BOOL session_init(void)
+bool session_init(void)
{
if (session_db_ctx() == NULL) {
DEBUG(1,("session_init: failed to open sessionid tdb\n"));
@@ -58,7 +58,7 @@ BOOL session_init(void)
called when a session is created
********************************************************************/
-BOOL session_claim(user_struct *vuser)
+bool session_claim(user_struct *vuser)
{
TDB_DATA key, data;
int i = 0;
@@ -254,7 +254,7 @@ void session_yield(user_struct *vuser)
/********************************************************************
********************************************************************/
-static BOOL session_traverse(int (*fn)(struct db_record *db,
+static bool session_traverse(int (*fn)(struct db_record *db,
void *private_data),
void *private_data)
{
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index a2f24c66d2..bc298d11f7 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -25,8 +25,8 @@
#include "includes.h"
extern struct auth_context *negprot_global_auth_context;
-extern BOOL global_encrypted_passwords_negotiated;
-extern BOOL global_spnego_negotiated;
+extern bool global_encrypted_passwords_negotiated;
+extern bool global_spnego_negotiated;
extern enum protocol_types Protocol;
extern int max_send;
@@ -186,14 +186,14 @@ static NTSTATUS check_guest_password(auth_serversupplied_info **server_info)
Cerate a clock skew error blob for a Windows client.
****************************************************************************/
-static BOOL make_krb5_skew_error(DATA_BLOB *pblob_out)
+static bool make_krb5_skew_error(DATA_BLOB *pblob_out)
{
krb5_context context = NULL;
krb5_error_code kerr = 0;
krb5_data reply;
krb5_principal host_princ = NULL;
char *host_princ_s = NULL;
- BOOL ret = False;
+ bool ret = False;
*pblob_out = data_blob_null;
@@ -251,7 +251,7 @@ static void reply_spnego_kerberos(connection_struct *conn,
struct smb_request *req,
DATA_BLOB *secblob,
uint16 vuid,
- BOOL *p_invalidate_vuid)
+ bool *p_invalidate_vuid)
{
TALLOC_CTX *mem_ctx;
DATA_BLOB ticket;
@@ -268,8 +268,8 @@ static void reply_spnego_kerberos(connection_struct *conn,
uint8 tok_id[2];
DATA_BLOB nullblob = data_blob_null;
fstring real_username;
- BOOL map_domainuser_to_guest = False;
- BOOL username_was_mapped;
+ bool map_domainuser_to_guest = False;
+ bool username_was_mapped;
PAC_LOGON_INFO *logon_info = NULL;
ZERO_STRUCT(ticket);
@@ -316,7 +316,7 @@ static void reply_spnego_kerberos(connection_struct *conn,
* -- Looks like this only happens with a KDC. JRA.
*/
- BOOL ok = make_krb5_skew_error(&ap_rep);
+ bool ok = make_krb5_skew_error(&ap_rep);
if (!ok) {
talloc_destroy(mem_ctx);
return ERROR_NT(nt_status_squash(
@@ -628,7 +628,7 @@ static void reply_spnego_ntlmssp(connection_struct *conn,
uint16 vuid,
AUTH_NTLMSSP_STATE **auth_ntlmssp_state,
DATA_BLOB *ntlmssp_blob, NTSTATUS nt_status,
- BOOL wrap)
+ bool wrap)
{
DATA_BLOB response;
struct auth_serversupplied_info *server_info = NULL;
@@ -716,7 +716,7 @@ static void reply_spnego_ntlmssp(connection_struct *conn,
****************************************************************************/
NTSTATUS parse_spnego_mechanisms(DATA_BLOB blob_in, DATA_BLOB *pblob_out,
- BOOL *p_is_krb5)
+ bool *p_is_krb5)
{
char *OIDs[ASN1_MAX_OIDS];
int i;
@@ -764,7 +764,7 @@ static void reply_spnego_negotiate(connection_struct *conn,
{
DATA_BLOB secblob;
DATA_BLOB chal;
- BOOL got_kerberos_mechanism = False;
+ bool got_kerberos_mechanism = False;
NTSTATUS status;
status = parse_spnego_mechanisms(blob1, &secblob,
@@ -782,7 +782,7 @@ static void reply_spnego_negotiate(connection_struct *conn,
#ifdef HAVE_KRB5
if ( got_kerberos_mechanism && ((lp_security()==SEC_ADS) ||
lp_use_kerberos_keytab()) ) {
- BOOL destroy_vuid = True;
+ bool destroy_vuid = True;
reply_spnego_kerberos(conn, req, &secblob, vuid,
&destroy_vuid);
data_blob_free(&secblob);
@@ -850,7 +850,7 @@ static void reply_spnego_auth(connection_struct *conn,
if (auth.data[0] == ASN1_APPLICATION(0)) {
/* Might be a second negTokenTarg packet */
- BOOL got_krb5_mechanism = False;
+ bool got_krb5_mechanism = False;
status = parse_spnego_mechanisms(auth, &secblob,
&got_krb5_mechanism);
if (NT_STATUS_IS_OK(status)) {
@@ -859,7 +859,7 @@ static void reply_spnego_auth(connection_struct *conn,
#ifdef HAVE_KRB5
if ( got_krb5_mechanism && ((lp_security()==SEC_ADS) ||
lp_use_kerberos_keytab()) ) {
- BOOL destroy_vuid = True;
+ bool destroy_vuid = True;
reply_spnego_kerberos(conn, req, &secblob,
vuid, &destroy_vuid);
data_blob_free(&secblob);
@@ -1336,14 +1336,14 @@ void reply_sesssetup_and_X(connection_struct *conn, struct smb_request *req)
fstring native_os;
fstring native_lanman;
fstring primary_domain;
- static BOOL done_sesssetup = False;
+ static bool done_sesssetup = False;
auth_usersupplied_info *user_info = NULL;
auth_serversupplied_info *server_info = NULL;
uint16 smb_flag2 = req->flags2;
NTSTATUS nt_status;
- BOOL doencrypt = global_encrypted_passwords_negotiated;
+ bool doencrypt = global_encrypted_passwords_negotiated;
DATA_BLOB session_key;
@@ -1489,7 +1489,7 @@ void reply_sesssetup_and_X(connection_struct *conn, struct smb_request *req)
nt_resp = data_blob(p+passlen1, passlen2);
} else {
pstring pass;
- BOOL unic= smb_flag2 & FLAGS2_UNICODE_STRINGS;
+ bool unic= smb_flag2 & FLAGS2_UNICODE_STRINGS;
#if 0
/* This was the previous fix. Not sure if it's still
diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c
index a5e0988b0f..512126254a 100644
--- a/source3/smbd/share_access.c
+++ b/source3/smbd/share_access.c
@@ -29,7 +29,7 @@
extern userdom_struct current_user_info;
-static BOOL do_group_checks(const char **name, const char **pattern)
+static bool do_group_checks(const char **name, const char **pattern)
{
if ((*name)[0] == '@') {
*pattern = "&+";
@@ -64,7 +64,7 @@ static BOOL do_group_checks(const char **name, const char **pattern)
return False;
}
-static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
+static bool token_contains_name(TALLOC_CTX *mem_ctx,
const char *username,
const char *sharename,
const struct nt_user_token *token,
@@ -151,7 +151,7 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
* The other use is the netgroup check when using @group or &group.
*/
-BOOL token_contains_name_in_list(const char *username,
+bool token_contains_name_in_list(const char *username,
const char *sharename,
const struct nt_user_token *token,
const char **list)
@@ -191,7 +191,7 @@ BOOL token_contains_name_in_list(const char *username,
* The other use is the netgroup check when using @group or &group.
*/
-BOOL user_ok_token(const char *username, struct nt_user_token *token, int snum)
+bool user_ok_token(const char *username, struct nt_user_token *token, int snum)
{
if (lp_invalid_users(snum) != NULL) {
if (token_contains_name_in_list(username, lp_servicename(snum),
@@ -247,10 +247,10 @@ BOOL user_ok_token(const char *username, struct nt_user_token *token, int snum)
* The other use is the netgroup check when using @group or &group.
*/
-BOOL is_share_read_only_for_token(const char *username,
+bool is_share_read_only_for_token(const char *username,
struct nt_user_token *token, int snum)
{
- BOOL result = lp_readonly(snum);
+ bool result = lp_readonly(snum);
if (lp_readlist(snum) != NULL) {
if (token_contains_name_in_list(username,
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index a066091b52..8f1e008985 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -42,7 +42,7 @@ static TDB_CONTEXT *tdb_stat_cache;
void stat_cache_add( const char *full_orig_name,
char *translated_path,
- BOOL case_sensitive)
+ bool case_sensitive)
{
size_t translated_path_length;
TDB_DATA data_val;
@@ -174,7 +174,7 @@ void stat_cache_add( const char *full_orig_name,
*
*/
-BOOL stat_cache_lookup(connection_struct *conn,
+bool stat_cache_lookup(connection_struct *conn,
char **pp_name,
char **pp_dirpath,
char **pp_start,
@@ -182,7 +182,7 @@ BOOL stat_cache_lookup(connection_struct *conn,
{
char *chk_name;
size_t namelen;
- BOOL sizechanged = False;
+ bool sizechanged = False;
unsigned int num_components = 0;
char *translated_path;
size_t translated_path_length;
@@ -390,7 +390,7 @@ unsigned int fast_string_hash(TDB_DATA *key)
Initializes or clears the stat cache.
**************************************************************************/
-BOOL reset_stat_cache( void )
+bool reset_stat_cache( void )
{
if (!lp_stat_cache())
return True;
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<maxentries) && !finished && !out_of_space;i++) {
- BOOL got_exact_match = False;
+ bool got_exact_match = False;
/* this is a heuristic to avoid seeking the dirptr except when
absolutely necessary. It allows for a filename of about 40 chars */
@@ -2113,11 +2113,11 @@ static void call_trans2findnext(connection_struct *conn,
uint16 info_level;
uint32 resume_key;
uint16 findnext_flags;
- BOOL close_after_request;
- BOOL close_if_end;
- BOOL requires_resume_key;
- BOOL continue_bit;
- BOOL mask_contains_wcard = False;
+ bool close_after_request;
+ bool close_if_end;
+ bool requires_resume_key;
+ bool continue_bit;
+ bool mask_contains_wcard = False;
char *resume_name = NULL;
const char *mask = NULL;
const char *directory = NULL;
@@ -2125,9 +2125,9 @@ static void call_trans2findnext(connection_struct *conn,
uint16 dirtype;
int numentries = 0;
int i, last_entry_off=0;
- 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;
struct ea_list *ea_list = NULL;
NTSTATUS ntstatus = NT_STATUS_OK;
@@ -2326,7 +2326,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
} /* end if resume_name && !continue_bit */
for (i=0;(i<(int)maxentries) && !finished && !out_of_space ;i++) {
- BOOL got_exact_match = False;
+ bool got_exact_match = False;
/* this is a heuristic to avoid seeking the dirptr except when
absolutely necessary. It allows for a filename of about 40 chars */
@@ -3110,7 +3110,7 @@ static unsigned int count_acl_entries(connection_struct *conn, SMB_ACL_T posix_a
Utility function to marshall a POSIX acl into wire format.
****************************************************************************/
-static BOOL marshall_posix_acl(connection_struct *conn, char *pdata, SMB_STRUCT_STAT *pst, SMB_ACL_T posix_acl)
+static bool marshall_posix_acl(connection_struct *conn, char *pdata, SMB_STRUCT_STAT *pst, SMB_ACL_T posix_acl)
{
int entry_id = SMB_ACL_FIRST_ENTRY;
SMB_ACL_ENTRY_T entry;
@@ -3309,7 +3309,7 @@ static void map_info2_flags_from_sbuf(const SMB_STRUCT_STAT *psbuf,
#endif /* HAVE_STAT_ST_FLAGS */
}
-static BOOL map_info2_flags_to_sbuf(const SMB_STRUCT_STAT *psbuf,
+static bool map_info2_flags_to_sbuf(const SMB_STRUCT_STAT *psbuf,
const uint32 smb_fflags,
const uint32 smb_fmask,
int *stat_fflags)
@@ -3475,7 +3475,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
char *base_name;
char *p;
SMB_OFF_T pos = 0;
- BOOL delete_pending = False;
+ bool delete_pending = False;
int len;
time_t create_time, mtime, atime;
struct timespec create_time_ts, mtime_ts, atime_ts;
@@ -4684,7 +4684,7 @@ static NTSTATUS smb_set_file_disposition_info(connection_struct *conn,
SMB_STRUCT_STAT *psbuf)
{
NTSTATUS status = NT_STATUS_OK;
- BOOL delete_on_close;
+ bool delete_on_close;
uint32 dosmode = 0;
if (total_data < 1) {
@@ -4901,12 +4901,12 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
files_struct *fsp,
const char *fname)
{
- BOOL overwrite;
+ bool overwrite;
uint32 root_fid;
uint32 len;
char *newname = NULL;
char *base_name = NULL;
- BOOL dest_has_wcard = False;
+ bool dest_has_wcard = False;
NTSTATUS status = NT_STATUS_OK;
char *p;
TALLOC_CTX *ctx = talloc_tos();
@@ -5019,8 +5019,8 @@ static NTSTATUS smb_set_posix_acl(connection_struct *conn,
uint16 posix_acl_version;
uint16 num_file_acls;
uint16 num_def_acls;
- BOOL valid_file_acls = True;
- BOOL valid_def_acls = True;
+ bool valid_file_acls = True;
+ bool valid_def_acls = True;
if (total_data < SMB_POSIX_ACL_HEADER_SIZE) {
return NT_STATUS_INVALID_PARAMETER;
@@ -5081,7 +5081,7 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
SMB_BIG_UINT count;
SMB_BIG_UINT offset;
uint32 lock_pid;
- BOOL blocking_lock = False;
+ bool blocking_lock = False;
enum brl_type lock_type;
NTSTATUS status = NT_STATUS_OK;
@@ -5522,7 +5522,7 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
uid_t set_owner = (uid_t)SMB_UID_NO_CHANGE;
gid_t set_grp = (uid_t)SMB_GID_NO_CHANGE;
NTSTATUS status = NT_STATUS_OK;
- BOOL delete_on_fail = False;
+ bool delete_on_fail = False;
enum perm_type ptype;
if (total_data < 100) {
@@ -5847,7 +5847,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn,
SMB_STRUCT_STAT *psbuf,
int *pdata_return_size)
{
- BOOL extended_oplock_granted = False;
+ bool extended_oplock_granted = False;
char *pdata = *ppdata;
uint32 flags = 0;
uint32 wire_open_mode = 0;
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index d1837c41dc..dceea450e6 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -49,7 +49,7 @@ gid_t get_current_user_gid_next(int *piterator)
Become the guest user without changing the security context stack.
****************************************************************************/
-BOOL change_to_guest(void)
+bool change_to_guest(void)
{
static struct passwd *pass=NULL;
@@ -81,11 +81,11 @@ BOOL change_to_guest(void)
Check if a username is OK.
********************************************************************/
-static BOOL check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
+static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
{
unsigned int i;
struct vuid_cache_entry *ent = NULL;
- BOOL readonly_share;
+ bool readonly_share;
NT_USER_TOKEN *token;
for (i=0;i<conn->vuid_cache.entries && i< VUID_CACHE_SIZE;i++) {
@@ -146,14 +146,14 @@ static BOOL check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
stack, but modify the current_user entries.
****************************************************************************/
-BOOL change_to_user(connection_struct *conn, uint16 vuid)
+bool change_to_user(connection_struct *conn, uint16 vuid)
{
user_struct *vuser = get_valid_user_struct(vuid);
int snum;
gid_t gid;
uid_t uid;
char group_c;
- BOOL must_free_token = False;
+ bool must_free_token = False;
NT_USER_TOKEN *token = NULL;
int num_groups = 0;
gid_t *group_list = NULL;
@@ -279,7 +279,7 @@ BOOL change_to_user(connection_struct *conn, uint16 vuid)
but modify the current_user entries.
****************************************************************************/
-BOOL change_to_root_user(void)
+bool change_to_root_user(void)
{
set_root_sec_ctx();
@@ -298,7 +298,7 @@ BOOL change_to_root_user(void)
user. Doesn't modify current_user.
****************************************************************************/
-BOOL become_authenticated_pipe_user(pipes_struct *p)
+bool become_authenticated_pipe_user(pipes_struct *p)
{
if (!push_sec_ctx())
return False;
@@ -317,7 +317,7 @@ BOOL become_authenticated_pipe_user(pipes_struct *p)
current_user.
****************************************************************************/
-BOOL unbecome_authenticated_pipe_user(void)
+bool unbecome_authenticated_pipe_user(void)
{
return pop_sec_ctx();
}
@@ -405,7 +405,7 @@ void unbecome_root(void)
Saves and restores the connection context.
****************************************************************************/
-BOOL become_user(connection_struct *conn, uint16 vuid)
+bool become_user(connection_struct *conn, uint16 vuid)
{
if (!push_sec_ctx())
return False;
@@ -421,7 +421,7 @@ BOOL become_user(connection_struct *conn, uint16 vuid)
return True;
}
-BOOL unbecome_user(void)
+bool unbecome_user(void)
{
pop_sec_ctx();
pop_conn_ctx();
diff --git a/source3/smbd/utmp.c b/source3/smbd/utmp.c
index 52174c4d83..e36e2aa042 100644
--- a/source3/smbd/utmp.c
+++ b/source3/smbd/utmp.c
@@ -249,7 +249,7 @@ static void uw_pathname(pstring fname, const char *uw_name, const char *uw_defau
Update utmp file directly. No subroutine interface: probably a BSD system.
****************************************************************************/
-static void pututline_my(pstring uname, struct utmp *u, BOOL claim)
+static void pututline_my(pstring uname, struct utmp *u, bool claim)
{
DEBUG(1,("pututline_my: not yet implemented\n"));
/* BSD implementor: may want to consider (or not) adjusting "lastlog" */
@@ -263,7 +263,7 @@ static void pututline_my(pstring uname, struct utmp *u, BOOL claim)
Credit: Michail Vidiassov <master@iaas.msu.ru>
****************************************************************************/
-static void updwtmp_my(pstring wname, struct utmp *u, BOOL claim)
+static void updwtmp_my(pstring wname, struct utmp *u, bool claim)
{
int fd;
struct stat buf;
@@ -306,7 +306,7 @@ static void updwtmp_my(pstring wname, struct utmp *u, BOOL claim)
Update via utmp/wtmp (not utmpx/wtmpx).
****************************************************************************/
-static void utmp_nox_update(struct utmp *u, BOOL claim)
+static void utmp_nox_update(struct utmp *u, bool claim)
{
pstring uname, wname;
#if defined(PUTUTLINE_RETURNS_UTMP)
@@ -384,7 +384,7 @@ static void utmp_strcpy(char *dest, const char *src, size_t n)
Update via utmpx/wtmpx (preferred) or via utmp/wtmp.
****************************************************************************/
-static void sys_utmp_update(struct utmp *u, const char *hostname, BOOL claim)
+static void sys_utmp_update(struct utmp *u, const char *hostname, bool claim)
{
#if !defined(HAVE_UTMPX_H)
/* No utmpx stuff. Drop to non-x stuff */
@@ -472,7 +472,7 @@ static int ut_id_encode(int i, char *fourbyte)
/*
fill a system utmp structure given all the info we can gather
*/
-static BOOL sys_utmp_fill(struct utmp *u,
+static bool sys_utmp_fill(struct utmp *u,
const char *username, const char *hostname,
const char *ip_addr_str,
const char *id_str, int id_num)
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index d9c772d6b1..b43f37e716 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -106,7 +106,7 @@ static inline void vfs_set_operation(struct vfs_ops * vfs, vfs_op_type which,
((void **)(void *)&vfs->ops)[which] = op;
}
-BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object)
+bool vfs_init_custom(connection_struct *conn, const char *vfs_object)
{
vfs_op_tuple *ops;
char *module_name = NULL;
@@ -256,7 +256,7 @@ void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
Generic VFS init.
******************************************************************/
-BOOL smbd_vfs_init(connection_struct *conn)
+bool smbd_vfs_init(connection_struct *conn)
{
const char **vfs_objects;
unsigned int i = 0;
@@ -287,10 +287,10 @@ BOOL smbd_vfs_init(connection_struct *conn)
Check if directory exists.
********************************************************************/
-BOOL vfs_directory_exist(connection_struct *conn, const char *dname, SMB_STRUCT_STAT *st)
+bool vfs_directory_exist(connection_struct *conn, const char *dname, SMB_STRUCT_STAT *st)
{
SMB_STRUCT_STAT st2;
- BOOL ret;
+ bool ret;
if (!st)
st = &st2;
@@ -309,7 +309,7 @@ BOOL vfs_directory_exist(connection_struct *conn, const char *dname, SMB_STRUCT_
Check if an object exists in the vfs.
********************************************************************/
-BOOL vfs_object_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT *sbuf)
+bool vfs_object_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_STAT st;
@@ -327,7 +327,7 @@ BOOL vfs_object_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT
Check if a file exists in the vfs.
********************************************************************/
-BOOL vfs_file_exist(connection_struct *conn, const char *fname,SMB_STRUCT_STAT *sbuf)
+bool vfs_file_exist(connection_struct *conn, const char *fname,SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_STAT st;
@@ -682,10 +682,10 @@ static struct {
SMB_DEV_T dev; /* These *must* be compatible with the types returned in a stat() call. */
SMB_INO_T inode; /* These *must* be compatible with the types returned in a stat() call. */
char *path; /* The pathname. */
- BOOL valid;
+ bool valid;
} ino_list[MAX_GETWDCACHE];
-extern BOOL use_getwd_cache;
+extern bool use_getwd_cache;
/****************************************************************************
Prompte a ptr (to make it recently used)
@@ -723,7 +723,7 @@ char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn)
#else
pstring s;
#endif
- static BOOL getwd_cache_init = False;
+ static bool getwd_cache_init = False;
SMB_STRUCT_STAT st, st2;
int i;
char *ret = NULL;
@@ -835,14 +835,14 @@ char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn)
NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
{
#ifdef REALPATH_TAKES_NULL
- BOOL free_resolved_name = True;
+ bool free_resolved_name = True;
#else
#ifdef PATH_MAX
char resolved_name_buf[PATH_MAX+1];
#else
pstring resolved_name_buf;
#endif
- BOOL free_resolved_name = False;
+ bool free_resolved_name = False;
#endif
char *resolved_name = NULL;
size_t con_path_len = strlen(conn->connectpath);