diff options
author | Michael Adam <obnox@samba.org> | 2011-07-22 14:08:03 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-07-22 15:42:16 +0200 |
commit | 281c6d02bdcc9988c0f1660a3c77ba4b3db3dc6d (patch) | |
tree | 895c2fd3944161297604caac8022ff550d919bbe | |
parent | a11cc880ef0a7e105c46b835fb3c793da7cabb53 (diff) | |
download | samba-281c6d02bdcc9988c0f1660a3c77ba4b3db3dc6d.tar.gz samba-281c6d02bdcc9988c0f1660a3c77ba4b3db3dc6d.tar.bz2 samba-281c6d02bdcc9988c0f1660a3c77ba4b3db3dc6d.zip |
s3:smbclient: add "logoff" command to close the session
-rw-r--r-- | source3/client/client.c | 19 |
1 files changed, 19 insertions, 0 deletions
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. */ |