diff options
Diffstat (limited to 'source3/torture/nbio.c')
-rw-r--r-- | source3/torture/nbio.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 1e72a6f7e4..f4625ab632 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -264,10 +264,11 @@ void nb_qfsinfo(int level) cli_dskattr(c, &bsize, &total, &avail); } -static void find_fn(const char *mnt, struct file_info *finfo, const char *name, +static NTSTATUS find_fn(const char *mnt, struct file_info *finfo, const char *name, void *state) { /* noop */ + return NT_STATUS_OK; } void nb_findfirst(const char *mask) @@ -284,9 +285,10 @@ void nb_flush(int fnum) static int total_deleted; -static void delete_fn(const char *mnt, struct file_info *finfo, +static NTSTATUS delete_fn(const char *mnt, struct file_info *finfo, const char *name, void *state) { + NTSTATUS status; char *s, *n; if (finfo->name[0] == '.') return; @@ -294,15 +296,20 @@ static void delete_fn(const char *mnt, struct file_info *finfo, n[strlen(n)-1] = 0; if (asprintf(&s, "%s%s", n, finfo->name) == -1) { printf("asprintf failed\n"); - return; + return NT_STATUS_NO_MEMORY; } if (finfo->mode & aDIR) { char *s2; if (asprintf(&s2, "%s\\*", s) == -1) { printf("asprintf failed\n"); - return; + return NT_STATUS_NO_MEMORY; + } + status = cli_list(c, s2, aDIR, delete_fn, NULL); + if (!NT_STATUS_IS_OK(status)) { + free(n); + free(s2); + return status; } - cli_list(c, s2, aDIR, delete_fn, NULL); nb_rmdir(s); } else { total_deleted++; @@ -310,6 +317,7 @@ static void delete_fn(const char *mnt, struct file_info *finfo, } free(s); free(n); + return NT_STATUS_OK; } void nb_deltree(const char *dname) |