1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-08 13:49:29 +03:00

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 cd66c133a1)
This commit is contained in:
Jeremy Allison
2007-07-24 22:28:19 +00:00
committed by Gerald (Jerry) Carter
parent 63fcb7a2fd
commit 76f0168f4f

View File

@ -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_rename(targetcli, targetname, dest)) {
d_printf("%s renaming files\n",cli_errstr(targetcli));
if ( !cli_resolve_path( "", cli, dest, &targetcli, targetdest ) ) {
d_printf("rename %s: %s\n", dest, cli_errstr(cli));
return 1;
}
if (!cli_rename(targetcli, targetsrc, targetdest)) {
d_printf("%s renaming files %s -> %s \n",
cli_errstr(targetcli),
targetsrc,
targetdest);
return 1;
}