summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-07-24 22:28:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:28:58 -0500
commit76f0168f4f89a53375da8847aae98ec0de5e1e16 (patch)
tree452bc1175f8ac85163248aa6409ca1a64280e8f8 /source3
parent63fcb7a2fd0064121ec71c913d32102b7de6dc6f (diff)
downloadsamba-76f0168f4f89a53375da8847aae98ec0de5e1e16.tar.gz
samba-76f0168f4f89a53375da8847aae98ec0de5e1e16.tar.bz2
samba-76f0168f4f89a53375da8847aae98ec0de5e1e16.zip
r24036: Fix dfs rename bug in smbclient reported by Thomas Bork <tombork@web.de>.
Couldn't rename file as we weren't DFS enabling the target path. Jeremy. (This used to be commit cd66c133a1b010874ea9e7a500ea24c52011e523)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index f2a5f8593f..ce66e08930 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2727,7 +2727,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);
@@ -2741,13 +2742,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;
}