From: Volker Lendecke Date: Sun, 18 Oct 2020 16:39:17 +0000 (+0200) Subject: smbclient: Add "mask" to do_list_helper_state X-Git-Tag: talloc-2.3.2~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=886665644c9c5fb0c0f36d79db80d0021b829b6b;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison --- 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;