summaryrefslogtreecommitdiffstats
path: root/source/client
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-08-17 19:47:22 +0000
committerGerald Carter <jerry@samba.org>2007-08-17 19:47:22 +0000
commit495d318ba383f65d9cbf03a999f63f54a5745dd9 (patch)
tree2c1b7b4484dcf511dac0c13b7e5eb1401a287de5 /source/client
parent21d145bb2e22aae05699ec8247cc6d4e8595d72a (diff)
downloadsamba-495d318ba383f65d9cbf03a999f63f54a5745dd9.tar.gz
samba-495d318ba383f65d9cbf03a999f63f54a5745dd9.tar.xz
samba-495d318ba383f65d9cbf03a999f63f54a5745dd9.zip
r24528: start syncing changes for 3.0.25c
Diffstat (limited to 'source/client')
-rw-r--r--source/client/client.c29
-rw-r--r--source/client/smbmount.c2
2 files changed, 23 insertions, 8 deletions
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);