[Samba] Support for multiple file streams?

simo idra at samba.org
Mon Jul 2 17:09:54 GMT 2007


On Mon, 2007-07-02 at 09:53 -0700, Jeremy Allison wrote:
> On Mon, Jul 02, 2007 at 04:50:54PM +0000, simo wrote:
> 
> > I was thinking if it couldn't be better to use just one directory in the
> > root of the filesystem and within it create a directory for each file
> > where we want to write an alternate stream. The idea would be to use the
> > files inode as the dir name 0x123456 and inside it the stream name as
> > file name for the stream. This way renaming or moving the file wouldn't
> > loose the streams. Does it make sense?
> 
> That's a pretty good idea - we'd have to do some recursing up the
> tree to find the filesystem root of each share - maybe we could
> do this at share connection time....

Or it could be an option.
It should be noted that admins should add a cron job to clean up, in
case someone unlinks the original file from the unix side without going
through samba.
Unlink is the only operation that comes to mind, the other risk is
creating a new file after another has been unilinked and getting the
same inode number. But I guess these are corner cases, and if we are
really paranoid I guess we can find a way to make sure some other
metadata is used to detect such condition.

The biggest problem is leaking streams from one user to another:
userA delete fileA with streamA
userB create fileB
accidentally fileB inode == fileA
userB has streamA data in fileB

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list