diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/torture/denytest.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/torture/denytest.c')
-rw-r--r-- | source3/torture/denytest.c | 23 |
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)) { |