[PATCH] Fix broken folder creation in smbclient using a base directory.

Jeremy Allison jra at samba.org
Thu Dec 6 22:06:50 GMT 2007


On Wed, Dec 05, 2007 at 02:17:38PM +0100, Andreas Schneider wrote:
> Hi,
> 
> this fixes the problem described in
> 
> http://article.gmane.org/gmane.network.samba.general/94343
> 
> 
> Cheers,
> 
> 	-- andreas

> From b1f15056ec6bb0caafb7fd2595819ba283aba044 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <anschneider at suse.de>
> Date: Wed, 5 Dec 2007 14:13:05 +0100
> Subject: [PATCH] Fix broken folder creation in smbclient using a base directory.
> 
> We have to add a the directory seperator at the end or
> smbclient -D foo -c "mkdir bar"
> will result in /foobar instead of /foo/bar.
> ---
>  source/client/client.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/source/client/client.c b/source/client/client.c
> index 5757694..b05394f 100644
> --- a/source/client/client.c
> +++ b/source/client/client.c
> @@ -285,7 +285,8 @@ static int do_cd(char *newdir)
>  	
>  	pstring_clean_name(cur_dir);
>  	pstrcpy( dname, cur_dir );
> -	
> +	pstrcat(cur_dir, CLI_DIRSEP_STR);
> +
>  	if ( !cli_resolve_path( "", cli, dname, &targetcli, targetpath ) ) {
>  		d_printf("cd %s: %s\n", dname, cli_errstr(cli));
>  		pstrcpy(cur_dir,saved_dir);
> -- 
> 1.5.3.4

Can you try this with the latest git-tree in branch v3-0-test,
which will be the next patch 3.0.XX release.

I can't reproduce the problem there, I think it may already be
fixed.

Thanks

Jeremy.


More information about the samba-technical mailing list