[Samba] Deletion of directory symlink via Samba deletes files in original subdirectory on Unix

Andy Liebman andyliebman at aol.com
Tue Nov 24 18:45:56 MST 2009

Jeremy Allison wrote:
> On Tue, Nov 24, 2009 at 04:24:13PM -0800, Kathy wrote:
>> Hello --
>> We have a Solaris 10 ZFS server running Samba with "follow
>> symlinks=yes" set.  We're noticing that if you delete (via Samba) a
>> file that is a symbolic link pointing to a subdirectory somewhere,
>> with files in that subdir, it will not only delete the symbolic link
>> file, but also delete the files in the target subdirectory.  On Unix,
>> if you delete a symbolic link, it will leave the original target
>> subdir (and its files) untouched.  This behavior only seems to happen
>> if the symlink is pointing to a populated subdirectory.  If you have a
>> symlink that points to a file and delete the symlink via Samba, the
>> original file remains intact.  Does anyone know of a way to get around
>> this particular behavior?  We would like it to behave as in Unix.
>> Only the symlink gets deleted and not the subdir/files it was pointing
>> at.
> What version of Samba ?
> Jeremy
This sounds a bit like the problem we (EditShare) discovered and that  
you patched a few years ago-- in the 3.0.14 days I think.  Remember... 
We discovered a sort of delayed reaction.  If you deleted a symlink to a 
file that some other user had open, when both users finally closed the 
file the FILE would get deleted rather than the SYMLINK. 

Could it be related?

Andy Liebman

More information about the samba mailing list