From d67a91b9556a81318fd36d7f17ce327e5f6d44e0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jul 2011 14:12:13 +0200 Subject: s3:smbclient: add a "tdis" command to view and change the tree id (tid). This low level command can be used to switch between tree connects in one session. --- source3/client/client.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/client') diff --git a/source3/client/client.c b/source3/client/client.c index 3dbc4ebf81..836bc56553 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4378,6 +4378,30 @@ static int cmd_tdis(void) } +/** + * get or set tid + */ + +static int cmd_tid(void) +{ + TALLOC_CTX *ctx = talloc_tos(); + char *tid_str; + + if (!next_token_talloc(ctx, &cmd_ptr, &tid_str, NULL)) { + if (cli_state_has_tcon(cli)) { + d_printf("current tid is %d\n", cli_state_get_tid(cli)); + } else { + d_printf("no tcon currently\n"); + } + } else { + uint16_t tid = atoi(tid_str); + cli_state_set_tid(cli, tid); + } + + return 0; +} + + /**************************************************************************** list active connections ****************************************************************************/ @@ -4568,6 +4592,7 @@ static struct { {"showconnect",cmd_show_connect,"display the current active connection",{COMPL_NONE,COMPL_NONE}}, {"tcon",cmd_tcon,"connect to a share" ,{COMPL_NONE,COMPL_NONE}}, {"tdis",cmd_tdis,"disconnect from a share",{COMPL_NONE,COMPL_NONE}}, + {"tid",cmd_tid,"show or set the current tid (tree-id)",{COMPL_NONE,COMPL_NONE}}, {"logoff",cmd_logoff,"log off (close the session)",{COMPL_NONE,COMPL_NONE}}, {"..",cmd_cd_oneup,"change the remote directory (up one level)",{COMPL_REMOTE,COMPL_NONE}}, -- cgit