directory with a symlink pointing to non-existing file

Pavel Filipensky pfilipen at redhat.com
Thu Oct 21 16:35:35 UTC 2021


Hi,

if on local linux file system there is a directory with only one file - a
symlink pointing to a non-existing file then:
- from SMB point of view the directory is *empty*, such symlink is not shown
- but SMB does allow to delete such *empty* directory, it gives
NT_STATUS_DIRECTORY_NOT_EMPTY

This is seen with samba 4.10 and 4.13. Could there be a difference with the
latest samba?

setting those smb.conf params has no effect:

allow insecure wide links = yes
unix extensions = no
follow symlinks = yes
wide links = yes


How to approach it? I can imagine these:

1.  Do nothing. A symlink pointing to a non-existing file was created
without involving SMB, so we should not blame SMB and instead make sure
that such behind the scene manipulations do not happen...

2. Implement fix to allow deletion of directory which contains only
pointing-to-nowhere symlinks

3. Implement fix that puts also pointing-to-nowhere symlinks to directory
listing

4. Provide better info when deletion of* empty *dir fails with
NT_STATUS_DIRECTORY_NOT_EMPTY. How?


Cheers,
Pavel

P.S. There is a related BUG: https://bugzilla.samba.org/show_bug.cgi?id=5209


More information about the samba-technical mailing list