Summary: smbclient rmdir on a non-empty directory does not delete the directory and also does not error, even with debug flag enabled. Since GNOME gvfs-smb backend uses libsmbclient, and it uses rmdir to delete directories, the lack of an error is interpreted as success. But the directory is not deleted. Reproduces always. Reproduce steps: [chris@f27h ~]$ smbclient //f27s.local/scratch/ Enter SAMBA\chris's password: Try "help" to get a list of possible commands. smb: \> cd noperms smb: \noperms\> ls . D 0 Wed Jan 3 12:00:27 2018 .. D 0 Wed Jan 3 19:33:01 2018 test2 D 0 Wed Jan 3 11:59:55 2018 test3 D 0 Wed Jan 3 11:59:55 2018 test4 D 0 Wed Jan 3 11:59:55 2018 test1 D 0 Wed Jan 3 11:59:55 2018 1073739776 blocks of size 1024. 503895948 blocks available smb: \noperms\> rmdir test1 smb: \noperms\> ls . D 0 Wed Jan 3 12:00:27 2018 .. D 0 Wed Jan 3 19:33:01 2018 test2 D 0 Wed Jan 3 11:59:55 2018 test3 D 0 Wed Jan 3 11:59:55 2018 test4 D 0 Wed Jan 3 11:59:55 2018 test1 D 0 Wed Jan 3 11:59:55 2018 1073739776 blocks of size 1024. 503895948 blocks available smb: \noperms\> Expected results: Either test1 should be deleted, or there should be an error. Additional information: Even when enabling debug with -d 10, there is no error. smb: \noperms\> rmdir test1 dos_clean_name [\noperms\test1] unix_clean_name [\noperms\test1] smb: \noperms\> See also: List discussion (it is a bug): https://lists.samba.org/archive/samba/2018-January/213048.html GNOME Nautilus can't delete directories: https://bugzilla.gnome.org/show_bug.cgi?id=792147
Created attachment 14407 [details] cherry-picked for v4-9-stable
Created attachment 14408 [details] cherry-picked for v4-8-stable
Re-assigning to Karolin for inclusion in 4.8.next, 4.9.next.
(In reply to Jeremy Allison from comment #3) Pushed to autobuild-v4-{9,8}-test.
Pushed to both branches. Closing out bug report. Thanks!
Will 4.7.x also get a fix for this? The current patch for 4.8.x applies there, but doesn't fix the issue. With the patch, 4.7.6 and 4.7.11 (the ones I tested) fail to remove even an empty directory, without returning an error.
Can you upload a wireshark trace of 4.7.x with the patch failing against Windows ? That will help me understand what might be going on here.
I'm sorry, I made a silly mistake while applying the patch to the 4.7 tree. The fix is correct and it works just fine. Please ignore my previous comment.
I need this fix for samba 4.5 (in Debian, see https://bugs.debian.org/915248). I have also applied https://git.samba.org/?p=samba.git;a=commitdiff;h=8d4005b07b08d5673b75d5d79f9b3d6936596fae. Is this enough?