From: Michael Adam Date: Thu, 9 Aug 2012 14:11:08 +0000 (+0200) Subject: s3:torture:delete: fix 11th test to work against windows X-Git-Tag: samba-4.0.0beta6~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db160bf5100b7c8bd7a1712c76354b30cd7c4925;p=thirdparty%2Fsamba.git s3:torture:delete: fix 11th test to work against windows --- diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 8324db2ecd0..e0570c5dc66 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4259,8 +4259,7 @@ static bool run_deletetest(int dummy) cli_setatr(cli1, fname, 0, 0); cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); - /* What error do we get when attempting to open a read-only file with - delete access ? */ + /* Can we open a read-only file with delete access? */ /* Create a readonly file. */ status = cli_ntcreate(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA, @@ -4282,16 +4281,14 @@ static bool run_deletetest(int dummy) FILE_READ_ATTRIBUTES|DELETE_ACCESS, 0, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - FILE_OVERWRITE_IF, 0, 0, &fnum1); - if (NT_STATUS_IS_OK(status)) { - printf("[11] open of %s succeeded should have been denied with ACCESS_DENIED!\n", fname); - cli_close(cli1, fnum1); - goto fail; - } else if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) { - printf("[11] open of %s should have been denied with ACCESS_DENIED! Got error %s\n", fname, nt_errstr(status)); + FILE_OPEN, 0, 0, &fnum1); + if (!NT_STATUS_IS_OK(status)) { + printf("[11] open of %s failed: %s\n", fname, nt_errstr(status)); goto fail; } + cli_close(cli1, fnum1); + printf("eleventh delete on close test succeeded.\n"); printf("finished delete test\n");