From 7327bde81acecf4ae0c09f80cebe21a1312aeb3a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jul 2011 14:11:34 +0200 Subject: s3:smbclient: add a "tdis" command to do a tree disconnect (close a connection to a share) --- source3/client/client.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index e3a7204118..3dbc4ebf81 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4359,6 +4359,24 @@ static int cmd_tcon(void) return 0; } +/** + * tree disconnect (disconnect from a share) + */ + +static int cmd_tdis(void) +{ + NTSTATUS status; + + status = cli_tdis(cli); + if (!NT_STATUS_IS_OK(status)) { + d_printf("tdis failed: %s\n", nt_errstr(status)); + return -1; + } + + d_printf("tdis successful\n"); + return 0; +} + /**************************************************************************** list active connections @@ -4549,6 +4567,7 @@ static struct { {"listconnect",cmd_list_connect,"list open connections",{COMPL_NONE,COMPL_NONE}}, {"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}}, {"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