Bug 7747 - streams_depot tries to remove non-empty streams dir on file unlink
Summary: streams_depot tries to remove non-empty streams dir on file unlink
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: 3.5.4
Hardware: x64 Linux
: P3 normal
Target Milestone: ---
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-22 05:16 UTC by Volodymyr Khomenko (dead mail address)
Modified: 2010-10-28 01:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volodymyr Khomenko (dead mail address) 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).

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