summaryrefslogtreecommitdiffstats
path: root/source3/torture/denytest.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/torture/denytest.c')
-rw-r--r--source3/torture/denytest.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c
index 1f60734fa7..be01e829dc 100644
--- a/source3/torture/denytest.c
+++ b/source3/torture/denytest.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "torture/proto.h"
+#include "libsmb/libsmb.h"
extern bool torture_showall;
@@ -1421,9 +1422,10 @@ bool torture_denytest1(int dummy)
printf("starting denytest1\n");
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
+ cli_unlink(cli1, fnames[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE, &fnum1);
- cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
+ cli_writeall(cli1, fnum1, 0, (const uint8_t *)fnames[i], 0,
+ strlen(fnames[i]), NULL);
cli_close(cli1, fnum1);
}
@@ -1452,7 +1454,9 @@ bool torture_denytest1(int dummy)
if (cli_read(cli1, fnum2, (char *)&x, 0, 1) == 1) {
res += A_R;
}
- if (cli_write(cli1, fnum2, 0, (char *)&x, 0, 1) == 1) {
+ if (NT_STATUS_IS_OK(cli_writeall(cli1, fnum2, 0,
+ (uint8_t *)&x, 0, 1,
+ NULL))) {
res += A_W;
}
}
@@ -1481,7 +1485,7 @@ bool torture_denytest1(int dummy)
}
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
+ cli_unlink(cli1, fnames[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
}
if (!torture_close_connection(cli1)) {
@@ -1512,9 +1516,10 @@ bool torture_denytest2(int dummy)
printf("starting denytest2\n");
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
+ cli_unlink(cli1, fnames[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE, &fnum1);
- cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
+ cli_writeall(cli1, fnum1, 0, (const uint8_t *)fnames[i], 0,
+ strlen(fnames[i]), NULL);
cli_close(cli1, fnum1);
}
@@ -1541,7 +1546,9 @@ bool torture_denytest2(int dummy)
if (cli_read(cli2, fnum2, (char *)&x, 0, 1) == 1) {
res += A_R;
}
- if (cli_write(cli2, fnum2, 0, (char *)&x, 0, 1) == 1) {
+ if (NT_STATUS_IS_OK(cli_writeall(cli2, fnum2, 0,
+ (uint8_t *)&x, 0, 1,
+ NULL))) {
res += A_W;
}
}
@@ -1570,7 +1577,7 @@ bool torture_denytest2(int dummy)
}
for (i=0;i<2;i++) {
- cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
+ cli_unlink(cli1, fnames[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
}
if (!torture_close_connection(cli1)) {