Make cli_unlink async.
authorJeremy Allison <jra@samba.org>
Thu, 30 Apr 2009 01:26:02 +0000 (18:26 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 30 Apr 2009 01:26:02 +0000 (18:26 -0700)
Jeremy.

13 files changed:
source3/client/client.c
source3/include/proto.h
source3/libsmb/clifile.c
source3/libsmb/libsmb_dir.c
source3/torture/denytest.c
source3/torture/locktest.c
source3/torture/locktest2.c
source3/torture/mangle_test.c
source3/torture/masktest.c
source3/torture/nbio.c
source3/torture/scanner.c
source3/torture/torture.c
source3/torture/utable.c

index 0271b456c3b8dc00f1fa4ee7f6d8ec0b2f045f10..7dda981800ac77d20d30b7b0839ee30815c6adb2 100644 (file)
@@ -2115,7 +2115,7 @@ static void do_del(file_info *finfo, const char *dir)
                return;
        }
 
-       if (!cli_unlink(finfo->cli, mask)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(finfo->cli, mask, aSYSTEM | aHIDDEN))) {
                d_printf("%s deleting remote file %s\n",
                                cli_errstr(finfo->cli),mask);
        }
@@ -2191,7 +2191,7 @@ static int cmd_wdel(void)
                return 1;
        }
 
-       if (!cli_unlink_full(targetcli, targetname, attribute)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(targetcli, targetname, attribute))) {
                d_printf("%s deleting remote files %s\n",cli_errstr(targetcli),targetname);
        }
        return 0;
index 962215b79fa5ad4dfffd2cb6dc5292ae3ac59837..11fd45ed5eb624caad5c3b29485d768ac80cc5ff 100644 (file)
@@ -2355,8 +2355,13 @@ struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
 NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
 NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
 
-bool cli_unlink_full(struct cli_state *cli, const char *fname, uint16_t attrs);
-bool cli_unlink(struct cli_state *cli, const char *fname);
+struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
+                                struct event_context *ev,
+                                struct cli_state *cli,
+                                const char *fname,
+                                uint16_t mayhave_attrs);
+NTSTATUS cli_unlink_recv(struct tevent_req *req);
+NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
 
 struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
                                  struct event_context *ev,
index e055a88000ba058d10edd7b58a888b57bc480db2..54c59473e6c46451a26e1f8277859cabcdd804dd 100644 (file)
@@ -756,46 +756,111 @@ NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const cha
  Delete a file.
 ****************************************************************************/
 
-bool cli_unlink_full(struct cli_state *cli, const char *fname, uint16_t attrs)
-{
-       char *p;
+static void cli_unlink_done(struct tevent_req *subreq);
 
-       memset(cli->outbuf,'\0',smb_size);
-       memset(cli->inbuf,'\0',smb_size);
+struct cli_unlink_state {
+       uint16_t vwv[1];
+};
 
-       cli_set_message(cli->outbuf,1, 0, true);
+struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
+                               struct event_context *ev,
+                               struct cli_state *cli,
+                               const char *fname,
+                               uint16_t mayhave_attrs)
+{
+       struct tevent_req *req = NULL, *subreq = NULL;
+       struct cli_unlink_state *state = NULL;
+       uint8_t additional_flags = 0;
+       uint8_t *bytes = NULL;
 
-       SCVAL(cli->outbuf,smb_com,SMBunlink);
-       SSVAL(cli->outbuf,smb_tid,cli->cnum);
-       cli_setup_packet(cli);
+       req = tevent_req_create(mem_ctx, &state, struct cli_unlink_state);
+       if (req == NULL) {
+               return NULL;
+       }
 
-       SSVAL(cli->outbuf,smb_vwv0, attrs);
+       SSVAL(state->vwv+0, 0, mayhave_attrs);
 
-       p = smb_buf(cli->outbuf);
-       *p++ = 4;
-       p += clistr_push(cli, p, fname,
-                       cli->bufsize - PTR_DIFF(p,cli->outbuf), STR_TERMINATE);
+       bytes = talloc_array(state, uint8_t, 1);
+       if (tevent_req_nomem(bytes, req)) {
+               return tevent_req_post(req, ev);
+       }
+       bytes[0] = 4;
+       bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), fname,
+                                  strlen(fname)+1, NULL);
 
-       cli_setup_bcc(cli, p);
-       cli_send_smb(cli);
-       if (!cli_receive_smb(cli)) {
-               return false;
+       if (tevent_req_nomem(bytes, req)) {
+               return tevent_req_post(req, ev);
        }
 
-       if (cli_is_error(cli)) {
-               return false;
+       subreq = cli_smb_send(state, ev, cli, SMBunlink, additional_flags,
+                               1, state->vwv, talloc_get_size(bytes), bytes);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
        }
+       tevent_req_set_callback(subreq, cli_unlink_done, req);
+       return req;
+}
 
