1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

Fix bug #7700 - Improvement of return code of smbclient

Based on an initial patch from H Hasegawa <hasegawa.hiroyuki@fujixerox.co.jp>.
Convert cli_list and associated functions to take calls that return NTSTATUS.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 29 19:40:16 UTC 2010 on sn-devel-104
This commit is contained in:
Jeremy Allison
2010-10-29 11:56:51 -07:00
parent 606a447503
commit 14ff2e8de9
11 changed files with 229 additions and 136 deletions

View File

@ -469,7 +469,7 @@ static NTSTATUS cli_list_old_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
NTSTATUS cli_list_old(struct cli_state *cli, const char *mask,
uint16 attribute,
void (*fn)(const char *, struct file_info *,
NTSTATUS (*fn)(const char *, struct file_info *,
const char *, void *), void *state)
{
TALLOC_CTX *frame = talloc_stackframe();
@ -504,7 +504,10 @@ NTSTATUS cli_list_old(struct cli_state *cli, const char *mask,
}
num_finfo = talloc_array_length(finfo);
for (i=0; i<num_finfo; i++) {
fn(cli->dfs_mountpoint, &finfo[i], mask, state);
status = fn(cli->dfs_mountpoint, &finfo[i], mask, state);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
}
fail:
TALLOC_FREE(frame);
@ -795,7 +798,7 @@ static NTSTATUS cli_list_trans_recv(struct tevent_req *req,
NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
uint16_t attribute, int info_level,
void (*fn)(const char *mnt, struct file_info *finfo,
NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
const char *mask, void *private_data),
void *private_data)
{
@ -830,7 +833,10 @@ NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
}
num_finfo = talloc_array_length(finfo);
for (i=0; i<num_finfo; i++) {
fn(cli->dfs_mountpoint, &finfo[i], mask, private_data);
status = fn(cli->dfs_mountpoint, &finfo[i], mask, private_data);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
}
fail:
TALLOC_FREE(frame);
@ -911,7 +917,7 @@ NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
}
NTSTATUS cli_list(struct cli_state *cli, const char *mask, uint16 attribute,
void (*fn)(const char *, struct file_info *, const char *,
NTSTATUS (*fn)(const char *, struct file_info *, const char *,
void *), void *state)
{
TALLOC_CTX *frame = talloc_stackframe();
@ -952,7 +958,10 @@ NTSTATUS cli_list(struct cli_state *cli, const char *mask, uint16 attribute,
}
for (i=0; i<num_finfo; i++) {
fn(cli->dfs_mountpoint, &finfo[i], mask, state);
status = fn(cli->dfs_mountpoint, &finfo[i], mask, state);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
}
fail:
TALLOC_FREE(frame);