torture_assert(tctx, fnum1 == -1, talloc_asprintf(tctx, "open of %s succeeded (should fail)",
fname));
- return True;
+ return true;
}
/* Test 2 - this should delete the file on close. */
talloc_asprintf(tctx, "open of %s failed (%s)",
fname, smbcli_errstr(cli1->tree)));
- torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli1->tree, fnum1, True),
+ torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli1->tree, fnum1, true),
talloc_asprintf(tctx, "setting delete_on_close failed (%s)",
smbcli_errstr(cli1->tree)));
if (NT_STATUS_IS_ERR(smbcli_close(cli1->tree, fnum1))) {
printf("(%s) close failed (%s)\n",
__location__, smbcli_errstr(cli1->tree));
- return False;
+ return false;
}
smbcli_unlink(cli1->tree, fname);
}
fname, smbcli_errstr(cli1->tree)));
torture_assert_ntstatus_ok(tctx,
- smbcli_nt_delete_on_close(cli1->tree, fnum1, True),
+ smbcli_nt_delete_on_close(cli1->tree, fnum1, true),
talloc_asprintf(tctx, "setting delete_on_close failed (%s)",
smbcli_errstr(cli1->tree)));
__location__, smbcli_errstr(cli1->tree));
}
smbcli_unlink(cli1->tree, fname);
- return False;
+ return false;
}
- return True;
+ return true;
}
/* Test 4 ... */
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
smbcli_errstr(cli1->tree)));
torture_assert_ntstatus_ok(tctx,
- smbcli_nt_delete_on_close(cli1->tree, fnum1, True),
+ smbcli_nt_delete_on_close(cli1->tree, fnum1, true),
talloc_asprintf(tctx, "setting delete_on_close failed (%s)",
smbcli_errstr(cli1->tree)));
/* This should fail - only allowed on NT opens with DELETE access. */
- torture_assert(tctx, !NT_STATUS_IS_OK(smbcli_nt_delete_on_close(cli1->tree, fnum1, True)),
+ torture_assert(tctx, !NT_STATUS_IS_OK(smbcli_nt_delete_on_close(cli1->tree, fnum1, true)),
"setting delete_on_close on OpenX file succeeded - should fail !");
torture_assert_ntstatus_ok(tctx, smbcli_close(cli1->tree, fnum1),
talloc_asprintf(tctx, "close - 2 failed (%s)", smbcli_errstr(cli1->tree)));
- return True;
+ return true;
}
/* Test 6 ... */
/* This should fail - only allowed on NT opens with DELETE access. */
torture_assert(tctx,
- !NT_STATUS_IS_OK(smbcli_nt_delete_on_close(cli1->tree, fnum1, True)),
+ !NT_STATUS_IS_OK(smbcli_nt_delete_on_close(cli1->tree, fnum1, true)),
"setting delete_on_close on file with no delete access succeeded - should fail !");
torture_assert_ntstatus_ok(tctx,
talloc_asprintf(tctx, "close - 2 failed (%s)",
smbcli_errstr(cli1->tree)));
- return True;
+ return true;
}
/* Test 7 ... */
static bool deltest7(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
{
int fnum1 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open of %s failed (%s)",
fname, smbcli_errstr(cli1->tree)));
- torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli1->tree, fnum1, True),
+ torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli1->tree, fnum1, true),
"setting delete_on_close on file failed !");
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, true, __location__);
torture_assert_ntstatus_ok(tctx,
- smbcli_nt_delete_on_close(cli1->tree, fnum1, False),
+ smbcli_nt_delete_on_close(cli1->tree, fnum1, false),
"unsetting delete_on_close on file failed !");
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
torture_assert_ntstatus_ok(tctx, smbcli_close(cli1->tree, fnum1),
talloc_asprintf(tctx, "close - 2 failed (%s)", smbcli_errstr(cli1->tree)));
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
fname, smbcli_errstr(cli1->tree)));
torture_assert_ntstatus_ok(tctx,
- smbcli_nt_delete_on_close(cli1->tree, fnum1, True),
+ smbcli_nt_delete_on_close(cli1->tree, fnum1, true),
"setting delete_on_close on file failed !");
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, True, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, true, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, true, __location__);
torture_assert_ntstatus_ok(tctx, smbcli_close(cli1->tree, fnum1),
talloc_asprintf(tctx, "close - 1 failed (%s)",
smbcli_errstr(cli1->tree)));
- correct &= check_delete_on_close(tctx, cli1, -1, fname, True, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, -1, fname, true, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, true, __location__);
torture_assert_ntstatus_ok(tctx, smbcli_close(cli2->tree, fnum2),
talloc_asprintf(tctx, "close - 2 failed (%s)", smbcli_errstr(cli2->tree)));
talloc_asprintf(tctx, "open of %s succeeded should have failed!",
fname));
- return True;
+ return true;
}
/* Test 10 ... */
torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open of %s failed (%s)",
fname, smbcli_errstr(cli1->tree)));
- status = smbcli_nt_delete_on_close(cli1->tree, fnum1, True);
+ status = smbcli_nt_delete_on_close(cli1->tree, fnum1, true);
torture_assert_ntstatus_equal(tctx, status, NT_STATUS_CANNOT_DELETE,
talloc_asprintf(tctx, "setting delete_on_close should fail with NT_STATUS_CANNOT_DELETE. Got %s instead)", smbcli_errstr(cli1->tree)));
talloc_asprintf(tctx, "close failed (%s)",
smbcli_errstr(cli1->tree)));
- return True;
+ return true;
}
/* Test 12 ... */
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
torture_assert_ntstatus_ok(tctx,
smbcli_nt_delete_on_close(cli1->tree, fnum1,
- True),
+ true),
"setting delete_on_close on file failed !");
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, True, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, true, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, true, __location__);
torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli2->tree, fnum2,
- False),
+ false),
"setting delete_on_close on file failed !");
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
torture_assert_ntstatus_ok(tctx, smbcli_close(cli1->tree, fnum1),
talloc_asprintf(tctx, "close - 1 failed (%s)",
torture_assert(tctx, dnum1 != -1, talloc_asprintf(tctx, "open of %s failed: %s!",
dname, smbcli_errstr(cli1->tree)));
- correct &= check_delete_on_close(tctx, cli1, dnum1, dname, False, __location__);
- torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli1->tree, dnum1, True),
+ correct &= check_delete_on_close(tctx, cli1, dnum1, dname, false, __location__);
+ torture_assert_ntstatus_ok(tctx, smbcli_nt_delete_on_close(cli1->tree, dnum1, true),
"setting delete_on_close on file failed !");
- correct &= check_delete_on_close(tctx, cli1, dnum1, dname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, dnum1, dname, true, __location__);
smbcli_close(cli1->tree, dnum1);
/* Now it should be gone... */
talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
fname_new, smbcli_errstr(cli1->tree)));
- status = smbcli_nt_delete_on_close(cli2->tree, fnum2, True);
+ status = smbcli_nt_delete_on_close(cli2->tree, fnum2, true);
torture_assert_ntstatus_ok(tctx, status,
"setting delete_on_close on file failed !");
/* The file should be around under the new name, there's a second
* handle open */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname_new, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname_new, true, __location__);
fnum2 = smbcli_nt_create_full(cli2->tree, fname, 0,
SEC_GENERIC_ALL,
torture_assert(tctx, fnum2 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
fname, smbcli_errstr(cli1->tree)));
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
smbcli_close(cli2->tree, fnum2);
smbcli_close(cli1->tree, fnum1);
torture_assert (tctx, fnum1 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)", fname, smbcli_errstr(cli1->tree)));
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, -1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli2, -1, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, -1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli2, -1, fname, false, __location__);
/* Now try opening again for read-only. */
fnum2 = smbcli_nt_create_full(cli2->tree, fname, 0,
torture_assert(tctx, fnum2 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
fname, smbcli_errstr(cli1->tree)));
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli1, -1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli2, -1, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli1, -1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli2, -1, fname, false, __location__);
smbcli_close(cli1->tree, fnum1);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, True, __location__);
- correct &= check_delete_on_close(tctx, cli2, -1, fname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, true, __location__);
+ correct &= check_delete_on_close(tctx, cli2, -1, fname, true, __location__);
smbcli_close(cli2->tree, fnum2);
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
fname, smbcli_errstr(cli1->tree)));
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
/* Now try opening again for read-only. */
fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0,
fname, smbcli_errstr(cli1->tree)));
/* still not reported as being set on either */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli1, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum2, fname, false, __location__);
smbcli_close(cli1->tree, fnum1);
- correct &= check_delete_on_close(tctx, cli1, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum2, fname, false, __location__);
smbcli_close(cli1->tree, fnum2);
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
dname, smbcli_errstr(cli1->tree)));
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, dname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, dname, false, __location__);
/* Now try opening again for read-only. */
fnum2 = smbcli_nt_create_full(cli1->tree, dname, 0,
torture_assert(tctx, fnum2 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
dname, smbcli_errstr(cli1->tree)));
- correct &= check_delete_on_close(tctx, cli1, fnum1, dname, False, __location__);
- correct &= check_delete_on_close(tctx, cli1, fnum2, dname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, dname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum2, dname, false, __location__);
smbcli_close(cli1->tree, fnum1);
- correct &= check_delete_on_close(tctx, cli1, fnum2, dname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum2, dname, true, __location__);
smbcli_close(cli1->tree, fnum2);
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
talloc_asprintf(tctx, "open - 1 of %s failed (%s)", fname, smbcli_errstr(cli1->tree)));
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, dname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, dname, false, __location__);
/* Now try opening again for read-only. */
fnum2 = smbcli_nt_create_full(cli1->tree, dname, 0,
smbcli_close(cli1->tree, fnum1);
- correct &= check_delete_on_close(tctx, cli1, fnum2, dname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum2, dname, true, __location__);
smbcli_close(cli1->tree, fnum2);
{
int fnum1 = -1;
int dnum1 = -1;
- bool correct = True;
+ bool correct = true;
NTSTATUS status;
del_clean_area(cli1, cli2);
/* Test 20 -- non-empty directory hardest to get right... */
- if (torture_setting_bool(tctx, "samba3", False)) {
- return True;
+ if (torture_setting_bool(tctx, "samba3", false)) {
+ return true;
}
smbcli_deltree(cli1->tree, dname);
torture_assert(tctx, dnum1 != -1, talloc_asprintf(tctx, "open of %s failed: %s!",
dname, smbcli_errstr(cli1->tree)));
- correct &= check_delete_on_close(tctx, cli1, dnum1, dname, False, __location__);
- status = smbcli_nt_delete_on_close(cli1->tree, dnum1, True);
+ correct &= check_delete_on_close(tctx, cli1, dnum1, dname, false, __location__);
+ status = smbcli_nt_delete_on_close(cli1->tree, dnum1, true);
{
char *fullname;
"smbcli_open failed");
}
- status = smbcli_nt_delete_on_close(cli1->tree, dnum1, False);
+ status = smbcli_nt_delete_on_close(cli1->tree, dnum1, false);
torture_assert_ntstatus_ok(tctx, status,
"setting delete_on_close on file failed !");
smbcli_close(cli1->tree, fnum1);
}
- status = smbcli_nt_delete_on_close(cli1->tree, dnum1, True);
+ status = smbcli_nt_delete_on_close(cli1->tree, dnum1, true);
torture_assert_ntstatus_equal(tctx, status, NT_STATUS_DIRECTORY_NOT_EMPTY,
"setting delete_on_close failed");
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
fname, smbcli_errstr(cli2->tree)));
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
smbcli_close(cli1->tree, fnum1);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
smbcli_close(cli2->tree, fnum2);
{
int fnum1 = -1;
int fnum2 = -1;
- bool correct = True;
+ bool correct = true;
del_clean_area(cli1, cli2);
fname, smbcli_errstr(cli2->tree)));
/* The delete on close bit is *not* reported as being set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, False, __location__);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
smbcli_close(cli1->tree, fnum1);
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname, False, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
/* Rename the file by handle. */
fname, fname_new, smbcli_errstr(cli2->tree)));
}
- correct &= check_delete_on_close(tctx, cli2, fnum2, fname_new, False, __location__);
+ correct &= check_delete_on_close(tctx, cli2, fnum2, fname_new, false, __location__);
smbcli_close(cli2->tree, fnum2);
int fnum1 = -1;
struct smbcli_state *cli1;
struct smbcli_state *cli2;
- bool correct = True;
+ bool correct = true;
if (!torture_open_connection(&cli1, 0))
- return False;
+ return false;
if (!torture_open_connection(&cli2, 1))
- return False;
+ return false;
del_clean_area(cli1, cli2);
fname, smbcli_errstr(cli1->tree)));
torture_assert_ntstatus_ok(tctx,
- smbcli_nt_delete_on_close(cli1->tree, fnum1, True),
+ smbcli_nt_delete_on_close(cli1->tree, fnum1, true),
talloc_asprintf(tctx, "setting delete_on_close failed (%s)",
smbcli_errstr(cli1->tree)));
/* Ensure delete on close is set. */
- correct &= check_delete_on_close(tctx, cli1, fnum1, fname, True, __location__);
+ correct &= check_delete_on_close(tctx, cli1, fnum1, fname, true, __location__);
/* Now yank the rug from under cli1. */
smbcli_transport_dead(cli1->transport, NT_STATUS_LOCAL_DISCONNECT);
fnum1 = -1;
if (!torture_open_connection(&cli1, 0)) {
- return False;
+ return false;
}
/* On slow build farm machines it might happen that they are not fast
int dnum1 = -1;
int dnum2 = -1;
struct smbcli_state *cli1;
- bool correct = True;
+ bool correct = true;
if (!torture_open_connection(&cli1, 0))
- return False;
+ return false;
smbcli_deltree(cli1->tree, dname);
dname, smbcli_errstr(cli1->tree)));
torture_assert_ntstatus_ok(
- tctx, smbcli_nt_delete_on_close(cli1->tree, dnum1, True),
+ tctx, smbcli_nt_delete_on_close(cli1->tree, dnum1, true),
talloc_asprintf(tctx, "setting delete_on_close failed (%s)",
smbcli_errstr(cli1->tree)));