summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-10-06 22:28:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:55 -0500
commit2151cde58014ea2e822c13d2f8a369b45dc19ca8 (patch)
treeb0cd4c5b394e636232f417bcf482da87d1e18975 /source4/torture/raw
parent05e7c481465e3065effaf21b43636d6605d7c313 (diff)
downloadsamba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.tar.gz
samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.tar.bz2
samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.zip
r25554: Convert last instances of BOOL, True and False to the standard types.
(This used to be commit 566aa14139510788548a874e9213d91317f83ca9)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/acls.c64
-rw-r--r--source4/torture/raw/chkpath.c26
-rw-r--r--source4/torture/raw/composite.c48
-rw-r--r--source4/torture/raw/context.c68
-rw-r--r--source4/torture/raw/eas.c42
-rw-r--r--source4/torture/raw/ioctl.c20
-rw-r--r--source4/torture/raw/lock.c100
-rw-r--r--source4/torture/raw/lockbench.c8
-rw-r--r--source4/torture/raw/mkdir.c8
-rw-r--r--source4/torture/raw/mux.c28
-rw-r--r--source4/torture/raw/notify.c160
-rw-r--r--source4/torture/raw/open.c220
-rw-r--r--source4/torture/raw/openbench.c12
-rw-r--r--source4/torture/raw/oplock.c40
-rwxr-xr-xsource4/torture/raw/pingpong.c10
-rw-r--r--source4/torture/raw/qfileinfo.c66
-rw-r--r--source4/torture/raw/qfsinfo.c20
-rw-r--r--source4/torture/raw/read.c78
-rw-r--r--source4/torture/raw/rename.c12
-rw-r--r--source4/torture/raw/samba3hide.c78
-rw-r--r--source4/torture/raw/samba3misc.c56
-rw-r--r--source4/torture/raw/search.c102
-rw-r--r--source4/torture/raw/seek.c18
-rw-r--r--source4/torture/raw/setfileinfo.c36
-rw-r--r--source4/torture/raw/streams.c24
-rw-r--r--source4/torture/raw/unlink.c10
-rw-r--r--source4/torture/raw/write.c70
27 files changed, 712 insertions, 712 deletions
diff --git a/source4/torture/raw/acls.c b/source4/torture/raw/acls.c
index ab112658e2..2c3f4a52c6 100644
--- a/source4/torture/raw/acls.c
+++ b/source4/torture/raw/acls.c
@@ -35,7 +35,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -46,7 +46,7 @@ static bool test_sd(struct torture_context *tctx,
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\sd.txt";
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -113,7 +113,7 @@ static bool test_sd(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd);
- ret = False;
+ ret = false;
}
printf("remove it again\n");
@@ -226,7 +226,7 @@ static bool test_nttrans_create(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd);
- ret = False;
+ ret = false;
}
done:
@@ -243,7 +243,7 @@ done:
if (_q.access_information.out.access_flags != (flags)) { \
printf("(%s) Incorrect access_flags 0x%08x - should be 0x%08x\n", \
__location__, _q.access_information.out.access_flags, (flags)); \
- ret = False; \
+ ret = false; \
goto done; \
} \
} while (0)
@@ -259,7 +259,7 @@ static bool test_creator_sid(struct torture_context *tctx,
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\creator.txt";
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -358,7 +358,7 @@ static bool test_creator_sid(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd);
- ret = False;
+ ret = false;
}
printf("try open for write\n");
@@ -418,7 +418,7 @@ static bool test_creator_sid(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd2);
- ret = False;
+ ret = false;
}
@@ -471,7 +471,7 @@ static bool test_generic_bits(struct torture_context *tctx,
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\generic.txt";
- BOOL ret = True;
+ bool ret = true;
int fnum = -1, i;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -499,8 +499,8 @@ static bool test_generic_bits(struct torture_context *tctx,
{ SEC_GENERIC_EXECUTE, SEC_RIGHTS_DIR_EXECUTE },
{ SEC_GENERIC_ALL, SEC_RIGHTS_DIR_ALL }
};
- BOOL has_restore_privilege;
- BOOL has_take_ownership_privilege;
+ bool has_restore_privilege;
+ bool has_take_ownership_privilege;
printf("TESTING FILE GENERIC BITS\n");
@@ -599,7 +599,7 @@ static bool test_generic_bits(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd2);
- ret = False;
+ ret = false;
}
io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -647,7 +647,7 @@ static bool test_generic_bits(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd2);
- ret = False;
+ ret = false;
}
io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -764,7 +764,7 @@ static bool test_generic_bits(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd2);
- ret = False;
+ ret = false;
}
io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -812,7 +812,7 @@ static bool test_generic_bits(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd2);
- ret = False;
+ ret = false;
}
io.ntcreatex.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -846,14 +846,14 @@ static bool test_owner_bits(struct torture_context *tctx,
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\generic.txt";
- BOOL ret = True;
+ bool ret = true;
int fnum = -1, i;
union smb_fileinfo q;
union smb_setfileinfo set;
struct security_descriptor *sd, *sd_orig;
const char *owner_sid;
- BOOL has_restore_privilege;
- BOOL has_take_ownership_privilege;
+ bool has_restore_privilege;
+ bool has_take_ownership_privilege;
uint32_t expected_bits;
printf("TESTING FILE OWNER BITS\n");
@@ -966,7 +966,7 @@ static bool test_inheritance(struct torture_context *tctx,
const char *dname = BASEDIR "\\inheritance";
const char *fname1 = BASEDIR "\\inheritance\\testfile";
const char *fname2 = BASEDIR "\\inheritance\\testdir";
- BOOL ret = True;
+ bool ret = true;
int fnum=0, fnum2, i;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -1175,7 +1175,7 @@ static bool test_inheritance(struct torture_context *tctx,
sd_orig->owner_sid)) {
printf("Bad sd in child file at %d\n", i);
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
- ret = False;
+ ret = false;
goto check_dir;
}
@@ -1186,7 +1186,7 @@ static bool test_inheritance(struct torture_context *tctx,
test_flags[i].file_flags,
test_flags[i].parent_flags,
i);
- ret = False;
+ ret = false;
}
check_dir:
@@ -1224,7 +1224,7 @@ static bool test_inheritance(struct torture_context *tctx,
printf("Bad sd in child dir at %d (parent 0x%x)\n",
i, test_flags[i].parent_flags);
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
- ret = False;
+ ret = false;
continue;
}
} else if (test_flags[i].parent_flags & SEC_ACE_FLAG_CONTAINER_INHERIT) {
@@ -1242,7 +1242,7 @@ static bool test_inheritance(struct torture_context *tctx,
printf("Bad sd in child dir at %d (parent 0x%x)\n",
i, test_flags[i].parent_flags);
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
- ret = False;
+ ret = false;
continue;
}
} else {
@@ -1255,7 +1255,7 @@ static bool test_inheritance(struct torture_context *tctx,
printf("Bad sd in child dir at %d (parent 0x%x)\n",
i, test_flags[i].parent_flags);
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
- ret = False;
+ ret = false;
continue;
}
}
@@ -1308,7 +1308,7 @@ static bool test_inheritance(struct torture_context *tctx,
NDR_PRINT_DEBUG(security_descriptor, q.query_secdesc.out.sd);
printf("expected:\n");
NDR_PRINT_DEBUG(security_descriptor, sd2);
- ret = False;
+ ret = false;
}
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
@@ -1316,7 +1316,7 @@ static bool test_inheritance(struct torture_context *tctx,
status = smb_raw_open(cli->tree, tctx, &io);
if (NT_STATUS_IS_OK(status)) {
printf("failed: w2k3 ACL bug (allowed open when ACL should deny)\n");
- ret = False;
+ ret = false;
fnum2 = io.ntcreatex.out.file.fnum;
CHECK_ACCESS_FLAGS(fnum2, SEC_RIGHTS_FILE_ALL);
smbcli_close(cli->tree, fnum2);
@@ -1382,14 +1382,14 @@ done:
/*
test dynamic acl inheritance
*/
-static BOOL test_inheritance_dynamic(struct torture_context *tctx,
+static bool test_inheritance_dynamic(struct torture_context *tctx,
struct smbcli_state *cli)
{
NTSTATUS status;
union smb_open io;
const char *dname = BASEDIR "\\inheritance";
const char *fname1 = BASEDIR "\\inheritance\\testfile";
- BOOL ret = True;
+ bool ret = true;
int fnum=0, fnum2;
union smb_fileinfo q;
union smb_setfileinfo set;
@@ -1399,7 +1399,7 @@ static BOOL test_inheritance_dynamic(struct torture_context *tctx,
printf("TESTING DYNAMIC ACL INHERITANCE\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
io.generic.level = RAW_OPEN_NTCREATEX;
@@ -1533,14 +1533,14 @@ done:
if (!(granted & access)) {\
printf("(%s) %s but flags 0x%08X are not granted! granted[0x%08X] desired[0x%08X]\n", \
__location__, nt_errstr(status), access, granted, desired); \
- ret = False; \
+ ret = false; \
goto done; \
} \
} else { \
if (granted & access) {\
printf("(%s) %s but flags 0x%08X are granted! granted[0x%08X] desired[0x%08X]\n", \
__location__, nt_errstr(status), access, granted, desired); \
- ret = False; \
+ ret = false; \
goto done; \
} \
} \
@@ -1552,7 +1552,7 @@ static bool test_sd_get_set(struct torture_context *tctx,
struct smbcli_state *cli)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
union smb_open io;
union smb_fileinfo fi;
union smb_setfileinfo si;
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c
index 6240584a68..42a3c3cebe 100644
--- a/source4/torture/raw/chkpath.c
+++ b/source4/torture/raw/chkpath.c
@@ -29,7 +29,7 @@
if (!NT_STATUS_EQUAL(status, correct) && !NT_STATUS_EQUAL(status, dos_correct)) { \
printf("(%d) Incorrect status %s - should be %s\n", \
__LINE__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -54,7 +54,7 @@ static NTSTATUS single_search(struct smbcli_state *cli,
return status;
}
-static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected)
+static bool test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected)
{
union smb_chkpath io;
NTSTATUS status;
@@ -63,19 +63,19 @@ static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expec
if (!NT_STATUS_EQUAL(status, expected) && !NT_STATUS_EQUAL(status, dos_expected)) {
printf("%-40s FAILED %s should be %s or %s\n",
path, nt_errstr(status), nt_errstr(expected), nt_errstr(dos_expected));
- return False;
+ return false;
} else {
printf("%-40s correct (%s)\n", path, nt_errstr(status));
}
- return True;
+ return true;
}
-static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_chkpath io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
int fnum1 = -1;
@@ -89,7 +89,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt..");
if (fnum == -1) {
printf("failed to open test.txt - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -97,7 +97,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (!torture_set_file_attribute(cli->tree, BASEDIR, FILE_ATTRIBUTE_HIDDEN)) {
printf("failed to set basedir hidden\n");
- ret = False;
+ ret = false;
goto done;
}
@@ -221,28 +221,28 @@ bool torture_raw_chkpath(struct torture_context *torture,
int fnum;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt"))) {
printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree));
- return False;
+ return false;
}
if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\V S"))) {
printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree));
- return False;
+ return false;
}
if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\V S\\VB98"))) {
printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree));
- return False;
+ return false;
}
fnum = create_complex_file(cli, torture, BASEDIR "\\nt\\V S\\VB98\\vb6.exe");
if (fnum == -1) {
printf("failed to open \\nt\\V S\\VB98\\vb6.exe - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index d713ff321e..c6969574a8 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -43,7 +43,7 @@ static void loadfile_complete(struct composite_context *c)
/*
test a simple savefile/loadfile combination
*/
-static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
const char *fname = BASEDIR "\\test.txt";
NTSTATUS status;
@@ -69,7 +69,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_savefile(cli->tree, &io1);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) savefile failed: %s\n", __location__,nt_errstr(status));
- return False;
+ return false;
}
io2.in.fname = fname;
@@ -98,30 +98,30 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_loadfile_recv(c[i], mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) loadfile[%d] failed - %s\n", __location__, i, nt_errstr(status));
- return False;
+ return false;
}
if (io2.out.size != len) {
printf("(%s) wrong length in returned data - %d should be %d\n",__location__,
io2.out.size, (int)len);
- return False;
+ return false;
}
if (memcmp(io2.out.data, data, len) != 0) {
printf("(%s) wrong data in loadfile!\n",__location__);
- return False;
+ return false;
}
}
talloc_free(data);
- return True;
+ return true;
}
/*
test a simple savefile/loadfile combination
*/
-static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
const char *fname = BASEDIR "\\test.txt";
NTSTATUS status;
@@ -134,7 +134,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
extern int torture_numops;
struct event_context *event_ctx;
int *count = talloc_zero(mem_ctx, int);
- BOOL ret = True;
+ bool ret = true;
data = talloc_array(mem_ctx, uint8_t, len);
@@ -149,7 +149,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_savefile(cli->tree, &io1);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) savefile failed: %s\n",__location__, nt_errstr(status));
- return False;
+ return false;
}
io2.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host");
@@ -189,7 +189,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) loadfile[%d] failed - %s\n", __location__, i,
nt_errstr(status));
- ret = False;
+ ret = false;
continue;
}
@@ -197,13 +197,13 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("(%s) wrong length in returned data - %d "
"should be %d\n", __location__,
io2.out.size, (int)len);
- ret = False;
+ ret = false;
continue;
}
if (memcmp(io2.out.data, data, len) != 0) {
printf("(%s) wrong data in loadfile!\n", __location__);
- ret = False;
+ ret = false;
continue;
}
}
@@ -214,7 +214,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/*
test setfileacl
*/
-static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
struct smb_composite_appendacl **io;
struct smb_composite_appendacl **io_orig;
@@ -244,7 +244,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_savefile(cli->tree, &io1);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) savefile failed: %s\n", __location__, nt_errstr(status));
- return False;
+ return false;
}
io_orig[i] = talloc (io_orig, struct smb_composite_appendacl);
@@ -253,7 +253,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_appendacl(cli->tree, io_orig[i], io_orig[i]);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) appendacl failed: %s\n", __location__, nt_errstr(status));
- return False;
+ return false;
}
}
@@ -273,7 +273,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = security_descriptor_dacl_add(test_sd, ace);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) appendacl failed: %s\n", __location__, nt_errstr(status));
- return False;
+ return false;
}
/* set parameters for appendacl async call */
@@ -308,13 +308,13 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_appendacl_recv(c[i], io[i]);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) appendacl[%d] failed - %s\n", __location__, i, nt_errstr(status));
- return False;
+ return false;
}
security_descriptor_dacl_add(io_orig[i]->out.sd, ace);
if (!security_acl_equal(io_orig[i]->out.sd->dacl, io[i]->out.sd->dacl)) {
printf("(%s) appendacl[%d] failed - needed acl isn't set\n", __location__, i);
- return False;
+ return false;
}
}
@@ -323,11 +323,11 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
talloc_free (test_sid);
talloc_free (test_sd);
- return True;
+ return true;
}
/* test a query FS info by asking for share's GUID */
-static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
char *guid = NULL;
NTSTATUS status;
@@ -338,7 +338,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
extern int torture_numops;
struct event_context *event_ctx;
int *count = talloc_zero(mem_ctx, int);
- BOOL ret = True;
+ bool ret = true;
io1.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host");
io1.in.port = 0;
@@ -375,7 +375,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_composite_fsinfo_recv(c[i], mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) fsinfo[%d] failed - %s\n", __location__, i, nt_errstr(status));
- ret = False;
+ ret = false;
continue;
}
@@ -383,7 +383,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("(%s) wrong level in returned info - %d "
"should be %d\n", __location__,
io1.out.fsinfo->generic.level, RAW_QFS_OBJECTID_INFORMATION);
- ret = False;
+ ret = false;
continue;
}
@@ -406,7 +406,7 @@ bool torture_raw_composite(struct torture_context *tctx,
bool ret = true;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
ret &= test_fetchfile(cli, tctx);
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 8c1c14d783..11ad11ab3f 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -35,7 +35,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -43,7 +43,7 @@
if ((v) != (correct)) { \
printf("(%s) Incorrect value %s=%d - should be %d\n", \
__location__, #v, v, correct); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -51,7 +51,7 @@
if ((v) == (correct)) { \
printf("(%s) Incorrect value %s=%d - should not be %d\n", \
__location__, #v, v, correct); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -59,10 +59,10 @@
/*
test session ops
*/
-static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
struct smbcli_session *session;
struct smbcli_session *session2;
struct smbcli_session *session3;
@@ -84,11 +84,11 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING SESSION HANDLING\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("create a second security context on the same transport\n");
- session = smbcli_session_init(cli->transport, mem_ctx, False);
+ session = smbcli_session_init(cli->transport, mem_ctx, false);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
@@ -102,7 +102,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
session->vuid = setup.out.vuid;
printf("create a third security context on the same transport, with vuid set\n");
- session2 = smbcli_session_init(cli->transport, mem_ctx, False);
+ session2 = smbcli_session_init(cli->transport, mem_ctx, false);
session2->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -129,7 +129,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
printf("create a fourth security context on the same transport, without extended security\n");
- session3 = smbcli_session_init(cli->transport, mem_ctx, False);
+ session3 = smbcli_session_init(cli->transport, mem_ctx, false);
session3->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -143,7 +143,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_LOGON_FAILURE);
printf("create a fouth anonymous security context on the same transport, without extended security\n");
- session4 = smbcli_session_init(cli->transport, mem_ctx, False);
+ session4 = smbcli_session_init(cli->transport, mem_ctx, false);
session4->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -163,7 +163,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
}
printf("use the same tree as the existing connection\n");
- tree = smbcli_tree_init(session, mem_ctx, False);
+ tree = smbcli_tree_init(session, mem_ctx, false);
tree->tid = cli->tree->tid;
printf("create a file using the new vuid\n");
@@ -229,7 +229,7 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
setups[i].in.credentials = cmdline_credentials;
- sessions[i] = smbcli_session_init(cli->transport, mem_ctx, False);
+ sessions[i] = smbcli_session_init(cli->transport, mem_ctx, false);
composite_contexts[i] = smb_composite_sesssetup_send(sessions[i], &setups[i]);
}
@@ -257,10 +257,10 @@ done:
/*
test tree ops
*/
-static BOOL test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *share, *host;
struct smbcli_tree *tree;
union smb_tcon tcon;
@@ -274,14 +274,14 @@ static BOOL test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING TREE HANDLING\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
share = lp_parm_string(global_loadparm, NULL, "torture", "share");
host = lp_parm_string(global_loadparm, NULL, "torture", "host");
printf("create a second tree context on the same session\n");
- tree = smbcli_tree_init(cli->session, mem_ctx, False);
+ tree = smbcli_tree_init(cli->session, mem_ctx, false);
tcon.generic.level = RAW_TCON_TCONX;
tcon.tconx.in.flags = 0;
@@ -362,10 +362,10 @@ done:
this demonstrates that a tcon isn't autoclosed by a ulogoff
the tcon can be reused using any other valid session later
*/
-static BOOL test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *share, *host;
struct smbcli_session *session1;
struct smbcli_session *session2;
@@ -382,14 +382,14 @@ static BOOL test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING TREE with ulogoff\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
share = lp_parm_string(global_loadparm, NULL, "torture", "share");
host = lp_parm_string(global_loadparm, NULL, "torture", "host");
printf("create the first new sessions\n");
- session1 = smbcli_session_init(cli->transport, mem_ctx, False);
+ session1 = smbcli_session_init(cli->transport, mem_ctx, false);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(global_loadparm);
@@ -400,7 +400,7 @@ static BOOL test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("vuid1=%d\n", session1->vuid);
printf("create a tree context on the with vuid1\n");
- tree = smbcli_tree_init(session1, mem_ctx, False);
+ tree = smbcli_tree_init(session1, mem_ctx, false);
tcon.generic.level = RAW_TCON_TCONX;
tcon.tconx.in.flags = 0;
tcon.tconx.in.password = data_blob(NULL, 0);
@@ -445,7 +445,7 @@ static BOOL test_tree_ulogoff(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
printf("create the second new sessions\n");
- session2 = smbcli_session_init(cli->transport, mem_ctx, False);
+ session2 = smbcli_session_init(cli->transport, mem_ctx, false);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(global_loadparm);
@@ -512,10 +512,10 @@ done:
this test demonstrates that exit() only sees the PID
used for the open() calls
*/
-static BOOL test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
union smb_open io;
union smb_write wr;
union smb_close cl;
@@ -527,7 +527,7 @@ static BOOL test_pid_exit_only_sees_open(struct smbcli_state *cli, TALLOC_CTX *m
printf("TESTING PID HANDLING exit() only cares about open() PID\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
pid1 = cli->session->pid;
@@ -620,10 +620,10 @@ done:
/*
test pid ops with 2 sessions
*/
-static BOOL test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
struct smbcli_session *session;
struct smb_composite_sesssetup setup;
union smb_open io;
@@ -637,11 +637,11 @@ static BOOL test_pid_2sess(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING PID HANDLING WITH 2 SESSIONS\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("create a second security context on the same transport\n");
- session = smbcli_session_init(cli->transport, mem_ctx, False);
+ session = smbcli_session_init(cli->transport, mem_ctx, false);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
@@ -724,10 +724,10 @@ done:
/*
test pid ops with 2 tcons
*/
-static BOOL test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *share, *host;
struct smbcli_tree *tree;
union smb_tcon tcon;
@@ -743,14 +743,14 @@ static BOOL test_pid_2tcon(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("TESTING PID HANDLING WITH 2 TCONS\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
share = lp_parm_string(global_loadparm, NULL, "torture", "share");
host = lp_parm_string(global_loadparm, NULL, "torture", "host");
printf("create a second tree context on the same session\n");
- tree = smbcli_tree_init(cli->session, mem_ctx, False);
+ tree = smbcli_tree_init(cli->session, mem_ctx, false);
tcon.generic.level = RAW_TCON_TCONX;
tcon.tconx.in.flags = 0;
@@ -869,7 +869,7 @@ done:
static bool torture_raw_context_int(struct torture_context *tctx,
struct smbcli_state *cli)
{
- BOOL ret = True;
+ bool ret = true;
ret &= test_session(cli, tctx);
ret &= test_tree(cli, tctx);
diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c
index 368a24dbae..b24b98796f 100644
--- a/source4/torture/raw/eas.c
+++ b/source4/torture/raw/eas.c
@@ -33,26 +33,26 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
-static BOOL maxeadebug; /* need that here, to allow no file delete in debug case */
+static bool maxeadebug; /* need that here, to allow no file delete in debug case */
-static BOOL check_ea(struct smbcli_state *cli,
+static bool check_ea(struct smbcli_state *cli,
const char *fname, const char *eaname, const char *value)
{
NTSTATUS status = torture_check_ea(cli, fname, eaname, value);
return NT_STATUS_IS_OK(status);
}
-static BOOL test_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
union smb_setfileinfo setfile;
union smb_open io;
const char *fname = BASEDIR "\\ea.txt";
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
printf("TESTING SETFILEINFO EA_SET\n");
@@ -208,7 +208,7 @@ static int test_one_eamax(struct smbcli_state *cli, const int fnum,
}
i -= (high - low + 1) / 2;
}
- } while (True);
+ } while (true);
return low;
}
@@ -222,21 +222,21 @@ static int test_one_eamax(struct smbcli_state *cli, const int fnum,
* maxeasize 65536 limit the max. size for a single EA name
* maxeanames 101 limit of the number of tested names
* maxeastart 1 this EA size is used to test for the 1st EA (atm)
- * maxeadebug 0 if set True, further debug output is done - in addition
+ * maxeadebug 0 if set true, further debug output is done - in addition
* the testfile is not deleted for further inspection!
*
* Set some/all of these options on the cmdline with:
* --option torture:maxeasize=1024 --option torture:maxeadebug=1 ...
*
*/
-static BOOL test_max_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_max_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\ea_max.txt";
int fnum = -1;
- BOOL ret = True;
- BOOL err = False;
+ bool ret = true;
+ bool err = false;
int i, j, k, last, total;
DATA_BLOB eablob;
@@ -255,19 +255,19 @@ static BOOL test_max_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/* Do some sanity check on possibly passed parms */
if (maxeasize <= 0) {
printf("Invalid parameter 'maxeasize=%d'",maxeasize);
- err = True;
+ err = true;
}
if (maxeanames <= 0) {
printf("Invalid parameter 'maxeanames=%d'",maxeanames);
- err = True;
+ err = true;
}
if (maxeastart <= 0) {
printf("Invalid parameter 'maxeastart=%d'",maxeastart);
- err = True;
+ err = true;
}
if (maxeadebug < 0) {
printf("Invalid parameter 'maxeadebug=%d'",maxeadebug);
- err = True;
+ err = true;
}
if (err) {
printf("\n\n");
@@ -353,7 +353,7 @@ static BOOL test_max_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf ("NOTE: More EAs could be available!\n");
}
if (total == 0) {
- ret = False;
+ ret = false;
}
done:
smbcli_close(cli->tree, fnum);
@@ -363,12 +363,12 @@ done:
/*
test using NTTRANS CREATE to create a file with an initial EA set
*/
-static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\ea2.txt";
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
struct ea_struct eas[3];
struct smb_ea_list ea_list;
@@ -450,7 +450,7 @@ bool torture_raw_eas(struct torture_context *torture, struct smbcli_state *cli)
bool ret = true;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
ret &= test_eas(cli, torture);
@@ -467,17 +467,17 @@ bool torture_raw_eas(struct torture_context *torture, struct smbcli_state *cli)
bool torture_max_eas(struct torture_context *torture)
{
struct smbcli_state *cli;
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx;
if (!torture_open_connection(&cli, 0)) {
- return False;
+ return false;
}
mem_ctx = talloc_init("torture_raw_eas");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
ret &= test_max_eas(cli, mem_ctx);
diff --git a/source4/torture/raw/ioctl.c b/source4/torture/raw/ioctl.c
index 357332c716..c4dd4c5bf2 100644
--- a/source4/torture/raw/ioctl.c
+++ b/source4/torture/raw/ioctl.c
@@ -31,18 +31,18 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%d) Incorrect status %s - should be %s\n", \
__LINE__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
/* test some ioctls */
-static BOOL test_ioctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_ioctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_ioctl ctl;
int fnum;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *fname = BASEDIR "\\test.dat";
printf("TESTING IOCTL FUNCTIONS\n");
@@ -50,7 +50,7 @@ static BOOL test_ioctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = create_complex_file(cli, mem_ctx, fname);
if (fnum == -1) {
printf("Failed to create test.dat - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -81,11 +81,11 @@ done:
}
/* test some filesystem control functions */
-static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
int fnum;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *fname = BASEDIR "\\test.dat";
union smb_ioctl nt;
@@ -94,7 +94,7 @@ static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = create_complex_file(cli, mem_ctx, fname);
if (fnum == -1) {
printf("Failed to create test.dat - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -102,7 +102,7 @@ static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
nt.ioctl.level = RAW_IOCTL_NTIOCTL;
nt.ntioctl.in.function = FSCTL_SET_SPARSE;
nt.ntioctl.in.file.fnum = fnum;
- nt.ntioctl.in.fsctl = True;
+ nt.ntioctl.in.fsctl = true;
nt.ntioctl.in.filter = 0;
nt.ntioctl.in.max_data = 0;
nt.ntioctl.in.blob = data_blob(NULL, 0);
@@ -114,7 +114,7 @@ static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
nt.ioctl.level = RAW_IOCTL_NTIOCTL;
nt.ntioctl.in.function = FSCTL_REQUEST_BATCH_OPLOCK;
nt.ntioctl.in.file.fnum = fnum;
- nt.ntioctl.in.fsctl = True;
+ nt.ntioctl.in.fsctl = true;
nt.ntioctl.in.filter = 0;
nt.ntioctl.in.max_data = 0;
nt.ntioctl.in.blob = data_blob(NULL, 0);
@@ -157,7 +157,7 @@ bool torture_raw_ioctl(struct torture_context *torture,
bool ret = true;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
ret &= test_ioctl(cli, torture);
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index f55d37330a..c2d5a778fb 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -33,7 +33,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -47,12 +47,12 @@ static bool test_lock(struct torture_context *tctx, struct smbcli_state *cli)
{
union smb_lock io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
const char *fname = BASEDIR "\\test.txt";
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_LOCK_LOCK\n");
@@ -61,7 +61,7 @@ static bool test_lock(struct torture_context *tctx, struct smbcli_state *cli)
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -183,12 +183,12 @@ static bool test_lockx(struct torture_context *tctx, struct smbcli_state *cli)
union smb_lock io;
struct smb_lock_entry lock[1];
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
const char *fname = BASEDIR "\\test.txt";
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_LOCK_LOCKX\n");
@@ -197,7 +197,7 @@ static bool test_lockx(struct torture_context *tctx, struct smbcli_state *cli)
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -363,13 +363,13 @@ static bool test_pidhigh(struct torture_context *tctx,
union smb_lock io;
struct smb_lock_entry lock[1];
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
const char *fname = BASEDIR "\\test.txt";
uint8_t c = 1;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing high pid\n");
@@ -380,13 +380,13 @@ static bool test_pidhigh(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
if (smbcli_write(cli->tree, fnum, 0, &c, 0, 1) != 1) {
printf("Failed to write 1 byte - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -405,7 +405,7 @@ static bool test_pidhigh(struct torture_context *tctx,
if (smbcli_read(cli->tree, fnum, &c, 0, 1) != 1) {
printf("Failed to read 1 byte - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -415,7 +415,7 @@ static bool test_pidhigh(struct torture_context *tctx,
if (smbcli_read(cli->tree, fnum, &c, 0, 1) == 1) {
printf("pid is incorrect handled for read with lock!\n");
- ret = False;
+ ret = false;
goto done;
}
@@ -423,7 +423,7 @@ static bool test_pidhigh(struct torture_context *tctx,
if (smbcli_read(cli->tree, fnum, &c, 0, 1) != 1) {
printf("High pid is used on this server!\n");
- ret = False;
+ ret = false;
} else {
printf("High pid is not used on this server (correct)\n");
}
@@ -450,14 +450,14 @@ static bool test_async(struct torture_context *tctx,
union smb_lock io;
struct smb_lock_entry lock[2];
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
const char *fname = BASEDIR "\\test.txt";
time_t t;
struct smbcli_request *req;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing LOCKING_ANDX_CANCEL_LOCK\n");
@@ -466,7 +466,7 @@ static bool test_async(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -492,7 +492,7 @@ static bool test_async(struct torture_context *tctx,
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -523,7 +523,7 @@ static bool test_async(struct torture_context *tctx,
if (time(NULL) > t+2) {
printf("lock cancel was not immediate (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -539,7 +539,7 @@ static bool test_async(struct torture_context *tctx,
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -555,7 +555,7 @@ static bool test_async(struct torture_context *tctx,
if (time(NULL) > t+2) {
printf("lock cancel by unlock was not immediate (%s) - took %d secs\n",
__location__, (int)(time(NULL)-t));
- ret = False;
+ ret = false;
goto done;
}
@@ -572,7 +572,7 @@ static bool test_async(struct torture_context *tctx,
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -584,12 +584,12 @@ static bool test_async(struct torture_context *tctx,
if (time(NULL) > t+2) {
printf("lock cancel by close was not immediate (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
printf("create a new sessions\n");
- session = smbcli_session_init(cli->transport, tctx, False);
+ session = smbcli_session_init(cli->transport, tctx, false);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(global_loadparm);
@@ -601,7 +601,7 @@ static bool test_async(struct torture_context *tctx,
printf("create new tree context\n");
share = lp_parm_string(global_loadparm, NULL, "torture", "share");
host = lp_parm_string(global_loadparm, NULL, "torture", "host");
- tree = smbcli_tree_init(session, tctx, False);
+ tree = smbcli_tree_init(session, tctx, false);
tcon.generic.level = RAW_TCON_TCONX;
tcon.tconx.in.flags = 0;
tcon.tconx.in.password = data_blob(NULL, 0);
@@ -616,7 +616,7 @@ static bool test_async(struct torture_context *tctx,
fnum = smbcli_open(tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to reopen %s - %s\n", fname, smbcli_errstr(tree));
- ret = False;
+ ret = false;
goto done;
}
io.lockx.level = RAW_LOCK_LOCKX;
@@ -644,7 +644,7 @@ static bool test_async(struct torture_context *tctx,
req = smb_raw_lock_send(tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -656,7 +656,7 @@ static bool test_async(struct torture_context *tctx,
if (time(NULL) > t+2) {
printf("lock cancel by exit was not immediate (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -665,7 +665,7 @@ static bool test_async(struct torture_context *tctx,
fnum = smbcli_open(tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to reopen %s - %s\n", fname, smbcli_errstr(tree));
- ret = False;
+ ret = false;
goto done;
}
io.lockx.level = RAW_LOCK_LOCKX;
@@ -693,7 +693,7 @@ static bool test_async(struct torture_context *tctx,
req = smb_raw_lock_send(tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -712,7 +712,7 @@ static bool test_async(struct torture_context *tctx,
if (time(NULL) > t+2) {
printf("lock cancel by ulogoff was not immediate (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -723,7 +723,7 @@ static bool test_async(struct torture_context *tctx,
fnum = smbcli_open(tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to reopen %s - %s\n", fname, smbcli_errstr(tree));
- ret = False;
+ ret = false;
goto done;
}
io.lockx.level = RAW_LOCK_LOCKX;
@@ -747,7 +747,7 @@ static bool test_async(struct torture_context *tctx,
req = smb_raw_lock_send(tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -759,7 +759,7 @@ static bool test_async(struct torture_context *tctx,
if (time(NULL) > t+2) {
printf("lock cancel by tdis was not immediate (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -779,7 +779,7 @@ static bool test_errorcode(struct torture_context *tctx,
union smb_open op;
struct smb_lock_entry lock[2];
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum, fnum2;
const char *fname;
struct smbcli_request *req;
@@ -787,7 +787,7 @@ static bool test_errorcode(struct torture_context *tctx,
int t;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing LOCK_NOT_GRANTED vs. FILE_LOCK_CONFLICT\n");
@@ -1105,7 +1105,7 @@ next_run:
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to reopen %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
io.lockx.level = RAW_LOCK_LOCKX;
@@ -1126,7 +1126,7 @@ next_run:
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1144,7 +1144,7 @@ next_run:
if (time(NULL) < start+1) {
printf("lock comes back to early (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1153,7 +1153,7 @@ next_run:
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to reopen %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
io.lockx.level = RAW_LOCK_LOCKX;
@@ -1174,7 +1174,7 @@ next_run:
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1194,7 +1194,7 @@ next_run:
if (time(NULL) < start+1) {
printf("lock comes back to early (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1203,7 +1203,7 @@ next_run:
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to reopen %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
io.lockx.level = RAW_LOCK_LOCKX;
@@ -1224,7 +1224,7 @@ next_run:
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
printf("Failed to setup timed lock (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1240,7 +1240,7 @@ next_run:
if (time(NULL) < start+1) {
printf("lock comes back to early (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1260,13 +1260,13 @@ static bool test_changetype(struct torture_context *tctx,
union smb_lock io;
struct smb_lock_entry lock[2];
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t c = 0;
const char *fname = BASEDIR "\\test.txt";
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing LOCKING_ANDX_CHANGE_LOCKTYPE\n");
@@ -1275,7 +1275,7 @@ static bool test_changetype(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -1294,7 +1294,7 @@ static bool test_changetype(struct torture_context *tctx,
if (smbcli_write(cli->tree, fnum, 0, &c, 100, 1) == 1) {
printf("allowed write on read locked region (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
@@ -1305,7 +1305,7 @@ static bool test_changetype(struct torture_context *tctx,
if (smbcli_write(cli->tree, fnum, 0, &c, 100, 1) == 1) {
printf("allowed write after lock change (%s)\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index d55a0a012e..855364b169 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -189,7 +189,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.service = share;
io->in.service_type = state->service_type;
io->in.credentials = cmdline_credentials;
- io->in.fallback_to_anonymous = False;
+ io->in.fallback_to_anonymous = false;
io->in.workgroup = lp_workgroup(global_loadparm);
/* kill off the remnants of the old connection */
@@ -303,9 +303,9 @@ static void report_rate(struct event_context *ev, struct timed_event *te,
/*
benchmark locking calls
*/
-BOOL torture_bench_lock(struct torture_context *torture)
+bool torture_bench_lock(struct torture_context *torture)
{
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(torture);
int i;
int timelimit = torture_setting_int(torture, "timelimit", 10);
@@ -328,7 +328,7 @@ BOOL torture_bench_lock(struct torture_context *torture)
state[i].client_num = i;
state[i].ev = ev;
if (!torture_open_connection_ev(&cli, i, ev)) {
- return False;
+ return false;
}
talloc_steal(mem_ctx, state);
state[i].tree = cli->tree;
diff --git a/source4/torture/raw/mkdir.c b/source4/torture/raw/mkdir.c
index ad7027938d..f502b10a69 100644
--- a/source4/torture/raw/mkdir.c
+++ b/source4/torture/raw/mkdir.c
@@ -30,23 +30,23 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
/*
test mkdir ops
*/
-static BOOL test_mkdir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_mkdir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_mkdir md;
struct smb_rmdir rd;
const char *path = BASEDIR "\\mkdir.dir";
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
/*
diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c
index 95ba319eea..846a9787cb 100644
--- a/source4/torture/raw/mux.c
+++ b/source4/torture/raw/mux.c
@@ -30,7 +30,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -38,12 +38,12 @@
/*
test the delayed reply to a open that leads to a sharing violation
*/
-static BOOL test_mux_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_mux_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
NTSTATUS status;
int fnum1, fnum2;
- BOOL ret = True;
+ bool ret = true;
struct smbcli_request *req1, *req2;
struct timeval tv;
double d;
@@ -104,7 +104,7 @@ static BOOL test_mux_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
d = timeval_elapsed(&tv);
if (d > 0.25) {
printf("bad timeout after cancel - %.2f should be <0.25\n", d);
- ret = False;
+ ret = false;
}
printf("close the 2nd sync open\n");
@@ -117,7 +117,7 @@ static BOOL test_mux_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
d = timeval_elapsed(&tv);
if (d > 0.25) {
printf("bad timeout for async conflict - %.2f should be <0.25\n", d);
- ret = False;
+ ret = false;
} else {
printf("async open delay %.2f\n", d);
}
@@ -141,12 +141,12 @@ done:
/*
test a write that hits a byte range lock and send the close after the write
*/
-static BOOL test_mux_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_mux_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_write io;
NTSTATUS status;
int fnum;
- BOOL ret = True;
+ bool ret = true;
struct smbcli_request *req;
printf("testing multiplexed lock/write/close\n");
@@ -154,7 +154,7 @@ static BOOL test_mux_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("open failed in mux_write - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -163,7 +163,7 @@ static BOOL test_mux_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/* lock a range */
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 0, 4, 0, WRITE_LOCK))) {
printf("lock failed in mux_write - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -197,12 +197,12 @@ done:
/*
test a lock that conflicts with an existing lock
*/
-static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_lock io;
NTSTATUS status;
int fnum;
- BOOL ret = True;
+ bool ret = true;
struct smbcli_request *req;
struct smb_lock_entry lock[1];
struct timeval t;
@@ -212,7 +212,7 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("open failed in mux_write - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -256,7 +256,7 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("async lock took %.2f msec\n", timeval_elapsed(&t) * 1000);
if (timeval_elapsed(&t) > 0.1) {
printf("failed to trigger early lock retry\n");
- return False;
+ return false;
}
printf("reopening with an exit\n");
@@ -330,7 +330,7 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("async lock exit took %.2f msec\n", timeval_elapsed(&t) * 1000);
if (timeval_elapsed(&t) > 0.1) {
printf("failed to trigger early lock failure\n");
- return False;
+ return false;
}
done:
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index d086dcbfde..96c7e4f947 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -31,7 +31,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%d) Incorrect status %s - should be %s\n", \
__LINE__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -40,14 +40,14 @@
if ((v) != (correct)) { \
printf("(%d) wrong value for %s 0x%x should be 0x%x\n", \
__LINE__, #v, (int)v, (int)correct); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
#define CHECK_WSTR(field, value, flags) do { \
if (!field.s || strcmp(field.s, value) || wire_bad_flags(&field, flags, cli->transport)) { \
printf("(%d) %s [%s] != %s\n", __LINE__, #field, field.s, value); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -55,10 +55,10 @@
/*
basic testing of change notify on directories
*/
-static BOOL test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
+static bool test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -99,7 +99,7 @@ static BOOL test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
printf("testing notify cancel\n");
@@ -159,7 +159,7 @@ static BOOL test_notify_dir(struct smbcli_state *cli, struct smbcli_state *cli2,
if (fnum3 == -1) {
printf("Failed to create %s - %s\n",
fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
talloc_free(fname);
@@ -267,7 +267,7 @@ done:
* pair in any of the three following notify_changes.
*/
-static BOOL check_rename_reply(struct smbcli_state *cli,
+static bool check_rename_reply(struct smbcli_state *cli,
int line,
struct notify_changes *actions,
uint32_t action, const char *name)
@@ -282,22 +282,22 @@ static BOOL check_rename_reply(struct smbcli_state *cli,
cli->transport))) {
printf("(%d) name [%s] != %s\n", line,
actions[i].name.s, name);
- return False;
+ return false;
}
- return True;
+ return true;
}
}
printf("(%d) expected action %d, not found\n", line, action);
- return False;
+ return false;
}
/*
testing of recursive change notify
*/
-static BOOL test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -333,10 +333,10 @@ static BOOL test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_CREATION;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req1 = smb_raw_changenotify_send(cli->tree, &notify);
- notify.nttrans.in.recursive = False;
+ notify.nttrans.in.recursive = false;
req2 = smb_raw_changenotify_send(cli->tree, &notify);
/* cancel initial requests so the buffer is setup */
@@ -357,7 +357,7 @@ static BOOL test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
smbcli_rename(cli->tree, BASEDIR "\\subname2-r", BASEDIR "\\subname3-r");
notify.nttrans.in.completion_filter = 0;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
msleep(200);
req1 = smb_raw_changenotify_send(cli->tree, &notify);
@@ -365,7 +365,7 @@ static BOOL test_notify_recursive(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
smbcli_unlink(cli->tree, BASEDIR "\\subname3-r");
- notify.nttrans.in.recursive = False;
+ notify.nttrans.in.recursive = false;
req2 = smb_raw_changenotify_send(cli->tree, &notify);
status = smb_raw_changenotify_recv(req1, mem_ctx, &notify);
@@ -426,9 +426,9 @@ done:
/*
testing of change notify mask change
*/
-static BOOL test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -464,10 +464,10 @@ static BOOL test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ct
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_ATTRIBUTES;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req1 = smb_raw_changenotify_send(cli->tree, &notify);
- notify.nttrans.in.recursive = False;
+ notify.nttrans.in.recursive = false;
req2 = smb_raw_changenotify_send(cli->tree, &notify);
/* cancel initial requests so the buffer is setup */
@@ -479,7 +479,7 @@ static BOOL test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ct
status = smb_raw_changenotify_recv(req2, mem_ctx, &notify);
CHECK_STATUS(status, NT_STATUS_CANCELLED);
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req1 = smb_raw_changenotify_send(cli->tree, &notify);
/* Set to hidden then back again. */
@@ -499,10 +499,10 @@ static BOOL test_notify_mask_change(struct smbcli_state *cli, TALLOC_CTX *mem_ct
* fnum it seems to be fixed until the fnum is closed. */
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_CREATION;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req1 = smb_raw_changenotify_send(cli->tree, &notify);
- notify.nttrans.in.recursive = False;
+ notify.nttrans.in.recursive = false;
req2 = smb_raw_changenotify_send(cli->tree, &notify);
smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name");
@@ -544,9 +544,9 @@ done:
/*
testing of mask bits for change notify
*/
-static BOOL test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -580,7 +580,7 @@ static BOOL test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
notify.nttrans.level = RAW_NOTIFY_NTTRANS;
notify.nttrans.in.buffer_size = 1000;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
#define NOTIFY_MASK_TEST(setup, op, cleanup, Action, expected, nchanges) \
do { for (mask=i=0;i<32;i++) { \
@@ -611,21 +611,21 @@ static BOOL test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
nchanges, \
notify.nttrans.out.changes[0].action, \
notify.nttrans.in.completion_filter); \
- ret = False; \
+ ret = false; \
} else if (notify.nttrans.out.changes[0].action != Action) { \
printf("ERROR: nchanges=%d action=%d expectedAction=%d filter=0x%08x\n", \
notify.nttrans.out.num_changes, \
notify.nttrans.out.changes[0].action, \
Action, \
notify.nttrans.in.completion_filter); \
- ret = False; \
+ ret = false; \
} else if (strcmp(notify.nttrans.out.changes[0].name.s, "tname1") != 0) { \
printf("ERROR: nchanges=%d action=%d filter=0x%08x name=%s\n", \
notify.nttrans.out.num_changes, \
notify.nttrans.out.changes[0].action, \
notify.nttrans.in.completion_filter, \
notify.nttrans.out.changes[0].name.s); \
- ret = False; \
+ ret = false; \
} \
mask |= (1<<i); \
} \
@@ -633,7 +633,7 @@ static BOOL test_notify_mask(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (((expected) & ~mask) != 0) { \
printf("ERROR: trigger on too few bits. mask=0x%08x expected=0x%08x\n", \
mask, expected); \
- ret = False; \
+ ret = false; \
} else { \
printf("WARNING: trigger on too many bits. mask=0x%08x expected=0x%08x\n", \
mask, expected); \
@@ -776,10 +776,10 @@ done:
/*
basic testing of change notify on files
*/
-static BOOL test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
union smb_open io;
union smb_close cl;
union smb_notify notify;
@@ -811,7 +811,7 @@ static BOOL test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
notify.nttrans.in.file.fnum = fnum;
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_STREAM_NAME;
- notify.nttrans.in.recursive = False;
+ notify.nttrans.in.recursive = false;
printf("testing if notifies on file handles are invalid (should be)\n");
@@ -836,9 +836,9 @@ done:
/*
basic testing of change notifies followed by a tdis
*/
-static BOOL test_notify_tdis(TALLOC_CTX *mem_ctx)
+static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -849,7 +849,7 @@ static BOOL test_notify_tdis(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY TDIS\n");
if (!torture_open_connection(&cli, 0)) {
- return False;
+ return false;
}
/*
@@ -878,7 +878,7 @@ static BOOL test_notify_tdis(TALLOC_CTX *mem_ctx)
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req = smb_raw_changenotify_send(cli->tree, &notify);
@@ -898,9 +898,9 @@ done:
/*
basic testing of change notifies followed by a exit
*/
-static BOOL test_notify_exit(TALLOC_CTX *mem_ctx)
+static bool test_notify_exit(TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -911,7 +911,7 @@ static BOOL test_notify_exit(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY EXIT\n");
if (!torture_open_connection(&cli, 0)) {
- return False;
+ return false;
}
/*
@@ -940,7 +940,7 @@ static BOOL test_notify_exit(TALLOC_CTX *mem_ctx)
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req = smb_raw_changenotify_send(cli->tree, &notify);
@@ -959,9 +959,9 @@ done:
/*
basic testing of change notifies followed by a ulogoff
*/
-static BOOL test_notify_ulogoff(TALLOC_CTX *mem_ctx)
+static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -972,7 +972,7 @@ static BOOL test_notify_ulogoff(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY ULOGOFF\n");
if (!torture_open_connection(&cli, 0)) {
- return False;
+ return false;
}
/*
@@ -1001,7 +1001,7 @@ static BOOL test_notify_ulogoff(TALLOC_CTX *mem_ctx)
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req = smb_raw_changenotify_send(cli->tree, &notify);
@@ -1027,9 +1027,9 @@ static void tcp_dis_handler(struct smbcli_transport *t, void *p)
/*
basic testing of change notifies followed by tcp disconnect
*/
-static BOOL test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
+static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -1040,7 +1040,7 @@ static BOOL test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY TCP DISCONNECT\n");
if (!torture_open_connection(&cli, 0)) {
- return False;
+ return false;
}
/*
@@ -1069,7 +1069,7 @@ static BOOL test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req = smb_raw_changenotify_send(cli->tree, &notify);
@@ -1086,9 +1086,9 @@ done:
/*
test setting up two change notify requests on one handle
*/
-static BOOL test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_notify notify;
union smb_open io;
@@ -1123,7 +1123,7 @@ static BOOL test_notify_double(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
notify.nttrans.in.file.fnum = fnum;
- notify.nttrans.in.recursive = True;
+ notify.nttrans.in.recursive = true;
req1 = smb_raw_changenotify_send(cli->tree, &notify);
req2 = smb_raw_changenotify_send(cli->tree, &notify);
@@ -1151,45 +1151,45 @@ done:
/*
test multiple change notifies at different depths and with/without recursion
*/
-static BOOL test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
- BOOL ret = True;
+ bool ret = true;
union smb_notify notify;
union smb_open io;
struct smbcli_request *req;
struct timeval tv;
struct {
const char *path;
- BOOL recursive;
+ bool recursive;
uint32_t filter;
int expected;
int fnum;
int counted;
} dirs[] = {
- {BASEDIR "\\abc", True, FILE_NOTIFY_CHANGE_NAME, 30 },
- {BASEDIR "\\zqy", True, FILE_NOTIFY_CHANGE_NAME, 8 },
- {BASEDIR "\\atsy", True, FILE_NOTIFY_CHANGE_NAME, 4 },
- {BASEDIR "\\abc\\foo", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\blah", True, FILE_NOTIFY_CHANGE_NAME, 13 },
- {BASEDIR "\\abc\\blah", False, FILE_NOTIFY_CHANGE_NAME, 7 },
- {BASEDIR "\\abc\\blah\\a", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\blah\\b", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\blah\\c", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\abc\\fooblah", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\zqy\\xx", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\zqy\\yyy", True, FILE_NOTIFY_CHANGE_NAME, 2 },
- {BASEDIR "\\zqy\\..", True, FILE_NOTIFY_CHANGE_NAME, 40 },
- {BASEDIR, True, FILE_NOTIFY_CHANGE_NAME, 40 },
- {BASEDIR, False,FILE_NOTIFY_CHANGE_NAME, 6 },
- {BASEDIR "\\atsy", False,FILE_NOTIFY_CHANGE_NAME, 4 },
- {BASEDIR "\\abc", True, FILE_NOTIFY_CHANGE_NAME, 24 },
- {BASEDIR "\\abc", False,FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
- {BASEDIR "\\abc", True, FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
- {BASEDIR "\\abc", True, FILE_NOTIFY_CHANGE_NAME, 24 },
+ {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_NAME, 30 },
+ {BASEDIR "\\zqy", true, FILE_NOTIFY_CHANGE_NAME, 8 },
+ {BASEDIR "\\atsy", true, FILE_NOTIFY_CHANGE_NAME, 4 },
+ {BASEDIR "\\abc\\foo", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\abc\\blah", true, FILE_NOTIFY_CHANGE_NAME, 13 },
+ {BASEDIR "\\abc\\blah", false, FILE_NOTIFY_CHANGE_NAME, 7 },
+ {BASEDIR "\\abc\\blah\\a", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\abc\\blah\\b", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\abc\\blah\\c", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\abc\\fooblah", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\zqy\\xx", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\zqy\\yyy", true, FILE_NOTIFY_CHANGE_NAME, 2 },
+ {BASEDIR "\\zqy\\..", true, FILE_NOTIFY_CHANGE_NAME, 40 },
+ {BASEDIR, true, FILE_NOTIFY_CHANGE_NAME, 40 },
+ {BASEDIR, false,FILE_NOTIFY_CHANGE_NAME, 6 },
+ {BASEDIR "\\atsy", false,FILE_NOTIFY_CHANGE_NAME, 4 },
+ {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_NAME, 24 },
+ {BASEDIR "\\abc", false,FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
+ {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_FILE_NAME, 0 },
+ {BASEDIR "\\abc", true, FILE_NOTIFY_CHANGE_NAME, 24 },
};
int i;
NTSTATUS status;
- BOOL all_done = False;
+ bool all_done = false;
printf("TESTING CHANGE NOTIFY FOR DIFFERENT DEPTHS\n");
@@ -1248,11 +1248,11 @@ static BOOL test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
dirs[i].counted += notify.nttrans.out.num_changes;
}
- all_done = True;
+ all_done = true;
for (i=0;i<ARRAY_SIZE(dirs);i++) {
if (dirs[i].counted != dirs[i].expected) {
- all_done = False;
+ all_done = false;
}
}
} while (!all_done && timeval_elapsed(&tv) < 20);
@@ -1263,7 +1263,7 @@ static BOOL test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (dirs[i].counted != dirs[i].expected) {
printf("ERROR: i=%d expected %d got %d for '%s'\n",
i, dirs[i].expected, dirs[i].counted, dirs[i].path);
- ret = False;
+ ret = false;
}
}
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index c75d8f6bfc..c4ccc0eb17 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -41,8 +41,8 @@ enum rdwr_mode {RDWR_NONE, RDWR_RDONLY, RDWR_WRONLY, RDWR_RDWR};
static enum rdwr_mode check_rdwr(struct smbcli_tree *tree, int fnum)
{
uint8_t c = 1;
- BOOL can_read = (smbcli_read(tree, fnum, &c, 0, 1) == 1);
- BOOL can_write = (smbcli_write(tree, fnum, 0, &c, 0, 1) == 1);
+ bool can_read = (smbcli_read(tree, fnum, &c, 0, 1) == 1);
+ bool can_write = (smbcli_write(tree, fnum, 0, &c, 0, 1) == 1);
if ( can_read && can_write) return RDWR_RDWR;
if ( can_read && !can_write) return RDWR_RDONLY;
if (!can_read && can_write) return RDWR_WRONLY;
@@ -67,7 +67,7 @@ static const char *rdwr_string(enum rdwr_mode m)
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -75,7 +75,7 @@ static const char *rdwr_string(enum rdwr_mode m)
fnum = create_complex_file(cli, mem_ctx, fname); \
if (fnum == -1) { \
printf("(%s) Failed to create %s - %s\n", __location__, fname, smbcli_errstr(cli->tree)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -84,7 +84,7 @@ static const char *rdwr_string(enum rdwr_mode m)
if (m != correct) { \
printf("(%s) Incorrect readwrite mode %s - expected %s\n", \
__location__, rdwr_string(m), rdwr_string(correct)); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_TIME(t, field) do { \
@@ -101,7 +101,7 @@ static const char *rdwr_string(enum rdwr_mode m)
timestring(mem_ctx, t1), \
timestring(mem_ctx, t2)); \
dump_all_info(mem_ctx, &finfo); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_NTTIME(t, field) do { \
@@ -117,7 +117,7 @@ static const char *rdwr_string(enum rdwr_mode m)
nt_time_string(mem_ctx, t), \
nt_time_string(mem_ctx, t2)); \
dump_all_info(mem_ctx, &finfo); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_ALL_INFO(v, field) do { \
@@ -129,14 +129,14 @@ static const char *rdwr_string(enum rdwr_mode m)
printf("(%s) wrong value for field %s 0x%x - 0x%x\n", \
__location__, #field, (int)v, (int)(finfo.all_info.out.field)); \
dump_all_info(mem_ctx, &finfo); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_VAL(v, correct) do { \
if ((v) != (correct)) { \
printf("(%s) wrong value for %s 0x%x - should be 0x%x\n", \
__location__, #v, (int)(v), (int)correct); \
- ret = False; \
+ ret = false; \
}} while (0)
#define SET_ATTRIB(sattrib) do { \
@@ -154,14 +154,14 @@ static const char *rdwr_string(enum rdwr_mode m)
/*
test RAW_OPEN_OPEN
*/
-static BOOL test_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
union smb_fileinfo finfo;
const char *fname = BASEDIR "\\torture_open.txt";
NTSTATUS status;
int fnum = -1, fnum2;
- BOOL ret = True;
+ bool ret = true;
printf("Checking RAW_OPEN_OPEN\n");
@@ -265,7 +265,7 @@ done:
/*
test RAW_OPEN_OPENX
*/
-static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
union smb_fileinfo finfo;
@@ -273,26 +273,26 @@ static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname_exe = BASEDIR "\\torture_openx.exe";
NTSTATUS status;
int fnum = -1, fnum2;
- BOOL ret = True;
+ bool ret = true;
int i;
struct timeval tv;
struct {
uint16_t open_func;
- BOOL with_file;
+ bool with_file;
NTSTATUS correct_status;
} open_funcs[] = {
- { OPENX_OPEN_FUNC_OPEN, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_OPEN, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, False, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_FAIL, True, NT_STATUS_DOS(ERRDOS, ERRbadaccess) },
- { OPENX_OPEN_FUNC_FAIL, False, NT_STATUS_DOS(ERRDOS, ERRbadaccess) },
- { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, True, NT_STATUS_OBJECT_NAME_COLLISION },
- { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, False, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_TRUNC, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_TRUNC, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, False, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_OPEN, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_OPEN, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_FAIL, true, NT_STATUS_DOS(ERRDOS, ERRbadaccess) },
+ { OPENX_OPEN_FUNC_FAIL, false, NT_STATUS_DOS(ERRDOS, ERRbadaccess) },
+ { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, true, NT_STATUS_OBJECT_NAME_COLLISION },
+ { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_TRUNC, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_TRUNC, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
};
printf("Checking RAW_OPEN_OPENX\n");
@@ -314,7 +314,7 @@ static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = create_complex_file(cli, mem_ctx, fname);
if (fnum == -1) {
d_printf("Failed to create file %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum);
@@ -325,7 +325,7 @@ static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("(%s) incorrect status %s should be %s (i=%d with_file=%d open_func=0x%x)\n",
__location__, nt_errstr(status), nt_errstr(open_funcs[i].correct_status),
i, (int)open_funcs[i].with_file, (int)open_funcs[i].open_func);
- ret = False;
+ ret = false;
}
if (NT_STATUS_IS_OK(status)) {
smbcli_close(cli->tree, io.openx.out.file.fnum);
@@ -358,7 +358,7 @@ static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/* check the fields when the file already existed */
fnum2 = create_complex_file(cli, mem_ctx, fname);
if (fnum2 == -1) {
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum2);
@@ -426,7 +426,7 @@ static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (timeval_elapsed(&tv) > 3.0) {
printf("(%s) Incorrect timing in openx with timeout - waited %.2f seconds\n",
__location__, timeval_elapsed(&tv));
- ret = False;
+ ret = false;
}
smbcli_close(cli->tree, fnum);
smbcli_unlink(cli->tree, fname);
@@ -495,7 +495,7 @@ done:
many thanks to kukks for a sniff showing how this works with os2->w2k
*/
-static BOOL test_t2open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_t2open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
union smb_fileinfo finfo;
@@ -504,31 +504,31 @@ static BOOL test_t2open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *fname = BASEDIR "\\torture_t2open_3.txt";
NTSTATUS status;
int fnum;
- BOOL ret = True;
+ bool ret = true;
int i;
struct {
uint16_t open_func;
- BOOL with_file;
+ bool with_file;
NTSTATUS correct_status;
} open_funcs[] = {
- { OPENX_OPEN_FUNC_OPEN, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_OPEN, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, False, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_FAIL, True, NT_STATUS_OBJECT_NAME_COLLISION },
- { OPENX_OPEN_FUNC_FAIL, False, NT_STATUS_OBJECT_NAME_COLLISION },
- { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, True, NT_STATUS_OBJECT_NAME_COLLISION },
- { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, False, NT_STATUS_OBJECT_NAME_COLLISION },
- { OPENX_OPEN_FUNC_TRUNC, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_TRUNC, False, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, True, NT_STATUS_OK },
- { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, False, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_OPEN, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_OPEN, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_FAIL, true, NT_STATUS_OBJECT_NAME_COLLISION },
+ { OPENX_OPEN_FUNC_FAIL, false, NT_STATUS_OBJECT_NAME_COLLISION },
+ { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, true, NT_STATUS_OBJECT_NAME_COLLISION },
+ { OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OBJECT_NAME_COLLISION },
+ { OPENX_OPEN_FUNC_TRUNC, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_TRUNC, false, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, true, NT_STATUS_OK },
+ { OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
};
fnum = create_complex_file(cli, mem_ctx, fname1);
if (fnum == -1) {
d_printf("Failed to create file %s - %s\n", fname1, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum);
@@ -580,7 +580,7 @@ static BOOL test_t2open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("(%s) incorrect status %s should be %s (i=%d with_file=%d open_func=0x%x)\n",
__location__, nt_errstr(status), nt_errstr(open_funcs[i].correct_status),
i, (int)open_funcs[i].with_file, (int)open_funcs[i].open_func);
- ret = False;
+ ret = false;
}
if (NT_STATUS_IS_OK(status)) {
smbcli_close(cli->tree, io.t2open.out.file.fnum);
@@ -660,7 +660,7 @@ done:
/*
test RAW_OPEN_NTCREATEX
*/
-static BOOL test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
union smb_fileinfo finfo;
@@ -668,27 +668,27 @@ static BOOL test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *dname = BASEDIR "\\torture_ntcreatex.dir";
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
int i;
struct {
uint32_t open_disp;
- BOOL with_file;
+ bool with_file;
NTSTATUS correct_status;
} open_funcs[] = {
- { NTCREATEX_DISP_SUPERSEDE, True, NT_STATUS_OK },
- { NTCREATEX_DISP_SUPERSEDE, False, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { NTCREATEX_DISP_CREATE, True, NT_STATUS_OBJECT_NAME_COLLISION },
- { NTCREATEX_DISP_CREATE, False, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN_IF, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN_IF, False, NT_STATUS_OK },
- { NTCREATEX_DISP_OVERWRITE, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OVERWRITE, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { NTCREATEX_DISP_OVERWRITE_IF, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OVERWRITE_IF, False, NT_STATUS_OK },
- { 6, True, NT_STATUS_INVALID_PARAMETER },
- { 6, False, NT_STATUS_INVALID_PARAMETER },
+ { NTCREATEX_DISP_SUPERSEDE, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_SUPERSEDE, false, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { NTCREATEX_DISP_CREATE, true, NT_STATUS_OBJECT_NAME_COLLISION },
+ { NTCREATEX_DISP_CREATE, false, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN_IF, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN_IF, false, NT_STATUS_OK },
+ { NTCREATEX_DISP_OVERWRITE, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OVERWRITE, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { NTCREATEX_DISP_OVERWRITE_IF, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OVERWRITE_IF, false, NT_STATUS_OK },
+ { 6, true, NT_STATUS_INVALID_PARAMETER },
+ { 6, false, NT_STATUS_INVALID_PARAMETER },
};
printf("Checking RAW_OPEN_NTCREATEX\n");
@@ -713,7 +713,7 @@ static BOOL test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR|O_TRUNC, DENY_NONE);
if (fnum == -1) {
d_printf("Failed to create file %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum);
@@ -724,7 +724,7 @@ static BOOL test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("(%s) incorrect status %s should be %s (i=%d with_file=%d open_disp=%d)\n",
__location__, nt_errstr(status), nt_errstr(open_funcs[i].correct_status),
i, (int)open_funcs[i].with_file, (int)open_funcs[i].open_disp);
- ret = False;
+ ret = false;
}
if (NT_STATUS_IS_OK(status) || open_funcs[i].with_file) {
smbcli_close(cli->tree, io.ntcreatex.out.file.fnum);
@@ -756,7 +756,7 @@ static BOOL test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
smbcli_unlink(cli->tree, fname);
fnum = create_complex_file(cli, mem_ctx, fname);
if (fnum == -1) {
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum);
@@ -833,7 +833,7 @@ done:
/*
test RAW_OPEN_NTTRANS_CREATE
*/
-static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
union smb_fileinfo finfo;
@@ -841,27 +841,27 @@ static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
const char *dname = BASEDIR "\\torture_ntcreatex.dir";
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
int i;
struct {
uint32_t open_disp;
- BOOL with_file;
+ bool with_file;
NTSTATUS correct_status;
} open_funcs[] = {
- { NTCREATEX_DISP_SUPERSEDE, True, NT_STATUS_OK },
- { NTCREATEX_DISP_SUPERSEDE, False, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { NTCREATEX_DISP_CREATE, True, NT_STATUS_OBJECT_NAME_COLLISION },
- { NTCREATEX_DISP_CREATE, False, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN_IF, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OPEN_IF, False, NT_STATUS_OK },
- { NTCREATEX_DISP_OVERWRITE, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OVERWRITE, False, NT_STATUS_OBJECT_NAME_NOT_FOUND },
- { NTCREATEX_DISP_OVERWRITE_IF, True, NT_STATUS_OK },
- { NTCREATEX_DISP_OVERWRITE_IF, False, NT_STATUS_OK },
- { 6, True, NT_STATUS_INVALID_PARAMETER },
- { 6, False, NT_STATUS_INVALID_PARAMETER },
+ { NTCREATEX_DISP_SUPERSEDE, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_SUPERSEDE, false, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { NTCREATEX_DISP_CREATE, true, NT_STATUS_OBJECT_NAME_COLLISION },
+ { NTCREATEX_DISP_CREATE, false, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN_IF, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OPEN_IF, false, NT_STATUS_OK },
+ { NTCREATEX_DISP_OVERWRITE, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OVERWRITE, false, NT_STATUS_OBJECT_NAME_NOT_FOUND },
+ { NTCREATEX_DISP_OVERWRITE_IF, true, NT_STATUS_OK },
+ { NTCREATEX_DISP_OVERWRITE_IF, false, NT_STATUS_OK },
+ { 6, true, NT_STATUS_INVALID_PARAMETER },
+ { 6, false, NT_STATUS_INVALID_PARAMETER },
};
printf("Checking RAW_OPEN_NTTRANS_CREATE\n");
@@ -888,7 +888,7 @@ static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR|O_TRUNC, DENY_NONE);
if (fnum == -1) {
d_printf("Failed to create file %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum);
@@ -899,7 +899,7 @@ static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("(%s) incorrect status %s should be %s (i=%d with_file=%d open_disp=%d)\n",
__location__, nt_errstr(status), nt_errstr(open_funcs[i].correct_status),
i, (int)open_funcs[i].with_file, (int)open_funcs[i].open_disp);
- ret = False;
+ ret = false;
}
if (NT_STATUS_IS_OK(status) || open_funcs[i].with_file) {
smbcli_close(cli->tree, io.ntcreatex.out.file.fnum);
@@ -931,7 +931,7 @@ static BOOL test_nttrans_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
smbcli_unlink(cli->tree, fname);
fnum = create_complex_file(cli, mem_ctx, fname);
if (fnum == -1) {
- ret = False;
+ ret = false;
goto done;
}
smbcli_close(cli->tree, fnum);
@@ -1012,14 +1012,14 @@ done:
open_disposition==NTCREATEX_DISP_OVERWRITE_IF. Windows 2003 allows the
second open.
*/
-static BOOL test_ntcreatex_brlocked(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_ntcreatex_brlocked(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io, io1;
union smb_lock io2;
struct smb_lock_entry lock[1];
const char *fname = BASEDIR "\\torture_ntcreatex.txt";
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
printf("Testing ntcreatex with a byte range locked file\n");
@@ -1082,13 +1082,13 @@ static BOOL test_ntcreatex_brlocked(struct smbcli_state *cli, TALLOC_CTX *mem_ct
/*
test RAW_OPEN_MKNEW
*/
-static BOOL test_mknew(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_mknew(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
const char *fname = BASEDIR "\\torture_mknew.txt";
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
time_t basetime = (time(NULL) + 3600*24*3) & ~1;
union smb_fileinfo finfo;
@@ -1137,13 +1137,13 @@ done:
/*
test RAW_OPEN_CREATE
*/
-static BOOL test_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
const char *fname = BASEDIR "\\torture_create.txt";
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
time_t basetime = (time(NULL) + 3600*24*3) & ~1;
union smb_fileinfo finfo;
@@ -1193,12 +1193,12 @@ done:
/*
test RAW_OPEN_CTEMP
*/
-static BOOL test_ctemp(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_ctemp(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
time_t basetime = (time(NULL) + 3600*24*3) & ~1;
union smb_fileinfo finfo;
const char *name, *fname = NULL;
@@ -1236,13 +1236,13 @@ done:
/*
test chained RAW_OPEN_OPENX_READX
*/
-static BOOL test_chained(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_chained(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
const char *fname = BASEDIR "\\torture_chained.txt";
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
const char *buf = "test";
char buf2[4];
@@ -1278,7 +1278,7 @@ static BOOL test_chained(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (memcmp(buf, buf2, sizeof(buf)) != 0) {
d_printf("wrong data in reply buffer\n");
- ret = False;
+ ret = false;
}
done:
@@ -1293,13 +1293,13 @@ done:
NetApp filers are known to fail on this.
*/
-static BOOL test_no_leading_slash(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_no_leading_slash(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
const char *fname = BASEDIR "\\torture_no_leading_slash.txt";
NTSTATUS status;
int fnum = -1;
- BOOL ret = True;
+ bool ret = true;
const char *buf = "test";
printf("Checking RAW_OPEN_OPENX without leading slash on path\n");
@@ -1335,13 +1335,13 @@ done:
/* A little torture test to expose a race condition in Samba 3.0.20 ... :-) */
-static BOOL test_raw_open_multi(void)
+static bool test_raw_open_multi(void)
{
struct smbcli_state *cli;
TALLOC_CTX *mem_ctx = talloc_init("torture_test_oplock_multi");
const char *fname = "\\test_oplock.dat";
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
union smb_open io;
struct smbcli_state **clients;
struct smbcli_request **requests;
@@ -1360,11 +1360,11 @@ static BOOL test_raw_open_multi(void)
if ((ev == NULL) || (clients == NULL) || (requests == NULL) ||
(ios == NULL)) {
DEBUG(0, ("talloc failed\n"));
- return False;
+ return false;
}
if (!torture_open_connection_share(mem_ctx, &cli, host, share, ev)) {
- return False;
+ return false;
}
cli->tree->session->transport->options.request_timeout = 60000;
@@ -1373,7 +1373,7 @@ static BOOL test_raw_open_multi(void)
if (!torture_open_connection_share(mem_ctx, &(clients[i]),
host, share, ev)) {
DEBUG(0, ("Could not open %d'th connection\n", i));
- return False;
+ return false;
}
clients[i]->tree->session->transport->
options.request_timeout = 60000;
@@ -1405,19 +1405,19 @@ static BOOL test_raw_open_multi(void)
requests[i] = smb_raw_open_send(clients[i]->tree, &ios[i]);
if (requests[i] == NULL) {
DEBUG(0, ("could not send %d'th request\n", i));
- return False;
+ return false;
}
}
DEBUG(10, ("waiting for replies\n"));
while (1) {
- BOOL unreplied = False;
+ bool unreplied = false;
for (i=0; i<num_files; i++) {
if (requests[i] == NULL) {
continue;
}
if (requests[i]->state < SMBCLI_REQUEST_DONE) {
- unreplied = True;
+ unreplied = true;
break;
}
status = smb_raw_open_recv(requests[i], mem_ctx,
@@ -1443,12 +1443,12 @@ static BOOL test_raw_open_multi(void)
if (event_loop_once(ev) != 0) {
DEBUG(0, ("event_loop_once failed\n"));
- return False;
+ return false;
}
}
if ((num_ok != 1) || (num_ok + num_collision != num_files)) {
- ret = False;
+ ret = false;
}
for (i=0; i<num_files; i++) {
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index dcba73dfff..a53efb3a8b 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -127,7 +127,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.service = share;
io->in.service_type = state->service_type;
io->in.credentials = cmdline_credentials;
- io->in.fallback_to_anonymous = False;
+ io->in.fallback_to_anonymous = false;
io->in.workgroup = lp_workgroup(global_loadparm);
/* kill off the remnants of the old connection */
@@ -338,9 +338,9 @@ static void report_rate(struct event_context *ev, struct timed_event *te,
/*
benchmark open calls
*/
-BOOL torture_bench_open(struct torture_context *torture)
+bool torture_bench_open(struct torture_context *torture)
{
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(torture);
int i;
int timelimit = torture_setting_int(torture, "timelimit", 10);
@@ -348,7 +348,7 @@ BOOL torture_bench_open(struct torture_context *torture)
struct event_context *ev = event_context_find(mem_ctx);
struct benchopen_state *state;
int total = 0, minops=0;
- bool progress=False;
+ bool progress=false;
progress = torture_setting_bool(torture, "progress", true);
@@ -362,7 +362,7 @@ BOOL torture_bench_open(struct torture_context *torture)
state[i].client_num = i;
state[i].ev = ev;
if (!torture_open_connection_ev(&state[i].cli, i, ev)) {
- return False;
+ return false;
}
talloc_steal(mem_ctx, state);
state[i].tree = state[i].cli->tree;
@@ -438,5 +438,5 @@ BOOL torture_bench_open(struct torture_context *torture)
failed:
talloc_free(mem_ctx);
- return False;
+ return false;
}
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index ad7676dcac..1f44f96b44 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -29,14 +29,14 @@
if ((v) != (correct)) { \
torture_comment(tctx, "(%s): wrong value for %s got 0x%x - should be 0x%x\n", \
__location__, #v, (int)v, (int)correct); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_STATUS(tctx, status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
torture_result(tctx, TORTURE_FAIL, __location__": Incorrect status %s - should be %s", \
nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -97,7 +97,7 @@ static void oplock_handler_close_recv(struct smbcli_request *req)
/*
a handler function for oplock break requests - close the file
*/
-static BOOL oplock_handler_close(struct smbcli_transport *transport, uint16_t tid,
+static bool oplock_handler_close(struct smbcli_transport *transport, uint16_t tid,
uint16_t fnum, uint8_t level, void *private)
{
union smb_close io;
@@ -114,13 +114,13 @@ static BOOL oplock_handler_close(struct smbcli_transport *transport, uint16_t ti
req = smb_raw_close_send(tree, &io);
if (req == NULL) {
printf("failed to send close in oplock_handler_close\n");
- return False;
+ return false;
}
req->async.fn = oplock_handler_close_recv;
req->async.private = NULL;
- return True;
+ return true;
}
static bool test_raw_oplock_normal(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
@@ -1309,10 +1309,10 @@ struct torture_suite *torture_raw_oplock(TALLOC_CTX *mem_ctx)
/*
stress testing of oplocks
*/
-BOOL torture_bench_oplock(struct torture_context *torture)
+bool torture_bench_oplock(struct torture_context *torture)
{
struct smbcli_state **cli;
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx = talloc_new(torture);
int torture_nprocs = torture_setting_int(torture, "nprocs", 4);
int i, count=0;
@@ -1326,7 +1326,7 @@ BOOL torture_bench_oplock(struct torture_context *torture)
torture_comment(torture, "Opening %d connections\n", torture_nprocs);
for (i=0;i<torture_nprocs;i++) {
if (!torture_open_connection_ev(&cli[i], i, ev)) {
- return False;
+ return false;
}
talloc_steal(mem_ctx, cli[i]);
smbcli_oplock_handler(cli[i]->transport, oplock_handler_close,
@@ -1334,7 +1334,7 @@ BOOL torture_bench_oplock(struct torture_context *torture)
}
if (!torture_setup_dir(cli[0], BASEDIR)) {
- ret = False;
+ ret = false;
goto done;
}
@@ -1397,13 +1397,13 @@ static struct hold_oplock_info {
uint32_t share_access;
uint16_t fnum;
} hold_info[] = {
- { BASEDIR "\\notshared_close", True,
+ { BASEDIR "\\notshared_close", true,
NTCREATEX_SHARE_ACCESS_NONE, },
- { BASEDIR "\\notshared_noclose", False,
+ { BASEDIR "\\notshared_noclose", false,
NTCREATEX_SHARE_ACCESS_NONE, },
- { BASEDIR "\\shared_close", True,
+ { BASEDIR "\\shared_close", true,
NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE, },
- { BASEDIR "\\shared_noclose", False,
+ { BASEDIR "\\shared_noclose", false,
NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_WRITE|NTCREATEX_SHARE_ACCESS_DELETE, },
};
@@ -1421,7 +1421,7 @@ static bool oplock_handler_hold(struct smbcli_transport *transport,
if (i == ARRAY_SIZE(hold_info)) {
printf("oplock break for unknown fnum %u\n", fnum);
- return False;
+ return false;
}
info = &hold_info[i];
@@ -1430,7 +1430,7 @@ static bool oplock_handler_hold(struct smbcli_transport *transport,
printf("oplock break on %s - closing\n",
info->fname);
oplock_handler_close(transport, tid, fnum, level, private);
- return True;
+ return true;
}
printf("oplock break on %s - acking break\n", info->fname);
@@ -1443,7 +1443,7 @@ static bool oplock_handler_hold(struct smbcli_transport *transport,
used for manual testing of oplocks - especially interaction with
other filesystems (such as NFS and local access)
*/
-BOOL torture_hold_oplock(struct torture_context *torture,
+bool torture_hold_oplock(struct torture_context *torture,
struct smbcli_state *cli)
{
struct event_context *ev =
@@ -1453,7 +1453,7 @@ BOOL torture_hold_oplock(struct torture_context *torture,
printf("Setting up open files with oplocks in %s\n", BASEDIR);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
smbcli_oplock_handler(cli->transport, oplock_handler_hold, cli->tree);
@@ -1483,14 +1483,14 @@ BOOL torture_hold_oplock(struct torture_context *torture,
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open %s - %s\n",
hold_info[i].fname, nt_errstr(status));
- return False;
+ return false;
}
if (io.ntcreatex.out.oplock_level != BATCH_OPLOCK_RETURN) {
printf("Oplock not granted for %s - expected %d but got %d\n",
hold_info[i].fname, BATCH_OPLOCK_RETURN,
io.ntcreatex.out.oplock_level);
- return False;
+ return false;
}
hold_info[i].fnum = io.ntcreatex.out.file.fnum;
}
@@ -1498,5 +1498,5 @@ BOOL torture_hold_oplock(struct torture_context *torture,
printf("Waiting for oplock events\n");
event_loop_wait(ev);
- return True;
+ return true;
}
diff --git a/source4/torture/raw/pingpong.c b/source4/torture/raw/pingpong.c
index 269208b97f..2e9de28d67 100755
--- a/source4/torture/raw/pingpong.c
+++ b/source4/torture/raw/pingpong.c
@@ -37,10 +37,10 @@
over and over until it completes.
reading from the file can be enabled with
- --option=torture:read=True
+ --option=torture:read=true
writing to the file can be enabled with
- --option=torture:write=True
+ --option=torture:write=true
*/
#include "includes.h"
@@ -148,7 +148,7 @@ static void read_byte(struct smbcli_state *cli, int fd, uint8_t *c, int offset)
io.readx.in.maxcnt = 1;
io.readx.in.offset = offset;
io.readx.in.remaining = 0;
- io.readx.in.read_for_execute = False;
+ io.readx.in.read_for_execute = false;
io.readx.out.data = c;
status = smb_raw_read(cli->tree, &io);
@@ -181,8 +181,8 @@ bool torture_ping_pong(struct torture_context *torture)
const char *fn;
int num_locks;
TALLOC_CTX *mem_ctx = talloc_new(torture);
- static BOOL do_reads;
- static BOOL do_writes;
+ static bool do_reads;
+ static bool do_writes;
int lock_timeout;
int fd;
struct smbcli_state *cli;
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index af9001c757..7dcd2000e9 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -186,7 +186,7 @@ static union smb_fileinfo *fname_find(bool is_ipc, const char *name)
#n1, #v1, (uint_t)s1->n1.out.v1, \
#n2, #v2, (uint_t)s2->n2.out.v2, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
#define STR_EQUAL(n1, v1, n2, v2) do {if (strcmp_safe(s1->n1.out.v1.s, s2->n2.out.v2.s) || \
@@ -195,7 +195,7 @@ static union smb_fileinfo *fname_find(bool is_ipc, const char *name)
#n1, #v1, s1->n1.out.v1.s, s1->n1.out.v1.private_length, \
#n2, #v2, s2->n2.out.v2.s, s2->n2.out.v2.private_length, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
#define STRUCT_EQUAL(n1, v1, n2, v2) do {if (memcmp(&s1->n1.out.v1,&s2->n2.out.v2,sizeof(s1->n1.out.v1))) { \
@@ -203,7 +203,7 @@ static union smb_fileinfo *fname_find(bool is_ipc, const char *name)
#n1, #v1, \
#n2, #v2, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
/* used to find hints on unknown values - and to make sure
@@ -215,7 +215,7 @@ static union smb_fileinfo *fname_find(bool is_ipc, const char *name)
(uint_t)s1->n1.out.v1, \
(uint_t)s1->n1.out.v1, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
#endif
@@ -230,14 +230,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
bool is_ipc)
{
int i;
- BOOL ret = True;
+ bool ret = true;
int count;
union smb_fileinfo *s1, *s2;
NTTIME correct_time;
uint64_t correct_size;
uint32_t correct_attrib;
const char *correct_name;
- BOOL skip_streams = False;
+ bool skip_streams = false;
/* scan all the fileinfo and pathinfo levels */
for (i=0; levels[i].name; i++) {
@@ -293,7 +293,7 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
}
if (count != 0) {
- ret = False;
+ ret = false;
printf("%d levels failed\n", count);
if (count > 35) {
torture_fail(torture, "too many level failures - giving up");
@@ -307,7 +307,7 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("STREAM_INFO broken (%d) - skipping streams checks\n",
s1 ? s1->stream_info.out.num_streams : -1);
}
- skip_streams = True;
+ skip_streams = true;
}
@@ -401,14 +401,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
nt_time_string(mem_ctx, s1->stype.out.tfield), \
nt_time_string(mem_ctx, correct_time)); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && memcmp(&s1->stype.out.tfield, &correct_time, sizeof(correct_time)) != 0) { \
printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
nt_time_string(mem_ctx, s1->stype.out.tfield), \
nt_time_string(mem_ctx, correct_time)); \
- ret = False; \
+ ret = false; \
}} while (0)
#define TIME_CHECK_DOS(sname, stype, tfield) do { \
@@ -417,14 +417,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
nt_time_string(mem_ctx, correct_time)); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && dos_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \
printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
nt_time_string(mem_ctx, correct_time)); \
- ret = False; \
+ ret = false; \
}} while (0)
#if 0 /* unused */
@@ -434,14 +434,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("(%d) handle %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
nt_time_string(mem_ctx, correct_time)); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && unx_nt_time_cmp(s1->stype.out.tfield, correct_time) != 0) { \
printf("(%d) path %s/%s incorrect - %s should be %s\n", __LINE__, #stype, #tfield, \
timestring(mem_ctx, s1->stype.out.tfield), \
nt_time_string(mem_ctx, correct_time)); \
- ret = False; \
+ ret = false; \
}} while (0)
#endif
@@ -499,14 +499,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("(%d) handle %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \
(uint_t)s1->stype.out.tfield, \
(uint_t)correct_size); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && s1->stype.out.tfield != correct_size) { \
printf("(%d) path %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \
(uint_t)s1->stype.out.tfield, \
(uint_t)correct_size); \
- ret = False; \
+ ret = false; \
}} while (0)
s1 = fnum_find("STANDARD_INFO");
@@ -553,14 +553,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("(%d) handle %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \
(uint_t)s1->stype.out.tfield, \
(uint_t)correct_attrib); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && s1->stype.out.tfield != correct_attrib) { \
printf("(%d) path %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \
(uint_t)s1->stype.out.tfield, \
(uint_t)correct_attrib); \
- ret = False; \
+ ret = false; \
}} while (0)
s1 = fnum_find("BASIC_INFO");
@@ -589,14 +589,14 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
wire_bad_flags(&s1->stype.out.tfield, flags, tree->session->transport))) { \
printf("(%d) handle %s/%s incorrect - '%s/%d'\n", __LINE__, #stype, #tfield, \
s1->stype.out.tfield.s, s1->stype.out.tfield.private_length); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname); \
if (s1 && (strcmp_safe(s1->stype.out.tfield.s, correct_name) != 0 || \
wire_bad_flags(&s1->stype.out.tfield, flags, tree->session->transport))) { \
printf("(%d) path %s/%s incorrect - '%s/%d'\n", __LINE__, #stype, #tfield, \
s1->stype.out.tfield.s, s1->stype.out.tfield.private_length); \
- ret = False; \
+ ret = false; \
}} while (0)
NAME_CHECK("NAME_INFO", name_info, fname, STR_UNICODE);
@@ -612,17 +612,17 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
if (!p) {
printf("Not a full path in all_info/fname? - '%s'\n",
s1->all_info.out.fname.s);
- ret = False;
+ ret = false;
} else {
if (strcmp_safe(correct_name, p) != 0) {
printf("incorrect basename in all_info/fname - '%s'\n",
s1->all_info.out.fname.s);
- ret = False;
+ ret = false;
}
}
if (wire_bad_flags(&s1->all_info.out.fname, STR_UNICODE, tree->session->transport)) {
printf("Should not null terminate all_info/fname\n");
- ret = False;
+ ret = false;
}
}
@@ -646,7 +646,7 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
0, 0);
if (fnum == -1) {
printf("Unable to open by alt_name - %s\n", smbcli_errstr(tree));
- ret = False;
+ ret = false;
}
if (!skip_streams) {
@@ -702,28 +702,28 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
printf("(%d) handle %s/%s != %s/%s - 0x%x vs 0x%x\n", __LINE__, \
#stype1, #tfield1, #stype2, #tfield2, \
s1->stype1.out.tfield1, s2->stype2.out.tfield2); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname1); s2 = fname_find(is_ipc, sname2); \
if (s1 && s2 && s1->stype1.out.tfield1 != s2->stype2.out.tfield2) { \
printf("(%d) path %s/%s != %s/%s - 0x%x vs 0x%x\n", __LINE__, \
#stype1, #tfield1, #stype2, #tfield2, \
s1->stype1.out.tfield1, s2->stype2.out.tfield2); \
- ret = False; \
+ ret = false; \
} \
s1 = fnum_find(sname1); s2 = fname_find(is_ipc, sname2); \
if (s1 && s2 && s1->stype1.out.tfield1 != s2->stype2.out.tfield2) { \
printf("(%d) handle %s/%s != path %s/%s - 0x%x vs 0x%x\n", __LINE__, \
#stype1, #tfield1, #stype2, #tfield2, \
s1->stype1.out.tfield1, s2->stype2.out.tfield2); \
- ret = False; \
+ ret = false; \
} \
s1 = fname_find(is_ipc, sname1); s2 = fnum_find(sname2); \
if (s1 && s2 && s1->stype1.out.tfield1 != s2->stype2.out.tfield2) { \
printf("(%d) path %s/%s != handle %s/%s - 0x%x vs 0x%x\n", __LINE__, \
#stype1, #tfield1, #stype2, #tfield2, \
s1->stype1.out.tfield1, s2->stype2.out.tfield2); \
- ret = False; \
+ ret = false; \
}} while (0)
VAL_CHECK("STANDARD_INFO", standard_info, delete_pending,
@@ -736,18 +736,18 @@ static bool torture_raw_qfileinfo_internals(struct torture_context *torture,
if (s1 && is_ipc) {
if (s1->basic_info.out.attrib != FILE_ATTRIBUTE_NORMAL) {
printf("(%d) attrib basic_info/nlink incorrect - %d should be %d\n", __LINE__, s1->basic_info.out.attrib, FILE_ATTRIBUTE_NORMAL);
- ret = False;
+ ret = false;
}
}
s1 = fnum_find("STANDARD_INFO");
if (s1 && is_ipc) {
if (s1->standard_info.out.nlink != 1) {
printf("(%d) nlinks standard_info/nlink incorrect - %d should be 1\n", __LINE__, s1->standard_info.out.nlink);
- ret = False;
+ ret = false;
}
if (s1->standard_info.out.delete_pending != 1) {
printf("(%d) nlinks standard_info/delete_pending incorrect - %d should be 1\n", __LINE__, s1->standard_info.out.delete_pending);
- ret = False;
+ ret = false;
}
}
VAL_CHECK("EA_INFO", ea_info, ea_size,
@@ -827,7 +827,7 @@ bool torture_raw_qfileinfo(struct torture_context *torture,
return false;
}
- ret = torture_raw_qfileinfo_internals(torture, torture, cli->tree, fnum, fname, False /* is_ipc */);
+ ret = torture_raw_qfileinfo_internals(torture, torture, cli->tree, fnum, fname, false /* is_ipc */);
smbcli_close(cli->tree, fnum);
smbcli_unlink(cli->tree, fname);
@@ -846,7 +846,7 @@ bool torture_raw_qfileinfo_pipe(struct torture_context *torture,
NTSTATUS status;
if (!(p = dcerpc_pipe_init(torture, cli->tree->session->transport->socket->event.ctx))) {
- return False;
+ return false;
}
status = dcerpc_pipe_open_smb(p, cli->tree, fname);
diff --git a/source4/torture/raw/qfsinfo.c b/source4/torture/raw/qfsinfo.c
index 05e6f78324..3207558624 100644
--- a/source4/torture/raw/qfsinfo.c
+++ b/source4/torture/raw/qfsinfo.c
@@ -74,7 +74,7 @@ static union smb_fsinfo *find(const char *name)
#n1, #v1, (uint_t)s1->n1.out.v1, \
#n2, #v2, (uint_t)s2->n2.out.v2, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
#define VAL_APPROX_EQUAL(n1, v1, n2, v2) do {if (abs((int)(s1->n1.out.v1) - (int)(s2->n2.out.v2)) > 0.1*s1->n1.out.v1) { \
@@ -82,7 +82,7 @@ static union smb_fsinfo *find(const char *name)
#n1, #v1, (uint_t)s1->n1.out.v1, \
#n2, #v2, (uint_t)s2->n2.out.v2, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
#define STR_EQUAL(n1, v1, n2, v2) do { \
@@ -91,7 +91,7 @@ static union smb_fsinfo *find(const char *name)
#n1, #v1, s1->n1.out.v1, \
#n2, #v2, s2->n2.out.v2, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
#define STRUCT_EQUAL(n1, v1, n2, v2) do {if (memcmp(&s1->n1.out.v1,&s2->n2.out.v2,sizeof(s1->n1.out.v1))) { \
@@ -99,7 +99,7 @@ static union smb_fsinfo *find(const char *name)
#n1, #v1, \
#n2, #v2, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
/* used to find hints on unknown values - and to make sure
@@ -110,7 +110,7 @@ static union smb_fsinfo *find(const char *name)
(uint_t)s1->n1.out.v1, \
(uint_t)s1->n1.out.v1, \
__FILE__, __LINE__); \
- ret = False; \
+ ret = false; \
}} while(0)
/* basic testing of all RAW_QFS_* calls
@@ -124,7 +124,7 @@ bool torture_raw_qfsinfo(struct torture_context *torture,
struct smbcli_state *cli)
{
int i;
- BOOL ret = True;
+ bool ret = true;
int count;
union smb_fsinfo *s1, *s2;
@@ -154,7 +154,7 @@ bool torture_raw_qfsinfo(struct torture_context *torture,
printf("%d levels failed\n", count);
if (count > 13) {
printf("too many level failures - giving up\n");
- return False;
+ return false;
}
}
@@ -212,7 +212,7 @@ bool torture_raw_qfsinfo(struct torture_context *torture,
if (abs(size1 - size2) > 1) {
printf("Inconsistent total size in DSKATTR and ALLOCATION - size1=%.0f size2=%.0f\n",
size1, size2);
- ret = False;
+ ret = false;
}
printf("total disk = %.0f MB\n", size1*scale/1.0e6);
}
@@ -234,7 +234,7 @@ bool torture_raw_qfsinfo(struct torture_context *torture,
if (abs(size1 - size2) > 1) {
printf("Inconsistent avail size in DSKATTR and ALLOCATION - size1=%.0f size2=%.0f\n",
size1, size2);
- ret = False;
+ ret = false;
}
printf("free disk = %.0f MB\n", size1*scale/1.0e6);
}
@@ -283,7 +283,7 @@ bool torture_raw_qfsinfo(struct torture_context *torture,
if (s1->stype.out.field.s && wire_bad_flags(&s1->stype.out.field, flags, cli->transport)) { \
printf("(%d) incorrect string termination in %s/%s\n", \
__LINE__, #stype, #field); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index 9a5153b553..90f6a3d4a8 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -30,7 +30,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -38,13 +38,13 @@
if ((v) != (correct)) { \
printf("(%s) Incorrect value %s=%ld - should be %ld\n", \
__location__, #v, (long)v, (long)correct); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
#define CHECK_BUFFER(buf, seed, len) do { \
if (!check_buffer(buf, seed, len, __LINE__)) { \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -64,7 +64,7 @@ static void setup_buffer(uint8_t *buf, uint_t seed, int len)
/*
check a random buffer based on a seed
*/
-static BOOL check_buffer(uint8_t *buf, uint_t seed, int len, int line)
+static bool check_buffer(uint8_t *buf, uint_t seed, int len, int line)
{
int i;
srandom(seed);
@@ -73,10 +73,10 @@ static BOOL check_buffer(uint8_t *buf, uint_t seed, int len, int line)
if (buf[i] != v) {
printf("Buffer incorrect at line %d! ofs=%d v1=0x%x v2=0x%x\n",
line, i, buf[i], v);
- return False;
+ return false;
}
}
- return True;
+ return true;
}
/*
@@ -86,7 +86,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
{
union smb_read io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -97,7 +97,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_READ_READ\n");
@@ -106,7 +106,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -144,7 +144,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.read.out.nread, strlen(test_data));
if (memcmp(buf, test_data, strlen(test_data)) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data, buf);
goto done;
}
@@ -156,7 +156,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.read.out.nread, strlen(test_data)-1);
if (memcmp(buf, test_data+1, strlen(test_data)-1) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data+1, buf);
goto done;
}
@@ -186,7 +186,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
cli->session->pid++;
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
- ret = False;
+ ret = false;
goto done;
}
cli->session->pid--;
@@ -213,7 +213,7 @@ static bool test_lockread(struct torture_context *tctx,
{
union smb_read io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -224,7 +224,7 @@ static bool test_lockread(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_READ_LOCKREAD\n");
@@ -233,7 +233,7 @@ static bool test_lockread(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -283,7 +283,7 @@ static bool test_lockread(struct torture_context *tctx,
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.lockread.out.nread, strlen(test_data));
if (memcmp(buf, test_data, strlen(test_data)) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data, buf);
goto done;
}
@@ -299,7 +299,7 @@ static bool test_lockread(struct torture_context *tctx,
CHECK_VALUE(io.lockread.out.nread, strlen(test_data)-1);
if (memcmp(buf, test_data+1, strlen(test_data)-1) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data+1, buf);
goto done;
}
@@ -333,7 +333,7 @@ static bool test_lockread(struct torture_context *tctx,
cli->session->pid++;
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
- ret = False;
+ ret = false;
goto done;
}
cli->session->pid--;
@@ -358,7 +358,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
{
union smb_read io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -369,7 +369,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_READ_READX\n");
@@ -377,7 +377,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -388,7 +388,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
io.readx.in.maxcnt = 1;
io.readx.in.offset = 0;
io.readx.in.remaining = 0;
- io.readx.in.read_for_execute = False;
+ io.readx.in.read_for_execute = false;
io.readx.out.data = buf;
status = smb_raw_read(cli->tree, &io);
@@ -418,7 +418,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
io.readx.in.file.fnum = fnum;
io.readx.in.offset = 0;
io.readx.in.remaining = 0;
- io.readx.in.read_for_execute = False;
+ io.readx.in.read_for_execute = false;
io.readx.in.mincnt = strlen(test_data);
io.readx.in.maxcnt = strlen(test_data);
status = smb_raw_read(cli->tree, &io);
@@ -427,7 +427,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
CHECK_VALUE(io.readx.out.remaining, 0xFFFF);
CHECK_VALUE(io.readx.out.compaction_mode, 0);
if (memcmp(buf, test_data, strlen(test_data)) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data, buf);
goto done;
}
@@ -442,7 +442,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
CHECK_VALUE(io.readx.out.remaining, 0xFFFF);
CHECK_VALUE(io.readx.out.compaction_mode, 0);
if (memcmp(buf, test_data+1, strlen(test_data)-1) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data+1, buf);
goto done;
}
@@ -548,7 +548,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
cli->session->pid++;
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
- ret = False;
+ ret = false;
goto done;
}
cli->session->pid--;
@@ -574,7 +574,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
if (NT_STATUS_IS_ERR(smbcli_lock64(cli->tree, fnum, io.readx.in.offset, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
- ret = False;
+ ret = false;
goto done;
}
@@ -597,7 +597,7 @@ static bool test_readbraw(struct torture_context *tctx,
{
union smb_read io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -608,7 +608,7 @@ static bool test_readbraw(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_READ_READBRAW\n");
@@ -616,7 +616,7 @@ static bool test_readbraw(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -658,7 +658,7 @@ static bool test_readbraw(struct torture_context *tctx,
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.readbraw.out.nread, strlen(test_data));
if (memcmp(buf, test_data, strlen(test_data)) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data, buf);
goto done;
}
@@ -671,7 +671,7 @@ static bool test_readbraw(struct torture_context *tctx,
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(io.readbraw.out.nread, strlen(test_data)-1);
if (memcmp(buf, test_data+1, strlen(test_data)-1) != 0) {
- ret = False;
+ ret = false;
printf("incorrect data at %d!? (%s:%s)\n", __LINE__, test_data+1, buf);
goto done;
}
@@ -723,7 +723,7 @@ static bool test_readbraw(struct torture_context *tctx,
cli->session->pid++;
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %d\n", __LINE__);
- ret = False;
+ ret = false;
goto done;
}
cli->session->pid--;
@@ -772,7 +772,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
union smb_write wr;
union smb_read rd;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum=0;
uint8_t *buf;
const int maxsize = 900;
@@ -782,7 +782,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_READ_READX with read_for_execute\n");
@@ -841,7 +841,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
rd.readx.in.maxcnt = maxsize;
rd.readx.in.offset = 0;
rd.readx.in.remaining = 0;
- rd.readx.in.read_for_execute = True;
+ rd.readx.in.read_for_execute = true;
rd.readx.out.data = buf;
status = smb_raw_read(cli->tree, &rd);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -856,7 +856,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
rd.readx.in.maxcnt = maxsize;
rd.readx.in.offset = 0;
rd.readx.in.remaining = 0;
- rd.readx.in.read_for_execute = False;
+ rd.readx.in.read_for_execute = false;
rd.readx.out.data = buf;
status = smb_raw_read(cli->tree, &rd);
CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
@@ -888,7 +888,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
rd.readx.in.maxcnt = maxsize;
rd.readx.in.offset = 0;
rd.readx.in.remaining = 0;
- rd.readx.in.read_for_execute = True;
+ rd.readx.in.read_for_execute = true;
rd.readx.out.data = buf;
status = smb_raw_read(cli->tree, &rd);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -903,7 +903,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
rd.readx.in.maxcnt = maxsize;
rd.readx.in.offset = 0;
rd.readx.in.remaining = 0;
- rd.readx.in.read_for_execute = False;
+ rd.readx.in.read_for_execute = false;
rd.readx.out.data = buf;
status = smb_raw_read(cli->tree, &rd);
CHECK_STATUS(status, NT_STATUS_OK);
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c
index 05a5320859..4b0d986659 100644
--- a/source4/torture/raw/rename.c
+++ b/source4/torture/raw/rename.c
@@ -27,7 +27,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -35,7 +35,7 @@
if ((v) != (correct)) { \
printf("(%s) Incorrect %s %d - should be %d\n", \
__location__, #v, (int)v, (int)correct); \
- ret = False; \
+ ret = false; \
}} while (0)
#define BASEDIR "\\testrename"
@@ -48,7 +48,7 @@ static bool test_mv(struct torture_context *tctx,
{
union smb_rename io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
const char *fname1 = BASEDIR "\\test1.txt";
const char *fname2 = BASEDIR "\\test2.txt";
@@ -59,7 +59,7 @@ static bool test_mv(struct torture_context *tctx,
printf("Testing SMBmv\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Trying simple rename\n");
@@ -197,7 +197,7 @@ static bool test_ntrename(struct torture_context *tctx,
{
union smb_rename io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum, i;
const char *fname1 = BASEDIR "\\test1.txt";
const char *fname2 = BASEDIR "\\test2.txt";
@@ -206,7 +206,7 @@ static bool test_ntrename(struct torture_context *tctx,
printf("Testing SMBntrename\n");
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Trying simple rename\n");
diff --git a/source4/torture/raw/samba3hide.c b/source4/torture/raw/samba3hide.c
index 309f65487a..8fe3aa4d2d 100644
--- a/source4/torture/raw/samba3hide.c
+++ b/source4/torture/raw/samba3hide.c
@@ -57,7 +57,7 @@ static void init_unixinfo_nochange(union smb_setfileinfo *info)
struct list_state {
const char *fname;
- BOOL visible;
+ bool visible;
};
static void set_visible(struct clilist_file_info *i, const char *mask,
@@ -66,43 +66,43 @@ static void set_visible(struct clilist_file_info *i, const char *mask,
struct list_state *state = (struct list_state *)priv;
if (strcasecmp_m(state->fname, i->name) == 0)
- state->visible = True;
+ state->visible = true;
}
-static BOOL is_visible(struct smbcli_tree *tree, const char *fname)
+static bool is_visible(struct smbcli_tree *tree, const char *fname)
{
struct list_state state;
- state.visible = False;
+ state.visible = false;
state.fname = fname;
if (smbcli_list(tree, "*.*", 0, set_visible, &state) < 0) {
- return False;
+ return false;
}
return state.visible;
}
-static BOOL is_readable(struct smbcli_tree *tree, const char *fname)
+static bool is_readable(struct smbcli_tree *tree, const char *fname)
{
int fnum;
fnum = smbcli_open(tree, fname, O_RDONLY, DENY_NONE);
if (fnum < 0) {
- return False;
+ return false;
}
smbcli_close(tree, fnum);
- return True;
+ return true;
}
-static BOOL is_writeable(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree,
+static bool is_writeable(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree,
const char *fname)
{
int fnum;
fnum = smbcli_open(tree, fname, O_WRONLY, DENY_NONE);
if (fnum < 0) {
- return False;
+ return false;
}
smbcli_close(tree, fnum);
- return True;
+ return true;
}
/*
@@ -110,7 +110,7 @@ static BOOL is_writeable(TALLOC_CTX *mem_ctx, struct smbcli_tree *tree,
* might fail. But for our purposes it's sufficient.
*/
-static BOOL smbcli_file_exists(struct smbcli_tree *tree, const char *fname)
+static bool smbcli_file_exists(struct smbcli_tree *tree, const char *fname)
{
return NT_STATUS_IS_OK(smbcli_getatr(tree, fname, NULL, NULL, NULL));
}
@@ -138,7 +138,7 @@ bool torture_samba3_hide(struct torture_context *torture)
torture, &cli, torture_setting_string(torture, "host", NULL),
torture_setting_string(torture, "share", NULL), NULL)) {
d_printf("torture_open_connection_share failed\n");
- return False;
+ return false;
}
status = torture_second_tcon(torture, cli->session, "hideunread",
@@ -146,7 +146,7 @@ bool torture_samba3_hide(struct torture_context *torture)
if (!NT_STATUS_IS_OK(status)) {
d_printf("second_tcon(hideunread) failed: %s\n",
nt_errstr(status));
- return False;
+ return false;
}
status = torture_second_tcon(torture, cli->session, "hideunwrite",
@@ -154,7 +154,7 @@ bool torture_samba3_hide(struct torture_context *torture)
if (!NT_STATUS_IS_OK(status)) {
d_printf("second_tcon(hideunwrite) failed: %s\n",
nt_errstr(status));
- return False;
+ return false;
}
status = smbcli_unlink(cli->tree, fname);
@@ -167,14 +167,14 @@ bool torture_samba3_hide(struct torture_context *torture)
if (fnum == -1) {
d_printf("Failed to create %s - %s\n", fname,
smbcli_errstr(cli->tree));
- return False;
+ return false;
}
smbcli_close(cli->tree, fnum);
if (!smbcli_file_exists(cli->tree, fname)) {
d_printf("%s does not exist\n", fname);
- return False;
+ return false;
}
/* R/W file should be visible everywhere */
@@ -182,27 +182,27 @@ bool torture_samba3_hide(struct torture_context *torture)
status = smbcli_chmod(cli->tree, fname, UNIX_R_USR|UNIX_W_USR);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_chmod failed: %s\n", nt_errstr(status));
- return False;
+ return false;
}
if (!is_writeable(torture, cli->tree, fname)) {
d_printf("File not writable\n");
- return False;
+ return false;
}
if (!is_readable(cli->tree, fname)) {
d_printf("File not readable\n");
- return False;
+ return false;
}
if (!is_visible(cli->tree, fname)) {
d_printf("r/w file not visible via normal share\n");
- return False;
+ return false;
}
if (!is_visible(hideunread, fname)) {
d_printf("r/w file not visible via hide unreadable\n");
- return False;
+ return false;
}
if (!is_visible(hideunwrite, fname)) {
d_printf("r/w file not visible via hide unwriteable\n");
- return False;
+ return false;
}
/* R/O file should not be visible via hide unwriteable files */
@@ -211,27 +211,27 @@ bool torture_samba3_hide(struct torture_context *torture)
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_chmod failed: %s\n", nt_errstr(status));
- return False;
+ return false;
}
if (is_writeable(torture, cli->tree, fname)) {
d_printf("r/o is writable\n");
- return False;
+ return false;
}
if (!is_readable(cli->tree, fname)) {
d_printf("r/o not readable\n");
- return False;
+ return false;
}
if (!is_visible(cli->tree, fname)) {
d_printf("r/o file not visible via normal share\n");
- return False;
+ return false;
}
if (!is_visible(hideunread, fname)) {
d_printf("r/o file not visible via hide unreadable\n");
- return False;
+ return false;
}
if (is_visible(hideunwrite, fname)) {
d_printf("r/o file visible via hide unwriteable\n");
- return False;
+ return false;
}
/* inaccessible file should be only visible on normal share */
@@ -239,33 +239,33 @@ bool torture_samba3_hide(struct torture_context *torture)
status = smbcli_chmod(cli->tree, fname, 0);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_chmod failed: %s\n", nt_errstr(status));
- return False;
+ return false;
}
if (is_writeable(torture, cli->tree, fname)) {
d_printf("inaccessible file is writable\n");
- return False;
+ return false;
}
if (is_readable(cli->tree, fname)) {
d_printf("inaccessible file is readable\n");
- return False;
+ return false;
}
if (!is_visible(cli->tree, fname)) {
d_printf("inaccessible file not visible via normal share\n");
- return False;
+ return false;
}
if (is_visible(hideunread, fname)) {
d_printf("inaccessible file visible via hide unreadable\n");
- return False;
+ return false;
}
if (is_visible(hideunwrite, fname)) {
d_printf("inaccessible file visible via hide unwriteable\n");
- return False;
+ return false;
}
smbcli_chmod(cli->tree, fname, UNIX_R_USR|UNIX_W_USR);
smbcli_unlink(cli->tree, fname);
- return True;
+ return true;
}
/*
@@ -277,7 +277,7 @@ bool torture_samba3_hide(struct torture_context *torture)
bool torture_samba3_closeerr(struct torture_context *tctx)
{
struct smbcli_state *cli = NULL;
- BOOL result = False;
+ bool result = false;
NTSTATUS status;
const char *dname = "closeerr.dir";
const char *fname = "closeerr.dir\\closerr.txt";
@@ -311,7 +311,7 @@ bool torture_samba3_closeerr(struct torture_context *tctx)
talloc_asprintf(tctx, "smbcli_open failed: %s\n",
smbcli_errstr(cli->tree)));
- status = smbcli_nt_delete_on_close(cli->tree, fnum, True);
+ status = smbcli_nt_delete_on_close(cli->tree, fnum, true);
torture_assert_ntstatus_ok(tctx, status,
"setting delete_on_close on file failed !");
@@ -329,7 +329,7 @@ bool torture_samba3_closeerr(struct torture_context *tctx)
torture_assert_ntstatus_equal(tctx, status, NT_STATUS_ACCESS_DENIED,
"smbcli_close");
- result = True;
+ result = true;
fail:
if (cli) {
diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index ec53af93e8..988405e806 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -31,7 +31,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
} \
} while (0)
@@ -42,7 +42,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
const char *dirname = "testdir";
int fnum;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx;
ssize_t nread;
char buf[16];
@@ -50,14 +50,14 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
if ((mem_ctx = talloc_init("torture_samba3_checkfsp")) == NULL) {
d_printf("talloc_init failed\n");
- return False;
+ return false;
}
if (!torture_open_connection_share(
torture, &cli, torture_setting_string(torture, "host", NULL),
torture_setting_string(torture, "share", NULL), NULL)) {
d_printf("torture_open_connection_share failed\n");
- ret = False;
+ ret = false;
goto done;
}
@@ -80,7 +80,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
status = smbcli_mkdir(cli->tree, dirname);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_mkdir failed: %s\n", nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
@@ -103,7 +103,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
if (!NT_STATUS_IS_OK(status)) {
d_printf("smb_open on the directory failed: %s\n",
nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
fnum = io.ntcreatex.out.file.fnum;
@@ -115,7 +115,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
if (nread >= 0) {
d_printf("smbcli_read on a directory succeeded, expected "
"failure\n");
- ret = False;
+ ret = false;
}
CHECK_STATUS(smbcli_nt_error(cli->tree),
@@ -127,7 +127,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
if (nread >= 0) {
d_printf("smbcli_read on a directory succeeded, expected "
"failure\n");
- ret = False;
+ ret = false;
}
CHECK_STATUS(smbcli_nt_error(tree2), NT_STATUS_INVALID_HANDLE);
@@ -140,7 +140,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
if (fnum == -1) {
d_printf("Failed to create %s - %s\n", fname,
smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -335,13 +335,13 @@ bool torture_samba3_badpath(struct torture_context *torture)
char *fpath1;
int fnum;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx;
- BOOL nt_status_support;
+ bool nt_status_support;
if (!(mem_ctx = talloc_init("torture_samba3_badpath"))) {
d_printf("talloc_init failed\n");
- return False;
+ return false;
}
nt_status_support = lp_nt_status_support(global_loadparm);
@@ -375,7 +375,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
status = smbcli_mkdir(cli_nt->tree, dirname);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_mkdir failed: %s\n", nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
@@ -586,7 +586,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
goto done;
fail:
- ret = False;
+ ret = false;
done:
if (cli_nt != NULL) {
@@ -619,11 +619,11 @@ bool torture_samba3_caseinsensitive(struct torture_context *torture)
char *fpath;
int fnum;
int counter = 0;
- BOOL ret = True;
+ bool ret = true;
if (!(mem_ctx = talloc_init("torture_samba3_caseinsensitive"))) {
d_printf("talloc_init failed\n");
- return False;
+ return false;
}
if (!torture_open_connection(&cli, 0)) {
@@ -656,11 +656,11 @@ bool torture_samba3_caseinsensitive(struct torture_context *torture)
count_fn, (void *)&counter);
if (counter == 3) {
- ret = True;
+ ret = true;
}
else {
d_fprintf(stderr, "expected 3 entries, got %d\n", counter);
- ret = False;
+ ret = false;
}
done:
@@ -677,7 +677,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
{
struct smbcli_state *cli;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *dirname = "posixlock";
const char *fname = "locked";
const char *fpath;
@@ -693,7 +693,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
struct smbcli_request *req;
if (!torture_open_connection(&cli, 0)) {
- ret = False;
+ ret = false;
goto done;
}
@@ -703,33 +703,33 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
if (!NT_STATUS_IS_OK(status)) {
torture_warning(tctx, "smbcli_mkdir failed: %s\n",
nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
if (!(fpath = talloc_asprintf(tctx, "%s\\%s", dirname, fname))) {
torture_warning(tctx, "talloc failed\n");
- ret = False;
+ ret = false;
goto done;
}
fnum = smbcli_open(cli->tree, fpath, O_RDWR | O_CREAT, DENY_NONE);
if (fnum == -1) {
torture_warning(tctx, "Could not create file %s: %s\n", fpath,
smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
if (!(localdir = torture_setting_string(tctx, "localdir", NULL))) {
torture_warning(tctx, "Need 'localdir' setting\n");
- ret = False;
+ ret = false;
goto done;
}
if (!(localname = talloc_asprintf(tctx, "%s/%s/%s", localdir, dirname,
fname))) {
torture_warning(tctx, "talloc failed\n");
- ret = False;
+ ret = false;
goto done;
}
@@ -751,7 +751,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
if (fcntl(fd, F_SETLK, &posix_lock) == -1) {
torture_warning(tctx, "fcntl failed: %s\n", strerror(errno));
- ret = False;
+ ret = false;
goto done;
}
@@ -774,7 +774,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
status = smb_raw_lock(cli->tree, &io);
- ret = True;
+ ret = true;
CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT);
if (!ret) {
@@ -791,7 +791,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
req = smb_raw_lock_send(cli->tree, &io);
if (req == NULL) {
torture_warning(tctx, "smb_raw_lock_send failed\n");
- ret = False;
+ ret = false;
goto done;
}
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 7b6529245b..0242b9c545 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -30,7 +30,7 @@
/*
callback function for single_search
*/
-static BOOL single_search_callback(void *private, const union smb_search_data *file)
+static bool single_search_callback(void *private, const union smb_search_data *file)
{
union smb_search_data *data = (union smb_search_data *)private;
@@ -234,7 +234,7 @@ static union smb_search_data *find(const char *name)
static bool test_one_file(struct torture_context *tctx,
struct smbcli_state *cli)
{
- BOOL ret = True;
+ bool ret = true;
int fnum;
const char *fname = "\\torture_search.txt";
const char *fname2 = "\\torture_search-NOTEXIST.txt";
@@ -246,7 +246,7 @@ static bool test_one_file(struct torture_context *tctx,
fnum = create_complex_file(cli, tctx, fname);
if (fnum == -1) {
printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -274,7 +274,7 @@ static bool test_one_file(struct torture_context *tctx,
printf("search level %s(%d) failed - %s\n",
levels[i].name, (int)levels[i].level,
nt_errstr(levels[i].status));
- ret = False;
+ ret = false;
continue;
}
@@ -295,7 +295,7 @@ static bool test_one_file(struct torture_context *tctx,
levels[i].name, (int)levels[i].level,
nt_errstr(expected_status),
nt_errstr(status));
- ret = False;
+ ret = false;
}
}
@@ -328,7 +328,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, (int)s->sname1.field1, \
#sname2, #field2, (int)v.sname2.out.field2); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -340,7 +340,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, timestring(tctx, s->sname1.field1), \
#sname2, #field2, nt_time_string(tctx, v.sname2.out.field2)); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -352,7 +352,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, nt_time_string(tctx, s->sname1.field1), \
#sname2, #field2, nt_time_string(tctx, v.sname2.out.field2)); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -364,7 +364,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, s->sname1.field1, \
#sname2, #field2, v.sname2.out.field2.s); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -378,7 +378,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, s->sname1.field1.s, \
#sname2, #field2, v.sname2.out.field2.s); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -392,7 +392,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, s->sname1.field1.s, \
fname); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -405,7 +405,7 @@ static bool test_one_file(struct torture_context *tctx,
__location__, \
#sname1, #field1, s->sname1.field1, \
fname); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -509,7 +509,7 @@ struct multiple_result {
/*
callback function for multiple_search
*/
-static BOOL multiple_search_callback(void *private, const union smb_search_data *file)
+static bool multiple_search_callback(void *private, const union smb_search_data *file)
{
struct multiple_result *data = (struct multiple_result *)private;
@@ -658,7 +658,7 @@ static bool test_many_files(struct torture_context *tctx,
const int num_files = 700;
int i, fnum, t;
char *fname;
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
struct multiple_result result;
struct {
@@ -751,7 +751,7 @@ static bool test_many_files(struct torture_context *tctx,
/*
check a individual file result
*/
-static bool check_result(struct multiple_result *result, const char *name, BOOL exist, uint32_t attrib)
+static bool check_result(struct multiple_result *result, const char *name, bool exist, uint32_t attrib)
{
int i;
for (i=0;i<result->count;i++) {
@@ -761,7 +761,7 @@ static bool check_result(struct multiple_result *result, const char *name, BOOL
if (exist) {
printf("failed: '%s' should exist with attribute %s\n",
name, attrib_string(result->list, attrib));
- return False;
+ return false;
}
return true;
}
@@ -769,14 +769,14 @@ static bool check_result(struct multiple_result *result, const char *name, BOOL
if (!exist) {
printf("failed: '%s' should NOT exist (has attribute %s)\n",
name, attrib_string(result->list, result->list[i].both_directory_info.attrib));
- return False;
+ return false;
}
if ((result->list[i].both_directory_info.attrib&0xFFF) != attrib) {
printf("failed: '%s' should have attribute 0x%x (has 0x%x)\n",
name,
attrib, result->list[i].both_directory_info.attrib);
- return False;
+ return false;
}
return true;
}
@@ -790,7 +790,7 @@ static bool test_modify_search(struct torture_context *tctx,
const int num_files = 20;
int i, fnum;
char *fname;
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
struct multiple_result result;
union smb_search_first io;
@@ -798,7 +798,7 @@ static bool test_modify_search(struct torture_context *tctx,
union smb_setfileinfo sfinfo;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Creating %d files\n", num_files);
@@ -808,7 +808,7 @@ static bool test_modify_search(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
talloc_free(fname);
@@ -876,16 +876,16 @@ static bool test_modify_search(struct torture_context *tctx,
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VALUE(result.count, 20);
- ret &= check_result(&result, "t009-9.txt", True, FILE_ATTRIBUTE_ARCHIVE);
- ret &= check_result(&result, "t014-14.txt", False, 0);
- ret &= check_result(&result, "t015-15.txt", False, 0);
- ret &= check_result(&result, "t016-16.txt", True, FILE_ATTRIBUTE_NORMAL);
- ret &= check_result(&result, "t017-17.txt", False, 0);
- ret &= check_result(&result, "t018-18.txt", True, FILE_ATTRIBUTE_ARCHIVE);
- ret &= check_result(&result, "t019-19.txt", True, FILE_ATTRIBUTE_ARCHIVE);
- ret &= check_result(&result, "T013-13.txt.2", True, FILE_ATTRIBUTE_ARCHIVE);
- ret &= check_result(&result, "T003-3.txt.2", False, 0);
- ret &= check_result(&result, "T013-13.txt.3", True, FILE_ATTRIBUTE_ARCHIVE);
+ ret &= check_result(&result, "t009-9.txt", true, FILE_ATTRIBUTE_ARCHIVE);
+ ret &= check_result(&result, "t014-14.txt", false, 0);
+ ret &= check_result(&result, "t015-15.txt", false, 0);
+ ret &= check_result(&result, "t016-16.txt", true, FILE_ATTRIBUTE_NORMAL);
+ ret &= check_result(&result, "t017-17.txt", false, 0);
+ ret &= check_result(&result, "t018-18.txt", true, FILE_ATTRIBUTE_ARCHIVE);
+ ret &= check_result(&result, "t019-19.txt", true, FILE_ATTRIBUTE_ARCHIVE);
+ ret &= check_result(&result, "T013-13.txt.2", true, FILE_ATTRIBUTE_ARCHIVE);
+ ret &= check_result(&result, "T003-3.txt.2", false, 0);
+ ret &= check_result(&result, "T013-13.txt.3", true, FILE_ATTRIBUTE_ARCHIVE);
if (!ret) {
for (i=0;i<result.count;i++) {
@@ -912,12 +912,12 @@ static bool test_sorted(struct torture_context *tctx, struct smbcli_state *cli)
const int num_files = 700;
int i, fnum;
char *fname;
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
struct multiple_result result;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Creating %d files\n", num_files);
@@ -927,7 +927,7 @@ static bool test_sorted(struct torture_context *tctx, struct smbcli_state *cli)
fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
talloc_free(fname);
@@ -976,12 +976,12 @@ static bool test_many_dirs(struct torture_context *tctx,
const int num_dirs = 20;
int i, fnum, n;
char *fname, *dname;
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_search_data *file, *file2, *file3;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Creating %d dirs\n", num_dirs);
@@ -992,7 +992,7 @@ static bool test_many_dirs(struct torture_context *tctx,
if (!NT_STATUS_IS_OK(status)) {
printf("(%s) Failed to create %s - %s\n",
__location__, dname, nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
@@ -1002,7 +1002,7 @@ static bool test_many_dirs(struct torture_context *tctx,
if (fnum == -1) {
printf("(%s) Failed to create %s - %s\n",
__location__, fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
talloc_free(fname);
@@ -1034,14 +1034,14 @@ static bool test_many_dirs(struct torture_context *tctx,
if (io.search_first.out.count != 1) {
printf("(%s) search first gave %d entries for dir %d - %s\n",
__location__, io.search_first.out.count, i, nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
CHECK_STATUS(status, NT_STATUS_OK);
if (strncasecmp(file[i].search.name, fname, strlen(fname)) != 0) {
printf("(%s) incorrect name '%s' expected '%s'[12].txt\n",
__location__, file[i].search.name, fname);
- ret = False;
+ ret = false;
goto done;
}
@@ -1067,14 +1067,14 @@ static bool test_many_dirs(struct torture_context *tctx,
if (io2.search_next.out.count != 1) {
printf("(%s) search next gave %d entries for dir %d - %s\n",
__location__, io2.search_next.out.count, i, nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
CHECK_STATUS(status, NT_STATUS_OK);
if (strncasecmp(file2[i].search.name, fname, strlen(fname)) != 0) {
printf("(%s) incorrect name '%s' expected '%s'[12].txt\n",
__location__, file2[i].search.name, fname);
- ret = False;
+ ret = false;
goto done;
}
@@ -1100,7 +1100,7 @@ static bool test_many_dirs(struct torture_context *tctx,
if (io2.search_next.out.count != 1) {
printf("(%s) search next gave %d entries for dir %d - %s\n",
__location__, io2.search_next.out.count, i, nt_errstr(status));
- ret = False;
+ ret = false;
goto done;
}
CHECK_STATUS(status, NT_STATUS_OK);
@@ -1108,14 +1108,14 @@ static bool test_many_dirs(struct torture_context *tctx,
if (strncasecmp(file3[i].search.name, file2[i].search.name, 3) != 0) {
printf("(%s) incorrect name '%s' on rewind at dir %d\n",
__location__, file2[i].search.name, i);
- ret = False;
+ ret = false;
goto done;
}
if (strcmp(file3[i].search.name, file2[i].search.name) != 0) {
printf("(%s) server did not rewind - got '%s' expected '%s'\n",
__location__, file3[i].search.name, file2[i].search.name);
- ret = False;
+ ret = false;
goto done;
}
@@ -1142,14 +1142,14 @@ static bool test_os2_delete(struct torture_context *tctx,
int total_deleted = 0;
int i, fnum;
char *fname;
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_search_first io;
union smb_search_next io2;
struct multiple_result result;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing OS/2 style delete on %d files\n", num_files);
@@ -1159,7 +1159,7 @@ static bool test_os2_delete(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
talloc_free(fname);
@@ -1227,7 +1227,7 @@ static bool test_os2_delete(struct torture_context *tctx,
if (total_deleted != num_files) {
printf("error: deleted %d - expected to delete %d\n",
total_deleted, num_files);
- ret = False;
+ ret = false;
}
done:
@@ -1250,7 +1250,7 @@ static bool test_ea_list(struct torture_context *tctx,
struct smbcli_state *cli)
{
int fnum;
- BOOL ret = True;
+ bool ret = true;
NTSTATUS status;
union smb_search_first io;
union smb_search_next nxt;
@@ -1258,7 +1258,7 @@ static bool test_ea_list(struct torture_context *tctx,
union smb_setfileinfo setfile;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_SEARCH_EA_LIST level\n");
diff --git a/source4/torture/raw/seek.c b/source4/torture/raw/seek.c
index f5413d8b1d..3ba022feef 100644
--- a/source4/torture/raw/seek.c
+++ b/source4/torture/raw/seek.c
@@ -28,7 +28,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%d) Incorrect status %s - should be %s\n", \
__LINE__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -36,7 +36,7 @@
if ((v) != (correct)) { \
printf("(%d) Incorrect value %s=%d - should be %d\n", \
__LINE__, #v, (int)v, (int)correct); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -45,25 +45,25 @@
/*
test seek ops
*/
-static BOOL test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_seek io;
union smb_fileinfo finfo;
union smb_setfileinfo sfinfo;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum, fnum2;
const char *fname = BASEDIR "\\test.txt";
uint8_t c[2];
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE);
if (fnum == -1) {
printf("Failed to open test.txt - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -142,7 +142,7 @@ static BOOL test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
ZERO_STRUCT(c);
if (smbcli_write(cli->tree, fnum, 0, c, 0, 2) != 2) {
printf("Write failed - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -162,7 +162,7 @@ static BOOL test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
if (smbcli_read(cli->tree, fnum, c, 0, 1) != 1) {
printf("Read failed - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -181,7 +181,7 @@ static BOOL test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
fnum2 = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE);
if (fnum2 == -1) {
printf("2nd open failed - %s\n", smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
sfinfo.generic.level = RAW_SFILEINFO_POSITION_INFORMATION;
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index 1178af4e9f..e58b3fd760 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -45,7 +45,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
NTSTATUS status, status2;
const char *call_name;
time_t basetime = (time(NULL) - 86400) & ~1;
- BOOL check_fnum;
+ bool check_fnum;
int n = time(NULL) % 100;
asprintf(&path_fname, BASEDIR "\\fname_test_%d.txt", n);
@@ -54,7 +54,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
#define RECREATE_FILE(fname) do { \
@@ -63,7 +63,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
if (fnum == -1) { \
printf("(%s) ERROR: open of %s failed (%s)\n", \
__location__, fname, smbcli_errstr(cli->tree)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -76,7 +76,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
RECREATE_BOTH;
#define CHECK_CALL_FNUM(call, rightstatus) do { \
- check_fnum = True; \
+ check_fnum = true; \
call_name = #call; \
sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
sfinfo.generic.in.file.fnum = fnum; \
@@ -84,18 +84,18 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
if (!NT_STATUS_EQUAL(status, rightstatus)) { \
printf("(%s) %s - %s (should be %s)\n", __location__, #call, \
nt_errstr(status), nt_errstr(rightstatus)); \
- ret = False; \
+ ret = false; \
} \
finfo1.generic.level = RAW_FILEINFO_ALL_INFO; \
finfo1.generic.in.file.fnum = fnum; \
status2 = smb_raw_fileinfo(cli->tree, torture, &finfo1); \
if (!NT_STATUS_IS_OK(status2)) { \
printf("(%s) %s pathinfo - %s\n", __location__, #call, nt_errstr(status)); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_CALL_PATH(call, rightstatus) do { \
- check_fnum = False; \
+ check_fnum = false; \
call_name = #call; \
sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
sfinfo.generic.in.file.path = path_fname; \
@@ -107,7 +107,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
if (!NT_STATUS_EQUAL(status, rightstatus)) { \
printf("(%s) %s - %s (should be %s)\n", __location__, #call, \
nt_errstr(status), nt_errstr(rightstatus)); \
- ret = False; \
+ ret = false; \
} \
finfo1.generic.level = RAW_FILEINFO_ALL_INFO; \
finfo1.generic.in.file.path = path_fname; \
@@ -118,7 +118,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
} \
if (!NT_STATUS_IS_OK(status2)) { \
printf("(%s) %s pathinfo - %s\n", __location__, #call, nt_errstr(status2)); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK1(call) \
@@ -137,7 +137,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
} \
if (!NT_STATUS_IS_OK(status2)) { \
printf("%s - %s\n", #call, nt_errstr(status2)); \
- ret = False; \
+ ret = false; \
} \
}} while (0)
@@ -148,7 +148,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
call_name, #stype, #field, \
(uint_t)value, (uint_t)finfo2.stype.out.field); \
dump_all_info(torture, &finfo1); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_TIME(call, stype, field, value) do { \
@@ -161,7 +161,7 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
printf("\t%s", timestring(torture, value)); \
printf("\t%s\n", nt_time_string(torture, finfo2.stype.out.field)); \
dump_all_info(torture, &finfo1); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_STR(call, stype, field, value) do { \
@@ -172,14 +172,14 @@ bool torture_raw_sfileinfo(struct torture_context *torture,
value, \
finfo2.stype.out.field); \
dump_all_info(torture, &finfo1); \
- ret = False; \
+ ret = false; \
}} while (0)
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -447,7 +447,7 @@ done:
bool torture_raw_sfileinfo_rename(struct torture_context *torture,
struct smbcli_state *cli)
{
- BOOL ret = True;
+ bool ret = true;
int fnum_saved, d_fnum, fnum2, fnum = -1;
char *fnum_fname;
char *fnum_fname_new;
@@ -457,7 +457,7 @@ bool torture_raw_sfileinfo_rename(struct torture_context *torture,
union smb_setfileinfo sfinfo;
NTSTATUS status, status2;
const char *call_name;
- BOOL check_fnum;
+ bool check_fnum;
int n = time(NULL) % 100;
asprintf(&path_fname, BASEDIR "\\fname_test_%d.txt", n);
@@ -466,7 +466,7 @@ bool torture_raw_sfileinfo_rename(struct torture_context *torture,
asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
RECREATE_BOTH;
@@ -597,5 +597,5 @@ bool torture_raw_sfileinfo_bug(struct torture_context *torture,
printf("now try and delete %s\n", fname);
- return True;
+ return true;
}
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 81181e49ab..14d674e482 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -32,7 +32,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -40,13 +40,13 @@
if ((v) != (correct)) { \
printf("(%s) Incorrect value %s=%d - should be %d\n", \
__location__, #v, (int)v, (int)correct); \
- ret = False; \
+ ret = false; \
}} while (0)
/*
check that a stream has the right contents
*/
-static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
+static bool check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
const char *fname, const char *sname,
const char *value)
{
@@ -62,15 +62,15 @@ static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
if (value == NULL) {
if (fnum != -1) {
printf("should have failed stream open of %s\n", full_name);
- return False;
+ return false;
}
- return True;
+ return true;
}
if (fnum == -1) {
printf("Failed to open stream '%s' - %s\n",
full_name, smbcli_errstr(cli->tree));
- return False;
+ return false;
}
buf = talloc_array(mem_ctx, uint8_t, strlen(value)+11);
@@ -79,28 +79,28 @@ static BOOL check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
if (ret != strlen(value)) {
printf("Failed to read %lu bytes from stream '%s' - got %d\n",
(long)strlen(value), full_name, (int)ret);
- return False;
+ return false;
}
if (memcmp(buf, value, strlen(value)) != 0) {
printf("Bad data in stream\n");
- return False;
+ return false;
}
smbcli_close(cli->tree, fnum);
- return True;
+ return true;
}
/*
test basic io on streams
*/
-static BOOL test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
union smb_open io;
const char *fname = BASEDIR "\\stream.txt";
const char *sname1, *sname2;
- BOOL ret = True;
+ bool ret = true;
int fnum = -1;
ssize_t retsize;
@@ -219,7 +219,7 @@ bool torture_raw_streams(struct torture_context *torture,
bool ret = true;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
ret &= test_stream_io(cli, torture);
diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c
index 287a8b3458..b9043a5899 100644
--- a/source4/torture/raw/unlink.c
+++ b/source4/torture/raw/unlink.c
@@ -29,7 +29,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -42,11 +42,11 @@ static bool test_unlink(struct torture_context *tctx, struct smbcli_state *cli)
{
union smb_unlink io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
const char *fname = BASEDIR "\\test.txt";
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Trying non-existant file\n");
@@ -207,7 +207,7 @@ static bool test_delete_on_close(struct torture_context *tctx,
union smb_unlink io;
struct smb_rmdir dio;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum, fnum2;
const char *fname = BASEDIR "\\test.txt";
const char *dname = BASEDIR "\\test.dir";
@@ -215,7 +215,7 @@ static bool test_delete_on_close(struct torture_context *tctx,
union smb_setfileinfo sfinfo;
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
dio.in.path = dname;
diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c
index 6151c60a71..98a0dde8c7 100644
--- a/source4/torture/raw/write.c
+++ b/source4/torture/raw/write.c
@@ -30,7 +30,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -38,13 +38,13 @@
if ((v) != (correct)) { \
printf("(%s) Incorrect value %s=%d - should be %d\n", \
__location__, #v, v, correct); \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
#define CHECK_BUFFER(buf, seed, len) do { \
if (!check_buffer(buf, seed, len, __location__)) { \
- ret = False; \
+ ret = false; \
goto done; \
}} while (0)
@@ -57,7 +57,7 @@
printf("(%s) wrong value for field %s %.0f - %.0f\n", \
__location__, #field, (double)v, (double)finfo.all_info.out.field); \
dump_all_info(tctx, &finfo); \
- ret = False; \
+ ret = false; \
}} while (0)
@@ -77,7 +77,7 @@ static void setup_buffer(uint8_t *buf, uint_t seed, int len)
/*
check a random buffer based on a seed
*/
-static BOOL check_buffer(uint8_t *buf, uint_t seed, int len, const char *location)
+static bool check_buffer(uint8_t *buf, uint_t seed, int len, const char *location)
{
int i;
srandom(seed);
@@ -86,10 +86,10 @@ static BOOL check_buffer(uint8_t *buf, uint_t seed, int len, const char *locatio
if (buf[i] != v) {
printf("Buffer incorrect at %s! ofs=%d buf=0x%x correct=0x%x\n",
location, i, buf[i], v);
- return False;
+ return false;
}
}
- return True;
+ return true;
}
/*
@@ -100,7 +100,7 @@ static bool test_write(struct torture_context *tctx,
{
union smb_write io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -111,7 +111,7 @@ static bool test_write(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_WRITE_WRITE\n");
@@ -120,7 +120,7 @@ static bool test_write(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -147,7 +147,7 @@ static bool test_write(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf+4, seed, 9);
@@ -166,7 +166,7 @@ static bool test_write(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -207,7 +207,7 @@ static bool test_write(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -228,7 +228,7 @@ static bool test_writex(struct torture_context *tctx,
{
union smb_write io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum, i;
uint8_t *buf;
const int maxsize = 90000;
@@ -245,7 +245,7 @@ static bool test_writex(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_WRITE_WRITEX\n");
@@ -254,7 +254,7 @@ static bool test_writex(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -282,7 +282,7 @@ static bool test_writex(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf+4, seed, 9);
@@ -301,7 +301,7 @@ static bool test_writex(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -334,7 +334,7 @@ static bool test_writex(struct torture_context *tctx,
cli->session->pid++;
if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 3, 1, 0, WRITE_LOCK))) {
printf("Failed to lock file at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
cli->session->pid--;
@@ -367,7 +367,7 @@ static bool test_writex(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -391,7 +391,7 @@ static bool test_writex(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed+1, 4000);
@@ -416,7 +416,7 @@ static bool test_writeunlock(struct torture_context *tctx,
{
union smb_write io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -427,7 +427,7 @@ static bool test_writeunlock(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_WRITE_WRITEUNLOCK\n");
@@ -436,7 +436,7 @@ static bool test_writeunlock(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -460,7 +460,7 @@ static bool test_writeunlock(struct torture_context *tctx,
CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf+4, seed, 9);
@@ -476,7 +476,7 @@ static bool test_writeunlock(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf+4, seed, 9);
@@ -500,7 +500,7 @@ static bool test_writeunlock(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -538,7 +538,7 @@ static bool test_writeunlock(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, io.writeunlock.in.offset, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -559,7 +559,7 @@ static bool test_writeclose(struct torture_context *tctx,
{
union smb_write io;
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
int fnum;
uint8_t *buf;
const int maxsize = 90000;
@@ -570,7 +570,7 @@ static bool test_writeclose(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
if (!torture_setup_dir(cli, BASEDIR)) {
- return False;
+ return false;
}
printf("Testing RAW_WRITE_WRITECLOSE\n");
@@ -579,7 +579,7 @@ static bool test_writeclose(struct torture_context *tctx,
fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum == -1) {
printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree));
- ret = False;
+ ret = false;
goto done;
}
@@ -614,7 +614,7 @@ static bool test_writeclose(struct torture_context *tctx,
if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf+4, seed, 9);
@@ -631,7 +631,7 @@ static bool test_writeclose(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf+4, seed, 9);
@@ -656,7 +656,7 @@ static bool test_writeclose(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);
@@ -695,7 +695,7 @@ static bool test_writeclose(struct torture_context *tctx,
memset(buf, 0, maxsize);
if (smbcli_read(cli->tree, fnum, buf, io.writeclose.in.offset, 4000) != 4000) {
printf("read failed at %s\n", __location__);
- ret = False;
+ ret = false;
goto done;
}
CHECK_BUFFER(buf, seed, 4000);