[PATCH] Re: fruit_rename() prepend ._ again if fruit:ressource=file

Ralph Böhme slow at samba.org
Tue Jun 27 08:46:07 UTC 2017


On Tue, Jun 27, 2017 at 03:02:14PM +0800, Jones Syue via samba-technical wrote:
> Hello list,
> 
> Test master (4.7.0pre1-GIT-bcfa12c) also has this symptom,
> refer to attach gdb log,
> 1st rename() and 2nd rename() are came from fruit_rename(),
> which call SMB_VFS_NEXT_RENAME() twice.
> 
> Attached patch could address this issue,
> this patch checks if the source appledouble basname matched
> the destination basename; if they are matched,
> would goto done and avoid 2nd rename().
> Please help review and any suggestions are appreciated,
> thank you.
> 
> For example,
> a text file called "newfile.txt",
> and win8.1 windows explorer renamed it to "._newfile.txt".
> In fruit_rename(),
> 1. The 1st SMB_VFS_NEXT_RENAME() do rename:
>    ./newfile.txt -> ./_.newfile.txt
> 2. Then this patch check and found that the source appbledouble
>    basename (._newfile.txt) matched the destination basename
>    (._newfile.txt), would goto done.
>    Hence the 2nd SMB_VFS_NEXT_RENAME() is not called.
> 
> Here is the smb.conf
> [global]
> fruit:nfs_aces = no
> fruit:veto_appledouble = no
> vfs objects =  shadow_copy2 catia fruit streams_depot aio_pthread

fwiw, unless you need Netatalk compatibility, as you're using streams_depot for
the streams and not streams_xattr, you could enable fruit:resource=stream. That
would also fix the rename issue.

Cheerio!
-slow



More information about the samba-technical mailing list