diff options
author | Volker Lendecke <vl@samba.org> | 2012-01-06 14:28:55 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-01-06 17:23:43 +0100 |
commit | 6529e520ee777e279f8211e24fc7575326298d0c (patch) | |
tree | 95afe72896cc9b6186475b783a1dbc8353ae833e | |
parent | 487c9d3b83ba41e0418ca67490adf9dbb2bcd09d (diff) | |
download | samba-6529e520ee777e279f8211e24fc7575326298d0c.tar.gz samba-6529e520ee777e279f8211e24fc7575326298d0c.tar.bz2 samba-6529e520ee777e279f8211e24fc7575326298d0c.zip |
s3: Use DELETE_ON_CLOSE instead of unlink
-rw-r--r-- | source3/torture/test_cleanup.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/torture/test_cleanup.c b/source3/torture/test_cleanup.c index 2b4989e48b..39f579a9cd 100644 --- a/source3/torture/test_cleanup.c +++ b/source3/torture/test_cleanup.c @@ -52,7 +52,12 @@ bool run_cleanup1(int dummy) if (!torture_open_connection(&cli, 1)) { return false; } - status = cli_openx(cli, fname, O_RDWR|O_CREAT, DENY_ALL, &fnum); + status = cli_ntcreate( + cli, fname, 0, + FILE_GENERIC_READ|FILE_GENERIC_WRITE|DELETE_ACCESS, + FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + FILE_OPEN, FILE_DELETE_ON_CLOSE, 0, &fnum); if (!NT_STATUS_IS_OK(status)) { printf("2nd open of %s failed (%s)\n", fname, nt_errstr(status)); @@ -60,12 +65,6 @@ bool run_cleanup1(int dummy) } cli_close(cli, fnum); - status = cli_unlink(cli, fname, 0); - if (!NT_STATUS_IS_OK(status)) { - printf("cli_unlink failed: %s\n", nt_errstr(status)); - goto done; - } -done: torture_close_connection(cli); return NT_STATUS_IS_OK(status); } |