-       return true;
+static void cli_unlink_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       NTSTATUS status;
+
+       status = cli_smb_recv(subreq, 0, NULL, NULL, NULL, NULL);
+       TALLOC_FREE(subreq);
+       if (!NT_STATUS_IS_OK(status)) {
+               tevent_req_nterror(req, status);
+               return;
+       }
+       tevent_req_done(req);
 }
 
-/****************************************************************************
- Delete a file.
-****************************************************************************/
+NTSTATUS cli_unlink_recv(struct tevent_req *req)
+{
+       return tevent_req_simple_recv_ntstatus(req);
+}
 
-bool cli_unlink(struct cli_state *cli, const char *fname)
+NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs)
 {
-       return cli_unlink_full(cli, fname, aSYSTEM | aHIDDEN);
+       TALLOC_CTX *frame = talloc_stackframe();
+       struct event_context *ev;
+       struct tevent_req *req;
+       NTSTATUS status = NT_STATUS_OK;
+
+       if (cli_has_async_calls(cli)) {
+               /*
+                * Can't use sync call while an async call is in flight
+                */
+               status = NT_STATUS_INVALID_PARAMETER;
+               goto fail;
+       }
+
+       ev = event_context_init(frame);
+       if (ev == NULL) {
+               status = NT_STATUS_NO_MEMORY;
+               goto fail;
+       }
+
+       req = cli_unlink_send(frame, ev, cli, fname, mayhave_attrs);
+       if (req == NULL) {
+               status = NT_STATUS_NO_MEMORY;
+               goto fail;
+       }
+
+       if (!tevent_req_poll(req, ev)) {
+               status = map_nt_error_from_unix(errno);
+               goto fail;
+       }
+
+       status = cli_unlink_recv(req);
+
+ fail:
+       TALLOC_FREE(frame);
+       if (!NT_STATUS_IS_OK(status)) {
+               cli_set_error(cli, status);
+       }
+       return status;
 }
 
 /****************************************************************************
index bc5e35f79b73c3493f6d57cb16f9000dd8df54d1..d230275685df12f9742d73e0ddfa8d8e5109c998 100644 (file)
@@ -1760,7 +1760,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
        }
        /*d_printf(">>>unlink: resolved path as %s\n", targetpath);*/
 
-       if (!cli_unlink(targetcli, targetpath)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(targetcli, targetpath, aSYSTEM | aHIDDEN))) {
 
                errno = SMBC_errno(context, targetcli);
 
@@ -1966,7 +1966,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
                int eno = SMBC_errno(ocontext, targetcli1);
 
                if (eno != EEXIST ||
-                   !cli_unlink(targetcli1, targetpath2) ||
+                   !NT_STATUS_IS_OK(cli_unlink(targetcli1, targetpath2, aSYSTEM | aHIDDEN)) ||
                    !NT_STATUS_IS_OK(cli_rename(targetcli1, targetpath1, targetpath2))) {
 
                        errno = eno;
index 9b08552df7f7e2f4ca307fc0cd923dc8eca2ab5a..cbcbf320f86b496a80debbc70de20594cc778265 100644 (file)
@@ -1418,7 +1418,7 @@ bool torture_denytest1(int dummy)
        printf("starting denytest1\n");
 
        for (i=0;i<2;i++) {
-               cli_unlink(cli1, fnames[i]);
+               cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
                fnum1 = cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
                cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
                cli_close(cli1, fnum1);
@@ -1474,7 +1474,7 @@ bool torture_denytest1(int dummy)
        }
 
        for (i=0;i<2;i++) {
-               cli_unlink(cli1, fnames[i]);
+               cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
        }
                
        if (!torture_close_connection(cli1)) {
@@ -1504,7 +1504,7 @@ bool torture_denytest2(int dummy)
        printf("starting denytest2\n");
 
        for (i=0;i<2;i++) {
-               cli_unlink(cli1, fnames[i]);
+               cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
                fnum1 = cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
                cli_write(cli1, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
                cli_close(cli1, fnum1);
@@ -1558,7 +1558,7 @@ bool torture_denytest2(int dummy)
        }
                
        for (i=0;i<2;i++) {
-               cli_unlink(cli1, fnames[i]);
+               cli_unlink(cli1, fnames[i], aSYSTEM | aHIDDEN);
        }
 
        if (!torture_close_connection(cli1)) {
index 4e8dcdd09aa5cfbb4483a6a635ba454ea12a9fb6..67c9516fb045714fba0c677ae9428e74994e76f6 100644 (file)
@@ -398,7 +398,7 @@ static void close_files(struct cli_state *cli[NSERVERS][NCONNECTIONS],
                }
        }
        for (server=0;server<NSERVERS;server++) {
-               cli_unlink(cli[server][0], FILENAME);
+               cli_unlink(cli[server][0], FILENAME, aSYSTEM | aHIDDEN);
        }
 }
 
index 68e18439e841a834fbcf96213bcc774f0e743393..10e2cbe772b8c301e4e231126cbaca3ff742bb21 100644 (file)
@@ -317,7 +317,7 @@ static void close_files(struct cli_state *cli[NSERVERS][NCONNECTIONS],
                }
        }
        for (server=0;server<NSERVERS;server++) {
-               cli_unlink(cli[server][0], FILENAME);
+               cli_unlink(cli[server][0], FILENAME, aSYSTEM | aHIDDEN);
        }
 }
 
index 81bdbce04d39ca606322f439e5253c687be22bac..e4468945c18c1a836f24a1e199e2037de8c7fbf0 100644 (file)
@@ -56,7 +56,7 @@ static bool test_one(struct cli_state *cli, const char *name)
        }
 
        fstr_sprintf(name2, "\\mangle_test\\%s", shortname);
