Bug 13204 - rmdir on non-empty directory fails silently
rmdir on non-empty directory fails silently
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient
4.7.4
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-06 20:53 UTC by chris
Modified: 2018-08-24 09:49 UTC (History)
4 users (show)

See Also:


Attachments
cherry-picked for v4-9-stable (8.75 KB, patch)
2018-08-13 10:05 UTC, Anoop C S
jra: review+
anoopcs: review? (asn)
Details
cherry-picked for v4-8-stable (8.75 KB, patch)
2018-08-13 10:06 UTC, Anoop C S
jra: review+
anoopcs: review? (asn)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chris 2018-01-06 20:53:16 UTC
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
Comment 1 Anoop C S 2018-08-13 10:05:24 UTC
Created attachment 14407 [details]
cherry-picked for v4-9-stable
Comment 2 Anoop C S 2018-08-13 10:06:53 UTC
Created attachment 14408 [details]
cherry-picked for v4-8-stable
Comment 3 Jeremy Allison 2018-08-13 18:57:05 UTC
Re-assigning to Karolin for inclusion in 4.8.next, 4.9.next.
Comment 4 Karolin Seeger 2018-08-14 10:57:34 UTC
(In reply to Jeremy Allison from comment #3)
Pushed to autobuild-v4-{9,8}-test.
Comment 5 Karolin Seeger 2018-08-24 09:49:14 UTC
Pushed to both branches.
Closing out bug report.

Thanks!