diff options
author | Michael Adam <obnox@samba.org> | 2011-07-22 14:12:13 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-07-22 15:42:17 +0200 |
commit | d67a91b9556a81318fd36d7f17ce327e5f6d44e0 (patch) | |
tree | 9a6c6493212ce730149a67ef8f5af0c35d473698 | |
parent | 7327bde81acecf4ae0c09f80cebe21a1312aeb3a (diff) | |
download | samba-d67a91b9556a81318fd36d7f17ce327e5f6d44e0.tar.gz samba-d67a91b9556a81318fd36d7f17ce327e5f6d44e0.tar.bz2 samba-d67a91b9556a81318fd36d7f17ce327e5f6d44e0.zip |
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.
-rw-r--r-- | source3/client/client.c | 25 |
1 files changed, 25 insertions, 0 deletions
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}}, |