-       if (!cli_unlink(cli, name2)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli, name2, aSYSTEM | aHIDDEN))) {
                printf("unlink of %s  (%s) failed (%s)\n", 
                       name2, name, cli_errstr(cli));
                return False;
@@ -74,11 +74,11 @@ static bool test_one(struct cli_state *cli, const char *name)
        }
 
        /* and unlink by long name */
-       if (!cli_unlink(cli, name)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli, name, aSYSTEM | aHIDDEN))) {
                printf("unlink2 of %s  (%s) failed (%s)\n", 
                       name, name2, cli_errstr(cli));
                failures++;
-               cli_unlink(cli, name2);
+               cli_unlink(cli, name2, aSYSTEM | aHIDDEN);
                return True;
        }
 
@@ -177,7 +177,7 @@ bool torture_mangle(int dummy)
                return False;
        }
 
-       cli_unlink(cli, "\\mangle_test\\*");
+       cli_unlink(cli, "\\mangle_test\\*", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\mangle_test");
 
        if (!NT_STATUS_IS_OK(cli_mkdir(cli, "\\mangle_test"))) {
@@ -201,7 +201,7 @@ bool torture_mangle(int dummy)
                }
        }
 
-       cli_unlink(cli, "\\mangle_test\\*");
+       cli_unlink(cli, "\\mangle_test\\*", aSYSTEM | aHIDDEN);
        if (!NT_STATUS_IS_OK(cli_rmdir(cli, "\\mangle_test"))) {
                printf("ERROR: Failed to remove directory\n");
                return False;
index fb562c80755d396cb9d51ed5eff2da21dbf6d90b..e80f9cd665c918879db1dcf4319906aa7e70c1f1 100644 (file)
@@ -350,7 +350,7 @@ static void testpair(struct cli_state *cli, const char *mask, const char *file)
                if (die_on_error) exit(1);
        }
 
-       cli_unlink(cli, file);
+       cli_unlink(cli, file, aSYSTEM | aHIDDEN);
 
        if (count % 100 == 0) DEBUG(0,("%d\n", count));
        SAFE_FREE(long_name);
