From 495d318ba383f65d9cbf03a999f63f54a5745dd9 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 17 Aug 2007 19:47:22 +0000 Subject: r24528: start syncing changes for 3.0.25c --- source/client/client.c | 29 ++++++++++++++++++++++------- source/client/smbmount.c | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'source/client') diff --git a/source/client/client.c b/source/client/client.c index 727e8db1f11..d05a2b8975a 100644 --- a/source/client/client.c +++ b/source/client/client.c @@ -2649,7 +2649,8 @@ static int cmd_rename(void) pstring src,dest; pstring buf,buf2; struct cli_state *targetcli; - pstring targetname; + pstring targetsrc; + pstring targetdest; pstrcpy(src,cur_dir); pstrcpy(dest,cur_dir); @@ -2663,13 +2664,21 @@ static int cmd_rename(void) pstrcat(src,buf); pstrcat(dest,buf2); - if ( !cli_resolve_path( "", cli, src, &targetcli, targetname ) ) { - d_printf("chown %s: %s\n", src, cli_errstr(cli)); + if ( !cli_resolve_path( "", cli, src, &targetcli, targetsrc ) ) { + d_printf("rename %s: %s\n", src, cli_errstr(cli)); + return 1; + } + + if ( !cli_resolve_path( "", cli, dest, &targetcli, targetdest ) ) { + d_printf("rename %s: %s\n", dest, cli_errstr(cli)); return 1; } - if (!cli_rename(targetcli, targetname, dest)) { - d_printf("%s renaming files\n",cli_errstr(targetcli)); + if (!cli_rename(targetcli, targetsrc, targetdest)) { + d_printf("%s renaming files %s -> %s \n", + cli_errstr(targetcli), + targetsrc, + targetdest); return 1; } @@ -3796,6 +3805,7 @@ static int do_message_op(void) fstring server_name; char name_type_hex[10]; int msg_port; + NTSTATUS status; make_nmb_name(&calling, calling_name, 0x0); make_nmb_name(&called , desthost, name_type); @@ -3812,12 +3822,17 @@ static int do_message_op(void) msg_port = port ? port : 139; - if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port) || - !cli_connect(cli, server_name, &ip)) { + if (!(cli=cli_initialise()) || (cli_set_port(cli, msg_port) != msg_port)) { d_printf("Connection to %s failed\n", desthost); return 1; } + status = cli_connect(cli, server_name, &ip); + if (!NT_STATUS_IS_OK(status)) { + d_printf("Connection to %s failed. Error %s\n", desthost, nt_errstr(status)); + return 1; + } + if (!cli_session_request(cli, &calling, &called)) { d_printf("session request failed\n"); cli_cm_shutdown(); diff --git a/source/client/smbmount.c b/source/client/smbmount.c index cce03e59a94..b1462dbddf1 100644 --- a/source/client/smbmount.c +++ b/source/client/smbmount.c @@ -152,7 +152,7 @@ static struct cli_state *do_connection(char *the_service) /* have to open a new connection */ if (!(c=cli_initialise()) || (cli_set_port(c, smb_port) != smb_port) || - !cli_connect(c, server_n, &ip)) { + !NT_STATUS_IS_OK(cli_connect(c, server_n, &ip))) { DEBUG(0,("%d: Connection to %s failed\n", sys_getpid(), server_n)); if (c) { cli_shutdown(c); -- cgit