3.0.25b: smbclient cannot rename files in dfs roots

Jeremy Allison jra at samba.org
Tue Jul 24 22:25:37 GMT 2007


On Tue, Jul 24, 2007 at 09:41:38PM +0200, Thomas Bork wrote:
> Hi @all,
> 
> smbclient from 3.0.25b cannot rename files in DFS roots, no matter, 
> which os version holds the shares for the DFS root:
> 
> smb: \sambatest\> dir
>   .                                  DA        0  Tue Jul 24 20:55:46 2007
>   ..                                 DA        0  Tue Jul 24 20:55:46 2007
>   test1.txt                           A        0  Tue Jul 24 20:55:15 2007
>   äöü€.txt                                     0  Sun Sep 25 13:29:03 
>   2005
> 
>                 38154 blocks of size 4194304. 12479 blocks available
> smb: \sambatest\> rename test1.txt test.txt
> NT_STATUS_OBJECT_PATH_NOT_FOUND renaming files
> 
> From log.smbd (against XP SP2 which holds the share):

Ok, fixed this for 3.0.25c. Patch is attached - please test, but
it fixes it for me in my local test (no network where I am, sorry).

Jeremy.
-------------- next part --------------
Index: client/client.c
===================================================================
--- client/client.c	(revision 24035)
+++ client/client.c	(working copy)
@@ -2649,7 +2649,8 @@
 	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,15 +2664,23 @@
 	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;
+	}
 	
 	return 0;
 }


More information about the samba-technical mailing list