Bug 7747 - streams_depot tries to remove non-empty streams dir on file unlink
streams_depot tries to remove non-empty streams dir on file unlink
Product: Samba 3.5
Classification: Unclassified
Component: VFS Modules
x64 Linux
: P3 normal
: ---
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2010-10-22 05:16 UTC by Volodymyr Khomenko
Modified: 2010-10-28 01:55 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Volodymyr Khomenko 2010-10-22 05:16:32 UTC
According to streams_depot_unlink() source code of streams_depot module,
it tries to call SMB_VFS_NEXT_RMDIR for streams directory while streams' files are still there. On such design RMDIR must fail and existent streams and directory are left, so filesystem is polluted by this.

P.S. Such scenario is applicable only for removing base file (and some streams are present). Unlinking independent streams are not so critical but still after deletion of the last stream the directory itself is NOT removed.

I think the implementation must either walk all streams of the file and remove them or use some kind of recursive rmdir. Removing streams directory on the last streams unlink is possibly not worth of additional efforts (empty directory is not so large).
Comment 1 Volker Lendecke 2010-10-22 05:28:04 UTC
Is this really an issue? Look at smbd/close.c, lines 447ff (in master). That code is supposed to walk the list of streams and individually remove the streams from a higher level.

If that does not work, it is a bug that needs fixing at that level (IMHO).

Comment 2 Volodymyr Khomenko 2010-10-28 01:55:31 UTC
Yep, you are right. Samba core already takes care about deleting streams before the base file. Sorry...