[Samba] Can't always delete directories (Directory not empty)

Yuri Kanivetsky yuri.kanivetsky at gmail.com
Fri Jun 10 20:45:14 UTC 2022


Hi,

The circumstances are... When you want to delete a directory, you need
to delete the contents first. For that you read the list of files.
Into a buffer. And if the buffer is not big enough, you delete what
you read and read the next batch.

That's where ordinary directories and directories mounted over CIFS
start to differ. My understanding is that with CIFS after you delete
the first batch of files, and ask for the second, what you really get
is the third batch. And at the end you try to delete a non-empty dir.
This can be reproduced with busybox's rm, coreutils' rm, musl, glibc,
mc, you name it. A detailed description is here:

https://gist.github.com/x-yuri/aa6db295cd56f757537f756bc390b1df

The question is, is this something end-user software has to deal with?
Or that's a bug in Samba?

Regards,
Yuri



More information about the samba mailing list