diff options
author | Volker Lendecke <vl@samba.org> | 2020-10-18 18:39:17 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-11-04 18:55:40 +0000 |
commit | 886665644c9c5fb0c0f36d79db80d0021b829b6b (patch) | |
tree | 101b024f1fdf8d79377f0a2062b1510144019f6b | |
parent | 623bc39bb8e54d4f86a524dd281f138a4b703970 (diff) | |
download | samba-886665644c9c5fb0c0f36d79db80d0021b829b6b.tar.gz |
smbclient: Add "mask" to do_list_helper_state
To me this is simpler to understand than to rely on the cli_list
callback which goes through some function call layers. Also, this
gives more obvious control over what we pass in the next patch.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/client/client.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/client/client.c b/source3/client/client.c index 2b9ef12defc..ffcf8f5a624 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -724,6 +724,7 @@ static int do_list_queue_empty(void) ****************************************************************************/ struct do_list_helper_state { + const char *mask; struct cli_state *cli; }; @@ -742,7 +743,7 @@ static NTSTATUS do_list_helper( char *p = NULL; /* Work out the directory. */ - dir = talloc_strdup(ctx, mask); + dir = talloc_strdup(ctx, state->mask); if (!dir) { return NT_STATUS_NO_MEMORY; } @@ -840,8 +841,9 @@ NTSTATUS do_list(const char *mask, add_to_do_list_queue(mask); while (!do_list_queue_empty()) { - const char *head = do_list_queue_head(); - struct do_list_helper_state state = { .cli = NULL }; + struct do_list_helper_state state = { + .mask = do_list_queue_head(), + }; char *targetpath = NULL; /* check for dfs */ @@ -851,11 +853,11 @@ NTSTATUS do_list(const char *mask, "", creds, cli, - head, + state.mask, &state.cli, &targetpath); if (!NT_STATUS_IS_OK(status)) { - d_printf("do_list: [%s] %s\n", head, + d_printf("do_list: [%s] %s\n", state.mask, nt_errstr(status)); remove_do_list_queue_head(); continue; |