From 281c6d02bdcc9988c0f1660a3c77ba4b3db3dc6d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jul 2011 14:08:03 +0200 Subject: s3:smbclient: add "logoff" command to close the session --- source3/client/client.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3') diff --git a/source3/client/client.c b/source3/client/client.c index 1cf44103e9..a5bee39f0a 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -4308,6 +4308,24 @@ static int cmd_logon(void) return 0; } +/** + * close the session + */ + +static int cmd_logoff(void) +{ + NTSTATUS status; + + status = cli_ulogoff(cli); + if (!NT_STATUS_IS_OK(status)) { + d_printf("logoff failed: %s\n", nt_errstr(status)); + return -1; + } + + d_printf("logoff successful\n"); + return 0; +} + /**************************************************************************** list active connections @@ -4497,6 +4515,7 @@ static struct { {"logon",cmd_logon,"establish new logon",{COMPL_NONE,COMPL_NONE}}, {"listconnect",cmd_list_connect,"list open connections",{COMPL_NONE,COMPL_NONE}}, {"showconnect",cmd_show_connect,"display the current active connection",{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}}, /* Yes, this must be here, see crh's comment above. */ -- cgit