@@ -367,7 +367,7 @@ static void test_mask(int argc, char *argv[],
 
        cli_mkdir(cli, "\\masktest");
 
-       cli_unlink(cli, "\\masktest\\*");
+       cli_unlink(cli, "\\masktest\\*", aSYSTEM | aHIDDEN);
 
        if (argc >= 2) {
                while (argc >= 2) {
index 7503e59357a619152b69cd6184be8ebf0d324d68..1542a8ffb47389664016436678f866ac2a1c9460 100644 (file)
@@ -128,7 +128,7 @@ void nb_setup(struct cli_state *cli)
 
 void nb_unlink(const char *fname)
 {
-       if (!cli_unlink(c, fname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(c, fname, aSYSTEM | aHIDDEN))) {
 #if NBDEBUG
                printf("(%d) unlink %s failed (%s)\n", 
                       line_count, fname, cli_errstr(c));
index 21b32dcf23e8dcae37c3db58066877246f02d7cb..3e9a24f121e3f959c9efdb8c2fd22643f091674c 100644 (file)
@@ -170,7 +170,7 @@ static bool scan_trans2(struct cli_state *cli, int op, int level,
 
        status = try_trans2_len(cli, "newfile", op, level, param, data, param_len, &data_len, 
                                &rparam_len, &rdata_len);
-       cli_unlink(cli, "\\newfile.dat");
+       cli_unlink(cli, "\\newfile.dat", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\newfile.dat");
        if (NT_STATUS_IS_OK(status)) return True;
 
@@ -372,7 +372,7 @@ static bool scan_nttrans(struct cli_state *cli, int op, int level,
 
        status = try_nttrans_len(cli, "newfile", op, level, param, data, param_len, &data_len, 
                                &rparam_len, &rdata_len);
-       cli_unlink(cli, "\\newfile.dat");
+       cli_unlink(cli, "\\newfile.dat", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\newfile.dat");
        if (NT_STATUS_IS_OK(status)) return True;
 
index 238a2f3c8304032293f109f9ff9d7b6642620f84..1f9d5dbb025ab009cadd622b4f66c288c102c90a 100644 (file)
@@ -487,7 +487,7 @@ static bool rw_torture(struct cli_state *c)
                        correct = False;
                }
 
-               if (!cli_unlink(c, fname)) {
+               if (!NT_STATUS_IS_OK(cli_unlink(c, fname, aSYSTEM | aHIDDEN))) {
                        printf("unlink failed (%s)\n", cli_errstr(c));
                        correct = False;
                }
@@ -499,7 +499,7 @@ static bool rw_torture(struct cli_state *c)
        }
 
        cli_close(c, fnum2);
-       cli_unlink(c, lockfname);
+       cli_unlink(c, lockfname, aSYSTEM | aHIDDEN);
 
        printf("%d\n", i);
 
@@ -634,7 +634,7 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
        bool correct = True;
        ssize_t bytes_read;
 
-       if (!cli_unlink(c1, lockfname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(c1, lockfname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s) (normal, this file should not exist)\n", cli_errstr(c1));
        }
 
@@ -694,7 +694,7 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
                correct = False;
        }
 
-       if (!cli_unlink(c1, lockfname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(c1, lockfname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s)\n", cli_errstr(c1));
                correct = False;
        }
@@ -772,7 +772,7 @@ static bool run_readwritelarge(int dummy)
 
        printf("starting readwritelarge\n");
 
-       cli_unlink(cli1, lockfname);
+       cli_unlink(cli1, lockfname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL, DENY_NONE);
        if (fnum1 == -1) {
@@ -801,7 +801,7 @@ static bool run_readwritelarge(int dummy)
                correct = False;
        }
 
-       if (!cli_unlink(cli1, lockfname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli1, lockfname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s)\n", cli_errstr(cli1));
                correct = False;
        }
@@ -1002,7 +1002,7 @@ static bool run_locktest1(int dummy)
 
        printf("starting locktest1\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        if (fnum1 == -1) {
@@ -1077,7 +1077,7 @@ static bool run_locktest1(int dummy)
                return False;
        }
 
-       if (!cli_unlink(cli1, fname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli1, fname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s)\n", cli_errstr(cli1));
                return False;
        }
@@ -1119,7 +1119,7 @@ static bool run_tcon_test(int dummy)
 
        printf("starting tcontest\n");
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        if (fnum1 == -1) {
@@ -1378,7 +1378,7 @@ static bool run_locktest2(int dummy)
 
        printf("starting locktest2\n");
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        cli_setpid(cli, 1);
 
@@ -1517,7 +1517,7 @@ static bool run_locktest3(int dummy)
 
        printf("starting locktest3\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        if (fnum1 == -1) {
@@ -1599,7 +1599,7 @@ static bool run_locktest3(int dummy)
                return False;
        }
 
-       if (!cli_unlink(cli1, fname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli1, fname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s)\n", cli_errstr(cli1));
                return False;
        }
@@ -1642,7 +1642,7 @@ static bool run_locktest4(int dummy)
 
        printf("starting locktest4\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        fnum2 = cli_open(cli2, fname, O_RDWR, DENY_NONE);
@@ -1784,7 +1784,7 @@ static bool run_locktest4(int dummy)
  fail:
        cli_close(cli1, fnum1);
        cli_close(cli2, fnum2);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
        torture_close_connection(cli1);
        torture_close_connection(cli2);
 
@@ -1813,7 +1813,7 @@ static bool run_locktest5(int dummy)
 
        printf("starting locktest5\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        fnum2 = cli_open(cli2, fname, O_RDWR, DENY_NONE);
@@ -1903,7 +1903,7 @@ static bool run_locktest5(int dummy)
  fail:
        cli_close(cli1, fnum1);
        cli_close(cli2, fnum2);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
        if (!torture_close_connection(cli1)) {
                correct = False;
        }
@@ -1938,7 +1938,7 @@ static bool run_locktest6(int dummy)
        for (i=0;i<1;i++) {
                printf("Testing %s\n", fname[i]);
 
-               cli_unlink(cli, fname[i]);
+               cli_unlink(cli, fname[i], aSYSTEM | aHIDDEN);
 
                fnum = cli_open(cli, fname[i], O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
                status = cli_locktype(cli, fnum, 0, 8, 0, LOCKING_ANDX_CHANGE_LOCKTYPE);
@@ -1950,7 +1950,7 @@ static bool run_locktest6(int dummy)
                cli_close(cli, fnum);
                printf("CANCEL_LOCK gave %s\n", nt_errstr(status));
 
-               cli_unlink(cli, fname[i]);
+               cli_unlink(cli, fname[i], aSYSTEM | aHIDDEN);
        }
 
        torture_close_connection(cli);
@@ -1975,7 +1975,7 @@ static bool run_locktest7(int dummy)
 
        printf("starting locktest7\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
 
@@ -2085,7 +2085,7 @@ static bool run_locktest7(int dummy)
 
 fail:
        cli_close(cli1, fnum1);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
        torture_close_connection(cli1);
 
        printf("finished locktest7\n");
@@ -2111,7 +2111,7 @@ static bool run_fdpasstest(int dummy)
 
        printf("starting fdpasstest\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        if (fnum1 == -1) {
@@ -2135,7 +2135,7 @@ static bool run_fdpasstest(int dummy)
        }
 
        cli_close(cli1, fnum1);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        torture_close_connection(cli1);
        torture_close_connection(cli2);
@@ -2173,8 +2173,8 @@ static bool run_fdsesstest(int dummy)
 
        printf("starting fdsesstest\n");
 
-       cli_unlink(cli, fname);
-       cli_unlink(cli, fname1);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli, fname1, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        if (fnum1 == -1) {
@@ -2200,7 +2200,7 @@ static bool run_fdsesstest(int dummy)
        if (fnum2 != -1) {
                printf("create with different vuid, same cnum succeeded.\n");
                cli_close(cli, fnum2);
-               cli_unlink(cli, fname1);
+               cli_unlink(cli, fname1, aSYSTEM | aHIDDEN);
        } else {
                printf("create with different vuid, same cnum failed.\n");
                printf("This will cause problems with service clients.\n");
@@ -2220,7 +2220,7 @@ static bool run_fdsesstest(int dummy)
 
        cli->cnum = saved_cnum;
        cli_close(cli, fnum1);
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        torture_close_connection(cli);
 
@@ -2248,7 +2248,7 @@ static bool run_unlinktest(int dummy)
 
        printf("starting unlink test\n");
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        cli_setpid(cli, 1);
 
@@ -2258,7 +2258,7 @@ static bool run_unlinktest(int dummy)
                return False;
        }
 
-       if (cli_unlink(cli, fname)) {
+       if (NT_STATUS_IS_OK(cli_unlink(cli, fname, aSYSTEM | aHIDDEN))) {
                printf("error: server allowed unlink on an open file\n");
                correct = False;
        } else {
@@ -2267,7 +2267,7 @@ static bool run_unlinktest(int dummy)
        }
 
        cli_close(cli, fnum);
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        if (!torture_close_connection(cli)) {
                correct = False;
@@ -2319,7 +2319,7 @@ static bool run_maxfidtest(int dummy)
        for (;i>=0;i--) {
                slprintf(fname,sizeof(fname)-1,ftemplate, i,(int)getpid());
                cli_close(cli, fnums[i]);
-               if (!cli_unlink(cli, fname)) {
+               if (!NT_STATUS_IS_OK(cli_unlink(cli, fname, aSYSTEM | aHIDDEN))) {
                        printf("unlink of %s failed (%s)\n", 
                               fname, cli_errstr(cli));
                        correct = False;
@@ -2480,7 +2480,7 @@ static bool run_attrtest(int dummy)
                return False;
        }
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
        fnum = cli_open(cli, fname, 
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
        cli_close(cli, fnum);
@@ -2515,7 +2515,7 @@ static bool run_attrtest(int dummy)
                correct = True;
        }
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        if (!torture_close_connection(cli)) {
                correct = False;
@@ -2549,7 +2549,7 @@ static bool run_trans2test(int dummy)
                return False;
        }
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
        fnum = cli_open(cli, fname, 
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
        if (!cli_qfileinfo(cli, fnum, NULL, &size, &c_time_ts, &a_time_ts, &w_time_ts,
@@ -2573,7 +2573,7 @@ static bool run_trans2test(int dummy)
 
        sleep(2);
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
        fnum = cli_open(cli, fname, 
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
        if (fnum == -1) {
@@ -2604,7 +2604,7 @@ static bool run_trans2test(int dummy)
        }
 
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
        fnum = cli_open(cli, fname, 
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
        cli_close(cli, fnum);
@@ -2620,7 +2620,7 @@ static bool run_trans2test(int dummy)
                }
        }
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
 
        /* check if the server updates the directory modification time
@@ -2651,7 +2651,7 @@ static bool run_trans2test(int dummy)
                        correct = False;
                }
        }
-       cli_unlink(cli, fname2);
+       cli_unlink(cli, fname2, aSYSTEM | aHIDDEN);
        cli_rmdir(cli, dname);
 
        if (!torture_close_connection(cli)) {
@@ -2734,7 +2734,7 @@ static bool run_oplock1(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        cli_sockopt(cli1, sockops);
 
@@ -2748,15 +2748,15 @@ static bool run_oplock1(int dummy)
 
        cli1->use_oplocks = False;
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        if (!cli_close(cli1, fnum1)) {
                printf("close2 failed (%s)\n", cli_errstr(cli1));
                return False;
        }
 
-       if (!cli_unlink(cli1, fname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli1, fname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s)\n", cli_errstr(cli1));
                return False;
        }
@@ -2806,7 +2806,7 @@ static bool run_oplock2(int dummy)
        cli2->use_oplocks = True;
        cli2->use_level_II_oplocks = True;
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        cli_sockopt(cli1, sockops);
        cli_sockopt(cli2, sockops);
@@ -2887,7 +2887,7 @@ static bool run_oplock2(int dummy)
 
        sleep(4);
 
-       if (!cli_unlink(cli1, fname)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli1, fname, aSYSTEM | aHIDDEN))) {
                printf("unlink failed (%s)\n", cli_errstr(cli1));
                correct = False;
        }
@@ -2987,7 +2987,7 @@ static bool run_deletetest(int dummy)
        /* Test 1 - this should delete the file on close. */
 
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_ALL_ACCESS|DELETE_ACCESS, FILE_ATTRIBUTE_NORMAL,
                                   0, FILE_OVERWRITE_IF, 
@@ -3028,7 +3028,7 @@ static bool run_deletetest(int dummy)
        /* Test 2 - this should delete the file on close. */
 
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_ALL_ACCESS,
                                   FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, 
@@ -3060,13 +3060,13 @@ static bool run_deletetest(int dummy)
                        correct = False;
                        goto fail;
                }
-               cli_unlink(cli1, fname);
+               cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
        } else
                printf("second delete on close test succeeded.\n");
 
        /* Test 3 - ... */
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL,
                                   FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OVERWRITE_IF, 0, 0);
@@ -3126,7 +3126,7 @@ static bool run_deletetest(int dummy)
                if (!cli_close(cli1, fnum1)) {
                        printf("[3] close failed (%s)\n", cli_errstr(cli1));
                }
-               cli_unlink(cli1, fname);
+               cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
                correct = False;
                goto fail;
        } else
@@ -3134,7 +3134,7 @@ static bool run_deletetest(int dummy)
 
        /* Test 4 ... */
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS,
                        FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OVERWRITE_IF, 0, 0);
@@ -3185,7 +3185,7 @@ static bool run_deletetest(int dummy)
 
        /* Test 5 ... */
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_open(cli1, fname, O_RDWR|O_CREAT, DENY_NONE);
        if (fnum1 == -1) {
@@ -3212,7 +3212,7 @@ static bool run_deletetest(int dummy)
 
        /* Test 6 ... */
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA,
                                   FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
@@ -3242,7 +3242,7 @@ static bool run_deletetest(int dummy)
 
        /* Test 7 ... */
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS,
                                   FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, 0, 0);
@@ -3290,7 +3290,7 @@ static bool run_deletetest(int dummy)
 
        /* Test 7 ... */
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        if (!torture_open_connection(&cli2, 1)) {
                printf("[8] failed to open second connection.\n");
@@ -3384,7 +3384,7 @@ static bool run_deletetest(int dummy)
                printf("tenth delete on close test succeeded.\n");
 
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        /* What error do we get when attempting to open a read-only file with
           delete access ? */
@@ -3435,7 +3435,7 @@ static bool run_deletetest(int dummy)
        if (fnum1 != -1) cli_close(cli1, fnum1);
        if (fnum2 != -1) cli_close(cli1, fnum2);
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        if (cli1 && !torture_close_connection(cli1)) {
                correct = False;
@@ -3554,8 +3554,8 @@ static bool run_rename(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname1);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);
        fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_READ_ACCESS, FILE_ATTRIBUTE_NORMAL,
                                   FILE_SHARE_READ, FILE_OVERWRITE_IF, 0, 0);
 
@@ -3576,8 +3576,8 @@ static bool run_rename(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname1);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);
        fnum1 = cli_nt_create_full(cli1, fname, 0, GENERIC_READ_ACCESS, FILE_ATTRIBUTE_NORMAL,
 #if 0
                                   FILE_SHARE_DELETE|FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0);
@@ -3602,8 +3602,8 @@ static bool run_rename(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname1);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, READ_CONTROL_ACCESS, FILE_ATTRIBUTE_NORMAL,
                                   FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0);
@@ -3649,8 +3649,8 @@ static bool run_rename(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname1);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);
 
         /*----*/
 
@@ -3674,8 +3674,8 @@ static bool run_rename(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname1);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);
 
         /*--*/
 
@@ -3719,8 +3719,8 @@ static bool run_rename(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
-       cli_unlink(cli1, fname1);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
+       cli_unlink(cli1, fname1, aSYSTEM | aHIDDEN);
 
        if (!torture_close_connection(cli1)) {
                correct = False;
@@ -3780,7 +3780,7 @@ static bool run_opentest(int dummy)
        }
 
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        cli_sockopt(cli1, sockops);
 
@@ -3841,7 +3841,7 @@ static bool run_opentest(int dummy)
                return False;
        }
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        printf("finished open test 2\n");
 
@@ -3903,7 +3903,7 @@ static bool run_opentest(int dummy)
        }
        printf("finished open test 3\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
 
        printf("testing ctemp\n");
@@ -3916,7 +3916,7 @@ static bool run_opentest(int dummy)
        if (!cli_close(cli1, fnum1)) {
                printf("close of temp failed (%s)\n", cli_errstr(cli1));
        }
-       if (!cli_unlink(cli1, tmp_path)) {
+       if (!NT_STATUS_IS_OK(cli_unlink(cli1, tmp_path, aSYSTEM | aHIDDEN))) {
                printf("unlink of temp failed (%s)\n", cli_errstr(cli1));
        }
 
@@ -3927,7 +3927,7 @@ static bool run_opentest(int dummy)
        }
 
        cli_setatr(cli2, fname, 0, 0);
-       cli_unlink(cli2, fname);
+       cli_unlink(cli2, fname, aSYSTEM | aHIDDEN);
 
        cli_sockopt(cli2, sockops);
 
@@ -3960,7 +3960,7 @@ static bool run_opentest(int dummy)
 
        printf("non-io open test #1 passed.\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        printf("TEST #2 testing 2 non-io opens (first with delete)\n");
 
@@ -3991,7 +3991,7 @@ static bool run_opentest(int dummy)
 
        printf("non-io open test #2 passed.\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        printf("TEST #3 testing 2 non-io opens (second with delete)\n");
 
@@ -4022,7 +4022,7 @@ static bool run_opentest(int dummy)
 
        printf("non-io open test #3 passed.\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        printf("TEST #4 testing 2 non-io opens (both with delete)\n");
 
@@ -4051,7 +4051,7 @@ static bool run_opentest(int dummy)
 
        printf("non-io open test #4 passed.\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        printf("TEST #5 testing 2 non-io opens (both with delete - both with file share delete)\n");
 
@@ -4085,7 +4085,7 @@ static bool run_opentest(int dummy)
 
        printf("TEST #6 testing 1 non-io open, one io open\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, FILE_READ_DATA, FILE_ATTRIBUTE_NORMAL,
                                   FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0);
@@ -4117,7 +4117,7 @@ static bool run_opentest(int dummy)
 
        printf("TEST #7 testing 1 non-io open, one io open with delete\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        fnum1 = cli_nt_create_full(cli1, fname, 0, FILE_READ_DATA, FILE_ATTRIBUTE_NORMAL,
                                   FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0);
@@ -4144,7 +4144,7 @@ static bool run_opentest(int dummy)
 
        printf("non-io open test #7 passed.\n");
 
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        if (!torture_close_connection(cli1)) {
                correct = False;
@@ -4344,7 +4344,7 @@ static bool run_openattrtest(int dummy)
 
        for (k = 0, i = 0; i < sizeof(open_attrs_table)/sizeof(uint32); i++) {
                cli_setatr(cli1, fname, 0, 0);
-               cli_unlink(cli1, fname);
+               cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
                fnum1 = cli_nt_create_full(cli1, fname, 0, FILE_WRITE_DATA, open_attrs_table[i],
                                   FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0);
 
@@ -4420,7 +4420,7 @@ static bool run_openattrtest(int dummy)
        }
 
        cli_setatr(cli1, fname, 0, 0);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
 
        printf("open attr test %s.\n", correct ? "passed" : "failed");
 
@@ -4478,7 +4478,7 @@ static bool run_dirtest(int dummy)
        for (i=0;i<torture_numops;i++) {
                fstring fname;
                slprintf(fname, sizeof(fname), "\\%x", (int)random());
-               cli_unlink(cli, fname);
+               cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
        }
 
        if (!torture_close_connection(cli)) {
@@ -4503,7 +4503,7 @@ static void del_fn(const char *mnt, file_info *finfo, const char *mask, void *st
                if (!NT_STATUS_IS_OK(cli_rmdir(pcli, fname)))
                        printf("del_fn: failed to rmdir %s\n,", fname );
        } else {
-               if (!cli_unlink(pcli, fname))
+               if (!NT_STATUS_IS_OK(cli_unlink(pcli, fname, aSYSTEM | aHIDDEN)))
                        printf("del_fn: failed to unlink %s\n,", fname );
        }
 }
@@ -4527,7 +4527,7 @@ bool torture_ioctl_test(int dummy)
 
        printf("starting ioctl test\n");
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
        fnum = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE);
        if (fnum == -1) {
@@ -4581,7 +4581,7 @@ bool torture_chkpath_test(int dummy)
 
        /* cleanup from an old run */
        cli_rmdir(cli, "\\chkpath.dir\\dir2");
-       cli_unlink(cli, "\\chkpath.dir\\*");
+       cli_unlink(cli, "\\chkpath.dir\\*", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\chkpath.dir");
 
        if (!NT_STATUS_IS_OK(cli_mkdir(cli, "\\chkpath.dir"))) {
@@ -4636,7 +4636,7 @@ bool torture_chkpath_test(int dummy)
        }
 
        cli_rmdir(cli, "\\chkpath.dir\\dir2");
-       cli_unlink(cli, "\\chkpath.dir\\*");
+       cli_unlink(cli, "\\chkpath.dir\\*", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\chkpath.dir");
 
        if (!torture_close_connection(cli)) {
@@ -4663,7 +4663,7 @@ static bool run_eatest(int dummy)
                return False;
        }
 
-       cli_unlink(cli, fname);
+       cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
        fnum = cli_nt_create_full(cli, fname, 0,
                                   FIRST_DESIRED_ACCESS, FILE_ATTRIBUTE_ARCHIVE,
                                   FILE_SHARE_NONE, FILE_OVERWRITE_IF, 
@@ -5228,7 +5228,7 @@ static bool run_windows_write(int dummy)
        ret = true;
  fail:
        cli_close(cli1, fnum);
-       cli_unlink(cli1, fname);
+       cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
        torture_close_connection(cli1);
        return ret;
 }
index aaa763a2a3cb5bd9916decbe017be1aefb805bf6..3b7523a85a9a8acf475114857b714b087c6cea03 100644 (file)
@@ -38,7 +38,7 @@ bool torture_utable(int dummy)
        memset(valid, 0, sizeof(valid));
 
        cli_mkdir(cli, "\\utable");
-       cli_unlink(cli, "\\utable\\*");
+       cli_unlink(cli, "\\utable\\*", aSYSTEM | aHIDDEN);
 
        for (c=1; c < 0x10000; c++) {
                char *p;
@@ -67,7 +67,7 @@ bool torture_utable(int dummy)
                }
 
                cli_close(cli, fnum);
-               cli_unlink(cli, fname);
+               cli_unlink(cli, fname, aSYSTEM | aHIDDEN);
 
                if (c % 100 == 0) {
                        printf("%d (%d/%d)\r", c, chars_allowed, alt_allowed);
@@ -130,7 +130,7 @@ bool torture_casetable(int dummy)
 
        memset(equiv, 0, sizeof(equiv));
 
-       cli_unlink(cli, "\\utable\\*");
+       cli_unlink(cli, "\\utable\\*", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\utable");
        if (!NT_STATUS_IS_OK(cli_mkdir(cli, "\\utable"))) {
                printf("Failed to create utable directory!\n");
@@ -187,7 +187,7 @@ bool torture_casetable(int dummy)
                cli_close(cli, fnum);
        }
 
-       cli_unlink(cli, "\\utable\\*");
+       cli_unlink(cli, "\\utable\\*", aSYSTEM | aHIDDEN);
        cli_rmdir(cli, "\\utable");
 
        return True;